Integrating IBM WebSphere Portal Search with IBM Workplace Web Content Management for version 6

How to search Workplace Web Content Management content using WebSphere Portal Search

Learn how to use IBM® WebSphere® Portal search to return results from the Workplace™ Web Content Management server. This article walks you through setting up the WebSphere Portal search collection, configuring the portlets used for WebSphere Portal search and Workplace Web Content Management, and creating the underlying structure necessary.

Share:

One of the most powerful tools that WebSphere Portal server offers is its search capabilities. With the release of WebSphere Portal version 6, Workplace Web Content Management has been more tightly integrated with this process. Not only can you configure the WebSphere Portal search to search Workplace Web Content Management content more easily, but you can also leverage WebSphere Portal search from within Workplace Web Content Management content. This detail means that you can use WebSphere Portal search from within Workplace Web Content Management to provide results not just from Workplace Web Content Management, but also from other sources that WebSphere Portal is configured to search. For example, you can return documents that have been stored in WebSphere Portal document manager through the WebSphere Portal search, and you can display those results within Workplace Web Content Management content. Also, you can search and provide results to Workplace Web Content Management content from the WebSphere Portal search portlets.

This article outlines the steps necessary to allow WebSphere Portal search to return Workplace Web Content Management results, shows how to display those results within the WebSphere Portal search portlets, and describes how to leverage the WebSphere Portal search functionality from within Workplace Web Content Management content.

Setting up WebSphere Portal to search Workplace Web Content Management content

The first step is to configure the WebSphere Portal search to be able to return results from Workplace Web Content Management content. Also, you have to create some Workplace Web Content Management content for the WebSphere Portal search to return. Here are the detailed steps for creating a new WebSphere Portal search collection and for creating a Workplace Web Content Management site to be searched.

To create a new WebSphere Portal search collection, follow these steps:

  1. Log in to the WebSphere Portal server as a member of the WebSphere Portal administrators group.
  2. Navigate to the Administration page. On the left navigation, you see a section for Search Administration. Click Manage Search.
  3. On the right side are the links to manage Services, Collections, and Scopes. Click Search Collections.
  4. In the Manage Search page that displays, click New Collection.
  5. Create a new collection with the following values:
    • Search Service: Default Portal Search Service
    • Location (note that this is operating system-specific; use WASHOME/profiles/wp_profile):/opt/IBM/WebSphere/AppServer/profiles/wp_profile/WCMTestCollection
    • Name: WCMTestCollection
    • Description: WCMTestCollection
    • Language: English
    • Categorizer: none
    • Summarizer: automatic
      Figure 1. New search collection form
      New search collection form
  6. Click OK to save the changes.
  7. Now, notice that there is no content source that the search collection is configured to search yet. That is fine because when you create the Workplace Web Content Management content, you populate the content source for this collection.



Now that you have the search collection defined, you have to create some Workplace Web Content Management content to be searched by the WebSphere Portal search. Create a simple Workplace Web Content Management site structure. Because this article focuses on WebSphere Portal search configuration, you won't get detailed Workplace Web Content Management information for this section.


Creating a Workplace Web Content Management site structure for search

For this search example, you create the following:

  • Workflow action, workflow stage, and a workflow
  • Authoring template
  • Presentation template
  • Site, site areas, and some content objects


