Friday, February 22, 2013

Rendering IBM Web content Manager search results using WCM search component

Rendering IBM Websphere portal search results using WCM search component

1) Create a search collection so that websphere portal search will be able to return results from WCM.
     
     Steps :- 
       1)  Login to Websphere Portal Administration -> Search Administration  -> Manage Search
       2)  Click  Search collections -> New  Collection.
       3)   Create a new collection with the following values 
                 Search Service: Default Portal Search Service
         Location:c:/IBM/WebSphere/AppServer/profiles/wp_profile/TestCollection 
                Name: TestCollection
                Description: TestCollection
                Language: English
                Categorizer: none
                Summarizer: automatic
      and click OK.


 2  Define content source for the Search collection to search
        
       1) click on the TestCollection and click New Content Source. and enter the following details
             content Source Name :- TestCollectionContentSource
              Collect documents linked from url :-https://<servername>:10029/seedlist/myserver?SeedlistId=web+content/Articles&Source=com.ibm.workplace.wcm.plugins.seedlist.retriever.WCMRetrieverFactory&Action=GetDocuments
  you can keep the rest of the fields with default values and click Create. 

Once you create the content source you should see it under the collection. now click on start crawlerfor the search collection to start collecting documents. 


3)  create an HTML form to perform the search and a  Web Content Management search component to display the results
    Create a presentation template with the code below

<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>


and name it as SearchPresTemplate

Create an authoring template and name it SearchAuthTemplate with the below fields.
 

New Create content with the authering template we created. 
name the form as Searchform

in HTML field copy and paste the below code. 


<form id="wcmsearchform" action='[PathCmpnt type="servlet"]/<libraryname>/<siteArea>/SearchForm' 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>
 
               ** Replace the  Libraryname and site area with your library and site area names. 


now click New->component-> Search  and enter the following details as shown below picture
Name:- searchComponent
displaytitle:- search Component
searchSercice:- default portal search service
Search Collection :- TestCollection  

and save the component
  

 
  

 Now click the comp1 and select the component you just created  and save it
Preview the content and search.