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

This session provides methods for voting on a 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
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodisOpen
Description

Tests if this ballot is open.

Returnboolean true if the ballot is open, false otherwise
CompliancemandatoryThis method must be implemented.
MethodcanVote
Description

Tests if this user can vote. 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 relationship operations.

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

Gets a race.

Parametersosid.id.IdraceId Id of the Race
Returnosid.voting.Racethe race
ErrorsNOT_FOUND raceId not found
NULL_ARGUMENT raceId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method is must be implemented.
MethodgetRacesForBallot
Description

Gets all Races on this ballot.

Parametersosid.id.IdballotId Id of the Ballot
Returnosid.voting.RaceListthe races
ErrorsNOT_FOUND ballotId not found
NULL_ARGUMENT ballotId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetMyUncastRacesForBallot
Description

Gets all Races on this ballot for which a vote has not been cast.

Parametersosid.id.IdballotId Id of the Ballot
Returnosid.voting.RaceListthe uncast races
ErrorsNOT_FOUND ballotId not found
NULL_ARGUMENT ballotId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanVoteWithRecordTypes
Description

Tests if this user can create a single Vote using the desired record interface types. While VotingManager.getVoteRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Vote. Providing an empty array tests if an Vote can be created with no records.

Parametersosid.id.IdraceIda race Id
osid.type.Type[]voteRecordTypesarray of vote record types
Returnboolean true if Vote creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT ballotId or voteRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetVotingAllocation
Description

Gets the voter allocation for a race.

Parametersosid.id.IdraceId Id of the Race
Returnosid.voting.VoterAllocationthe allocation
ErrorsNOT_FOUND raceId not found
NULL_ARGUMENT raceId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method is must be implemented.
MethodgetVoteForm
Description

Gets a vote form for a race.

Parametersosid.id.IdraceId Id of the Race
osid.id.IdcandidateIda candidate
osid.type.Type[]voteRecordTypesarray of vote record types
Returnosid.voting.VoteFormthe race
ErrorsNOT_FOUND raceId or candidateId not found
NULL_ARGUMENT raceId, candidateId, or voteRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDcannot get form with requested record types
CompliancemandatoryThis method is must be implemented.
Methodvote
Description

Votes for a candidate in a race.

Parametersosid.voting.VoteFormvoteFormthe vote form
Returnosid.voting.Votethe vote
ErrorsILLEGAL_STATE voteForm already used in a voting transaction
INVALID_ARGUMENTform is invalid
NULL_ARGUMENT voteForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED voteForm did not originate from getVoteForm()
CompliancemandatoryThis method must be implemented.
MethodgetMyVotesForBallot
Description

Gets all my Votes cast on a ballot.

Parametersosid.id.IdballotIda ballot
Returnosid.voting.VoteListthe votes
ErrorsNOT_FOUND ballotId is not found
NULL_ARGUMENT ballotId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetMyVotesForRace
Description

Gets all my Votes cast on this ballot for the given race.

Parametersosid.id.IdraceIda race
Returnosid.voting.VoteListthe votes
ErrorsNOT_FOUND raceId is not found
NULL_ARGUMENT raceId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanRevote
Description

Tests if this user can change a vote by deleting a vote and voting again.

Parametersosid.id.IdballotIda ballot
Returnboolean true if changing a vote is permitted, false otherwise
ErrorsNOT_FOUND ballotId is not found
NULL_ARGUMENT ballotId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteMyVote
Description

Deletes a vote in a race.

Parametersosid.id.IdvoteIda vote
ErrorsILLEGAL_STATE canRevote() is false
NOT_FOUND voteId is not found
NULL_ARGUMENT voteId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.