com.plumtree.portaluiinfrastructure.search
Class SearchSettingCollection

java.lang.Object
  extended by com.plumtree.portaluiinfrastructure.search.SearchSettingCollection

public class SearchSettingCollection
extends java.lang.Object

Author:
CraigS Helper class containing a batch of search settings, plus methods to do useful things with them.

Field Summary
protected  XPHashtable _settings
          Map from PT_SEARCH_SETTING to Object, contains things we need to set on an IPTSearchRequest object later
static java.lang.String GADGET_SEARCH_TYPE_BANNERSEARCH
           
static java.lang.String GADGET_SEARCH_TYPE_NONCOMMUNITYFOLDER
           
static java.lang.String PT_SEARCHSETTING_ABSTYPES_S
           
static java.lang.String PT_SEARCHSETTING_ACCESS_LEVEL_S
           
static java.lang.String PT_SEARCHSETTING_ADMINFOLDERS_S
           
static java.lang.String PT_SEARCHSETTING_APPS_S
           
static java.lang.String PT_SEARCHSETTING_ASSOC_COLLAB_PROJECT_ID_S
           
static java.lang.String PT_SEARCHSETTING_ASSOC_PORTLET_ID_S
           
static java.lang.String PT_SEARCHSETTING_BESTBETS_S
           
static java.lang.String PT_SEARCHSETTING_COMMUNITY_ID_S
           
static java.lang.String PT_SEARCHSETTING_DDFOLDERS_S
           
static java.lang.String PT_SEARCHSETTING_GADGET_ALIGNMENT_S
           
static java.lang.String PT_SEARCHSETTING_GADGET_FIELDS_S
           
static java.lang.String PT_SEARCHSETTING_GADGET_SEARCH_TYPE_S
           
static java.lang.String PT_SEARCHSETTING_GADGET_TYPE_S
           
static java.lang.String PT_SEARCHSETTING_GROUPBYPROP_S
           
static java.lang.String PT_SEARCHSETTING_INCLUDE_SUBFOLDERS_S
           
static java.lang.String PT_SEARCHSETTING_INITIALSEARCHSTRING_S
           
static java.lang.String PT_SEARCHSETTING_KWIC_S
           
static java.lang.String PT_SEARCHSETTING_LANGUAGE_S
          String equivalents of PT_SEARCH_SETTING settings
static java.lang.String PT_SEARCHSETTING_LIMITBYLOCALE_S
           
static java.lang.String PT_SEARCHSETTING_MAXRESULTS_S
           
static java.lang.String PT_SEARCHSETTING_OBJIDS_S
           
static java.lang.String PT_SEARCHSETTING_OBJTYPES_S
           
static java.lang.String PT_SEARCHSETTING_ORDERBY_S
           
static java.lang.String PT_SEARCHSETTING_QUERYTYPE_S
           
static java.lang.String PT_SEARCHSETTING_SKIPRESULTS_S
           
static java.lang.String PT_SEARCHSETTING_SPELLCHECK_S
           
static java.lang.String PT_SEARCHSETTING_THESAURUS_S
           
static java.lang.String PT_SEARCHSETTING_USER_IS_GUEST_S
           
 
Constructor Summary
SearchSettingCollection()
           
 
Method Summary
 void add(int setting, boolean value)
          Add a setting to the map
 void add(int setting, int value)
          Add a setting to the map
 void add(int setting, int[] value)
          Add a setting to the map
 void add(int setting, java.lang.Object value)
          Add a setting to the map (for use only within the search package)
 void add(int setting, java.lang.String value)
          Add a setting to the map
 java.lang.String dump()
          Helper method for debugging
static void encodeRequestSettings(IPTSearchRequest request, XPHashtable map, java.lang.String keyPrefix, IXPCollection inclusions, IXPCollection exclusions)
          Encode all settings in the provided IPTSearchRequest, ready for URL encoding, into the provided XPHashtable.
static IXPList GetPageContextSettings()
           
