public interface

WebSearch

implements Persistable WebObjectInfo
com.microstrategy.web.objects.WebSearch
Known Indirect Subclasses

Class Overview

The WebSearch class represents a search object, either in metadata or created on the fly. It allows the user to modify search properties of both new searches and searches which are saved in the metadata, and submit searches to the Intelligence Server.

Summary

[Expand]
Inherited Constants
From interface com.microstrategy.utils.serialization.EnumWebPersistableState
Public Methods
abstract WebFolder doSynchronousQuickSearch()
Do the Synchronous Quick Search
abstract String getAbbreviationPattern()
Gets the abbreviation pattern that the Search object will search for.
abstract int getAccessRights()
Returns the access rights of the object being searched for, that the search will be narrowed by.
abstract int getBlockBegin()
Returns the blockBegin value for the objects that the search returns.
abstract int getBlockCount()
Returns the blockCount value for the objects that the search returns.
abstract String getDescriptionPattern()
Returns the description pattern that the search is currently limited to.
abstract int getDomain()
Returns the current domain for the search.
abstract int getFirstObjectIndex()
Returns the index to begin searching from.
abstract int getMaxObjects()
Returns the maximum number of objects the search is configured to return.
abstract int getMaxWait()
Returns the maximum amount of time, in milliseconds, to wait for a search to finish in synchronous mode.
abstract String getNamePattern()
Returns the pattern to search for in the name of the objects in metadata.
abstract int getPollingFrequency()
Returns the current polling frequency, in milliseconds.
abstract WebFolder getResults()
Attempts to get the results of a search from the Intelligence Server.
abstract int getScope()
Returns the current scope for the search.
abstract List<WebFolder> getSearchExcludeRoots()
Returns the excluded folders for the search
abstract String getSearchFields()
Return current setting of Search Fields
abstract int getSearchFlags()
Returns the currently set search flags.
abstract String getSearchID()
Returns the search ID of the last search submitted by this object, or the last time setSearchID was called.
abstract String getSearchOwner()
Returns the value of the search owner restriction on the search, if it is currently set.
abstract String getSearchRoot()
Returns the root folder ID that the search is limited to, if applicable.
abstract int getSearchType()
Return current setting of Search Type
abstract int getStateClear()
Returns the object states that the search is prohibited from returning.
abstract int getStateSet()
Returns the object states that the search will be limited to.
abstract int getStatus()
Returns the status of the last getResults call which was made.
abstract boolean isAsync()
Returns whether getResults will be asynchronous.
abstract boolean isGettingTreeInfo()
Gets the setting about whether the search result would include the browsing tree structure or not.
abstract boolean isQuickSearch()
Gets the setting about whether the search should be handled by the new quick search engine.
abstract boolean isSynchronousQuickSearch()
Gets the setting about whether the search should be handled by the Synchronous quick search engine.
abstract void notUsedBy(int type)
The resulting objects of the search is NOT used by objects of the specified type (EnumDSSXMLObjectTypes) or subtype (EnumDSSXMLObjectSubTypes).
abstract void notUses(int type)
The resulting objects of the search does NOT use the specified type (EnumDSSXMLObjectTypes) or subtype (EnumDSSXMLObjectSubTypes).
abstract void purge()
Purges the search whose ID is set on this WebSearch object from the Intelligence Server's memory.
abstract void reset()
Resets all member variables on this object, which causes a reset of the search criteria.
abstract void setAbbreviationPattern(String abbreviationPattern)
Sets the abbreviation pattern of objects that a search will return.
abstract void setAccessRights(int accessRights)
This will set the access rights that the search results will be limited by.
abstract void setAsync(boolean async)
Sets whether getResults will be asynchronous.
abstract void setBlockBegin(int blockBegin)
Sets the blockBegin value for the objects that the search returns.
abstract void setBlockCount(int blockCount)
Sets the blockCount value for the objects that the search returns.
abstract void setCreatedModifiedByDate(Date beginTime, Date endTime)
Sets the created/modified by date range of the search criteria.
abstract void setCreatedModifiedByDate(String beginTime, String endTime)
Sets the created/modified by date range of the search criteria.
abstract void setCreatedModifiedByInterval(int timeInterval, int intervalUnit)
Sets the interval for the created/modified by time for the search.
abstract void setDescriptionPattern(String descriptionPattern)
Sets the description pattern that the search will be limited to.
abstract void setDomain(int domain)
Sets the domain that the search will be limited to.
abstract void setFirstObjectIndex(int firstObjectIndex)
Sets the index to begin searching from.
abstract void setGettingTreeInfo(boolean gettingTreeInfo)
Sets the setting about whether the search result would include the browsing tree structure or not.
abstract void setMaxObjects(int maxObjects)
Sets the maximum number of objects that the search will return.
abstract void setMaxWait(int millis)
Sets the maximum amount of time, in milliseconds, to wait for a search to finish in synchronous mode.
abstract void setNamePattern(String namePattern)
Sets the pattern to search for in the name of the objects in metadata.
abstract void setPollingFrequency(int millis)
Sets the current polling frequency, in milliseconds.
abstract void setQuickSearch(boolean quickSearch)
Sets the setting about whether the search should be handled by the new quick search engine.
abstract void setScope(int scope)
Sets the scope that the search will be limited to.
abstract void setSearchFields(String searchFields)
Sets the setting for the new quick search engine.
abstract void setSearchFlags(int flags)
Sets the search flags for the search.
abstract void setSearchID(String searchID)
Sets the search ID, which will be used when getResults is called.
abstract void setSearchOwner(String searchOwner)
Sets the value of the owner restriction on the search.
abstract void setSearchRoot(String searchRoot)
Sets the root folder that the search will be limited to.
abstract void setSearchType(int searchType)
Sets the setting for the new quick search engine.
abstract void setStateClear(int stateClear)
Sets the object states that the search is prohibited from returning.
abstract void setStateSet(int stateSet)
Sets the object states that should be returned in the search.
abstract void submit()
Submits the current state of this search object to the Intelligence Server.
abstract void submit(String searchXML)
Submits the given search XML to the Intelligence Server.
abstract SimpleList types()
Returns a SimpleList from which types can be added or removed.
abstract void usedBy(int type)
The resulting objects of the search is used by objects of the specified type (EnumDSSXMLObjectTypes) or subtype (EnumDSSXMLObjectSubTypes).
abstract SimpleList usedBy()
Returns a SimpleList which can be used to add or remove objects which constrain the search to only return objects which are used by the given object(s).
abstract SimpleList uses()
Returns a SimpleList which can be used to add or remove objects which constrain the search to only return objects which use the given object(s).
abstract void uses(int type)
The resulting objects of the search uses the specified type (EnumDSSXMLObjectTypes) or subtype (EnumDSSXMLObjectSubTypes).
[Expand]
Inherited Methods
From interface com.microstrategy.utils.KeyedObject
From interface com.microstrategy.utils.serialization.Persistable
From interface com.microstrategy.web.objects.WebDisplayUnit
From interface com.microstrategy.web.objects.WebFeatures
From interface com.microstrategy.web.objects.WebObjectInfo
From interface com.microstrategy.web.objects.WebPromptSite

Public Methods

public abstract WebFolder doSynchronousQuickSearch ()

Do the Synchronous Quick Search

Returns
  • A folder object representing the folder returned from the search, or null if the search is not yet ready.
Throws
WebObjectsException Thrown if the search could not be submitted to the Intelligence Server.

public abstract String getAbbreviationPattern ()

Gets the abbreviation pattern that the Search object will search for. If this is an empty string, then the search will not be restricted on the objects' abbreviation pattern.

Returns
  • The abbreviation pattern to search for.

public abstract int getAccessRights ()

Returns the access rights of the object being searched for, that the search will be narrowed by. This value corresponds to those in EnumDSSXMLAccessRightFlags.

Returns
  • An int corresponding to the access rights that the search will be filtered on.

public abstract int getBlockBegin ()

Returns the blockBegin value for the objects that the search returns. This is used for incremental fetching of the search results, and tells which item in the search should be the first one of the subset of search results that is to be returned.

The default value of blockBegin is 1, meaning return items starting with the first object found.

Returns
  • The current setting for the first element to return from the search.

public abstract int getBlockCount ()

Returns the blockCount value for the objects that the search returns. This is used for incremental fetching of the search results, and tells how many items should be returned in the subset of search results that is to be returned.

The default value of blockCount is -1, meaning return all items.

Returns
  • The current setting for the number of elements, starting from the blockBegin element, to return from the search. This only affects the window of data that is returned by the search - it does not limit the actual number of results from the search.

public abstract String getDescriptionPattern ()

Returns the description pattern that the search is currently limited to. An empty string denotes that the search will not be limited by the description of the objects.

Returns
  • The current description pattern to search for.

public abstract int getDomain ()

Returns the current domain for the search. The domain tells the scope in which the search will be performed.

The default domain is DssXmlSearchDomainProject.

Returns
See Also

public abstract int getFirstObjectIndex ()

Returns the index to begin searching from. By default, this value is 1, meaning search from beginning, but it can be changed by calling setFirstObjectIndex.

Returns
  • The index to begin searching from.

public abstract int getMaxObjects ()

Returns the maximum number of objects the search is configured to return. By default, this value is -1, meaning return all objects, but it can be changed by calling setMaxObjects.

Returns
  • The maximum number of objects a search will return.

public abstract int getMaxWait ()

Returns the maximum amount of time, in milliseconds, to wait for a search to finish in synchronous mode.

Returns
  • The maximum wait time, in milliseconds. If this value is -1, then getResults will not return unless the search finishes or an error is detected.
See Also

public abstract String getNamePattern ()

Returns the pattern to search for in the name of the objects in metadata.

Returns
  • The name pattern that will be searched for.

public abstract int getPollingFrequency ()

Returns the current polling frequency, in milliseconds. This determines, in synchronous mode, how often the API will poll the Intelligence Server upon calling getResults.

Returns
  • The current polling frequency, in milliseconds.

public abstract WebFolder getResults ()

Attempts to get the results of a search from the Intelligence Server. The search ID used will be the one set on this WebSearch object. If the asynchronous setting is true, then this method will return null and set the status variable if the report is not ready. If asynchronous is false, then this method will poll the Intelligence Server, subject to the parameters maxWait and pollingFrequency.

Returns
  • A folder object representing the folder returned from the search, or null if the search is not yet ready.
Throws
WebObjectsException Signals an error in the execution or retrieval of results of the search.

public abstract int getScope ()

Returns the current scope for the search.

The default scope is DssXmlSearchScopeRootedObjects.

Returns
See Also

public abstract List<WebFolder> getSearchExcludeRoots ()

Returns the excluded folders for the search

public abstract String getSearchFields ()

Return current setting of Search Fields

Returns
  • String

public abstract int getSearchFlags ()

Returns the currently set search flags.

The default value of the search flags is 0.

Returns

public abstract String getSearchID ()

Returns the search ID of the last search submitted by this object, or the last time setSearchID was called.

Returns
  • The currently active search ID.

public abstract String getSearchOwner ()

Returns the value of the search owner restriction on the search, if it is currently set.

Returns
  • The user whose objects the search is limited to.

public abstract String getSearchRoot ()

Returns the root folder ID that the search is limited to, if applicable.

Returns
  • The folder ID that is to be used as the root of the search.

public abstract int getSearchType ()

Return current setting of Search Type

Returns

public abstract int getStateClear ()

Returns the object states that the search is prohibited from returning. Value comes from the bitwise OR of values from EnumDSSXMLObjectState. The default value is 0.

Returns
  • The current value for the clear states.

public abstract int getStateSet ()

Returns the object states that the search will be limited to. Value comes from the bitwise OR of values from EnumDSSXMLObjectState. The default value is 0.

Returns
  • The current value for the set states.
See Also

public abstract int getStatus ()

Returns the status of the last getResults call which was made.

Returns

public abstract boolean isAsync ()

Returns whether getResults will be asynchronous. If this is true, then getResults will poll the Intelligence Server once, and return, storing the status in the status property variable (obtainable via getStatus). If this is false, then the API will poll the Intelligence Server, using the polling frequency set by setPollingFrequency, and return only when either the result of the search is available or the max wait time (which can be set by setMaxWait) has been reached, at which point it will return without a result.

Returns
  • True if this object is asynchronous, false otherwise.

public abstract boolean isGettingTreeInfo ()

Gets the setting about whether the search result would include the browsing tree structure or not.

Returns
  • setting about whether the search result would include the browsing tree structure or not.

public abstract boolean isQuickSearch ()

Gets the setting about whether the search should be handled by the new quick search engine.

Returns
  • setting about whether the search should be handled by the new quick search engine.

public abstract boolean isSynchronousQuickSearch ()

Gets the setting about whether the search should be handled by the Synchronous quick search engine.

Returns
  • setting about whether the search should be handled by the Synchronous quick search engine.

public abstract void notUsedBy (int type)

The resulting objects of the search is NOT used by objects of the specified type (EnumDSSXMLObjectTypes) or subtype (EnumDSSXMLObjectSubTypes).

Parameters
type specify type (EnumDSSXMLObjectTypes) or subtype (EnumDSSXMLObjectSubTypes).

public abstract void notUses (int type)

The resulting objects of the search does NOT use the specified type (EnumDSSXMLObjectTypes) or subtype (EnumDSSXMLObjectSubTypes).

