com.plumtree.server
Interface IPTFederatedSearchAgent

All Superinterfaces:
IPTUnknown

public interface IPTFederatedSearchAgent
extends IPTUnknown

This is the interface for the federated search agent. It allows another portal to request a federated search of this portal.

More specifically, in the COM implementation, the server side of a federated search request is handled by PTFederatedSearchServer (in the Extensibility package). PTFederatedSearchServer creates an PTSearchProxy, which instantiates an IPTFederatedSearchAgent, which, in turn, creates local portal search objects (e.g. IPTSearchRequest) to actually run the search.

Version:
$Revision$
Author:
CraigS, based on earlier comments in Plumtree.idl

Method Summary
 boolean DoBasicSearch(java.lang.String strRequestingPortal, java.lang.String strRequestingPortalPassword, java.lang.String strRequestingUser, java.lang.String strSearchString, int lNumToSkip, int lMaxToReturn, java.lang.Object errorMessage)
          Run a search against this portal.
 java.lang.String GetCardImageURL(int lRowIndex, java.lang.String bstrImageServerURL)
          Returns a URL for an icon associated with a particular result's type.
 java.lang.String GetDocumentURL(int lRowIndex)
          Returns an URL that may be used to open the document corresponding to a search result.
 double GetFieldsAsDouble(int lRowIndex, int lPropID)
          Returns the value of a single field (property) of type double in a single search result.
 int GetFieldsAsInt(int lRowIndex, int lPropID)
          Returns the value of a single field (property) of type int in a single search result.
 java.lang.Object GetFieldsAsObject(int lRowIndex, int lPropID)
          Returns the value of a single field (property) in a single search result.
 java.lang.String GetFieldsAsString(int lRowIndex, int lPropID)
          Returns the value of a single field (property) of type String in a single search result.
 com.plumtree.openfoundation.util.XPDateTime GetFieldsAsXPDateTime(int lRowIndex, int lPropID)
          Returns the value of a single field (property) of date type in a single search result.
 int GetMatchesReturned()
          Get the number of results returned.
 int GetTotalMatches()
          Get the total number of matches for the query.
 void Initialize(IPTSession pSession)
          Initializes object.
 
Methods inherited from interface com.plumtree.server.IPTUnknown
GetInterfaces
 

Method Detail

DoBasicSearch

boolean DoBasicSearch(java.lang.String strRequestingPortal,
                      java.lang.String strRequestingPortalPassword,
                      java.lang.String strRequestingUser,
                      java.lang.String strSearchString,
                      int lNumToSkip,
                      int lMaxToReturn,
                      java.lang.Object errorMessage)
Run a search against this portal. Call Initialize() before calling this method. After this method has been called, call the various Get methods to obtain information about the results.

Parameters:
strRequestingPortal - Name of the portal requesting this search; must match PT_PROPID_FEDERATEDPORTAL_FEDERATEDPORTALIDENTITY for some locally registered federated portal.
strRequestingPortalPassword - Password for the requesting portal.
strRequestingUser - User whose credentials to use when running the search.
strSearchString - User's search string.
lNumToSkip - Number of results to skip before returning results. For results 21-30, this is 20.
lMaxToReturn - Maximum number of results to return. For results 21-30, this is 10.
errorMessage - Location where this object writes any error message resulting from the search, if return value is false. For the Java implementation, this should be an XPStringBuilder.
Returns:
true if search was successful, false otherwise.

GetTotalMatches

int GetTotalMatches()
Get the total number of matches for the query. Not all of these are necessarily returned; call GetResultsReturned() for that. If the UI says "Results 1-10 of 123", this method returns 123.

Returns:
total number of matches

GetMatchesReturned

int GetMatchesReturned()
Get the number of results returned. This is NOT the same as the total number of matches for the query (see GetTotalMatches() for that); this is the number of items for which complete information was returned. (If the UI says "Results 1-10 of 123", this method returns 10.)

Returns:
number of returned results

GetFieldsAsInt

int GetFieldsAsInt(int lRowIndex,
                   int lPropID)
Returns the value of a single field (property) of type int in a single search result.

Parameters:
lRowIndex - Result rank, in the range 0 to (GetMatchesReturned()-1).
lPropID - ID of the property desired, or one of the special-case pseudoproperties given by PT_INTRINSICS in the ranges [1,8] and [51,58]. Must be a numeric property.
Returns:
the property value.

GetFieldsAsString

java.lang.String GetFieldsAsString(int lRowIndex,
                                   int lPropID)
Returns the value of a single field (property) of type String in a single search result.

Parameters:
lRowIndex - Result rank, in the range 0 to (GetMatchesReturned()-1).
lPropID - ID of the property desired, or one of the special-case pseudoproperties given by PT_INTRINSICS in the ranges [1,8] and [51,58]. Must be a text (string-valued) property.
Returns:
the property value.

GetFieldsAsDouble

double GetFieldsAsDouble(int lRowIndex,
                         int lPropID)
Returns the value of a single field (property) of type double in a single search result.

Parameters:
lRowIndex - Result rank, in the range 0 to (GetMatchesReturned()-1).
lPropID - ID of the property desired, or one of the special-case pseudoproperties given by PT_INTRINSICS in the ranges [1,8] and [51,58]. Must be a numeric property.
Returns:
the property value.

GetFieldsAsXPDateTime

com.plumtree.openfoundation.util.XPDateTime GetFieldsAsXPDateTime(int lRowIndex,
                                                                  int lPropID)
Returns the value of a single field (property) of date type in a single search result.

Note that there is special-case behavior for the OBJECTCREATED and OBJECTLASTMODIFIED properties - although the portal considers these to be date properties, search actually returns them as Double instead, so call GetFieldsAsDouble. The method SearchResultModel.ConvertSearchDateTimeToXPDateTime converts this double to an XPDateTime (or see the Search Developer's Guide for code).

Parameters:
lRowIndex - Result rank, in the range 0 to (GetMatchesReturned()-1).
lPropID - ID of the property desired, or one of the special-case pseudoproperties given by PT_INTRINSICS in the ranges [1,8] and [51,58]. Must be a date property.
Returns:
the property value.

GetFieldsAsObject

java.lang.Object GetFieldsAsObject(int lRowIndex,
                                   int lPropID)
Returns the value of a single field (property) in a single search result. Actual underlying result type depends on the property type.

Parameters:
lRowIndex - Result rank, in the range 0 to (GetMatchesReturned()-1).
lPropID - ID of the property desired, or one of the special-case pseudoproperties given by PT_INTRINSICS in the ranges [1,8] and [51,58].
Returns:
the property value.

GetCardImageURL

java.lang.String GetCardImageURL(int lRowIndex,
                                 java.lang.String bstrImageServerURL)
Returns a URL for an icon associated with a particular result's type.

Parameters:
lRowIndex - Result rank, in the range 0 to (GetMatchesReturned()-1).
bstrImageServerURL - Base URL to the image server.
Returns:
complete icon URL, or null or empty string if unknown

GetDocumentURL

java.lang.String GetDocumentURL(int lRowIndex)
Returns an URL that may be used to open the document corresponding to a search result.

Parameters:
lRowIndex - Result rank, in the range 0 to (GetMatchesReturned()-1).
Returns:
the document URL

Initialize

void Initialize(IPTSession pSession)
Initializes object. Call this method first, before DoBasicSearch.

Parameters:
pSession - Current Plumtree session.


Copyright © 2008 Plumtree Software Inc. All Rights Reserved.