Sun Java System Portal Server 7.1 Update 1 Community Guide

Chapter 9 Deploying and Configuring the Wiki Portlet

This chapter contains the following:

Deploying the Wiki Portlet

This section includes instructions for deploying and editing the wiki portlet after Portal Server installation. After Portal Server is installed, portlets (available for deployment) are in the PortalServer-base/portletapps/portletname directory. If Portal Server has been configured, the portlet application will be in PortalServer-DataDir/portals/portal-ID/portletapps/portletapp directory. If Portal Server has not been configured, you must manually copy the files to the PortalServer-DataDir/portals/portal-ID/portletapps/portletapp directory before deploying the portlet.

ProcedureTo Deploy the Portlet

  1. Log in to the Portal Server host and change directories to where the portlet application is located.

    The wiki portlet is in the PortalServer-DataDir/portals/portal-ID/portletapps/wiki directory.

  2. Create the portlet WAR file.

    To create the WAR file:

    1. Edit the tokens.properties file to specify customizable parameters for the portlet.

      See Tokens for Wiki Portlet for more information.

    2. Run ant customize.

      Ensure that JavaTM DB is running before running ant.

  3. Deploy the Portlets.

    To deploy, type ant auto-deploy. You can run ant wikinodeploy to test your configuration before deploying the portlet. The ant wikinodeploy command will build the WAR file and configure the database, but will not deploy the portlet.

  4. Log in and verify that the wiki portlet is deployed.

    1. Go to http://HOST:PORT/portal/dt and select the sample where you deployed the wiki portlet.

    2. Log in to the sample and view the portlet.

ProcedureTo Change the Default Password for the Database

For each portlet using a relational database, a separate database instance is configured with a default userid and password. The default userid is portal and the default password is a random string generated during installation. Change the default password and the access permissions of the properties files containing the password.

  1. Restart Java DB.

    See Starting, Stopping, and Disabling the Java DB in Sun Java System Portal Server 7.1 Configuration Guide for more information.

  2. Change the password for the default user, portal, by connecting to the wikidb_portal-ID database.

    For example, if you are using a GUI like SQuirrel-j, use the SQL editor to execute the following command after connecting to the database:


    CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.authentication.provider',
     'BUILTIN');
    CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.connection.requireAuthentication',
     'true');
    CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.user.portal',
     'your-new-password');
    CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.database.fullAccessUsers',
     'portal');
    CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.database.defaultConnectionMode',
     'noAccess');
  3. Restart Java DB.

    See Starting, Stopping, and Disabling the Java DB in Sun Java System Portal Server 7.1 Configuration Guide for more information.

  4. Verify that the password was set correctly by connecting to the wikidb_portal-ID database with the new password.

  5. For each portal instance:

    1. Refer to the web container's documentation and set the password for the jdbc/WikiDB datasource to the new password that was set in step 2.

    2. Open the PortalServer-DataDir/portals/portal-ID/portletapps/wiki/tokens.properties file and change the password value for the DB_ADMIN_PASSWORD and DB_PASSWORD properties to the new password that you set in step 2.

    3. Change the permissions for the PortalServer-DataDir/portals/portal-ID/portletapps/wiki/tokens.properties file so that it is readable and writable only by the owner.

      For example, type chmod 600 tokens.properties.

    4. Restart the web container.

ProcedureTo Include Portlets on a Wiki Page

    In order to display portlets on a wiki page, the wiki portlet must be the first selected element of a DynamicAggregationContainer. The display profile of the Developer Sample desktop and of the sample wiki community include such a container. The wiki portlet can display and aggregate other channels (or portlets) or aggregate provider and portlet channels that are in the available list of the DynamicAggregationContainer. If a channel is not in the available list, it will not appear on the page with no error or other indication. This allows the wiki portlet to include different channels for different users based on their display profiles. All portlets must be at the main wiki page in order to show the searched object from community home search results.

Interwiki Linking

Within a wiki, you can link to your own pages as well as pages in another wiki. Since each community gets its own wiki, you can link between communities this way. Each wiki is provisioned with its own set of initial pages. Linking between wikis is possible using links of the form [WikiName:PageName]. To link to another community's wiki, you must know the name of that community. For example, in the main page of the community X wiki, include the following:


X:Main
=======================
This is the main page of the community X wiki.
You can link to another page in X like this [SomePage]
You can also link to a page in a different wiki, eg, in communty Y,
like this [Y:Main] or [Y:SomePage]

Wiki permissions are tied to community membership and only members can edit a community wiki. The visitors can read community wiki pages if the community is not secure. By default, the community system currently disallows visitors any access to community content.

Configuring the Wiki Portlet

This section contains the following:

Portlet Preferences

The wiki portlet includes the following preferences that can be modified from the Portal Server management console or by editing the display profile template used when creating new communities in the PortalServer-dataDir/communitytemplates/wiki/ directory:

wikiTemplate

Specifies the name of the JSPWiki template used by this wiki portlet. The Portal Server software includes two of these templates: a full page template called wikicommunity and a rearranged version used by smaller wiki portlets called wikiportlet.

wikiPage

Specifies the name of the default wiki page for this wiki portlet

