The Plumtree Enterprise Web Development Kit (EDK) allows you to create remote search services and related configuration pages without parsing SOAP or accessing the portal API. The EDK Search API provides an abstraction from the necessary SOAP calls; you simply implement an object interface. For a complete listing of interfaces, classes, and methods, see the EDK API documentation.
The EDK's Plumtree.Remote.Search package/namespace includes the following interfaces:
In general, the portal calls these interfaces in the following order. See the definitions that follow for more information.
IRemoteSearch.BasicSearch, using ISearchQuery, ISearchUser and ISearchContext as parameters.
The ISearchResult object returned allows the search service to iterate through the search results and return them to the user. The service calls ISearchResult.GetSearchResultList to retrieve an ISearchRecord for each record returned. ISearchRecord allows you to retrieve the title, description, file URL and image URL and set the title, description, file URL and image URL to be returned to the portal.
The IRemoteSearch interface allows the portal to initiate a query over a back-end directory structure. BasicSearch allows you to pass in an ISearchQuery that defines the query to be performed. You can also pass in a ISearchUser and ISearchContext for access to the PRC.
The ISearchQuery interface defines the search query to be performed by the portal. Using ISearchQuery, you can define the scope of the query and provide user preferences and user information to be used for authentication or user-level access control. SearchException allows you to provide useful error messages (i.e., the specific preference type was not found). For details, see the EDK API documentation. This interface provides the following methods:
GetMaxReturn determines the maximum number of records to return per page.
GetNumberToSkip returns the number of records that will be skipped: where the search will start. For example, the search could start at record 30.
GetSearchInfo returns any related administrative preferences set for the associated Federated Search object in the portal.
GetSearchResult returns an ISearchResult object that allows the search service to access the results returned by IRemoteSearch.
GetSearchString returns the query string passed to the portal.
GetUserInfo returns any User Information settings sent to the search service. To access User Information, you must configure the specific settings you need in the Search Web Service editor on the User Information page.
GetUserPrefs returns any user settings sent to the search service. To access user settings, you must configure the specific settings you need in the Search Web Service editor on the Preferences page.
The ISearchUser interface can be used to access the current user’s portal object ID and locale, and to obtain the login token for the current session with the portal to access the Plumtree Remote Client (PRC).
The ISearchContext interface can be used to access the portal UUID and SOAP service endpoint URI to implement the PRC.
The ISearchResult interface allows you to retrieve the results returned from a search query and return the results to the portal. The search service code must handle pagination; the methods in the ISearchResult facilitate iteration over large numbers of search records.
Get/SetNumberSkipped returns the number of records that were skipped: where the search started. For example, the search could start at record 30.
Get/SetSearchResultList returns a SearchRecord array of search results.
Get/SetTotalNumberofHits returns the total number of search records.
Is/SetDescriptionEncoded determines whether or not the description for the search results is HTMLencoded.
The ISearchRecord interface allows you to manipulate the metadata for each search record. Only the title is required.
Get/SetTitle returns the title for the search record (required).
Get/SetDescription returns the description for the search record. If the description should be HTMLencoded, use ISearchResult.SetDescriptionEncoded.
Get/SetOpenDocumentURL returns the URL that will retrieve the document. This URL must be accessible over the Web or through the gateway. If the document is gatewayed, make sure to configure the Search Web Service object with the appropriate gateway URLs.
Get/SetImageURL returns the URL to the image that will be displayed with the search record.
You should consider the following best practices for every search service:
Know what to expect in response to a query. You must be ready to handle pagination and authentication if necessary.
Check the SOAP timeout for the back-end server and calibrate your response accordingly.
Use relative URLs in your code to allow migration to another remote server.