Skip to main content link. Accesskey S
  • Log In
  • Help
  • IBM Logo
  • WebSphere Portal Family wiki
  • All Wikis
  • All Forums
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • IBM Redbooks
Community Articles Product Documentation Learning Center IBM Redbooks This category IBM Redbooks: Building a Sample Website Using IBM Web Content Manager 7.0 IBM Redbooks: Building and Implementing a Social Portal IBM Redbooks: Developing Exceptional Multi-Channel Web Experiences V7: IBM Web Content Manager Product Documentation V7: IBM WebSphere Portal Enable for z/OS Product Documentation V7: IBM WebSphere Portal Express Product Documentation V7: WebSphere Portal Product Documentation V8: IBM Web Content Manager Product Documentation V8: IBM WebSphere Portal Express Product Documentation V8: IBM WebSphere Portal Product Documentation (includes z/OS) Custom Search Scope...
Search
Community Articles > IBM Web Content Manager > Search for Web Content Manager > WCM - How to allow Portal Search Crawler to access WCM Library File Resource Components
  • New Article
  • Share Show Menu▼
  • Subscribe Show Menu▼

About the Original Author

Christopher Knight
Contribution Summary:
  • Articles authored: 24
  • Articles edited: 19
  • Comments Posted: 4

Recent articles by this author

Retrieving WCM Content using PZN Rules Based on Current User's Categories

How to retrieve WCM content based on the current user categories, using PZN rules.

Leveraging WCM rendering portlet configuration values within PZN Rules

Learn how to integrate Personalization (PZN) Rules with IBM Web Content Manager (WCM).

Improving IBM Web Content Manager Personalization rule performance using Include Only

Using realworld examples, this article demonstrates how to use the Include Only option in Personalization rules and explains the performance difference between using and not using the functionality.

Creating a custom rendering plugin to display the average rating for an IBM Web Content Manager item

To leverage the information about rating IBM Web Content Manager (WCM) items, this article uses a custom rendering plugin to display the average rating for a WCM content item. This can be used, for example, within a menu design so you can see what the rating is for a piece of content.

Leveraging JSON JavaScript to extend IBM Lotus Web Content Management component design

This article describes a fully functional example of how to use JavaScript Object Notation (JSON) JavaScript objects within IBM® Lotus® Web Content Management component designs.

Community articleWCM - How to allow Portal Search Crawler to access WCM Library File Resource Components

Added by Christopher Knight | Edited by IBM contributor Craig Lordan on October 23, 2009 | Version 8
  • Edit
  • More Actions Show Menu▼
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars
expanded Abstract
collapsed Abstract
No abstract provided.
Tags: 6.0, 6.0.1, 6.0.x, 6.1, 6.1.0.1, API, Portal, search
Allowing WebSphere Portal Search to crawl WCM content is a powerful way to provide search functionality to your WCM site.

The following information can be used to leverage that relationship:

http://www.ibm.com/developerworks/lotus/library/wcm-search/
http://www-10.lotus.com/ldd/portalwiki.nsf/dx/advanced-wcmwebsphere-portal-search-integration

However, although the portal search crawler can index file's that are attached directly to WCM content in these scenarios, it cannot index the WCM File Resource Components that are only stored in the library.

There are 2 possible approaches to index the files:
1) Use WCM API to generate URL's to all the library file resource components, then point a crawl URL to the .jsp. A sample .jsp is provided.
2) Use WCM API to create one piece of content per library file resource component. A sample .jsp is provided.

For the first approach, the basic idea is:

* JSP uses API to generate URLs to all library file resource components. It does this by using WCM API to generate rendering context to a default piece of content, then creating an anchor tag

* Then, provide a Portal Search Crawl URL to the .jsp

To leverage this approach:

1) Modify the provided searchCrawl.jsp for the following values:

  • Change ws.getDocumentLibrary("CKTestWFLibrary") to the name of the library the files reside in
  • RenderingContext rc = ws.createRenderingContext(request, response, new HashMap(),"http://cmknightsun.raleigh.ibm.com:10038/wps/wcm","/myconnect");
