Sun Java System Portal Server 7.1 Update 1 Community Guide

Part III Community Sample Portal

This part contains the following:

Chapter 13 Overview of the Community Sample Portal

This chapter contains the following:

Community Sample Desktop

After installing the Portal Server software, the welcome page at http://host:port/portal/welcome/index.jsp includes links to the three sample portals. Select the Community Sample to view the Community Sample portal anonymous desktop.

The Community Sample desktop anonymous page, by default, includes:

The Communities Home page can be viewed by logging in as test/test. To participate in the Community Sample, users must be in the CommunitySample organization. The Communities home page allows users to browse and/or search communities, view list of their communities, preview and visit interesting communities, and create communities using the community portlets. For more information on the community portlets, see Overview of Community Portlets.

By default, for each community that the user is a member of, they will have a community page that allows the user to interact with the services, leave the community, and remove the community if the user is the owner. The community visitor page allows users to preview a community and join the community.

For more information on customizing the user interface of the sample portal, see Chapter 15, Customizing the Community Sample Portal User Interface.

Content Filepath

After installation and configuration of the Community Sample PAR file, content for Community Sample portal is deployed in the following directories.

PortalServer-DataDir/portals/portal-ID/communitytemplates/

This directory contains the templates for the Community Sample and the associated properties files for the templates.

PortalServer-DataDir/portals/portal-ID/desktop/community_sample/

Provides dynamic content including JavaServerTM Pages (JSPTM), tag library for Sun JavaTM Web User Interface Components' theme (portletSetupTags.tld), properties file, and containers.

PortalServer-DataDir/portals/portal-ID/desktop/classes/CommunitySamplePortal.properties

Provides properties for the Community Sample. If you modify properties in this file, restart the server for the new values to take effect.

PortalServer-DataDir/portals/portal-ID/web-src/community

Provides static content including JavaScript, images, style sheet (css/desktop.css), and channel content.

Available Sample Templates

The Portal Server software includes:

Two Column

A two column table layout with thin channels on the left and wide channels on the right.

Left Navigation

A menu navigated content layout with menu on the left and selected content on the right.

Wiki

A WYSIWYG layout to allow users to create wiki-like content and page layout including support for wiki plugins, attachments, editing, syntax and so on.

Weblog and Wiki

A layout similar to Left Navigation with only Blog and Wiki portlets available on the page.

Custom templates can be added to the system. See Creating and Modifying a Template for more information.

Chapter 14 Modifying the Attributes

The community portlets must construct URLs that access and control the community sample in which they are executing. The attributes described in this chapter define how these community URLs are constructed.

Attributes for the Community Sample

CommunityParentContainerURLParameter (CommunityParentContainer.selectedChannel)

Specifies the top level container for the community sample, as well as the URL parameter that causes this container to select a new contained channel.

CommunityHomeContainerName (CommunityHomeContainer)

Specifies the name of the container that defines the community home page.

CommunityCreateContainerName

Specifies the name of the community portlet channel used to create new communities.

In most cases, you will not need to change these values. You may want to change them if, for example, you are designing a new sample from scratch, and are using different container and channel names than the defaults used in the community sample. To help understand how the system uses these attributes, some tokenized example community URLs are provided below:

http://host:port/portal/dt?CommunityParentContainerURLParameter=CommunityHomeContainerName

Access community home page.

http://host:port/portal/dt?CommunityParentContainerURLParameter=X_Container

Access a community page, for community ID X.

http://host:port/portal/dt?CommunityParentContainerURLParameter=CommunityCreateContainerName

Access the community create portlet.

See also Technical Note: Adding Sun Java System Portal Server 7.1 Community Services to Your Portal.

Chapter 15 Customizing the Community Sample Portal User Interface

This chapter contains the following:

Overview of the Community Sample Portal User Interface

This section contains the following:

Introduction to the Community Sample

The Community Sample includes a display profile loaded at install time that contains the definitions of containers, channels, and providers used by the sample. The sample relies on the display profile's aggregation methods (see Part III, Display Profile, in Sun Java System Portal Server 7.1 Technical Reference for more information) and the community templates for displaying communities and their contained portlets.

The display profile for the sample is a set of containers which handle basic aggregation and display operations. After installation, directories and files effecting the user interface of the sample portal can be found in the PortalServer-DataDir/portals/portal-ID/desktop/community_sample directory.

The Community Sample relies on a combination of two stylesheets (see Stylesheets for the Community Sample) which define the fonts, colors, and images used for its user interface. There are intentionally no conflicts in the selection of these two stylesheets.

Customizable Files

The Community Sample uses the following to render the sample portal user interface:

JSP and HTML Files

header.jsp

This file in PortalServer-DataDir/portals/portal-ID/desktop/community_sample/ directory contains the header display for all sample containers. It controls user interface for the sample by including the stylesheets.

footer.html

This file in PortalServer-DataDir/portals/portal-ID/desktop/community_sample/ directory is included by containers (CommunityParentContainer) and closes HTML tags (namely, body and html tags) as well as displays some footer information.

datetime.jsp

This file in PortalServer-DataDir/portals/portal-ID/desktop/community_sample/ directory is included by the header.jsp file and provides data/time info based on the user's time zone setting. For anonymous user, the default server time zone is used. There is currently no user interface style in this file.

breadcrumb.jsp

This file in PortalServer-DataDir/portals/portal-ID/desktop/community_sample/ directory is included by the header.jsp and provides a rudimentary breadcrumb used in the sample. The user interface in this file is controlled by the desktop.css file.

singlePreferenceMenubar.jsp