Follow these steps:

  1. Log in to the WebSphere Portal server as a user who has access to the Workplace Web Content Management Authoring portlet. For example, log in as the WebSphere Portal administrator.
  2. Navigate to the Workplace Web Content Management Authoring portlet.
  3. Create the workflow items necessary for the example:
    • Create and save a new publish workflow action, and name it CKPublishAction.
    • Create and save a new workflow stage. Name it CKPublishStage. Select the CKPublishAction as the Execute on Entering Stage value. In the Workflow Security section, click the Read button to add users to the Read security of all objects that use this workflow stage. For example, grant Read access to the [all users] group so that all users of the WebSphere Portal server have access to objects while they are associated with this workflow stage. See the IBM WebSphere Portal, Version 6 Information Center for questions about security.
    • Create and save a new workflow. Name it CKImmediatePublish, and select the CKPublishStage as the workflow stage associated with the workflow.
  4. Create and save the authoring template necessary for the example. Create an authoring template named CKSearchAuthTemplate, with the following elements as shown in figure 2:
    • Title, which is a text element
    • Body, which is a rich text element
    • Three more component reference elements, named Comp1, Comp2, and Comp3
      Figure 2. Authoring template elements
      Authoring template elements
  5. You should also prepopulate the workflow setting with the CKImmediatePublish workflow, so that all content created based on this authoring template automatically uses that workflow by default. This approach simplifies the authoring process.
  6. Create and save the presentation template necessary for the example. Create a presentation template named CKSearchPresTemplate. To display all the objects placed on the authoring template, use the following code for the HTML of the presentation template:
     <html>
     <head>
     </head>
     <body TEXT="Black" BGCOLOR="White" BACKGROUND=""
     LEFTMARGIN="0" RIGHTMARGIN="0" TOPMARGIN="0" BOTTOMMARGIN="0">
     <Element context="current" type="content" key="Title"/><br>
     <Element context="current" type="content" key="Body"/><br>
     <Element context="current" type="content" key="Comp1"/><br>
     <Element context="current" type="content" key="Comp2"/><br>
     <Element context="current" type="content" key="Comp3"/><br>
     </body>
     </html>
  7. Create and save a new site area. Name the site area CKHomeSite, and map the CKSearchAuthTemplate/CKSearchPresTemplate to the site area. Also, select the Searchable option. For the Search Service, select Default Portal Search Service. For the Search Collection, select CKSearchCollection. Enter the username and password for the WebSphere Portal administrator as shown in figure 3.
    Figure 3. Site settings
    Site settings
  8. From this point, create the following site structure. An asterisk (*) denotes site area; a hyphen (-) denotes content. See figure 4. Note that all site areas use the CKSearchAuthTemplate and CKAuthPresTemplate, and all content uses CKSearchAuthTemplate:

    CKHomeSite
    * CKHomeSiteArea
    -  HomeContent
    *  CKProductsSiteArea
    --  ProductsHomeContent
    ** CKKnivesSiteArea
    --- KnivesContent
    ** CKPansSiteArea
    --- Pans Content
    * CKNewsSiteArea
    -- LatestNews
    -- NewsContent1
    -- NewsContent2
    Figure 4. Site structure
    Site structure
  9. When creating the content, populate the Title and Body fields with relevant information that you want to search for later. As an example, when you create the content you can populate the description field with the titles of the content. For the HomeContent content object, populate the description field with HomeContent.

Verify that the Workplace Web Content Management content is available to WebSphere Portal Search

After you have created the content under the site area, you can verify that the content is now available to the WebSphere Portal search collection that you defined earlier. To do this task, navigate to Administration - WebSphere Portal - Search Administration - Manage Search, and click Search Collections. From the Search Collections page, click WCMTestCollection that you created earlier. You see that there is now a content source available to the collection, which was created when you selected the Searchable check box on the site object that you created.

In addition to the Search Administration portlet, which is used to set up portal search collections, there are a couple of portlets that you can use to leverage the search collection and return results: the Search Center portlet and the Search and Browse portlet. You can also use the Web Content Management Local Rendering portlet to display your results as a piece of content.


Search Center portlet

The Search Center portlet is deployed by default. You can use the Search Center portlet from any page that has the search bar in the upper right of the WebSphere Portal page as shown in figure 5.

Figure 5. Search Center portlet
Search Center portlet

The Search Center portlet is a basic search portlet; you can configure only the number of results to show at a time and the default language of the search. You can also define what scope to search, which means that you can search all sources or you can select individual sources for searching. The sources that you can select are defined by what you have set up in WebSphere Portal search administration, under Search Scopes.

Now that the Workplace Web Content Management content has been created, use the Search Center portlet to search for Workplace Web Content Management content. Enter HomeContent in the search field, and click the search button. You see results that reference the Workplace Web Content Management content that you created in the preceding steps. When you created the HomeContent object, you made that object the default content for the CKHomeSite site and the CKHomeSiteArea site area. Figure 6 shows the results.

