Class ecm.model.SearchTemplate
Extends
ecm.model._SearchTemplateBase.
Represents the search criteria that are defined for a search template. For IBM Content Manager OnDemand,
the search template is equivalent to a folder.
To improve performance, the search criteria are not filled in the search template initially. Instead, the
retrieveSearchCriteria
must be called to initiate an asynchronous request to make the
search criteria available.
At run time, a user can set the values in the search template to start a search.
Private functions should not be used to access public members of the class. Access member variables directly. For example:
var searchTemplate = new SearchTemplate({ id: "id", name: "search1", description: "my search", objectType:
"document" });
console.debug("Search object type=" + searchTemplate.objectType);
Defined in: <ecm\model\SearchTemplate.js>.
Constructor Summary
Constructor Attributes | Constructor Name and Description |
---|---|
ecm.model.SearchTemplate(properties)
Constructs a search template.
|
Field Summary
Field Attributes | Field Name and Description |
---|---|
An array of ecm.model.SearchClass objects
|
|
A boolean value indicating whether the search is editable
|
|
An array ecm.model.SearchFolder objects
|
|
A boolean value indicating whether the search is configured to include sub classes in query criteria
|
|
A boolean value indicating whether the search file type is invalid.
|
|
A boolean value indicating whether the text search criteria is invalid.
|
|
A boolean value indicating whether the work criteria are invalid.
|
|
A ecm.model.MetadataTemplateSearchCriteria object (Box only).
|
|
An object holding the extended search options
|
|
An array of object store objects
|
|
A string value holding the search object type
|
|
An array of saved search names (CMOD only)
|
|
A boolean value indicating whether the search is a private search (CMOD only)
|
|
A boolean value indicating whether the serach is a public search (CMOD only)
|
|
A boolean value indicating whether the search is viewable (CMOD only)
|
|
The number of items to display per page in the search results (FileNet P8, IBM Content Manager, and CMIS
only).
|
|
A string value holding the product name
|
|
A boolean value indicating whether this search is using teamspace macros
|
|
A string value holding the text based search criteria value
|
|
A string value holding the text based search type
|
- Fields borrowed from class ecm.model._SearchTemplateBase:
- andSearch, autoResolved, autoRun, cacheResults, description, invalidClass, invalidFolder, invalidProperty, invalidRepository, parentFolderId, searchConfig, searchCriteria, showInTree, UUID
Method Summary
Method Attributes | Method Name and Description |
---|---|
clone()
Returns a clone of this search.
|
|
containsEqualCriteria(searchTemplate)
Compares the criteria of search templates and return true if they are equal.
|
|
deleteODQueries(queryies, callback)
Delete a search from OnDemand.
|
|
Generates a query string from the (likely filled in) search template.
|
|
Return the ecm.model.ContentClass used in this search
|
|
Indicates whether this search is configured to run automatically when opened.
|
|
Returns boolean value if search template was created by Navigator search builder.
|
|
Indicates whether this search can be displayed in a tree view widget.
|
|
Indicates whether this search contains text search criteria.
|
|
retrieveODSavedQueries(callback)
Retrieves named queries from OnDemand for this search template.
|
|
retrieveODSavedQuery(queryName, callback)
Retrieves a named query from OnDemand for this search template.
|
|
saveODQuery(queryName, isPublic, callback)
Save a search to OnDemand.
|
|
search(callback, sortProperty, descending, teamspace, errorCallback, useCache)
Perform a search using the (filled in) search template.
|
|
searchDocument(documentId, callback)
Perform a search for the contained items object specified object
|
|
setCritieraToODSavedQuery(odSavedQuery)
Set the search criteria to be a OD saved query (CMOD only)
|
|
setSearchContentClass(searchContentClass)
Set the content class for the search
|
|
toJson(searching)
Convert the search criteria into Json format
|
|
toRecentSearchJson(contextId, userId)
|
|
updateAllowedValues(name, names, values, callback)
Update the allowed criteria values on the serach template
|
- Methods borrowed from class ecm.model._SearchTemplateBase:
- equals, generateUUID, isAttributeHidden, isLoaded, isNew, onSearchCompleted, onSearchCriteriaRetrieved, onUnsupportedSearchCriteriaRetrieved, refresh, retrieveSearchCriteria, save
Constructor Detail
ecm.model.SearchTemplate(properties)
- Parameters:
- properties
- The properties of the search template. The properties can be any of the public fields as defined below, plus those of the ecm.model.ContentItem, ecm.model.Item, and ecm.model._ModelObject.
Field Detail
classes
editable
folders
includeSubclasses
invalidFileType
invalidTextSearch
invalidWork
metadataTemplateCriteria
- Since:
- 3.0
moreOptions
objectStores
objectType
odSavedSearches
odViewPrivateSearch
odViewPublicSearch
odViewSavedSearch
pageSize
Important: If you display the search results in a content list, small page sizes (typically less than 50) are not recommended because additional requests might be sent to fill the content list. For example, if the content list displays 10 rows, and you set the page size to 6, the first 6 items returned by the search are displayed, but to fill the content list, an additional query attempts to retrieve 4 more items.
- Since:
- 2.0.3.3
productName
teamspaceMacroSearch
textSearchCriteria
textSearchType
Method Detail
clone()
containsEqualCriteria(searchTemplate)
- Parameters:
- searchTemplate
- A ecm.model.SearchTemplate to use for comparison
deleteODQueries(queryies, callback)
- Parameters:
- queryies
- Name of the queries to delete.
- callback
- A callback function called after the search has been deleted.
getQueryString()
'[{"name":"TIMESTAMP","operator":"Equals","values":["",""]},{"name":"USER_ID","operator":"Equals","values":["anderson",""]},{"name":"SOURCE","operator":"Equals","values":["scanner",""]}]'
getSearchContentClass()
isAutoRun()
isNavigatorSavedSearch()
isShowInTree()
isTextSearchCriteriaPresent()
retrieveODSavedQueries(callback)
- Parameters:
- callback
- Callback method to allow the caller to take action after retrieve of named queries completes.
retrieveODSavedQuery(queryName, callback)
- Parameters:
- queryName
- Name of the query to retrieve.
- callback
- Callback method to allow the caller to take action after the named query is complete.
saveODQuery(queryName, isPublic, callback)
- Parameters:
- queryName
- Name of the query to save.
- isPublic
- A boolean value indicating whether this search is public
- callback
- A callback function called after the named query has completed being saved.
search(callback, sortProperty, descending, teamspace, errorCallback, useCache)
- Parameters:
- callback
- A callback function to be called after the search has been performed. Passes a ecm.model.ResultSet as a parameter.
- sortProperty
- A string value holding the property name to used as the sort property
- descending
- A flag indicating the sort direction (ie. ascending or descending)
- teamspace
- A ecm.model.Teamspace object (if the search is run within the context of a teamspace
- errorCallback
- A callback function to call if there are errors returned when performing the search
- useCache
- A boolean value indicating whether to use cached results if they are available and the criteria has not changed since the last search
- Returns:
- A ecm.model.Request object or null if the results are retrieved from cache
searchDocument(documentId, callback)
- Parameters:
- documentId
- A string value holding a document id
- callback
- A callback function to be called after the search has been performed. Passes a ecm.model.ResultSet as a parameter.
setCritieraToODSavedQuery(odSavedQuery)
- Parameters:
- odSavedQuery
- A ecm.model.ODSavedSearch object
setSearchContentClass(searchContentClass)
- Parameters:
- searchContentClass
- A ecm.model.ContentClass object or ecm.model.SearchContentClasses if multiple classes specified
toJson(searching)
- Parameters:
- searching
toRecentSearchJson(contextId, userId)
- Parameters:
- contextId
- userId
- Deprecated:
- As of release 2.0.2
updateAllowedValues(name, names, values, callback)
- Parameters:
- name
- A string value holding the criteria name
- names
- An array of criteria names
- values
- An array of criteria values
- callback
- A callback function to be called after the critera values have been updated