OSID Logo
OSID Specifications
voting package
Version 3.0.0
Release Candidate Preview
Interfaceosid.voting.CandidateLookupSession
Implementsosid.OsidSession
Description

This session defines methods for retrieving candidates. A Candidate is an arbitrary entity that may represent a person, place or thing used to identify an object used in various services.

This lookup session defines several views:

  • comparative view: elements may be silently omitted or re-ordered
  • plenary view: provides a complete result set or is an error condition
  • isolated polls view: All candidate methods in this session operate, retrieve and pertain to candidates defined explicitly in the current polls. Using an isolated view is useful for managing Candidates with the CandidateAdminSession.
  • federated polls view: All candidate methods in this session operate, retrieve and pertain to all candidates defined in this polls and any other candidates implicitly available in this polls through polls inheritence.
  • effective candidate view: All candidate lookup methods return candidates where the current date falls in between the effective dates inclusive.
  • any effective candidate view: Candidates of any effective date are returned from methods.

The methods useFederatedPollsView() and useIsolatedPollsView() behave as a radio group and one should be selected before invoking any lookup methods.

Candidates may have an additional records indicated by their respective record types. The record may not be accessed through a cast of the Candidate.

MethodgetPollsId
Description

Gets the Polls Id associated with this session.

Returnosid.id.Idthe Polls Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetPolls
Description

Gets the Polls associated with this session.

Returnosid.voting.Pollsthe Polls associated with this session
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanLookupCandidates
Description

Tests if this user can perform Candidate lookups. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations.

Returnboolean false if lookup methods are not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoduseComparativeCandidateView
Description

The returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error. This view is used when greater interoperability is desired at the expense of precision.

CompliancemandatoryThis method is must be implemented.
MethodusePlenaryCandidateView
Description

A complete view of the Candidate returns is desired. Methods will return what is requested or result in an error. This view is used when greater precision is desired at the expense of interoperability.

CompliancemandatoryThis method is must be implemented.
MethoduseFederatedPollsView
Description

Federates the view for methods in this session. A federated view will include candidates in polls which are children of this polls in the polls hierarchy.

CompliancemandatoryThis method is must be implemented.
MethoduseIsolatedPollsView
Description

Isolates the view for methods in this session. An isolated view restricts lookups to this polls only.

CompliancemandatoryThis method is must be implemented.
MethoduseEffectiveCandidateView
Description

Only candidates whose effective dates are current are returned by methods in this session.

CompliancemandatoryThis method is must be implemented.
MethoduseAnyEffectiveCandidateView
Description

All candidates of any effective dates are returned by methods in this session.

CompliancemandatoryThis method is must be implemented.
MethodgetCandidate
Description

Gets the Candidate specified by its Id.

In plenary mode, the exact Id is found or a NOT_FOUND results. Otherwise, the returned Candidate may have a different Id than requested, such as the case where a duplicate Id was assigned to a Candidate and retained for compatibility.

In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.

Parametersosid.id.IdcandidateIdthe Id of the Candidate to retrieve
Returnosid.voting.Candidatethe returned Candidate
ErrorsNOT_FOUNDno Candidate found with the given Id
NULL_ARGUMENT candidateId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetCandidatesByIds
Description

Gets a CandidateList corresponding to the given IdList.

In plenary mode, the returned list contains all of the candidates specified in the Id list, in the order of the list, including duplicates, or an error results if an Id in the supplied list is not found or inaccessible. Otherwise, inaccessible Candidates may be omitted from the list and may present the elements in any order including returning a unique set.

In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.

Parametersosid.id.IdListcandidateIdsthe list of Ids to retrieve
Returnosid.voting.CandidateListthe returned Candidate list
ErrorsNOT_FOUNDan Id was not found
NULL_ARGUMENT candidateIds is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetCandidatesByGenusType
Description

Gets a CandidateList corresponding to the given candidate genus Type which does not include candidates of types derived from the specified Type.

In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those candidates that are accessible through this session.

In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.

