Class ecm.model._RecentSearchesMixin
Provides methods to retrieve, add and remove recent searches. Recent searches are stored in the user configuration with minimal data (ID, vsId, name, description and repository ID), so items must be explicitly loaded before use. For example:
var callback = function(searchTemplate) { // search template is loaded and ready for use };
var request = repository.retrieveSearchTemplate(recentSearch.id, recentSearch.vsId, "released", callback);
Defined in: <ecm\model\_RecentSearchesMixin.js>.
Constructor Summary
Constructor Attributes | Constructor Name and Description |
---|---|
Mixin for managing recent searches.
|
Method Summary
Method Attributes | Method Name and Description |
---|---|
addRecentSearch(search, callback)
Asynchronously adds the specified search template to the list of recent searches.
|
|
Clears the cached list of recent searches.
|
|
onRecentSearchAdded(recentSearches)
Called when a search template is added to the list of recent searches.
|
|
onRecentSearchesRemoved(recentSearches)
Called when a search template is removed from the list of recent searches.
|
|
removeRecentSearches(search, callback)
Asynchronously removes the specified search templates from the list of recent searches.
|
|
retrieveRecentSearches(callback)
Calls the specified function with the list of recent searches.
|
Method Detail
addRecentSearch(search, callback)
Asynchronously adds the specified search template to the list of recent searches.
- Parameters:
- search
- The ecm.model.SearchTemplate object to be added to the list of recent searches
- callback
- An optional function called with the updated list of recent searches after the search is added
- Returns:
- A ecm.model.Request object
clearRecentSearches()
Clears the cached list of recent searches.
onRecentSearchAdded(recentSearches)
Called when a search template is added to the list of recent searches.
- Parameters:
- recentSearches
- The updated list of recent searches
onRecentSearchesRemoved(recentSearches)
Called when a search template is removed from the list of recent searches.
- Parameters:
- recentSearches
- The updated list of recent searches
removeRecentSearches(search, callback)
Asynchronously removes the specified search templates from the list of recent searches.
- Parameters:
- search
- The ecm.model.SearchTemplate object to be removed from the list of recent searches
- callback
- An optional function called with the updated list of recent searches after the search is removed
- Returns:
- A ecm.model.Request object
retrieveRecentSearches(callback)
Calls the specified function with the list of recent searches. The list is obtained from cache if available;
otherwise, it is retrieved asynchronously. The items are ecm.model.SearchTemplate stubs that must be
loaded before use.
- Parameters:
- callback
- An optional function called with the updated list of recent searches after the search is added
- Returns:
- A ecm.model.Request object if the list of recent searches is not in the cache