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

This session defines methods for retrieving ballots. A Ballot 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 ballot methods in this session operate, retrieve and pertain to ballots defined explicitly in the current polls. Using an isolated view is useful for managing Ballots with the BallotAdminSession.
  • federated polls view: All ballot methods in this session operate, retrieve and pertain to all ballots defined in this polls and any other ballots implicitly available in this polls through polls inheritence.
  • active ballot view: active ballots are returned from methods in this session
  • any status ballot view: active and inactive ballots are returned from methods in this session

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

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

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.
MethodcanLookupBallots
Description

Tests if this user can perform Ballot 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.
MethoduseComparativeBallotView
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.
MethodusePlenaryBallotView
Description

A complete view of the Ballot 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 ballots 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.
MethoduseActiveBallotView
Description

Only active ballots are returned from methods in this session.

CompliancemandatoryThis method is must be implemented.
MethoduseAnyStatusBallotView
Description

Borth active and inactive ballots are returned from methods in this session.

CompliancemandatoryThis method is must be implemented.
MethodgetBallot
Description

Gets the Ballot specified by its Id.

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

In active mode, ballots are returned that are currently active. In any status mode, active and inactive ballots are returned.

Parametersosid.id.IdballotIdthe Id of the Ballot to retrieve
Returnosid.voting.Ballotthe returned Ballot
ErrorsNOT_FOUNDno Ballot found with the given Id
NULL_ARGUMENT ballotId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetBallotsByIds
Description

Gets a BallotList corresponding to the given IdList.

In plenary mode, the returned list contains all of the ballots 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 Ballots may be omitted from the list and may present the elements in any order including returning a unique set.

In active mode, ballots are returned that are currently active. In any status mode, active and inactive ballots are returned.

Parametersosid.id.IdListballotIdsthe list of Ids to retrieve
Returnosid.voting.BallotListthe returned Ballot list
ErrorsNOT_FOUNDan Id was not found
NULL_ARGUMENT ballotIds is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetBallotsByGenusType
Description

Gets a BallotList corresponding to the given ballot genus Type which does not include ballot of types derived from the specified Type.

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

In active mode, ballots are returned that are currently active. In any status mode, active and inactive ballots are returned.

Parametersosid.type.TypeballotGenusTypea ballot genus type
Returnosid.voting.BallotListthe returned Ballot list
ErrorsNULL_ARGUMENT ballotGenusType is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetBallotsByParentGenusType
Description

Gets a BallotList corresponding to the given ballot genus Type and include any additional ballots with genus types derived from the specified Type.

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

In active mode, ballots are returned that are currently active. In any status mode, active and inactive ballots are returned.

Parametersosid.type.TypeballotGenusTypea ballot genus type
Returnosid.voting.BallotListthe returned Ballot list
ErrorsNULL_ARGUMENT ballotGenusType is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetBallotsByRecordType
Description

Gets a BallotList containing the given ballot record Type.

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

In active mode, ballots are returned that are currently active. In any status mode, active and inactive ballots are returned.

Parametersosid.type.TypeballotRecordTypea ballot record type
Returnosid.voting.BallotListthe returned Ballot list
ErrorsNULL_ARGUMENT ballotRecordType is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetBallotsByProvider
Description

Gets a BallotList from the given provider.

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

In active mode, ballots are returned that are currently active. In any status mode, active and inactive ballots are returned.

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

Gets a BallotList that are effective for the entire given date range but not confined to the date range.

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

In active mode, ballots are returned that are currently active. In any status mode, active and inactive ballots are returned.

Parametersosid.calendaring.DateTimefroms atsrting date
osid.calendaring.DateTimetoan ending date
Returnosid.voting.BallotListthe returned Ballot 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.
MethodgetBallots
Description

Gets all Ballots.

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

In active mode, ballots are returned that are currently active. In any status mode, active and inactive ballots are returned.

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