Change cmknightsun.raleigh.ibm.com:10038 to valid host:port in your system
  • siteAreaIdIterator = ws.findByName(DocumentTypes.SiteArea, "CKTestSiteArea");
Change "CKTestSiteArea" to a valid site area in your site. Ensure that the site area has default content, and can be rendered.

2) After the .jsp is modified, place the .jsp in the following directory:
/PROFILENAME/installedApps/nodename/wcm.ear/ilwwcm.war/jsp/html/

3) After the jsp is placed, validate that you get a list of links by hitting the URL: http://host:port/wps/wcm/jsp/html/searchCrawl.jsp

Now, all you have to do is make a WebSphere Portal search collection reference this .jsp
4) Navigate to WP Admin page -> Search Administration -> Manage Search -> Search Collections. Click on one of the search collections, or create one.
5) In the search collection form, click on New Content Source. Name the content source whatever you like. For the URL, enter in the URL from step 3 above, the http://host:port/wps/wcm/jsp/html/searchCrawl.jsp. Modify the other parameters as necessary. Specifically, set it to only follow 1 level of links.
6) Click create.

Once the content source is created, validate it and force a crawl.

For the second approach, the idea is

* JSP uses API to create a piece of WCM content in a specific site area. The content has a ComponentReference that is populated with a reference to the file resource component.

* When creating the content, the JSP will first check to see whether a piece of content already exists with the same name at the same path. When the content is created, it is given the same name as the file resource component.

* The end result is a content object wrapper for every file resource component in your library. Then, since the search crawler will process these content objects, the files will be search indexed.

To leverage this approach:

1) Create an authoring template named "AT - BasicFileAt". Populate with just one element, a ComponentReference element named CompRef.

2) Create a presentation template named "PT - BasicFilePT". Add the following tag:


Set the security on the presentation based on which users you want to be able to search the files.

3) Create a site area somewhere under the site that you've marked as searchable. Name it "SearchFileSiteArea". Map the authoring template "AT - BasicFileAt" to the "PT - BasicFilePT" presentation template. Set the security on the site area based on which users you want to be able to search the files.

4) Now you are ready to run the .jsp. Upload the attached attachFiles.jsp to /profilehome/installedApps/nodename/wcm.ear/ilwwcm.war/jsp/html. You will have to modify the JSP to change the following values:

ws.setCurrentDocumentLibrary(ws.getDocumentLibrary("CKTestLib"));

Change CKTestLib to the name of your library

tempIterator = ws.findByName(DocumentTypes.Workflow, "Publish Workflow");

Change Publish Workflow to the name of the workflow you want your content to use. Note, for this sample it's assumed that you will have a 1 stage workflow for this content that will publish the content as soon as its saved. If that's not desireable, the file will have to be changed to implement publishing.

5) When the .jsp is run, it will first check to ensure a content object doesnt already exist at the path. The JSP will create a new content object using AT - BasicFileAt, store it under the
SearchFileSiteArea, assign it the workflow. Then, it populates the ComponentReference with a reference to the current file resource component.

6) The end result is you will have the SearchFileSiteArea in your site structure. When the WP Search crawler crawls the top site, you will now have your file resource elements indexed.



  • Edit
  • More Actions Show Menu▼


expanded Attachments (2)
collapsed Attachments (2)
Edit the article to add or modify attachments.
File TypeSizeFile NameCreated On
application/octet-stream 1 KB searchCrawl.jsp 9/23/09 10:33 AM
application/octet-stream 4 KB attachFiles.jsp 9/23/09 10:33 AM
expanded Versions (1)
collapsed Versions (1)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (8)Oct 23, 2009 4:17:54 PMCraig Lordan  IBM contributor
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedHelpAbout
  • IBM Collaboration Solutions wikis
  • IBM developerWorks
  • IBM Software support
  • Twitter LinkIBMSocialBizUX on Twitter
  • FacebookIBMSocialBizUX on Facebook
  • ForumsLotus product forums
  • BlogsIBM Social Business UX blog
  • Community LinkIBM Collaboration Solutions
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Accessibility
  • IBM Terms of use
  • Wiki terms of use