This is a developer-level activity.
High-level functionality in the FileNet P8 Workplace application is organized as a series of primary views. The following screenshot shows the primary views listed in the left navigation pane and in the top toolbar of Workplace. Selecting a view link invokes a Java™Server Pages (JSP) page that renders that view's functionality.
Through the Workplace site preferences, an administrator can change the order of the views, hide or show views, and restrict access to views (see Primary Views Preferences). Using the framework on which Workplace is built, a developer can add custom views.
This topic shows you how to add a custom primary view to Workplace. Starting with an overview of creating a plug-in view page, the topic explains how to register the page in the Workplace primary views descriptor file.
NOTE Do not confuse the configuration of "site preferences for Primary Views" with "primary views for site preferences." The later refers to the ability of an administrator to modify the primary views of site preference settings available in the Workplace Site Preferences Tool. For more information, see Customizing Primary Views for Site Preferences.
Creating a primary view page to plug into Workplace requires an understanding of the Web Application Toolkit framework and base modules on which the Workplace application is built. This section outlines the general steps you would take to create a new primary view page.
To create a primary view page:
<object key="configuredPage">
<setting key="primaryView">true</setting>
<setting key="label" localizationKey="server.PrimaryViews_xml.customView">Custom View</setting>
<setting key="id">custom</setting>
<setting key="url">CustomPage.jsp</setting>
<setting key="guestAllowed">true</setting>
<setting key="treeNodeKey">RootPagesTree</setting>
<array key="rootDescriptors">
<value>com.filenet.wcm.apps.server.util.sitenavigation.CustomPageDescriptor</value>
</array>
</object>
NOTE The "rootDescriptors" key is required only if you want to add sub views to the tree in the left navigation pane.
PrimaryViews.xml contains the definitions for primary view pages. The file is located in the <AE_install_path>FileNet/Config/AE folder. PrimaryViews.xml follows the Workplace Preferences XML Schema, Preferences.xsd, located in <AE_install_path>Workplace/WEB-INF/xml.
File Structure of PrimaryViews.xmlAs shown in the listing below, PrimaryViews.xml consists of three sections. The first is an array element that describes the order of the views in the left navigation pane and in the top toolbar of Workplace The second section is an array element that describes the default page order that is read when the Restore button is clicked on the Primary View page of the Workplace site preferences. The third section is a list of primary view pages, with each page defined in a "configuredPage" object element. To add a custom primary view page, add a "configuredPage" object element with the applicable configuration settings.
<array key="pageOrder">
<value>home</value>
<value>tasks</value>
<value>favorites</value>
<value>browse</value>
<value>search</value>
<value>author</value>
<value>admin</value>
</array>
<array key="defaultPageOrder">
<value>home</value>
<value>tasks</value>
<value>favorites</value>
<value>browse</value>
<value>search</value>
<value>author</value>
<value>admin</value>
</array>
<list key="configuredPages">
<object key="configuredPage">
<setting key="primaryView">true</setting>
<setting key="label" localizationKey="server.PrimaryViews_xml.Browse">Browse</setting>
<setting key="id">browse</setting>
<setting key="url">Browse.jsp</setting>
<setting key="guestAllowed">true</setting>
<setting key="treeNodeKey">RootPagesTree</setting>
<array key="rootDescriptors">
<value>com.filenet.wcm.apps.server.util.sitenavigation.BrowsePageDescriptor</value>
</array>
</object>
...
<list>
The following table describes the settings for the "configuredPage" object element. Each setting is identified by its key attribute. Unless otherwise specified, a setting is optional. If an optional setting is not present, its default value is used.
Setting | Value |
---|---|
<setting key="primaryView"> |
Indicates that the page is a primary view, which would appear in the top toolbar, and, optionally, in the left navigation pane of Workplace. Set the value to "true". |
<label key="label" |
Based on the client locales passed in requests, Workplace retrieves UI strings from resource bundles. The label element identifies the view in the UI, and serves as an override to the UI strings set in the property resource bundles. The resource subelements specify the override values. If your Workplace application is supporting clients of various locales, you can have one or more resource subelements with a locale attribute. The value of this attribute should use the standard ISO language and country codes as supported by browsers.
The label element is required with a localizationKey attribute. Workplace uses this attribute to look up the UI string in a resource bundle, should one not be specified in the XML. If Workplace cannot find the localized string in the XML or resource bundle, it will fall back to the value of the resource element (that does not include a locale attribute). This element is required. For a detailed description of the resource lookup logic, see Lookup Precedence for Locale Resources. |
<setting key="id"> |
Defines the ID for the page. This setting is required and the value has to be unique for each page. |
<setting key="url"> |
Defines the URL of the primary view page. This setting is required.
If the URL does not start with "http://", then it's considered to be a relative URL, and, when redirecting, the base path of the Workplace application will be prepended to the URL. For example, if the URL is "customView.jsp", and the base URL is "http://myserver/Workplace", Workplace will redirect to "http://myserver/Workplace/customView.jsp". |
<setting key="guestAllowed"> |
If the value is "false", guest users will not see this page. Default value is true. |
<setting key="treeNodeKey"> |
Specifies a key used by the tree view modules. This key is only required if your page uses the tree view in the left navigation pane. Set the value to "RootPagesTree" for all primary views. |
<array key="rootDescriptors"> |
Defines an array of one or more root descriptor classes. This key is only required to add sub views to the tree in the left navigation pane. Specify the fully qualified name of the page descriptor class that you created. For the purpose of creating a simple primary view, a root descriptor is not required. |