OSID Logo
OSID Specifications
voting package
Version 3.0.0
Interfaceosid.voting.VotingSession
Implementsosid.OsidSession
Implemented Byosid.voting.batch.VotingBatchSession
Used Byosid.voting.VotingManager
osid.voting.VotingProxyManager
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.

Returnbooleantrue 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.

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

Gets a race.

Parametersosid.id.IdraceIdId of the Race
Returnosid.voting.Racethe race
ErrorsNOT_FOUNDraceId not found
NULL_ARGUMENTraceId 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.IdballotIdId of the Ballot
Returnosid.voting.RaceListthe races
ErrorsNOT_FOUNDballotId not found
NULL_ARGUMENTballotId 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.IdballotIdId of the Ballot
Returnosid.voting.RaceListthe uncast races
ErrorsNOT_FOUNDballotId not found
NULL_ARGUMENTballotId 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
Returnbooleantrue if Vote creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENTballotId or voteRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetVotingAllocation
Description

Gets the voter allocation for a race.

Parametersosid.id.IdraceIdId of the Race
Returnosid.voting.VoterAllocationthe allocation
ErrorsNOT_FOUNDraceId not found
NULL_ARGUMENTraceId 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.IdraceIdId of the Race
osid.id.IdcandidateIda candidate
osid.type.Type[]voteRecordTypesarray of vote record types
Returnosid.voting.VoteFormthe race
ErrorsNOT_FOUNDraceId or candidateId not found
NULL_ARGUMENTraceId, 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_STATEvoteForm already used in a voting transaction
INVALID_ARGUMENTform is invalid
NULL_ARGUMENTvoteForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDvoteForm 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_FOUNDballotId is not found
NULL_ARGUMENTballotId 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_FOUNDraceId is not found
NULL_ARGUMENTraceId 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
Returnbooleantrue if changing a vote is permitted, false otherwise
ErrorsNOT_FOUNDballotId is not found
NULL_ARGUMENTballotId 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_STATEcanRevote() is false
NOT_FOUNDvoteId is not found
NULL_ARGUMENTvoteId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.