editorType

Specifies the type of editor used by this wiki portlet. Values can be text or html. A text wiki portlet uses a simple text editor, whereas an HTML wiki uses a WYSIWYG HTML editor.

editorOptions

Specifies the HTML editor plug-ins used in this wiki. This is specified only when editorType is html. Valid values are: PortletPicker, Stylist, CharacterMap, ContextMenu, FullScreen, ListType, SuperClean, TableOperations.

availablePortlets

Specifies the list of channel names (either portlets or provider channels) which this wiki portlet allows the user to select from when placing a channel on the page. Note that only channels in the corresponding DynamicAggregationContainer available list will actually be displayed. Typically, these two lists would contain the same channels.

Tokens for Wiki Portlet

The Wiki Portlet is based on JSPWiki. For more information on JSPWiki, see http://www.jspwiki.org. The Wiki Portlet supports the following configuration tokens in the PortalServer-DataDir/portals/portal-ID/portletapps/wiki/tokens.properties file:

WIKI_REPOSITORY_TYPE

Specifies the wiki page repository type, jdbc, for database (default) file for filesystem.

WIKI_WORK_DIR

Specifies the location of temp files and search index.

WIKI_FILESYSTEM_REPOSITORY_DIR

Specifies the location of filesystem repository (not used for JDBC repository).

WIKI_PAGE_TEMPLATES_DIR

Specifies the base location of the page template directories which are used to create the initial page sets of new wikis.

DB_ADMIN_URL, DB_ADMIN_USER, DB_ADMIN_PASSWORD, DB_ADMIN_DRIVER_CLASS, and DB_ADMIN_DRIVER_CLASSPATH

These are used by the system to create the wiki database repository when the wiki is first configured.

DB_JNDI_NAME and COMMUNITYMC_JNDI_NAME

These are used for the configuration of the wiki and community database resources.

The Wiki Portlet allows for the following runtime tokens in the PortalServer-DataDir/portals/portal-ID/portletapps/wiki/tokens.properties file:

jspwiki.applicationName

Specifies the default application name. It affects the HTML titles and logging, for example. It can be different from the actual web name (http://my.com/mywiki) of the application, but usually it is the same.

jspwiki.pageProvider

Specifies the provider class to use. For example, the values can be:

RCSFileProvider

For simple RCS-based file storage.

FileSystemProvider

For simple pure file storage with no version information.

VersioningFileProvider

For simple, non-RCS based versioning storage.

By default, this is set to JDBCPageProvider.

jspwiki.JDBCPageProvider.continuationEditMinutes

Specifies the minutes for editing the page before increasing the version of the page. Multiple edits by the same user within this interval will not increment the page version number and will appear as a single edit in the page history.

jspwiki.JDBCPageProvider.migrateFrom and jspwiki.JDBCAttachmentProvider.migrateFrom

Specifies the path to the properties files of the imported page and attachment repositories, which are used to build the initial database repository from default data, or to migrate from old versions of JSPWiki.

jspwiki.fileSystemProvider.pageDir

Specifies where wiki files are kept for FileSystemProvider and RCSFileProvider.

jspwiki.workDir

Specifies the JSPWiki working directory. The working directory is used to cache things like page reference data.

jspwiki.attachmentProvider

Specifies the attachment provider to use. You can specify BasicAttachmentProvider for a simple, flat file versioning provider or leave the value empty to disable the functionality. By default, this is set to JDBCAttachmentProvider.

jspwiki.basicAttachmentProvider.storageDir

If you specify the BasicAttachmentProvider as the attachment provider, this specifies where to store the files the user has uploaded.

jspwiki.baseURL

Specifies the base URL which can be used to rewrite all of JSPWiki's internal references.

jspwiki.auth.useOldAuth

Enables authorization. Authorization for community wiki is based on community membership.

jspwiki.translatorReader.allowHTML

Specifies whether raw HTML is allowed as Wiki input. By default, this is set to true. You can also specify yes or no, or on or off.

jspwiki.templateDir

Specifies the default template used by the Wiki engine. The templates live in wiki-webapp-location/templates/template-name directory. JSPWiki will attempt to find two basic templates (ViewTemplate and EditTemplate) from that directory. The default JSPWiki template is called default which is provided as a reference only. The wiki portlet uses templates called wikicommunity and wikiportlet.

jspwiki.lockExpiryTime

Specifies the number of minutes a person can lock a page while editing it.

jspwiki.searchProvider, jspwiki.searchServer, and jspwiki.searchDatabase

Specifies search server configuration information.

jspwiki.pageTemplatesConfigDir

Specifies a file system directory containing wiki page template configurations. A wiki page template defines a set of initial pages used when a new wiki is created. Wiki channels specify the page template with the wikiTemplate property. There are currently three templates:

default

Used by the wiki tab and wiki portlets in the Developer Sample portal.

community

Used by wiki communities.

communityportlet

Used by wiki portlets in the community framework.

log4j.logLevel

Specifies the logging level.

log4j.appender.FileLog.File

Specifies the log file location. The default log location is dynamically set to PortalServer-DataDir/logs/instance-name/jspwiki.log.