In this tutorial, I will explain how to start working with the IBM
WCM (Web Content Management). I will give a brief overview of some of
the useful IBM WCM elements.
In this example, I assume that we have a person object that simply has the following attributes:
1. Creating the library
of all, it is good to create your own content library from the portal
administration (Iam here using WebSphere Portal 6.1), let’s call the
library the “personLibrary”.
Check Figure 1.
Figure 1: Creating a new library for content
Then make sure that you are selecting the personLibrary as shown below in Figure 2.
Figure 2: Selecting the library
2. Creating the Workflow
the second step, let’s define the workflow of our content. For the
purpose of this introductory tutorial, I will create a dummy workflow
with a single workflow stage that includes the publish action ONLY. This
means that the content will be published automatically once it is
2.1. Creating the Workflow Action
To create a publish action; Just click (New -> Workflow Action -> Publish Action) as shown below in Figure 3.
Figure 3: Create the publish action
the information of the workflow action “PublishAction” as shown below
in Figure 4, and then click the “Save and Close” button.
Figure 4: Create the publish action
2.2. Creating the Workflow Stage
we created our “Publish Action”. To create a new workflow stage, just
click (New->Workflow Stage) as shown below in Figure 5.
Figure 5: Creating new workflow stage
the workflow stage information “Stage1” as shown in Figure 6 (Do not
forget to bind our created “PublishAction” with the “Execute on Entering
Stage” of the workflow stage, then click the “Save and Close” button.
Figure 6: Creating new workflow stage
2.3. Creating the Workflow
we are about to create the workflow (Workflow1). Select (New ->
Workflow), and enter the workflow information as shown in Figure 7 (Do
not forget to select our workflow stage “Stage1” for the workflow).
Figure 7: Creating the workflow
3. Creating the Site Area
Now, we should start creating the site area in which we will store the contents.
3.1. Creating the Site
area should be placed under site. so before creating the site area, we
should create the site. To create the site, click (New -> Site), and
then enter the site (Site1) information as shown in Figure 8, and click
the “Save and Close” button.
Figure 8: Creating the site
3.2. Creating the Site Area
we can create the site area under the site. Click (New -> Site
Area), and then select the parent site as shown below in Figure 9.
Figure 9: Placing the site area under the created site
Then enter the site area (siteArea1) information as shown below, and click the “Save and Close” button as shown in Figure 10.
Figure 10: Creating the site area
4. Creating the Authoring Template
authoring template is used for defining the attributes of the WCM
contents. To create the authoring template for our Person content, just
click (New->Authoring Template). And select “Manage Elements” to add
the Person content attributes as shown Figure 11.
Figure 11: Create the authoring template
Select the element type “Text” for both Person name and national id as shown in Figure 12.
Figure 12: Adding the personName attribute to the “Person” content
For the person image, select the element type “Image” for the person photo as shown in Figure 13.
Figure 13: Adding the person photo attribute to the “Person” content
save the authoring template with the “PersonAT” name as shown below in
Figure 14 then click the “Save and Close” button.
Figure 14: Creating the person authoring template
5. Creating Sample Persons
After defining the person authoring template, we can use the WCM authoring tool to create sample persons.
Click (New->Content) and select the (PersonAT) authoring template then click “OK”.
enter the person information in the input screen. Select our created
“workflow1” for the content and select our created “siteArea1” to place
the content under as shown in Figure 15.
Figure 15: Creating the sample persons
Once you click save, the content will be automatically published.
6. Creating the Presentation Template
display the person content, we need to define a presentation template.
To create a presentation template, just select (New->Presentation
Enter the information of the presentation template as follows:
<h1>This is the Presentation Template:</h1>
<b>Name: </b><Element context="current" type="content" key="personName"/> <br/>
<b>National ID: </b><Element context="current" type="content" key="nationalID"/> <br/>
<Element context="current" type="content" key="personImage"/>
And then click “Save and Close”.
To link the
presentation template with the authoring template, we should go to the
(siteArea1) and click the template mapping button to map the authoring
template with the presentation template as shown in Figure 16.
Figure 16: Mapping the authoring with the presentation templates
7. Creating the Menu Component
we need to list the created persons and display their contents in our
portal application, then we should use the menu component.
To create the menu component, just select (New->Component->Menu) as shown in Figure 17.
Figure 17: Creating the Menu component
Enter the information of the menu as follows, check Figure 18:
Menu Element Query:
Select our authoring template (PersonAT) and our site area (SiteArea1).
Design for each menu search result:
<b>Name: </b><Element context="autoFill" type="content" key="personName"/> <br/>
<b>National ID: </b><Element context="autoFill" type="content" key="nationalID"/> <br/>
<Element context="autoFill" type="content" key="personImage"/>
No result design:
No Content is available
Figure 18: Creating the menu component
clicking the “Save” button, click the “Preview” button to see the
output of the menu component. The result is shown in the picture below.
Figure 19: The menu component results
8. Calling the Menu Component from our portlet application
call the menu component from our portlet application, we can use the
WCM tag library for doing this task. So in our portlet page, we can call
the menu component using the as shown in
the code. Do not forget to include the WCM tld file in your portlet
application; you can get the WCM tld file from
<%@taglib uri="/WEB-INF/tld/wcm.tld" prefix="wcm" %>
<wcm:initworkspace username="wpsadmin" password="password"/>
<wcm:setExplicitContext wcmWebAppPath="http://localhost:10035/wps/wcm" wcmServletPath="/myconnect"
<wcm:libraryComponent name="personList" library="personLibrary" />
tutorial shows us how to create a WCM Library, Workflow, Site, Site
Area, Authoring Template, Presentation Template and Menu Component. The
tutorial shows us also how it easy to use the WCM APIs from our portlet