Parameters
type specify type (EnumDSSXMLObjectTypes) or subtype (EnumDSSXMLObjectSubTypes).

public abstract void purge ()

Purges the search whose ID is set on this WebSearch object from the Intelligence Server's memory. This will free up resources dedicated to the given search.

Throws
WebObjectsException Signals an error in purging the search.

public abstract void reset ()

Resets all member variables on this object, which causes a reset of the search criteria.

public abstract void setAbbreviationPattern (String abbreviationPattern)

Sets the abbreviation pattern of objects that a search will return.

Parameters
abbreviationPattern Abbreviation pattern to search for. An empty string will ensure that no filtering of the search results is done on the abbreviation pattern.

public abstract void setAccessRights (int accessRights)

This will set the access rights that the search results will be limited by.

Parameters
accessRights The value to search for. This is the bitwise OR of values from EnumDSSXMLAccessRightFlags.

public abstract void setAsync (boolean async)

Sets whether getResults will be asynchronous. If this is true, then getResults will poll the Intelligence Server once, and return, storing the status in the status property variable (obtainable via getStatus). If this is false, then the API will poll the Intelligence Server, using the polling frequency set by setPollingFrequency, and return only when either the result of the search is available or the max wait time (which can be set by setMaxWait) has been reached, at which point it will return without a result.

Parameters
async The desired setting of [a]synchronous operation.
See Also

public abstract void setBlockBegin (int blockBegin)

Sets the blockBegin value for the objects that the search returns. This is used for incremental fetching of the search results, and tells which item in the search should be the first one of the subset of search results that is to be returned.

Parameters
blockBegin The first element in the result list that should be returned from the search.
See Also

public abstract void setBlockCount (int blockCount)

Sets the blockCount value for the objects that the search returns. This is used for incremental fetching of the search results, and tells how many items should be returned in the subset of search results that is to be returned.

Parameters
blockCount The new setting to use for the number of elements, starting from the blockBegin element, to return from the search. This only affects the window of data that is returned by the search - it does not limit the actual number of results from the search.
See Also

public abstract void setCreatedModifiedByDate (Date beginTime, Date endTime)

Sets the created/modified by date range of the search criteria.

Parameters
beginTime A java.util.Date set to the beginning date of the range.
endTime A java.util.Date set to the ending date of the range.
Throws
IllegalArgumentException Thrown if one of the arguments is null.

public abstract void setCreatedModifiedByDate (String beginTime, String endTime)

Sets the created/modified by date range of the search criteria.

Parameters
beginTime A string representing the beginning date of the range.
endTime A string representing the ending date of the range.
Throws
IllegalArgumentException Thrown if one of the arguments is null.

public abstract void setCreatedModifiedByInterval (int timeInterval, int intervalUnit)

Sets the interval for the created/modified by time for the search. This interval is measured from the time of the search, and the intervalUnit determines what the time unit on timeInterval is.

Parameters
timeInterval The number of intervalUnits from the time of the search to filter the search results with.
intervalUnit The unit to use for the search. Comes from EnumDSSXMLSearchUnit.

public abstract void setDescriptionPattern (String descriptionPattern)

Sets the description pattern that the search will be limited to. An empty string denotes that the search will not be limited by the description of the objects.

Parameters
descriptionPattern The description pattern to use in the search.

public abstract void setDomain (int domain)

Sets the domain that the search will be limited to. By default, the domain is DssXmlSearchDomainProject.

Parameters
domain The new value for the domain, coming from the EnumDSSXMLSearchDomain enumeration.
See Also

public abstract void setFirstObjectIndex (int firstObjectIndex)

Sets the index to begin searching from. Default is 1, meaning search from beginning.

Parameters
firstObjectIndex The index to begin searching from.

public abstract void setGettingTreeInfo (boolean gettingTreeInfo)

Sets the setting about whether the search result would include the browsing tree structure or not. When this sets it to true, user would be able to retrieve the search result in a tree structure by calling getChildrenInTree() on the return value from getResults() from this interface.

public abstract void setMaxObjects (int maxObjects)

Sets the maximum number of objects that the search will return. Default is -1, meaning return all objects.

Parameters
maxObjects The maximum number of objects to return from the search.
See Also

public abstract void setMaxWait (int millis)

Sets the maximum amount of time, in milliseconds, to wait for a search to finish in synchronous mode.

Parameters
millis The maximum wait time, in milliseconds. If this value is -1, then getResults will not return unless the search finishes or an error is detected.
See Also

