Vinodh R Mahendrakumar
Customizing the WCM Authoring Templates for Portal
In Lotus Web Content Management (WCM) one of the key requirements is to offer a simple and easy to use authoring interface which can provide better user experience which also helps to save time and effort.
This article talks about a few ways to customize the Authoring Template (AT) to provide better comfort and guidance to content authors.
WCM provides a feature to customize the look and feel of a particular field. This will be exploited to hide the fields. The steps for hiding certain sections in a WCM Authoring Template are discussed.
As depicted in Figure 1, WCM provides out-of-the-box functionality to hide entire sections.
Figure 1: Hiding Sections
Certain elements within a section can also be hidden as shown in Figure 2.
Figure 2: Hiding Fields
The section below describes the steps to hide the following fields within the Workflow Section. As seen in Figure 1, there is no out-of-the-box feature available to hide the following fields:
- Document Status
- Select Workflow Button
- Next Workflow Stage
- Joint Approval
Using the Manage Elements button, add an element of type Text or Short Text to the Authoring Template, name it as Text.
Figure 3: Manage Elements
Now go to the Default content settings in the Authoring Template, expand Content section, and click on Text Properties Image to open up the form as shown below.
The path to the custom JSP which hides the fields mentioned above is specified here.
Figure 4: Default Content Settings
The sample JSP can be found in the attachments section.
Place the JSP inside < >/installedApps/<>/PA_WCM_Authoring_UI.ear/ilwwcm-authoring.war/
The JSP page may also need to be stored in the client war directory of the servlet or portlet that calls the JSP, example:
Before including the JSP, when a new content is created using this AT, it would look like the following, assuming that none of the fields inside workflow section were hidden:
Figure 5: Preview of the content before including the JSPs
Once the JSP is included in the content items, it looks as shown below:
Figure 6: Preview of the content after including the JSPs
Auto-populating Information in Content Entry Form
This section talks about populating user information using PUMA ( Management Architecture) SPI.
A better end user experience could be provided if certain fields in the content entry form, such as, Name
, can be pre-populated based on the current authenticated user.
PUMA SPI allows getting details about the current logged-in user which can be populated into appropriate fields as per the requirement. The steps describe how to populate Name and Email fields automatically based on the current user.
Using the Manage Elements button add elements of type Text or Short Text to the Authoring Template. These will hold the name and email of the content author.
Figure 7: Manage Elements
Now go to Default content settings in the Authoring Template, expand Content section and click on Name Properties Image to open up the form as shown below.
The path to the custom JSP which populates this field is specified here.
Figure 8: Default Content Settings
Place the name.jsp inside < >/installedApps/< >/PA_WCM_Authoring_UI.ear\ilwwcm-authoring.war
The JSP page may also need to be stored in the client war directory of the servlet or portlet that calls the JSP.
Repeat the above procedure for the Email
CustomItemBean customItem =
In Listing 3, the name of the current logged in user is obtained from PUMA SPI.
Figure 9: Preview of the content before including the JSPs
PumaProfile pp = home.getProfile(request);
List attribNames = new ArrayList();
map = pp.getAttributes(pp.getCurrentUser(),attribNames);
Content which previously appeared like the one shown above, looks like the following once the custom JSP is used.
Figure 10: Preview of the content after including the JSPs.
This attachment can be downloaded from Lotus Greenhouse. If you do not have a Lotus Greenhouse ID, you may receive one immediately via the registration page.