|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.plumtree.uiinfrastructure.activityspace.AClearModel com.plumtree.portalpages.browsing.search.network.NetworkSearchModel
public class NetworkSearchModel
"network source" and "outgoing federated portal" are used interchangeably in these comments. Upon initialization, the model queries for available outgoing federated portals. They can be accessed through GetNumSources(), GetSourceID(), and GetSourceName().
Nested Class Summary | |
---|---|
static class |
NetworkSearchModel.FedPortal
Inner helper class to hold info about outgoing federated portals |
static class |
NetworkSearchModel.SearchResultSet
Inner helper class to hold info about search results |
static class |
NetworkSearchModel.TempDataClass
|
Field Summary | |
---|---|
static java.lang.String |
CACHEDPREFS_KEY
key for cache used to store prefs so we don't hit the db unnecessarily |
static java.lang.String |
INCOMING_SWS_CLSID
Intrinsic search provider CLSID used to identify inbound federated portals, stored in the search provider registry table PTFEDSEARCHREG. |
protected static java.lang.String |
LOCATIONPREF_DELIMITER
|
AActivitySpace |
m_asOwner
Owning activity space |
protected boolean |
m_isPathwaysEnabled
|
protected boolean |
m_isPathwaysSearch
|
protected int |
m_numPathwaysResults
|
protected int |
m_pageSize
|
protected java.lang.String |
m_pathwaysFormat
|
protected XPArrayList |
m_pathwaysObjectTypes
|
protected java.lang.String |
m_pathwaysOrder
|
protected java.lang.String |
m_pathwaysOrderBy
|
PathwaysQueryArguments |
m_pathwaysQueryArgument
|
protected int |
m_pathwaysStartAt
|
protected int |
m_pathwaysTotalCount
|
protected java.lang.String |
m_pathwaysViewId
|
protected IPTSearchRequest |
m_searchRequest
|
boolean |
m_tmpAlwaysDoLocalSearch
TMP set this flag to true to make all searches run against the local portal. |
static int |
MAX_SEARCHSTRING_LENGTH
|
static java.lang.String |
NETSEARCHPREF_LOCATIONIDS
key used for storing user pref for locations to be checked automatically on the launch page |
static java.lang.String |
NUM_RESULTS_PREFS_KEY
|
static java.lang.String |
OUTGOING_SWS_CLSID
Outbound search SWS provider CLSID, stored in the search provider registry table PTFEDSEARCHREG. |
static java.lang.String |
SPACE_COLON_SPACE
|
static java.lang.String |
STR_MVC_CLASS_NAME
|
static int |
THISPORTAL_ID
Integer id to distinguish local portal searching from searching a particular network source. |
Constructor Summary | |
---|---|
NetworkSearchModel()
|
Method Summary | |
---|---|
boolean |
AreAllResultSetsValid()
|
protected boolean |
CheckIfDisabled(int objectIDintgr)
returns true if the outbound fed portals associated web service is disabled |
void |
CleanupAllData()
This method is called when an ActivitySpace is removed from the cache. |
void |
CleanupTempData()
This method is called at the end of every HTTP request by the Interpreter. |
void |
ClearSearchedSourceList()
reset searched source list to be empty |
java.lang.Object |
Create()
This method is used by the ASManager to return new instances of managed objects. |
protected NetworkSearchModel.SearchResultSet |
doLocalPathwaysSearch(java.lang.String searchString,
int startIndex,
int endIndex)
This function sets up a pathways integrated federated search request |
protected NetworkSearchModel.SearchResultSet |
doLocalSearch(java.lang.String searchString,
int startIndex,
int endIndex)
Perform a search against the local portal. |
protected NetworkSearchModel.SearchResultSet |
doSearch(int sourceID,
java.lang.String searchString,
int startIndex,
int endIndex)
Perform an actual search for the indicated source. |
protected int |
GetAndSaveOutgoingFederatedPortals(IPTObjectManager ptOM)
Get and save the id, name, providerclsid, and thisportalidentity of all available federated portals (inbound and outbound). |
java.lang.String |
GetDescriptionForResultFromSource(int sourceId,
int resultId)
Returns null if we hold no result info for the given source or if an error occurred while searching the given source. |
java.lang.String |
GetErrorFromSource(int sourceID)
Return any error message for a given source, used when the results for the source were invalid. |
HTMLElement |
GetErrorLinkFromSource(int sourceID)
certain errors lead to the generation of a link to a config page where the problem can be fixed, in which case this returns the link. |
int |
GetFirstDisplayedResultFromSource(int sourceId)
|
int |
GetFirstDisplayedResultOverall()
Overall rank of first result on page to be displayed. |
java.lang.String |
GetFormattedError(int sourceId)
|
HTMLImg |
GetImageForResultFromSource(int fedPortalID,
int rank)
Returns null if we hold no result info for the given source or if an error occurred while searching the given source. |
XPHashtable |
GetLocationPreferencesForUser()
check to see if the user has any stored preferences regarding which sources to check. |
java.lang.String |
GetName()
Return the name of the MVC object. |
java.lang.Object |
GetNewTempData()
This method returns a new temporary data object. |
int |
GetNumberResults()
|
int |
GetNumDisplayedResultsFromSource(int sourceId)
Number of results actually returned in the search response from this source, i.e., the number of results shown on the page at the moment. |
int |
GetNumDisplayedResultsOverall()
Overall number of results on displayed page. |
int |
GetNumResultsFromSource(int sourceID)
Returns -1 if we hold no result info for the given source or if an error occurred while searching the given source. |
int |
GetNumResultsOverall()
Overall number of results. |
int |
GetNumSources()
Return the number of available outbound federated portals NOTE: total does *not* include the local portal (i.e, the first check box on the launch page) |
int |
GetPageNum()
Get the page number for the current results page being displayed |
IXPList |
GetSearchedSources()
Return the object ids for the network sources which will be/were searched by this model. |
java.lang.String |
GetSearchString()
Return the search string from the latest call to Prepare(). |
boolean |
GetSearchStringTruncated()
A flag indicating whether we had to truncate the user's search string to NetworkSearchModel.MAX_SEARCHSTRING_LENGTH characters |
int |
GetSourceID(int id)
Return the objectid of the ith available outbound federated portal. |
java.lang.String |
GetSourceName(int id)
Return the name of the ith available outbound federated portal. |
java.lang.String |
GetTitleForResultFromSource(int sourceId,
int resultId)
Returns null if we hold no result info for the given source or if an error occurred while searching the given source. |
java.lang.String |
GetUnencodedSearchString()
Return the raw, unencoded search string from the latest call to Prepare() |
HTMLAnchor |
GetURLForResultFromSource(int fedPortalID,
int rank,
boolean popup)
Returns null if we hold no result info for the given source or if an error occurred while searching the given source. |
java.lang.String |
GetViewMode()
Get the mode in which we are displaying results (collated or parallel) |
void |
Init(AActivitySpace parent)
This method initializes the model. |
boolean |
IsDisabled(int objectId)
returns true if the fed portal's associated web service is currently disabled |
protected boolean |
isOutgoingFedPortal(java.lang.String clsid)
Return true if the given portal is an outgoing portal. |
boolean |
isResultSetValid(int sourceID)
Return true if the model holds a valid result set for a given source. |
void |
LoadNumberResults()
|
protected void |
LocalPathwaysSearchInit()
Initialization code for constructing a pathways search request, much like in SearchResultsModel.PathwaysReinit() |
protected HTMLElement |
makeErrorLink(int sourceID,
boolean userConfig,
IPTFederatedSearch ptFedSearch)
For certain errors, we want to provide a link leading the user to a page where config info must be set up. |
void |
Prepare(java.lang.String searchString,
IXPList sourceIDs,
int pageNum)
Call this before using the model to retrieve search results for any results Section page. |
void |
SaveLocationPreferences(java.lang.String[] locationIDStrings)
if the user has checked "always check these locations for me" on the launch page, then here we save the checked locations as user preferences |
void |
SaveNumberResults()
|
void |
SetAlwaysDoLocalSearch(boolean flag)
TMP A debugging method which will go away when the code is complete |
protected void |
SetLocalSearchSettings(java.lang.String searchString,
int startIndex,
int endIndex)
This function handles the settings of the local portal search |
void |
SetNumberResults(int num)
|
void |
SetPageNum(int pageNum)
Set the page number for the current results page being displayed |
void |
SetSearchStringTruncated(boolean flag)
Set a flag indicating whether we had to truncate the user's search string to NetworkSearchModel.MAX_SEARCHSTRING_LENGTH characters |
void |
SetViewMode(java.lang.String viewMode)
Set the mode in which we are displaying results (collated or parallel) |
Methods inherited from class com.plumtree.uiinfrastructure.activityspace.AClearModel |
---|
GetTempData |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String STR_MVC_CLASS_NAME
public static final java.lang.String NETSEARCHPREF_LOCATIONIDS
public static final java.lang.String CACHEDPREFS_KEY
protected static final java.lang.String LOCATIONPREF_DELIMITER
public static final int MAX_SEARCHSTRING_LENGTH
public static final java.lang.String SPACE_COLON_SPACE
public static final java.lang.String OUTGOING_SWS_CLSID
public static final java.lang.String INCOMING_SWS_CLSID
public static final int THISPORTAL_ID
public boolean m_tmpAlwaysDoLocalSearch
public AActivitySpace m_asOwner
protected boolean m_isPathwaysSearch
protected boolean m_isPathwaysEnabled
protected java.lang.String m_pathwaysFormat
protected int m_pathwaysStartAt
protected java.lang.String m_pathwaysViewId
protected int m_numPathwaysResults
protected java.lang.String m_pathwaysOrder
protected java.lang.String m_pathwaysOrderBy
protected int m_pathwaysTotalCount
protected XPArrayList m_pathwaysObjectTypes
public PathwaysQueryArguments m_pathwaysQueryArgument
protected IPTSearchRequest m_searchRequest
protected int m_pageSize
public static final java.lang.String NUM_RESULTS_PREFS_KEY
Constructor Detail |
---|
public NetworkSearchModel()
Method Detail |
---|
public void SetNumberResults(int num)
SetNumberResults
in interface INetworkSearchModel
SetNumberResults
in interface INetworkSearchModelRO
public int GetNumberResults()
GetNumberResults
in interface INetworkSearchModel
GetNumberResults
in interface INetworkSearchModelRO
public void SetAlwaysDoLocalSearch(boolean flag)
SetAlwaysDoLocalSearch
in interface INetworkSearchModel
public boolean isResultSetValid(int sourceID)
isResultSetValid
in interface INetworkSearchModelRO
public boolean AreAllResultSetsValid()
AreAllResultSetsValid
in interface INetworkSearchModelRO
public void CleanupTempData()
IModel
CleanupTempData
in interface IModel
CleanupTempData
in class AClearModel
IModel.CleanupTempData()
public void CleanupAllData()
IModel
CleanupAllData
in interface IModel
CleanupAllData
in class AClearModel
IModel.CleanupAllData()
public void ClearSearchedSourceList()
INetworkSearchModel
ClearSearchedSourceList
in interface INetworkSearchModel
public java.lang.Object Create()
AClearModel
Create
in interface IManagedObject
Create
in class AClearModel
IManagedObject.Create()
public java.lang.String GetDescriptionForResultFromSource(int sourceId, int resultId)
GetDescriptionForResultFromSource
in interface INetworkSearchModelRO
public java.lang.String GetErrorFromSource(int sourceID)
GetErrorFromSource
in interface INetworkSearchModelRO
public HTMLElement GetErrorLinkFromSource(int sourceID)
INetworkSearchModelRO
GetErrorLinkFromSource
in interface INetworkSearchModelRO
public java.lang.String GetFormattedError(int sourceId)
GetFormattedError
in interface INetworkSearchModelRO
public int GetFirstDisplayedResultFromSource(int sourceId)
GetFirstDisplayedResultFromSource
in interface INetworkSearchModelRO
sourceId
-
public int GetFirstDisplayedResultOverall()
GetFirstDisplayedResultOverall
in interface INetworkSearchModelRO
public HTMLImg GetImageForResultFromSource(int fedPortalID, int rank)
GetImageForResultFromSource
in interface INetworkSearchModelRO
public java.lang.String GetName()
IMVCObject
GetName
in interface IMVCObject
GetName
in class AClearModel
IMVCObject.GetName()
public int GetNumDisplayedResultsFromSource(int sourceId)
GetNumDisplayedResultsFromSource
in interface INetworkSearchModelRO
public int GetNumDisplayedResultsOverall()
GetNumDisplayedResultsOverall
in interface INetworkSearchModelRO
public int GetNumResultsFromSource(int sourceID)
GetNumResultsFromSource
in interface INetworkSearchModelRO
public int GetNumResultsOverall()
GetNumResultsOverall
in interface INetworkSearchModelRO
public int GetNumSources()
GetNumSources
in interface INetworkSearchModelRO
public int GetPageNum()
GetPageNum
in interface INetworkSearchModelRO
public java.lang.String GetSearchString()
GetSearchString
in interface INetworkSearchModelRO
public java.lang.String GetUnencodedSearchString()
GetUnencodedSearchString
in interface INetworkSearchModelRO
public IXPList GetSearchedSources()
GetSearchedSources
in interface INetworkSearchModelRO
public int GetSourceID(int id)
GetSourceID
in interface INetworkSearchModelRO
public java.lang.String GetSourceName(int id)
GetSourceName
in interface INetworkSearchModelRO
public java.lang.String GetTitleForResultFromSource(int sourceId, int resultId)
GetTitleForResultFromSource
in interface INetworkSearchModelRO
public HTMLAnchor GetURLForResultFromSource(int fedPortalID, int rank, boolean popup)
GetURLForResultFromSource
in interface INetworkSearchModelRO
public java.lang.String GetViewMode()
GetViewMode
in interface INetworkSearchModelRO
public void Init(AActivitySpace parent)
IModel
Init
in interface IModel
Init
in class AClearModel
parent
- the parent Activity Spacecom.plumtree.portaluiinfrastructure.activityspace.IModel#Init(AActivitySpace)
public void Prepare(java.lang.String searchString, IXPList sourceIDs, int pageNum)
Prepare
in interface INetworkSearchModel
public void SetPageNum(int pageNum)
SetPageNum
in interface INetworkSearchModel
public void SetViewMode(java.lang.String viewMode)
SetViewMode
in interface INetworkSearchModel
protected boolean isOutgoingFedPortal(java.lang.String clsid)
protected int GetAndSaveOutgoingFederatedPortals(IPTObjectManager ptOM)
public boolean IsDisabled(int objectId)
IsDisabled
in interface INetworkSearchModelRO
protected boolean CheckIfDisabled(int objectIDintgr)
protected void LocalPathwaysSearchInit()
protected void SetLocalSearchSettings(java.lang.String searchString, int startIndex, int endIndex)
searchString
- the search text valuestartIndex
- the start of the search index valueendIndex
- the end of the search index valueprotected NetworkSearchModel.SearchResultSet doLocalPathwaysSearch(java.lang.String searchString, int startIndex, int endIndex)
searchString
- the search termstartIndex
- the start index number of the searchendIndex
- the end index number of the search
protected NetworkSearchModel.SearchResultSet doLocalSearch(java.lang.String searchString, int startIndex, int endIndex)
protected NetworkSearchModel.SearchResultSet doSearch(int sourceID, java.lang.String searchString, int startIndex, int endIndex)
protected HTMLElement makeErrorLink(int sourceID, boolean userConfig, IPTFederatedSearch ptFedSearch)
public void SaveLocationPreferences(java.lang.String[] locationIDStrings)
SaveLocationPreferences
in interface INetworkSearchModel
public XPHashtable GetLocationPreferencesForUser()
GetLocationPreferencesForUser
in interface INetworkSearchModelRO
public void SetSearchStringTruncated(boolean flag)
SetSearchStringTruncated
in interface INetworkSearchModel
public boolean GetSearchStringTruncated()
GetSearchStringTruncated
in interface INetworkSearchModelRO
public void LoadNumberResults()
public void SaveNumberResults()
public java.lang.Object GetNewTempData()
AClearModel
GetNewTempData
in class AClearModel
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |