Interface CandidateSearchSession
- All Superinterfaces:
AutoCloseable, CandidateQuerySession, Closeable, OsidSession, OsidSession
This session provides methods for searching among Candidate
objects. The search query is constructed using the CandidateQuery
.
getCandidatesByQuery() is the basic search method and returns a
list of Candidates . A more advanced search may be performed with
getCandidatesBySearch() .It accepts an CandidateSearch in
addition to the query for the purpose of specifying additional options
affecting the entire search, such as ordering.
getCandidatesBySearch() returns an CandidateSearchResults that
can be used to access the resulting CandidateList or be used to
perform a search within the result set through CandidateList .
This session defines views that offer differing behaviors for searching.
- federated polls view: searches include candidates in polls of which this polls is a ancestor in the polls hierarchy
- isolated polls view: searches are restricted to candidates in this polls
Candidates may have a candidiate query record indicated by their
respective record types. The candidiate query record is accessed via the
CandidateQuery .
-
Method Summary
Modifier and TypeMethodDescriptiongetCandidateQueryFromInspector(CandidateQueryInspector candidateQueryInspector) Gets a candidate query from an inspector.getCandidatesBySearch(CandidateQuery candidateQuery, CandidateSearch candidateSearch) Gets the search results matching the given search query using the given search.Gets a candidate search.Gets a candidate search order.Methods inherited from interface CandidateQuerySession
canSearchCandidates, getCandidateQuery, getCandidatesByQuery, getPolls, getPollsId, useFederatedPollsView, useIsolatedPollsViewModifier and TypeMethodDescriptionbooleanTests if this user can performCandidatesearches.Gets a candidate query.getCandidatesByQuery(CandidateQuery candidateQuery) Gets a list ofCandidatesmatching the given candidate query.getPolls()Gets thePollsassociated with this session.Gets thePollsIdassociated with this session.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.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.
-
Method Details
-
getCandidateSearch
CandidateSearch getCandidateSearch()Gets a candidate search.- Returns:
- the candidate search
- Compliance:
mandatory- This method must be implemented.
-
getCandidateSearchOrder
CandidateSearchOrder getCandidateSearchOrder()Gets a candidate search order. TheCandidateSearchOrderis supplied to aCandidateSearchto specify the ordering of results.- Returns:
- the candidate search order
- Compliance:
mandatory- This method must be implemented.
-
getCandidatesBySearch
CandidateSearchResults getCandidatesBySearch(CandidateQuery candidateQuery, CandidateSearch candidateSearch) throws OperationFailedException, PermissionDeniedException Gets the search results matching the given search query using the given search.- Parameters:
candidateQuery- the candidate querycandidateSearch- the candidate search- Returns:
- the returned search results
- Throws:
NullArgumentException-candidateQueryorcandidateSearchisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-candidateQueryorcandidateSearchis not of this service- Compliance:
mandatory- This method must be implemented.
-
getCandidateQueryFromInspector
Gets a candidate query from an inspector. The inspector is available from aCandidateSearchResults.- Parameters:
candidateQueryInspector- a candidate query inspector- Returns:
- the candidate query
- Throws:
NullArgumentException-candidateQueryInspectorisnullUnsupportedException-candidateQueryInspectoris not of this service- Compliance:
mandatory- This method must be implemented.
-