Adding Sun Java System Portal Server 7.1 Community Services to Your Portal
Kanchana Sekhar, October 2007
This article contains instructions for integrating the Sun Java System Portal Server
Community Sample into your portal desktop. The Community Sample provides the ability for
a portal user to create a new community, view communities, join a community,
and maintain a community through portlets.
All of the examples in this article use the Enterprise Sample desktop
and associated JavaServer Pages (JSP) files.
Default Settings Used in This Document
The following settings are used throughout this document:
Sample Portal Distinguished Name (DN)
o=EnterpriseSample,dc=sun,dc=com
Portal ID
portal-ID
Portal Desktop Parent Container
ASCTabContainer
Portal Desktop Service CommunityParentContainerURLParameter
CommunityParentContainer.selectedChannel
Portal Desktop Service CommunityHomeContainerName
CommunityHomeContainer
Portal Desktop Service CommunityCreateContainerName
Before adding the Community Sample, ensure that Portal Server 7.1 software is installed
and then follow the instructions in To Save Your Existing Portal Server Data to make a backup copy
of existing data. After making a backup copy of your existing data, you
can proceed to add the Community Sample to your portal by referring to
the Task Map for Adding the Community Sample to Your Portal.
To Save Your Existing Portal Server Data
Make a backup copy of the display profile document.
For example, type PortalServer-base/bin/psadmin list-display-profile --adminuseruid--passwordfilepasswordfile--dn "o=EnterpriseSample,dc=sun,dc=com" --portalportal-ID > /tmp/dpbackup.xml. Here:
PortalServer-base
The directory where Portal Server software is installed (by default, /opt/SUNWportal/)
uid
The administrator's distinguished name
passwordfile
The file that contains the administrator's password
portal-ID
The portal ID (by default, portal1)
Make a backup copy of your desktopType directory.
For example, type
cp -Rf /var/opt/SUNWportal//portals/portal-ID/desktop/enterprise_sample/ PortalServer-DataDir/portals/portal-ID/desktop/enterprise_sample.bak/. Here portal-ID refers to the portal ID (by default,
portal1).
Task Map for Adding the Community Sample to Your Portal
Use the following task map (that explains the tasks you must do)
to add the Community Sample to your portal.
Task
Description
Instruction
1. Specify the portal desktop service
attributes.
The Community Sample portlets must construct URLs that access and control the Community
Sample in which they are executing. The Portal Desktop Service attributes define how
these community URLs are constructed. The desktop service attributes for the Community Sample
page must be set for all Access Manager organization and roles associated with
the desktop user.
2. Create the PAR directory structure and the PAR DPMapping.properties
file.
The PAR file format is the file structure that is used by
the psadmin import and psadmin export commands to store portal data. The PAR directory structure
is the directory structure from where a PAR file can be generated using
the psadmin create-par command. The PAR directory structure describes the file system directories that
is similar to the PAR file format with additional mapping properties file.
The Community Sample uses the Sun JavaTM Web
User Interface Components theme support for stylesheet and JavaScript functionality. You must include the
Tag Library Descriptor (TLD) in your portal desktopType path.
This step is optional if the Community Sample is already installed. If
the Community Sample is not installed, then copy the sample templates from the
Community Sample to the PAR and copy the Community Template images to the
PAR.
6. Set up the left navigation Community Sample template CSS and JSP Files.
To
set up the left navigation Community Sample template CSS and JSP files with
the same look and feel as the left navigation in the Community Sample,
create the JSPMenuContainerProvider directory, JSP files, and CSS in the PAR.
A community template contains a set of services (channels) and the
visual layout. Community templates define (in the role display profile document) the type of
services available for the community, the default settings for each service, and the
containers that bind the services. You can customize the template to define the
layout of the Community Sample in your portal.
The CommunityParentContainer used by the Community Sample is based on the JSPSingleContainerProvider.
The content page for this container is the single.jsp file. If your portal
desktop default channel or parent container is a JSPSingleContainerProvider and you want
the Community Sample look and feel, then you can use the Community Sample's
single.jsp file. Otherwise, create a new file.
11. Remove the Community Sample from Anonymous
portal desktop.
If you do not want to display the Community Page on
the Anonymous Portal Desktop, use the management console or the psadmin utility to remove
the Community sample on the Anonymous portal desktop.
The desktop service attributes for the Community Sample page must be set for
all Access Manager organization and roles associated with the desktop user. For example,
the Enterprise Sample roles NewCustomerToursRole and AustralianExpansionRole need the portal desktop service
attributes set before user mary can use the Community Sample page. For more information
about the portal desktop service attributes, see Chapter 14, Modifying the Attributes, in Sun Java System Portal Server 7.1 Update 1 Community Guide.
Specify the value for the CommunityParentContainerURLParameter attribute.
Value for this attribute is CommunityParentContainer.selectedChannel. This attribute specifies the top level
container for the community page, as well as the URL parameter that causes
this container to select a new contained channel.
For example, to set this attribute, type PortalServer-base/bin/psadmin set-attribute --adminuseruid--passwordfilepasswordfile--dn "o=EnterpriseSample,dc=sun,dc=com" --portalportal-ID--component desktop --attribute-name CommunityParentContainerURLParameter CommunityParentContainer.selectedChannel.
The top level container used in this example is the CommunityParentContainer which
is a based on JSPSingleContainerProvider. The Portal Desktop URL syntax for specifying the
JSPSingleContainerProvider's selected channel is the container name followed by .selectedChannel. The Enterprise
Sample roles NewCustomerToursRole and AustralianExpansionRole need the portal desktop service attribute, CommunityParentContainerURLParameter,
set before user mary can use the Community Sample page.
To set the attribute for:
The NewCustomerToursRole, type PortalServer-base/bin/psadmin set-attribute --adminuser amadmin --passwordfile passwordfile --dn "cn=NewCustomerToursRole,o=EnterpriseSample,dc=sun,dc=com" --portalportal-ID--component desktop --attribute-name CommunityParentContainerURLParameter CommunityParentContainer.selectedChannel
The AustraliaExpansionRole, type PortalServer-base/bin/psadmin set-attribute --adminuser amadmin --passwordfile passwordfile --dn "cn=AustraliaExpansionRole,o=EnterpriseSample,dc=sun,dc=com" --portalportal-ID--component desktop --attribute-name CommunityParentContainerURLParameter CommunityParentContainer.selectedChannel.
Specify the value for the CommunityHomeContainerName attribute.
The value for this attribute is CommunityHomeContainer. This attribute specifies the name of
the container that defines the community home page.
For example, to set this attribute, type PortalServer-base/bin/psadmin set-attribute --adminuseruid--passwordfilepasswordfile--dn "o=EnterpriseSample,dc=sun,dc=com" --portalportal-ID--component desktop --attribute-name CommunityHomeContainer CommunityHomeContainer.
The community home page container used in this example is the CommunityHomeContainer.
The Enterprise Sample roles NewCustomerToursRole and AustralianExpansionRole need the portal desktop service
attribute, CommunityHomeContainerName, set before user mary can use the Community Sample page.
To set the attribute for:
The NewCustomerToursRole, type PortalServer-base/bin/psadmin set-attribute --adminuser amadmin --passwordfile passwordfile --dn "cn=NewCustomerToursRole,o=EnterpriseSample,dc=sun,dc=com" --portalportal-ID--component desktop --attribute-name CommunityHomeContainer CommunityHomeContainer
The AustraliaExpansionRole, type PortalServer-base/bin/psadmin set-attribute --adminuser amadmin --passwordfile passwordfile --dn "cn=AustraliaExpansionRole,o=EnterpriseSample,dc=sun,dc=com" --portalportal-ID--component desktop --attribute-name CommunityHomeContainer CommunityHomeContainer.
Specify the value for the CommunityCreateContainerName attribute.
The value for this attribute is CommunityCreatePortlet. This attribute specifies the name of
the community portlet channel used to create new communities.
For example, to set this attribute, type PortalServer-base/bin/psadmin set-attribute --adminuseruid--passwordfilepasswordfile--dn "o=EnterpriseSample,dc=sun,dc=com" --portalportal-ID--component desktop --attribute-name CommunityCreateContainer CommunityCreatePortlet.
The Enterprise Sample roles NewCustomerToursRole and AustralianExpansionRole need the portal desktop service
attribute, CommunityCreateContainerName, set before user mary can use the Community Sample page.
To set the attribute for:
The NewCustomerToursRole, type PortalServer-base/bin/psadmin set-attribute --adminuser amadmin --passwordfile passwordfile --dn "cn=NewCustomerToursRole,o=EnterpriseSample,dc=sun,dc=com" --portalportal-ID--component desktop --attribute-name CommunityCreateContainer CommunityCreatePortlet
The AustraliaExpansionRole, type PortalServer-base/bin/psadmin set-attribute --adminuser amadmin --passwordfile passwordfile --dn "cn=AustraliaExpansionRole,o=EnterpriseSample,dc=sun,dc=com" --portalportal-ID--component desktop --attribute-name CommunityCreateContainer CommunityCreatePortlet.
The DPMapping.properties file specifies the mapping for the display profile documents. The display
profile node (dpnode) is set to the defaultOrganization value.
For example, create /tmp/communitypagepar/dp/DPMapping.properties file with the following contents:
Specify the community page containers and channels for use with the community portlets.
In addition, add the community parent container to the portal desktop parent container.
For example, in the Enterprise Sample, the Parent Container, ASCTabContainer, must be updated to
include the CommunityParentContainer as one of the available and selected tabs. Your portal
desktop parent container may be different than the one used in the Enterprise
Sample.
Copy the TLD directory (PortalServer-base/par-src/community_sample/pbfiles/templateBaseDir/community_sample/tld) to the PAR and verify that the
files were copied.
For example, type cp -RfPortalServer-base/par-src/community_sample/pbfiles/templateBaseDir/community_sample/tld
/tmp/communitypagepar/pbfiles/templateBaseDir/enterprise_sample.
Copy the communityTemplateBaseDir directory in the PortalServer-base/par-src/community_sample/pbfiles/ directory to the PAR.
For example, type cp -RfPortalServer-base/par-src/community_sample/pbfiles/communityTemplateBaseDir /tmp/communitypagepar/pbfiles/communityTemplateBaseDir.
Copy the Community Template images in PortalServer-base/par-src/community_sample/static/web-src/community/images/templates directory to the PAR.
For example, type cp -RfPortalServer-base/par-src/community_sample/static/web-src/community/images/templates
/tmp/communitypagepar/static/web-src/community/images/templates.
To Set Up the Left Navigation Community Sample Template CSS and JSP Files
Create the JSPMenuContainerProvider directory in the PAR.
Type mkdir /tmp/communitypagepar/pbfiles/templateBaseDir/enterprise_sample/JSPMenuContainerProvider.
Copy the menu.jsp file from the JSPMenuContainerProvider directory (under the PortalServer-base/par-src/community_sample/pbfiles/templateBaseDir/community_sample/ directory)
to the PAR.
Type cp PortalServer-base/par-src/community_sample/pbfiles/templateBaseDir/
community_sample/JSPMenuContainerProvider/menu.jsp \
/tmp/communitypagepar/pbfiles/templateBaseDir/enterprise_sample/JSPMenuContainerProvider \
where the default value for PortalServer-base is /opt/SUNWportal.
Create the menumain.jsp file in this directory: /tmp/communitypagepar/pbfiles/templateBaseDir/enterprise_sample/JSPMenuContainerProvider.
A community template contains a set of services (channels) and the visual layout.
Community templates define (in the role display profile document) the type of services
available for the community, the default settings for each service, and the containers
that bind the services. Change the layout setting for the Two Column community
template must to 3 if you are using the Enterprise Sample desktop.
Change directories to /tmp/communitypagepar/pbfiles/communityTemplateBaseDir/2column.
Edit all XML files to change the layout value.
For the %COMMUNITY_CONTAINER%, add the property <Integer name="layout" value="integer"/>. For example, to change the layout setting
for the Two Column community template to 3 for the Enterprise Sample desktop:
For example, the header.jsp file used by the Enterprise Sample's parent container ASCTabContainer
is PortalServer-DataDir/portals/portal-ID/desktop/enterprise_sample/header.jsp.
To Remove the Community Sample From Anonymous Portal Desktop
From the command line, type PortalServer-base/bin/psadmin modify-display-profile --combine--adminuseruid--passwordfilepasswordfile--dn "uid=authlessenterprisesample,ou=People,o=EnterpriseSample,dc=sun,dc=com" --portalportal-ID /tmp/parentcontainerremoveedp.xml.