Figure 6. Search Center results
Search Center results

Search and Browse portlet

The Search and Browse portlet offers more in terms of customization than the Search Center portlet offers. In the Search and Browse portlet, you configure the portlet to search only one specific search collection at a time. This approach allows you to narrow the search scope down and to deploy different search portlets for each of the search collections. Also, the user has access to more advanced search options, such as searching for certain document types or searching for values in the document fields.

The Search and Browse portlet is not deployed to any page by default, so you have to place the portlet on a page. One easy way to do this step is to create a new page in WebSphere Portal and to deploy a copy of the Search and Browse portlet to it.

Follow these steps:

  1. Log in to the WebSphere Portal server as the administrator.
  2. Navigate to Administration - WebSphere Portal - Portal User Interface - Manage Pages.
  3. Click the Content Root link, then click the Home link to create a new page under the Home page.
  4. Click the New Page button.
  5. Name the page CK Search Page, and leave the default values. Click Save.
  6. Now that you have a page, create a friendly URL mapping to the page. This mapping enables the user to click the Workplace Web Content Management search results and to display them in a Workplace Web Content Management portlet later. Navigate to Administration - WebSphere Portal - Portal Settings - URL Mapping.
  7. Click the New Context button, and name the new context WCMContent. Click OK.
  8. Map the connection between the URL mapping and the portal page you just created. In the URL mapping portlet (where you are now), click the globe icon for the WCMContent URL mapping. Navigate through to the CK Search Page by clicking the Home link, then select CK Search Page as shown in figure 7.
    Figure 7. Select CK search page
    Select CK search page
  9. Click OK. Now, you have a page where you can deploy a Workplace Web Content Management local rendering portlet, so that you can display Workplace Web Content Management content that was found by the Search and Browse portlet within a portal page.

Now that you have the page to deploy the portlet on, create a copy of the Search and Browse portlet to deploy to the page. Follow these steps:

  1. Navigate to Administration - WebSphere Portal - Portlet Management - Portlets.
  2. Search for the Search and Browse portlet by searching Title Starts With, and enter Search. Click the Search button to see the Search and Browse portlet in the results. If you do not see the portlet, follow the Information center documentation about deploying the Search and Browse portlet. (You install the portlet from /WebSphere Portal HOME/installableApps/SearchAndBrowse.war.)
  3. Click the Copy Portlet button, which looks like two pages as shown in figure 8.
    Figure 8. Copy Search and Browse
    Copy Search and Browse
  4. You are presented with a page where you can define the name of the portlet copy. For both fields, enter CK - Search and Browse. Click OK.
  5. Now that you have created a copy of the portlet, configure the portlet to point to the search collection that was created earlier. On the CK - Search and Browse portlet in the Manage Portlets page, click the configure icon.
  6. You are presented with a list of values to configure the Search and Browse portlet. You care about only three settings at the moment (to change values, click the pencil icon next to the portlet setting that you want to change):
    • Change the OpenResultMode from new to WCM, and then click OK.
    • Change CollectionLocation from (change to collection location) to the location of the collection that you created. You need to specify the whole location, not just the name. In an example environment, this location is /opt/IBM/WebSphere/AppServer/profiles/wp_profile/WCMTestCollection. This value is the same setting as the Location parameter from the Search Collection that you created earlier.
    • Change to the second page of settings. You do not need to change this now, but the value for OPEN_Web Content Management_WINDOW determines where the Web Content Management content is displayed when you click a search result. Note that the default is /WebSphere Portal/myportal/WCMContent?WCM_GLOBAL_CONTEXT=. Because you created the URL mapping of WCMContent to map to your CK Search Page, when the search results are returned they have a URL that updates the Workplace Web Content Management Local Rendering portlet on that page (which you have not deployed yet) with the Workplace Web Content Management content that you want to display from the search results.
  7. Click OK to save your changes.

Workplace Web Content Management Local Rendering portlet

Now that you have a copy of the Search and Browse portlet, you want to create a copy of the Web Content Viewer portlet to view your Workplace Web Content Management documents that are returned by the WebSphere Portal search.

