Create Category Selection Trees

Category Selection Trees can be used to allow Users to personalize Menus.

Note: connect.cfg

Ensure the following tag appears in the <Module> section of the Web Content Management configuration file:

<AJPECatSelect 
class=com.aptrix.pluto.CategoryProfileUpdaterModule 
remoteAccess=true autoLoad=false />
Note: Local Rendering Portlet

Category Selection Trees cannot be used with the Local Rendering Portlet.

 

Taxonomy Component Form

The main function of the Taxonomy Component is to display a category selection tree used to allow a user to select categories for menu personalization.

  • The component is configured by selecting either a Taxonomy or a Category as a start area.
  • Once the start area is selected, a child depth from the start area and a parent level are set relative to the start area. An "Include Start" option determines if the start area is to be displayed. This option has no effect if the start area is a Taxonomy.
  • also select a Search Rule.
  • There are two component design options available

    • One is rendered when the logged in user has selected the category that is to be displayed.
    • The other is rendered if the user has not selected the category.
    These component designs are Rich Text Components, and are used in a similar fashion to the Navigator and Menu Components.

The Taxonomy Component Form example below creates a checkbox input form:

  • The category identity number is assigned to the "value" attribute in the input fields.
  • Checkbox input fields are created, assigning the "selectedCategories" value to the "name" attribute.
  • Hidden input fields are created, assigning the "visibleCategories" value to the "name" attribute.

 

Component Designs

The following code examples are used to develop a basic Category Selection Tree:

Header:

<PathCmpnt end="/[Site]/[SiteArea]/[Content]?MOD=AJPECatSelect' method=post&gt;" start="&lt;FORM action='" type="servlet"/> This calls the Category Profile Updater Module.
<input type="hidden" value='<PathCmpnt type="noprefixservlet"/>/[Site]/[SiteArea]/[Content]' name="redirectURL"> This points to the Page to go to after the user request has been processed This must be a valid "[Site area]/[Content]" path. Otherwise the component will not render correctly.
<input type="hidden" name="updateSourceProfile" value="true"> This line determines how a User's Category Profile is updated.

The "value" parameter is optional.

True

Permanently updates the user Category profile.

False

Updates only the User's session profile.
<input type="hidden" name="profileMapperName" value="Current User Categories"> This defines the Search Rule used to locate the Category to display or update. This should be entered exactly as shown.Important: first create a Search Rule named "Current User Categories" for this to work.

Unselected component design:

This is used to display unselected items in the rendered Category Selection Tree.

<input type="checkbox" name="selectedCategories"
 value="<Placeholder tag="idnum"/>"/>
<IndentCmpnt offset="0" repeat=".."/>
<Placeholder tag="name"/>
<input type="hidden" name="visibleCategories"
 value="<Placeholder tag="idnum"/>"/>
<br>

Selected component design:

This is used to display selected items in the rendered Category Selection Tree.

<input type="checkbox" checked name="selectedCategories"
 value="<Placeholder tag="idnum"/>"/>
<IndentCmpnt offset="0" repeat=".."/>
<Placeholder tag="name"/>
<input type="hidden" name="visibleCategories"
 value="<Placeholder tag="idnum"/>"/>
<br>

Footer:

The footer contains the submit button.

<input type="submit" value="Set User Categories"></input>
</form>

Note: Indent Component

This example uses the Indent Component tag. This can be used in the Navigator and Taxonomy components. This tag represents a HTML/text string that should be repeated depending on the depth of a tree node being rendered in these components.

In the above taxonomy component example, the indent component is used to render and repeat the "." string dependent on the depth of the node the component design is being applied to. It is possible to offset the repeat value by assigning an integer value to the "offset" attribute of the tag. E.g., A current node depth of 5 and an offset value of -2 would render the repeat string three times. If the sum of the offset and the node depth is negative or 0, the repeat string is not rendered. Note: Component Designs

The only difference between the Unselected component design and the Selected component design is that the checkbox input field in the selected component design has the "checked" attribute set. Note: User Access

If using a Taxonomy Component, Users must be given "Edit" access to their own User item to enable them to update their selected Categories. Note: Using Dreamweaver to build Components

A Web Content Management solution comes with a set of enhancements to Dreamweaver. This allows you to build Presentation Templates and Web Content Management Components in HTML and then upload them into the Web Content Management environment. See Dreamweaver Enhancements for more details. Note: Using a URL to update User Categories

An alternative to using a Category Selection Tree to enable users to select Categories is to update a user's selected Categories via a URL:

http://host:port/wcm/connect/Site/SiteArea/SelectPage?MOD=AJPECatSelect
&redirectURL=/wcm/connect/Site/SiteArea/Content&updateSourceProfile=false
&profileMapperName=Current User Categories
&selectedCategories=category1,category3
&visibleCategories=category1,category2,category3,category4

The "selectedCategories" and "visibleCategories" parameters have multiple values which are comma delimited. The categories specified in "selectCategories" should be a subset of "visibleCategories".

This URL could be used on a page in the form of a button to allow users to update their user categories. E.g. - You could create a button that would add the Category "News" to a User's selected categories list.

Parent topic: Taxonomy Component.


IBM Workplace Web Content Management - V5.1.0.1 -

 

Workplace Web Content Management is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.