Parametersosid.type.TypecandidateGenusTypea candidate genus type
Returnosid.voting.CandidateListthe returned Candidate list
ErrorsNULL_ARGUMENT candidateGenusType is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetCandidatesByParentGenusType
Description

Gets a CandidateList corresponding to the given candidate genus Type and include any additional candidates with genus types derived from the specified Type.

In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those candidates that are accessible through this session.

In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.

Parametersosid.type.TypecandidateGenusTypea candidate genus type
Returnosid.voting.CandidateListthe returned Candidate list
ErrorsNULL_ARGUMENT candidateGenusType is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetCandidatesByRecordType
Description

Gets a CandidateList containing the given candidate record Type.

In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those candidates that are accessible through this session.

In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.

Parametersosid.type.TypecandidateRecordTypea candidate record type
Returnosid.voting.CandidateListthe returned Candidate list
ErrorsNULL_ARGUMENT candidateRecordType is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetCandidatesOnDate
Description

Gets a list of candidates effective during the entire given date range inclusive but not confined to the date range.

In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those availabilities that are accessible through this session.

In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.

Parametersosid.calendaring.DateTimefromstart of date range
osid.calendaring.DateTimetoend of date range
Returnosid.voting.CandidateListthe returned Candidate list
ErrorsINVALID_ARGUMENT from is greater than to
NULL_ARGUMENT from or to is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetCandidatesForRace
Description

Gets a CandidateList in the given race.

In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those candidates that are accessible through this session.

In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.

Parametersosid.id.IdraceIda race Id
Returnosid.voting.CandidateListthe returned Candidate list
ErrorsNULL_ARGUMENT raceId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetCandidatesForRaceOnDate
Description

Gets a list of candidates for the given race effective during the entire given date range inclusive but not confined to the date range.

In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those availabilities that are accessible through this session.

In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.

Parametersosid.id.IdraceIda race Id
osid.calendaring.DateTimefromstart of date range
osid.calendaring.DateTimetoend of date range
Returnosid.voting.CandidateListthe returned Candidate list
ErrorsINVALID_ARGUMENT from is greater than to
NULL_ARGUMENT raceId, from or to is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetCandidatesForResource
Description

Gets a CandidateList associated with the given resource.

In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those candidates that are accessible through this session.

In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.

Parametersosid.id.IdresourceIda resource Id
Returnosid.voting.CandidateListthe returned Candidate list
ErrorsNULL_ARGUMENT resourceId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetCandidatesForResourceOnDate
Description

Gets a list of candidates for the given resource effective during the entire given date range inclusive but not confined to the date range.

In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those availabilities that are accessible through this session.

In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.

Parametersosid.id.IdresourceIda resource Id
osid.calendaring.DateTimefromstart of date range
osid.calendaring.DateTimetoend of date range
Returnosid.voting.CandidateListthe returned Candidate list
ErrorsINVALID_ARGUMENT from is greater than to
NULL_ARGUMENT resourceId, from or to is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetCandidatesForRaceAndResource
Description

Gets a CandidateList in the given race and resource.

In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those candidates that are accessible through this session.

In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.

Parametersosid.id.IdraceIda race Id
osid.id.IdresourceIda resource Id
Returnosid.voting.CandidateListthe returned Candidate list
ErrorsNULL_ARGUMENT raceId or resourceId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetCandidatesForRaceAndResourceOnDate
Description

Gets a list of candidates for the given race and resource effective during the entire given date range inclusive but not confined to the date range.

In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those availabilities that are accessible through this session.

In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.

Parametersosid.id.IdraceIda race Id
osid.id.IdresourceIda resource Id
osid.calendaring.DateTimefromstart of date range
osid.calendaring.DateTimetoend of date range
Returnosid.voting.CandidateListthe returned Candidate list
ErrorsINVALID_ARGUMENT from is greater than to
NULL_ARGUMENT raceId, resourceId, from, or to is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetCandidates
Description

Gets all Candidates.

In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those candidates that are accessible through this session.

In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.

Returnosid.voting.CandidateLista list of Candidates
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.