Follow these steps:

  1. Navigate to Administration - WebSphere Portal - Portlet Management - Portlets, and search for Title Begins With Web.
  2. Click the Copy Portlet button on the Workplace Web Content Viewer portlet. Give the Portlet a name, CK Web Content Management Search - Web Content Management - Content Viewer for the portlet application, and CK Web Content Management Search - Web Content Viewer for the portlet title as shown in figure 9.
    Figure 9. Copy Web Content Management Rendering portlet
    Copy Web Content Management Rendering portlet
  3. Click OK to create the copy of the portlet that you want to use later to display results.

Setting up the Search and Results page

Now you have both the Search and Browse portlet to search for and display Web Content Management results, as well as a Workplace Web Content Management Local Rendering portlet that you can use to display the Workplace Web Content Management content retrieved by the WebSphere Portal search. All that remains is to deploy these two portlets to the portal page that you created earlier. You use the new portlet pallette functionality to do this.

Follow these steps:

  1. Navigate back to the portal Home page. After you are on the home page, click the tab for the CK Search Page that you created earlier as shown in figure 10.
    Figure 10. CK Search Page tab
    CK Search Page tab
  2. Notice that the page is empty. Click the portlet pallette icon, which is located on the upper right side of the page and looks like a plus sign.
  3. The portlet pallette appears. Add two portlets. In the search field on the portlet pallet, type CK to show the Search and Browse portlet as well as the Local Rendering portlet that you created earlier.
  4. Drag and drop both of these portlets on to the CK Search Page. For example, place the CK - Search and Browse portlet on the top, and then place the CK WCM Search portlet under that.
  5. Close the portlet pallette. The last step is to point the portlet at a default piece of content. You do this step to give the portlet something to point to initially when the WebSphere Portal session is first started. To do this:
    • Select the Edit Portlet option in the CK Web Content Management Search - Web Content Viewer portlet. Select Configure from the list.
    • You now see the configure mode of the Workplace Web Content Management Local Rendering portlet. Point it to a piece of default content. NOTE: If you have more than one Workplace Web Content Management Content library defined, make sure that you select the same library where you created the Workplace Web Content Management content for this sample. Ensure that Content is selected for Content Type, and then click the Edit button in the Content section.
    • Navigate to CKHomeSite - CKHomeSiteArea, and then select the HomeContent object. Click OK.
    • Make sure that Broadcast Links is set to none and that Receive Links is set to This portlet and other portlets. Click OK to finish configuring the portlet.

Now, you have the page with both the Search and Browse portlet and the Web Content Management portlet configured to receive links from the Results portlet. Try searching for HomeContent in the Search and Browse portlet. You should see results for the HomeContent pages that you created. When you click a link to a result, the Workplace Web Content Management portlet is updated to display the content that you found.


Leveraging WebSphere Portal search from Workplace Web Content Management

Now that you have examined how to set up the WebSphere Portal search to get results from Workplace Web Content Management content, you can examine how to leverage WebSphere Portal search from directly within the Workplace Web Content Management content. To do this task, create some elements in Workplace Web Content Management to create a search form and to search in the WebSphere Portal search collections. You need to create an HTML form to perform the search and a Workplace Web Content Management search element to display the results. You then display both of these elements from within a piece of Workplace Web Content Management content, and then you display that Web Content Management content to access the form and the results.

Because you have already created both an authoring template and a presentation template that allows you to use Workplace Web Content Management library components, you can create a new site area and a piece of content within that site area. The content and site area leverage the CKSearchAuthTemplate and CKSearchPresTemplate authoring and presentation templates, and you can create the site area directly under the CKHomeSite site area. This approach means minimal work for you. Finally, you create the HTML search form and the Workplace Web Content Management search element, and you place them within the content that you create.

