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 theWEB-INF/portlet.xmlfile.userManager(com.infopark.pm.user.UserManager)
The user manager of the system, queried by theAuthenticationFilterfor accessing user data.portletContainer(com.infopark.pm.portlet.PortletContainer)
Manages the portlets defined in the fileWEB-INF/portlet.xmland makes them accessible for handling dynamic content.documentManager(com.infopark.pm.DocumentManager)
Provides the content for theContentServlet. For this, the supplied implementation makes use of a configurablecom.infopark.pm.DocumentSource.permissionManager(com.infopark.pm.PermissionManager)
Provides thePermissionFilterwith the names of the groups whose users are permitted to access content to be delivered. From version 6.7.1, thepermissionManagerdoes no longer exist since theAuthorizationManagercovers 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 theContentServletcan compute the resulting document.contentHandlerMap(java.util.Map)
Determines which content is to be delivered by theContentServletand how this is done (dynamically or statically). For each MIME type a bean of thecom.infopark.pm.doc.ContentHandlertype 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="https://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd https://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:
portletconfigures a portletcustom-portlet-modeconfigures a non-standard portlet mode such asaboutorprint.custom-window-stateconfigures a non-standard window state.user-attributedefines 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 theWEB-INF/libdirectory or as a compiled class inWEB-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.0deactivates this function,-1permits unlimited caching (until an action is performed).init-param: A configuration parameter for this portlet. Any number ofinit-paramelements may be specified for a portlet.description: Optional descriptionname: The parameter namedescription: 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 thanVIEWcan 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.propertiessuffix).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, andkeywords.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> ...