d67d96c321
Implemented advanced/saved search architecture -- to use, you create a new search with var search = new Scholar.Search(), add conditions to it with addCondition(condition, operator, value), and run it with search(). The standard conditions with their respective operators can be retrieved with Scholar.SearchConditions.getStandardConditions(). Others are for special search flags and can be specified as follows (condition, operator, value): 'context', null, collectionIDToSearchWithin 'recursive', 'true'|'false' (as strings!--defaults to false if not specified, though, so should probably just be removed if not wanted), null 'joinMode', 'any'|'all', null For standard conditions, currently only 'title' and the itemData fields are supported -- more coming soon. Localized strings created for the standard search operators API: search.setName(name) -- must be called before save() on new searches search.load(savedSearchID) search.save() -- saves search to DB and returns a savedSearchID search.addCondition(condition, operator, value) search.updateCondition(searchConditionID, condition, operator, value) search.removeCondition(searchConditionID) search.getSearchCondition(searchConditionID) -- returns a specific search condition used in the search search.getSearchConditions() -- returns search conditions used in the search search.search() -- runs search and returns an array of item ids for results search.getSQL() -- will be used by Dan for search-within-search Scholar.Searches.getAll() -- returns an array of saved searches with 'id' and 'name', in alphabetical order Scholar.Searches.erase(savedSearchID) -- deletes a given saved search from the DB Scholar.SearchConditions.get(condition) -- get condition data (operators, etc.) Scholar.SearchConditions.getStandardConditions() -- retrieve conditions for use in drop-down menu (as opposed to special search flags) Scholar.SearchConditions.hasOperator() -- used by Dan for error-checking |
||
---|---|---|
.. | ||
chnmIScholarService.js |