public abstract void setNamePattern (String namePattern)

Sets the pattern to search for in the name of the objects in metadata.

Parameters
namePattern The name pattern that will be searched for.
See Also

public abstract void setPollingFrequency (int millis)

Sets the current polling frequency, in milliseconds. This determines, in synchronous mode, how often the API will poll the Intelligence Server upon calling getResults.

Parameters
millis The desired polling frequency, in milliseconds.

public abstract void setQuickSearch (boolean quickSearch)

Sets the setting about whether the search should be handled by the new quick search engine. When this sets it to true, the search will be handled by the new quick search engine.

public abstract void setScope (int scope)

Sets the scope that the search will be limited to. By default, scope is DssXmlSearchScopeRootedObjects.

Parameters
scope domain The new value for the scope, coming from the EnumDSSXMLSearchScope enumeration.
See Also

public abstract void setSearchFields (String searchFields)

Sets the setting for the new quick search engine. Search Fields are combination of "name", "description" and "comment" separated by ",". When this is not set, search request will ask engine to use its default value - - Begin With - "name" - Exactly - "name" - Contains Any Word - "name,description,comment"

public abstract void setSearchFlags (int flags)

Sets the search flags for the search.

Parameters
flags A value corresponding to a bitwise OR from the enumeration class EnumDSSXMLSearchFlags.
See Also

public abstract void setSearchID (String searchID)

Sets the search ID, which will be used when getResults is called.

Parameters
searchID The search ID of a search which is executing or has results waiting on the Intelligence Server.
See Also

public abstract void setSearchOwner (String searchOwner)

Sets the value of the owner restriction on the search.

Parameters
searchOwner The user whose objects the search is limited to.
See Also

public abstract void setSearchRoot (String searchRoot)

Sets the root folder that the search will be limited to. Requires an object ID corresponding to a folder.

Parameters
searchRoot The folder ID of a folder that will be used as the root of the search.
See Also

public abstract void setSearchType (int searchType)

Sets the setting for the new quick search engine. Search Types are defined in EnumDSSXMLSearchTypes When this is not set, search reqeust will be redirected to old searc engine.

public abstract void setStateClear (int stateClear)

Sets the object states that the search is prohibited from returning.

Parameters
stateClear An int corresponding to the bitwise OR of values from EnumDSSXMLObjectState. These states will not be in the search result set.
See Also

public abstract void setStateSet (int stateSet)

Sets the object states that should be returned in the search.

Parameters
stateSet An int corresponding to the bitwise OR of values from EnumDSSXMLObjectState. Only objects with these states will be in the search result.
See Also

public abstract void submit ()

Submits the current state of this search object to the Intelligence Server. This will cause the search ID to be set to the search ID which results from this submission.

Throws
WebObjectsException Thrown if the search could not be submitted to the Intelligence Server.

public abstract void submit (String searchXML)

Submits the given search XML to the Intelligence Server. This will cause the search ID to be set to the search ID which results from this submission.

Parameters
searchXML The search XML to be sent to the Intelligence Server. This overrides all properties on this WebSearch object.
Throws
WebObjectsException Thrown if the search could not be submitted to the Intelligence Server.

public abstract SimpleList types ()

Returns a SimpleList from which types can be added or removed. Note that the SimpleList returned can only have java.lang.Integer objects added to it.

Returns
  • A SimpleList reflecting the types of objects which will be searched for.

public abstract void usedBy (int type)

The resulting objects of the search is used by objects of the specified type (EnumDSSXMLObjectTypes) or subtype (EnumDSSXMLObjectSubTypes).

Parameters
type specify type (EnumDSSXMLObjectTypes) or subtype (EnumDSSXMLObjectSubTypes).

public abstract SimpleList usedBy ()

Returns a SimpleList which can be used to add or remove objects which constrain the search to only return objects which are used by the given object(s). Note that the SimpleList returned can only have WebObjectInfo objects added to it.

Returns
  • A SimpleList reflecting the used-by objects which will constrain the search.

public abstract SimpleList uses ()

Returns a SimpleList which can be used to add or remove objects which constrain the search to only return objects which use the given object(s). Note that the SimpleList returned can only have WebObjectInfo objects added to it.

Returns
  • A SimpleList reflecting the uses objects which will constrain the search.

public abstract void uses (int type)

The resulting objects of the search uses the specified type (EnumDSSXMLObjectTypes) or subtype (EnumDSSXMLObjectSubTypes).

Parameters
type specify type (EnumDSSXMLObjectTypes) or subtype (EnumDSSXMLObjectSubTypes).