static int getSettingIdFromString(java.lang.String s)
          Static helper method to map a string (i.e.
 IXPEnumerator GetSettingIDs()
          Get an enumeration of the settings stored in the collection
 java.lang.Object GetSettingValue(int key)
          Get an enumeration of the settings stored in the collection
 int GetSize()
          Get the size of the map
static java.lang.String getStringFromSettingId(int s)
          Static helper method to map a PT_SEARCH_SETTING to the URL parameter used to encode it
 boolean IsSimpleCommunityRestriction()
          Helper method that indicates whether this collection simply restricts a search to a community.
 boolean IsSimpleFolderRestriction()
          Helper method that indicates whether this collection simply restricts a search to a folder (possibly including subfolders).
 void merge(SearchSettingCollection otherSet)
          Merge another batch of settings into ours
static java.lang.Object parseURLString(int id, java.lang.String[] value)
          Parse the URL-ified String[] setting value and return an Object that can be passed to add() (and from there into IPTSearchRequest.SetSettings()).
static java.lang.String[] stringifySettingValue(int id, java.lang.Object v)
          Return a stringified version of v that can be used in an URL
 void updateRequest(IPTSearchRequest request)
          Update an IPTSearchRequest with our settings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PT_SEARCHSETTING_LANGUAGE_S

public static final java.lang.String PT_SEARCHSETTING_LANGUAGE_S
String equivalents of PT_SEARCH_SETTING settings

See Also:
Constant Field Values

PT_SEARCHSETTING_LIMITBYLOCALE_S

public static final java.lang.String PT_SEARCHSETTING_LIMITBYLOCALE_S
See Also:
Constant Field Values

PT_SEARCHSETTING_SKIPRESULTS_S

public static final java.lang.String PT_SEARCHSETTING_SKIPRESULTS_S
See Also:
Constant Field Values

PT_SEARCHSETTING_MAXRESULTS_S

public static final java.lang.String PT_SEARCHSETTING_MAXRESULTS_S
See Also:
Constant Field Values

PT_SEARCHSETTING_APPS_S

public static final java.lang.String PT_SEARCHSETTING_APPS_S
See Also:
Constant Field Values

PT_SEARCHSETTING_ABSTYPES_S

public static final java.lang.String PT_SEARCHSETTING_ABSTYPES_S
See Also:
Constant Field Values

PT_SEARCHSETTING_OBJTYPES_S

public static final java.lang.String PT_SEARCHSETTING_OBJTYPES_S
See Also:
Constant Field Values

PT_SEARCHSETTING_DDFOLDERS_S

public static final java.lang.String PT_SEARCHSETTING_DDFOLDERS_S
See Also:
Constant Field Values

PT_SEARCHSETTING_ADMINFOLDERS_S

public static final java.lang.String PT_SEARCHSETTING_ADMINFOLDERS_S
See Also:
Constant Field Values

PT_SEARCHSETTING_OBJIDS_S

public static final java.lang.String PT_SEARCHSETTING_OBJIDS_S
See Also:
Constant Field Values

PT_SEARCHSETTING_INCLUDE_SUBFOLDERS_S

public static final java.lang.String PT_SEARCHSETTING_INCLUDE_SUBFOLDERS_S
See Also:
Constant Field Values

PT_SEARCHSETTING_COMMUNITY_ID_S

public static final java.lang.String PT_SEARCHSETTING_COMMUNITY_ID_S
See Also:
Constant Field Values

PT_SEARCHSETTING_KWIC_S

public static final java.lang.String PT_SEARCHSETTING_KWIC_S
See Also:
Constant Field Values

PT_SEARCHSETTING_SPELLCHECK_S

public static final java.lang.String PT_SEARCHSETTING_SPELLCHECK_S
See Also:
Constant Field Values

PT_SEARCHSETTING_BESTBETS_S

public static final java.lang.String PT_SEARCHSETTING_BESTBETS_S
See Also:
Constant Field Values

PT_SEARCHSETTING_THESAURUS_S

public static final java.lang.String PT_SEARCHSETTING_THESAURUS_S
See Also:
Constant Field Values

PT_SEARCHSETTING_ORDERBY_S

public static final java.lang.String PT_SEARCHSETTING_ORDERBY_S
See Also:
Constant Field Values

PT_SEARCHSETTING_ACCESS_LEVEL_S

public static final java.lang.String PT_SEARCHSETTING_ACCESS_LEVEL_S
See Also:
Constant Field Values

PT_SEARCHSETTING_GROUPBYPROP_S

public static final java.lang.String PT_SEARCHSETTING_GROUPBYPROP_S
See Also:
Constant Field Values

PT_SEARCHSETTING_QUERYTYPE_S

public static final java.lang.String PT_SEARCHSETTING_QUERYTYPE_S
See Also:
Constant Field Values

PT_SEARCHSETTING_INITIALSEARCHSTRING_S

public static final java.lang.String PT_SEARCHSETTING_INITIALSEARCHSTRING_S
See Also:
Constant Field Values

PT_SEARCHSETTING_GADGET_FIELDS_S

public static final java.lang.String PT_SEARCHSETTING_GADGET_FIELDS_S
See Also:
Constant Field Values

PT_SEARCHSETTING_GADGET_TYPE_S

public static final java.lang.String PT_SEARCHSETTING_GADGET_TYPE_S
See Also:
Constant Field Values

PT_SEARCHSETTING_GADGET_ALIGNMENT_S

public static final java.lang.String PT_SEARCHSETTING_GADGET_ALIGNMENT_S
See Also:
Constant Field Values

PT_SEARCHSETTING_ASSOC_PORTLET_ID_S

public static final java.lang.String PT_SEARCHSETTING_ASSOC_PORTLET_ID_S
See Also:
Constant Field Values

PT_SEARCHSETTING_ASSOC_COLLAB_PROJECT_ID_S

public static final java.lang.String PT_SEARCHSETTING_ASSOC_COLLAB_PROJECT_ID_S
See Also:
Constant Field Values

PT_SEARCHSETTING_GADGET_SEARCH_TYPE_S

public static final java.lang.String PT_SEARCHSETTING_GADGET_SEARCH_TYPE_S
See Also:
Constant Field Values

PT_SEARCHSETTING_USER_IS_GUEST_S

public static final java.lang.String PT_SEARCHSETTING_USER_IS_GUEST_S
See Also:
Constant Field Values

GADGET_SEARCH_TYPE_BANNERSEARCH

public static final java.lang.String GADGET_SEARCH_TYPE_BANNERSEARCH
See Also:
Constant Field Values

GADGET_SEARCH_TYPE_NONCOMMUNITYFOLDER

public static final java.lang.String GADGET_SEARCH_TYPE_NONCOMMUNITYFOLDER
See Also:
Constant Field Values

_settings

protected XPHashtable _settings
Map from PT_SEARCH_SETTING to Object, contains things we need to set on an IPTSearchRequest object later

Constructor Detail

SearchSettingCollection

public SearchSettingCollection()
Method Detail

getSettingIdFromString

public static int getSettingIdFromString(java.lang.String s)
Static helper method to map a string (i.e. a URL parameter) to a PT_SEARCH_SETTING value.


getStringFromSettingId

public static java.lang.String getStringFromSettingId(int s)
Static helper method to map a PT_SEARCH_SETTING to the URL parameter used to encode it


GetPageContextSettings

public static IXPList GetPageContextSettings()
Returns:

GetSettingIDs

public IXPEnumerator GetSettingIDs()
Get an enumeration of the settings stored in the collection


GetSize

public int GetSize()
Get the size of the map


GetSettingValue

public java.lang.Object GetSettingValue(int key)
Get an enumeration of the settings stored in the collection


IsSimpleCommunityRestriction

public boolean IsSimpleCommunityRestriction()
Helper method that indicates whether this collection simply restricts a search to a community. Used by the UI to replace the "Search with Same Restrictions" message with "Search in Same Community" when possible.


IsSimpleFolderRestriction

public boolean IsSimpleFolderRestriction()
Helper method that indicates whether this collection simply restricts a search to a folder (possibly including subfolders). Used by the UI to replace the "Search with Same Restrictions" message with "Search in Same Folder" when possible.


add

public void add(int setting,
                java.lang.Object value)
Add a setting to the map (for use only within the search package)


add

public void add(int setting,
                boolean value)
Add a setting to the map


add

public void add(int setting,
                int value)
Add a setting to the map


add

public void add(int setting,
                java.lang.String value)
Add a setting to the map


add

public void add(int setting,
                int[] value)
Add a setting to the map


dump

public java.lang.String dump()
Helper method for debugging


encodeRequestSettings

public static void encodeRequestSettings(IPTSearchRequest request,
                                         XPHashtable map,
                                         java.lang.String keyPrefix,
                                         IXPCollection inclusions,
                                         IXPCollection exclusions)
Encode all settings in the provided IPTSearchRequest, ready for URL encoding, into the provided XPHashtable. The map keys are Strings (e.g. PT_SEARCHSETTING_OBJTYPES_S) prepended with the provided prefix. The values are String[]-ified setting values. inclusions and exclusions are IXPCollections of Integers. If the inclusions collection is non-null, only settings contained within it are included in the returned map. Any settings contained in the exclusions collection are omitted from the returned map.


parseURLString

public static java.lang.Object parseURLString(int id,
                                              java.lang.String[] value)
Parse the URL-ified String[] setting value and return an Object that can be passed to add() (and from there into IPTSearchRequest.SetSettings()).


merge

public void merge(SearchSettingCollection otherSet)
Merge another batch of settings into ours


stringifySettingValue

public static java.lang.String[] stringifySettingValue(int id,
                                                       java.lang.Object v)
Return a stringified version of v that can be used in an URL


updateRequest

public void updateRequest(IPTSearchRequest request)
Update an IPTSearchRequest with our settings




Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.