Package com.ibm.lotus.search.providers.content.seedlist.retriever

Package contains interfaces for retrieving content from specific content provider.

See:
          Description

Interface Summary
Request Allows to conrol aspects of the documents and seedlists retrieving actions.
RetrieverFactory Used to obtain the seedlist retriever service and seedlist request objects.
RetrieverSeedlist Represents a Seedlist whose enrties (documents or sub-seedlists) relate to another Retriever type.
RetrieverService Represents a host, which provides content retrieving services.
 

Package com.ibm.lotus.search.providers.content.seedlist.retriever Description

Package contains interfaces for retrieving content from specific content provider. The content provider can be any application, located locally or remotely. The content of the application from the API perspective is structured in a tree and any level of nodes which points to additional content is called a Seedlist (See - Seedlist). The letfs are called "Documents (See - Document).

The API provides functionality to obtain from specified seedlist :


The following sections would explain how to prepare for content retrieveing. The description is from the perspective of the using application, however it is meant mainly for explaining how the interface is expected to be implemented.

A seedlist-based publishing application begins by obtaining an implementation factory object. The Seedlist API is a factory-based Java API. All the objects that are used in the publishing application are either created by calling Seedlist API factory objects methods or returned by calling methods of factory generated objects. switching between Seedlist API implementations is easy by loading different factories. Only one Seedlist API factory object, which can be used throughout the application, needs to be obtained.

Preparing to retrieve content
To start retrieving content from content provider using the Seedlist API, an instance of a RetrieverService interface that represents that content provider, must first be obtained.

Obtain a RetrieverService

Instantiate the relevant RetrieverFactory implementation and use it to obtain a RetrieverService object. Use the method RetrieverFactory.getRetrieverService(Properties, HttpServletRequest, HttpServletResponse). The RetrieverService object allows to obtain all the published content from a specific content provider server. Required configuration parameters are set in a java.util.Properties object, which is passed to the getRetrieverService factory method that generates the RetrieverService object. Only one RetrieverService for each content provider server needs to be obtained.

Code snippet demonstrates how to obtain a RetrieverService object

HttpServletRequest servletRequest = ...; // received on the Portlet request
HttpServletResponse servletResponse = ...; // received on the Portlet request
Properties props = ...; // taken for example from the plugin.xml which defines the retriever implementation
RetrieverService retrieverService = retrieverFactory.getRetrieverService(props, servletRequest, servletResponse);
Obtain documents and sub-seedlists

Create a request object using the factory object and set its different parameters according to the required result. Issue the request using the RetrieverService object and get as a result an EntrySet object.
Sample code shows assembling of retriever request and obatining a list of all the children and documents of a specific seedlist

Seedlist seedlist = ...; // the seedlist which its content is required
com.ibm.lotus.search.providers.content.seedlist.retriever.Request retrieverRequest = 
                                                retrieverFactory.createRequest(seedlist.getId());
// range (i.e, start index and number of requested entries) of retrieved entries
retrieverRequest.setEntryRange(startIndex, numEntries);
// last update date for retrieved documents
retrieverRequest.setDate(lastUpdate);
// locale to represent localized data
retrieverRequest.setLocale(locale);
// session inner state
retrieverRequest.setState(state);
// inter-session state
retrieverRequest.setTimestamp(timestamp);
// prepare user security information
ApplicationInfo appInfo = retrieverFactory.createApplicationInfo(userId);

EntrySet entries = null;
if(seedlist.canRetrieveDocuments()) {
   entries = retrieverService.getDocuments(appInfo, retrieverRequest);
} else {
   entries = retrieverService.getChildren(appInfo, retrieverRequest);
}