Standard Configuration

Servlet and Filter Definition

The Portal Manager can be configured by means of the two files web.xml and pm.xml. These files can be found in the WEB-INF directory located below the web application directory of the Portal Managers. In the CMS Standard installation, the path is (relative to the CMS directory):

instance/default/webapps/PM/WEB-INF

Just as in other web applications, the web.xml file serves to declare the servlets, servlet filters etc. used and to specify their URL schemas.

Portal Manager Configuration

The current configuration of the Portal Manager can be found in the pm.xml file. This file is a standard Spring bean file. In the standard configuration the following beans exist:

  • hostConfig (com.infopark.pm.HostConfig)
    Determines the hosts for which requests are accepted as well as the languages supported. See also <npspm showIfLanguage> and the portlet configuration in the WEB-INF/portlet.xml file.

  • userManager (com.infopark.pm.user.UserManager)
    The user manager of the system, queried by the AuthenticationFilter for accessing user data.

  • portletContainer (com.infopark.pm.portlet.PortletContainer)
    Manages the portlets defined in the file WEB-INF/portlet.xml and makes them accessible for handling dynamic content.

  • documentManager (com.infopark.pm.DocumentManager)
    Provides the content for the ContentServlet. For this, the supplied implementation makes use of a configurable com.infopark.pm.DocumentSource.

  • permissionManager (com.infopark.pm.PermissionManager)
    Provides the PermissionFilter with the names of the groups whose users are permitted to access content to be delivered. From version 6.7.1, the permissionManager does no longer exist since the AuthorizationManager covers its functions.

  • authorizationManager (com.infopark.pm.user.AuthorizationManager)
    Uses the specified methods (com.infopark.pm.user.Authorizer) to check whether the user may access content.

  • templateEngine (com.infopark.pm.TemplateEngine)
    Prepares dynamic content so that the ContentServlet can compute the resulting document.

  • contentHandlerMap (java.util.Map)
    Determines which content is to be delivered by the ContentServlet and how this is done (dynamically or statically). For each MIME type a bean of the com.infopark.pm.doc.ContentHandler type can be specified. Individual implementations are used for static and dynamic content.

Configuring a Portlet Web Application

The Portlets contained in a web application can be configured by means of the WEB-INF/portlet.xml file which has the following structure:

<?xml version="1.0" encoding="UTF-8" ?>
<portlet-app version="1.0"
  xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
            http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
    <portlet>
      ...
    </portlet>
    ...
    <custom-portlet-mode>
      ...
    </custom-portlet-mode>
    ...
    <custom-window-state>
      ...
    </custom-window-state>
    ...
    <user-attribute>
      ...
    </user-attribute>
    ...
</portlet-app>

The elements have the following meaning:

  • portlet configures a portlet
  • custom-portlet-mode configures a non-standard portlet mode such as about or print.
  • custom-window-state configures a non-standard window state.
  • user-attribute defines optional user properties made available to the portlets.

Security constraints (security-constraint) are not supported by the Portal Manager.

Configuring a Portlet

Every portlet can be configured by means of a portlet element. The following example includes the most important elements:

    ...
    <portlet>
        <portlet-name>example</portlet-name>
        <portlet-class>com.infopark.example.Portlet</portlet-class>
        <init-param>
            <description>my init param description</description>
            <name>host</name>
            <value>127.0.0.1</value>
        </init-param>
        <expiration-cache>0</expiration-cache>
        <supports>
            <mime-type>text/html</mime-type>
            <portlet-mode>edit</portlet-mode>
        </supports>
        <supported-locale>en</supported-locale>
        <supported-locale>de</supported-locale>
        <resource-bundle>com.infopark.example.localizer</resource-bundle>
        <portlet-preferences>
            <preference>
                <name>readOnlyPreference</name>
                <value>foo</value>
                <value>bar</value>
                <read-only>true</read-only>
            </preference>
            <preferences-validator>com.infopark.example.Validator</preferences-validator>
        </portlet-preferences>
    </portlet>
    ...

The elements have the following meaning:

  • portlet-name: The portlet identifier. The identifier must be unique in the web application. It is used to include the portlet.

  • portlet-class: The Java class that provides the portlet functionality. This class must be contained in a jar archive in the WEB-INF/lib directory or as a compiled class in WEB-INF/classes.

  • expiration-cache: This option allows the Portal Manager to cache the portlet contents for the number of seconds specified, meaning that the content is not recomputed during this period of time. 0 deactivates this function, -1 permits unlimited caching (until an action is performed).

  • init-param: A configuration parameter for this portlet. Any number of init-param elements may be specified for a portlet.

    • description: Optional description
    • name: The parameter name
    • description: The value of the parameter
  • supports: Configures supported MIME types and portlet modes:

    • mime-type: Configures a supported MIME type. For each type, an individual element needs to be specified, the MIME type is obligatory.
    • portlet-mode: Other portlet modes than VIEW can be configured here.
  • supported-locale: A supported language. Typically, only an ISO language code is specified here, the country code, separated by an underscore character is optional. A portlet can support one or more languages, i.e. the element can be specified more than once.

  • resource-bundle: The name under which the resources can be found (without the language or the .properties suffix).

  • portlet-info: As an alternative to resources, a title, a short title, and keywords can be specified directly using this element. The corresponding subelements are: title, short-title, and keywords.

  • portlet-preferences: For every portlet, any number of presets can be configured. The values of these settings can be modified at runtime unless the setting is flagged as read-only. Additionally, a validator class can be specified.

The expiration-cache option is supported from version 6.5.2 of the CMS. With computationally intensive portlets, this option may improve the performance of the portal.

Portlet Modes and Window States

From version 6.5.1, you can use your own portlet modes and window states (not defined in the JSR168 specification). To do this, please create the file portlet.xml in the WEB-INF directory of the PM web application and declare your custom portlet modes and windows states in it.

Example:

    ...
    <custom-portlet-mode>
      <portlet-mode>preview</portlet-mode>
    </custom-portlet-mode>
    <custom-portlet-mode>
      <portlet-mode>urn:javax:portlet:mode:custom:about</portlet-mode>
    </custom-portlet-mode>
    <custom-window-state>
      <window-state>solo</window-state>
    </custom-window-state>
    ...