This file in PortalServer-DataDir/portals/portal-ID/desktop/community_sample/ directory provides menubar used by JSPDynamicSingleContainer.

singlePreferenceHeader.jsp

This file in PortalServer-DataDir/portals/portal-ID/desktop/community_sample/ directory provides header used by JSPDynamicSingleContainer.

portletEdit.jsp

This file in PortalServer-DataDir/portals/portal-ID/desktop/community_sample/ directory wraps portlet and Provider content in an edit page.

JavaScript and Tag Libraries

openURLInParent.js

This file in PortalServer-DataDir/portals/portal-ID/desktop/community_sample/ directory provides JavaScript for popup and detachment of channels in their own browser window.

tld/portletSetupTags.tld

This file in PortalServer-DataDir/portals/portal-ID/desktop/community_sample/ provides single tag to include Sun JavaTM Web User Interface Components theme support for stylesheet and JavaScript functionality.

Container Provider, Channel Provider, and Channel Templates

PagePreferencesContainer

This directory (under PortalServer-DataDir/portals/portal-ID/desktop/classes/ directory) contains the files that allows a user to change the content and layout of portlets contained in an available container or community template container for which the isEditable property in the display profile is true. If true, the header.jsp file includes a link to Page Preferences in the breadcrumb area at right.

AccountPreferencesContainer

This directory (under PortalServer-DataDir/portals/portal-ID/desktop/classes/ directory) contains the files used for allowing a user to change account preferences such as name, password, timezone, and so on.

CommunityParentContainer

This directory (under PortalServer-DataDir/portals/portal-ID/desktop/classes/ directory) is an instance of JSPSingleContainerProvider and includes the default channel defined in the portal server console for the sample.

CommunityAnonymousContainer

This container includes a set of channels representing the anonymous user's sample display and it is an instance of the JSPTableContainerProvider.

CommunityHomeContainer

This container includes the set of channels representing the logged in user's sample display and it is an instance of the JSPTableContainerProvider.

JSPEditContainer

This directory (under PortalServer-DataDir/portals/portal-ID/desktop/classes/ directory) contains a version of the JSPEditContainer's default files with different styles matching the overall style of the Community Sample.

Login

This channel is included in the CommunityAnonymousContainer's display profile definition and provides the user with the ability to login to the sample or create a new account.

error

This directory includes error templates. Style for these file's user interface is defined in the two stylesheets mentioned above.

JSPTableContainerProvider

This directory (under PortalServer-DataDir/portals/portal-ID/desktop/classes/ directory) contains a version of the JSPTableContainer's default files with different styles matching the overall style of the Community Sample.

JSPMenuContainerProvider

This directory (under PortalServer-DataDir/portals/portal-ID/desktop/classes/ directory) provides for left-side navigation layout.

JSPDynamicSingleContainer

This directory is under PortalServer-DataDir/portals/portal-ID/desktop/community_sample directory.

DiscussionProvider

Provides for Community look and feel changes for this provider.

SearchProvider

Provides for Community look and feel changes for this provider.

Properties Files

message.properties

This file in PortalServer-DataDir/portals/portal-ID/desktop/community_sample/ directory provides properties used by the template files in the error directory. The properties in this file are swapped by the error templates in the PortalServer-DataDir/portals/portal-ID/desktop/community_sample/error directory at runtime.

CommunitySamplePortal.properties

This file in PortalServer-DataDir/portals/portal-ID/desktop/classes/ directory provides properties for the Community Sample portal. These properties are used by the Community Sample portal JSPs.

This file includes properties for the Community Sample portal desktop:

  • Header, Masthead, Breadcrumb, and footer

  • Page Preferences link and Account Settings link

  • Login channel

  • channelMenubar and popupChannelMenubar

  • communityParentContainer/single.jsp file

  • JSPEditContainer/edit.jsp file

  • JSPMenuContainer/menumain.jsp file

If you modify this file, you must restart the server for the changes to take effect.

Stylesheets for the Community Sample

defaulttheme.jar

This JAR file includes the stylesheet that controls many defaults properties for the Community Sample including: font, colors, and the like not found in the desktop.css file.

For more information on the Sun Java Web User Interface Components stylesheet, see Theme for Sun Java Web User Interface Components Tech Note.

desktop.css

Augmentation of style is included for other components through an additional stylesheet located with the rest of the sample's web-src in the web container's web source directory under PortalServer-DataDir/portals/portal-ID/web-src/community/css directory. This stylesheet is not browser specific and modifications to this file only effects the sample portal's overall appearance and that of the containers used.

Sample Customizations

This section includes the following:

ProcedureTo Use a Custom Stylesheet

  1. Log in to the Portal Server and change directories to PortalServer-DataDir/portals/portal-ID/web-src/community/css.

  2. Rename the desktop.css file to desktop.css.orig.

    For example, type mv desktop.css desktop.css.orig.

  3. Copy your custom stylesheet (CSS file) to this directory or modify the desktop.css file.

ProcedureTo Change the Logo and Title Appearance in the Header

  1. Log in to the Portal Server host and edit the desktop.css file in the PortalServer-DataDir/portals/portal-ID/web-src/community/css directory.

  2. Modify the:

    #header #logo

    To modify the logo.

    #header #title

    To modify the title in the header.

ProcedureTo Add a Channel to the Sample Desktop

  1. Log in to the Portal Server management console and select Portals and the portal-ID.

  2. Select CommunitySample from the Select DN pull-down list and select the Manage Containers and Channels link.

  3. Change the view type from Community Parent Containe to DP XML Tree and select CommunityHomeContainer.

  4. Select New Channel or Container link to add channels to the CommunityHomeContainer.