First, create the HTML form. This example is basic. Follow these steps:

  1. Open the Workplace Web Content Management authoring portlet. Click New, and then select HTML Component.
  2. Name the component CKSearchForm. Paste the code shown in listing 1 in the HTML field:
    Listing 1. Naming the component field
     <form action='<PathCmpnt type="servlet"/
     >/web+content/CKHomeSite/CKHomeSiteArea/CKSearchSiteArea/CKSearchContent' 
     method="post"> 
     <table>
         <tr><td>
             <input type="text" name="search_query"/>
         </td></tr>
         <tr><td align="right">
             <input type="submit" value="Search"/>
         </td></tr>
     </table>
     </form>
  3. The value for the form action depends on your Workplace Web Content Management environment. The web content comes from the content library that is being used, and the rest depends on where you create the content that references the search form and results.
  4. Save the HTML component.

Next, you have to create the Workplace Web Content Management search element to search in.

  1. In the Workplace Web Content Management authoring portlet, click New, and select Search Component. Name the search component CKSearchElement.
  2. On the search element, select the Default Portal Search Service for the Search Service, and select the WCMTestCollection for the Search Collection.
  3. Leave the default values for the number of page settings.
  4. Enter the following values:
    • For Header, enter:
      <table>
    • For Result:
       <tr><td>
           <attributeResource attributeName="namelink"/><br>
           <attributeResource attributeName="summary"/>
       </td></tr>
    • For Separator:
       <tr> <td bgcolor="#FFFAA" colspan="2"/>  </tr>
    • For Footer:
       </table>
    • For No Results:
      There are no results for your query. Please refine your search and try again.
  5. Save and Close the search element.

Now that you have the search form and the search element, create a piece of content to view it.

  1. On the Workplace Web Content Management authoring portlet, click New and select Content.
  2. For the authoring template, select CKSearchAuthTemplate, then click OK.
  3. Name the content CKSearchContent.
  4. For Comp1, select the CKSearchForm HTML component that you created.
  5. For Comp2, select the CKSearchElement component that you created.
  6. Give the content a workflow, save the content, and publish it. Save the content under the CKHomeSite/CKHomeSiteArea/CKSearchSiteArea.

To test the search form and results, preview the CKSearchContent object. You should see a text field with a submit button and a message that says no results were found. This result is to be expected because you haven't searched for anything yet. Try searching for HomeContent, and see what the results are and how they are rendered.

There are a couple of things to note here. One, the search form sample that you used is simple, but you can use a more advanced search form. You can check the WebSphere Portal Information Center for the additional search options that you can use. Also, the way that you are rendering the results is simple. There are other options available; again, check the WebSphere Portal Information Center for additional options.


You learned how to configure the WebSphere Portal search to retrieve results for Workplace Web Content Management content. Also, you saw how you can retrieve those results through two of the WebSphere Portal portlets, the Search Center portlet and the Search and Browse portlet. Additionally, you learned how to present the Web Content Management content returned by the Search and Browse portlet within the Workplace Web Content Management Local Rendering portlet. Finally, you learned how to leverage the WebSphere Portal search directly from Workplace Web Content Management content.

Now that you have this new skill set, just think of the value that you can add to your WebSphere Portal. As Workplace Web Content Management likely is your main source of actual content, adding the ability to search that content is key to a successful portal implementation. Almost as important is the ability to change the way that users search the content and the way that the results are presented to them. Using the information gained in this article, you can close the gap of presenting content to your users and allowing them to chose what content they want to see.

As a concrete example of an advantage of using this information, look at the basic Search Center portlet. Although it is useful, it is not very configurable, and you have no control over the results that are returned. By changing the basic search form that you created in this demonstration, you can limit the search results of the Workplace Web Content Management content to be returned only for a certain author by adding an input tag with a name of search_authors. Or, you can limit the search results by the Workplace Web Content Management categories that you have assigned to the content by adding an input tag with a name of search_categories. See the Informatioon Center for the full list of tags that you can use.

In addition to limiting the search results, by changing the default configuration of the search component that you created, you can fully control how you want your search results to be displayed to the user. If you want to display the author of the content in the results, just add a tag for attributeName=author in the result section of the search component.

Resources

Learn

Discuss

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into IBM collaboration and social software on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Lotus, WebSphere
ArticleID=311198
ArticleTitle=Integrating IBM WebSphere Portal Search with IBM Workplace Web Content Management for version 6
publish-date=06032008