OSID Logo
OSID Specifications
voting package
Version 3.1.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.Id the Polls Id associated with this session
Compliancemandatory This method must be implemented.
MethodgetPolls
Description

Gets the Polls associated with this session.

Returnosid.voting.Polls the polls
ErrorsOPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodisOpen
Description

Tests if this ballot is open.

Returnboolean true if the ballot is open, false otherwise
Compliancemandatory This 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
Compliancemandatory This method must be implemented.
MethodgetRace
Description

Gets a race.

Parametersosid.id.IdraceId Id of the Race
Returnosid.voting.Race the race
ErrorsNOT_FOUND raceId not found
NULL_ARGUMENT raceId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method is must be implemented.
MethodgetRacesForBallot
Description

Gets all Races on this ballot.

Parametersosid.id.IdballotId Id of the Ballot
Returnosid.voting.RaceList the races
ErrorsNOT_FOUND ballotId not found
NULL_ARGUMENT ballotId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This 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.RaceList the uncast races
ErrorsNOT_FOUND ballotId not found
NULL_ARGUMENT ballotId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This 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.IdraceId a race Id
osid.type.Type[]voteRecordTypes array 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
Compliancemandatory This method must be implemented.
MethodgetVotingAllocation
Description

Gets the voter allocation for a race.

Parametersosid.id.IdraceId Id of the Race
Returnosid.voting.VoterAllocation the allocation
ErrorsNOT_FOUND raceId not found
NULL_ARGUMENT raceId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method is must be implemented.
MethodgetVoteForm
Description

Gets a vote form for a race.

Parametersosid.id.IdraceId Id of the Race
osid.id.IdcandidateId a candidate
osid.type.Type[]voteRecordTypes array of vote record types
Returnosid.voting.VoteForm the race
ErrorsNOT_FOUND raceId or candidateId not found
NULL_ARGUMENT raceId, candidateId, or voteRecordTypes is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED cannot get form with requested record types
Compliancemandatory This method is must be implemented.
Methodvote
Description

Votes for a candidate in a race.

Parametersosid.voting.VoteFormvoteForm the vote form
Returnosid.voting.Vote the vote
ErrorsILLEGAL_STATE voteForm already used in a voting transaction
INVALID_ARGUMENT form is invalid
NULL_ARGUMENT voteForm is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED voteForm did not originate from getVoteForm()
Compliancemandatory This method must be implemented.
MethodgetMyVotesForBallot
Description

Gets all my Votes cast on a ballot.

Parametersosid.id.IdballotId a ballot
Returnosid.voting.VoteList the votes
ErrorsNOT_FOUND ballotId is not found
NULL_ARGUMENT ballotId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodgetMyVotesForRace
Description

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

Parametersosid.id.IdraceId a race
Returnosid.voting.VoteList the votes
ErrorsNOT_FOUND raceId is not found
NULL_ARGUMENT raceId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcanRevote
Description

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

Parametersosid.id.IdballotId a ballot
Returnboolean true if changing a vote is permitted, false otherwise
ErrorsNOT_FOUND ballotId is not found
NULL_ARGUMENT ballotId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethoddeleteMyVote
Description

Deletes a vote in a race.

Parametersosid.id.IdvoteId a vote
ErrorsILLEGAL_STATE canRevote() is false
NOT_FOUND voteId is not found
NULL_ARGUMENT voteId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.