Interface ResourceSearchSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, ResourceQuerySession
This session provides methods for searching among Resource
objects. The search query is constructed using the ResourceQuery .
getResourcesByQuery() is the basic search method and returns a
list of Resources . A more advanced search may be performed with
getResourcesBySearch() .It accepts an ResourceSearch in
addition to the query for the purpose of specifying additional options
affecting the entire search, such as ordering.
getResourcesBySearch() returns an ResourceSearchResults that can
be used to access the resulting ResourceList or be used to perform
a search within the result set through ResourceList .
This session defines views that offer differing behaviors for searching.
- federated bin view: searches include resources in bins of which this bin is an ancestor in the bin hierarchy
- isolated bin view: searches are restricted to resources in this bin
Resources may have a resource query record indicated by their
respective record types. The resource query record is accessed via the
ResourceQuery .
-
Method Summary
Modifier and TypeMethodDescriptiongetResourceQueryFromInspector(ResourceQueryInspector resourceQueryInspector) Gets a resource query from an inspector.getResourcesBySearch(ResourceQuery resourceQuery, ResourceSearch resourceSearch) Gets the search results matching the given search query using the given search.Gets a resource search.Gets a resource search order.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.Methods inherited from interface ResourceQuerySession
canSearchResources, getBin, getBinId, getResourceQuery, getResourcesByQuery, useFederatedBinView, useIsolatedBinViewModifier and TypeMethodDescriptionbooleanTests if this user can performResourcesearches.getBin()Gets theBinassociated with this session.getBinId()Gets theBinIdassociated with this session.Gets a resource query.getResourcesByQuery(ResourceQuery resourceQuery) Gets a list ofResourcesmatching the given resource query.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.
-
Method Details
-
getResourceSearch
ResourceSearch getResourceSearch()Gets a resource search.- Returns:
- the resource search
- Compliance:
mandatory- This method must be implemented.
-
getResourceSearchOrder
ResourceSearchOrder getResourceSearchOrder()Gets a resource search order. TheResourceSearchOrderis supplied to aResourceSearchto specify the ordering of results.- Returns:
- the resource search order
- Compliance:
mandatory- This method must be implemented.
-
getResourcesBySearch
ResourceSearchResults getResourcesBySearch(ResourceQuery resourceQuery, ResourceSearch resourceSearch) throws OperationFailedException, PermissionDeniedException Gets the search results matching the given search query using the given search.- Parameters:
resourceQuery- the resource queryresourceSearch- the resource search- Returns:
- the resource search results
- Throws:
NullArgumentException-resourceQueryorresourceSearchisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-resourceQueryorresourceSearchis not of this service- Compliance:
mandatory- This method must be implemented.
-
getResourceQueryFromInspector
Gets a resource query from an inspector. The inspector is available from aResourceSearchResults.- Parameters:
resourceQueryInspector- a resource query inspector- Returns:
- the resource query
- Throws:
NullArgumentException-resourceQueryInspectorisnullUnsupportedException-resourceQueryInspectoris not of this service- Compliance:
mandatory- This method must be implemented.
-