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

This session votes in bulk. The data for create and update is provided by the consumer via the form object. OsidForms are requested for eachupdate and may not be reused.

Create and update operations differ in their usage. To create a Vote, a VoteForm is requested using getVoteForms() specifying the desired race, candidate, and record Types or none if no record Types are needed. Each of the returned VoteForms will indicate that it is to be used with a create operation and can be used to examine metdata or validate data prior to creation. Once a VoteForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each VoteForm corresponds to an attempted transaction.

The VoteForms returned from getVoteForms() may be linked to the originating request through the peer Ids of the VoteForm. In the case where there may be duplicates, any VoteForm of the same peer Ids may be used for a create operation.

Once a batch of VoteForms are submitted for create, a CreateResponse is returned for each VoteForm, although the ordering is not defined. Only errors that pertain to the entire create operation are returned from castVotes() errors specific to an individual VoteForm are indicated in the corresponding CreateResponse. CreateResponses may be linked to the originating VoteForm through the VoteForm Id .

The delete operations delete Votes in bulk. Bulk delete operations return the results in DeleteResponses.

MethodgetVoteForms
Description

Gets the vote forms for casting a bunch of new votes. A vote form is returned for each supplied race and candidate pair.

Parametersosid.voting.batch.VotePeerListpeersthe vote peers
osid.type.Type[]voteRecordTypesarray of vote record types to be included in each create operation or an empty list if none
Returnosid.voting.batch.VoteBatchFormListthe vote forms
ErrorsNOT_FOUNDa raceId or candidateId is not found
NULL_ARGUMENT peers or voteRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to request forms with given record types
CompliancemandatoryThis method must be implemented.
MethodcastVotes
Description

Creates a new set of Votes. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in the BatchCreateResponse .

Parametersosid.voting.batch.VoteBatchFormListvoteFormsthe vote forms
Returnosid.transaction.batch.CreateResponseListthe create responses
ErrorsNULL_ARGUMENT voteForms is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteAllVotes
Description

Deletes all Votes in this Polls .

Returnosid.transaction.batch.DeleteResponseListthe delete responses
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteVotes
Description

Deletes votes for the given Ids.

Parametersosid.id.IdListvoteIdsthe Ids of the votes to delete
Returnosid.transaction.batch.DeleteResponseListthe delete responses
ErrorsNULL_ARGUMENT voteIds is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteVotesForRace
Description

Deletes votes for the given race.

Parametersosid.id.IdraceIdthe Ids of a race
Returnosid.transaction.batch.DeleteResponseListthe delete responses
ErrorsNULL_ARGUMENT raceId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteVotesForVoter
Description

Deletes votes cast by a voter.

Parametersosid.id.IdresourceIdthe Ids of a resource
Returnosid.transaction.batch.DeleteResponseListthe delete responses
ErrorsNULL_ARGUMENT resourceId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteVotesForBallot
Description

Deletes all votes for all races on a ballot.

Parametersosid.id.IdballotIdthe Ids of a ballot
Returnosid.transaction.batch.DeleteResponseListthe delete responses
ErrorsNULL_ARGUMENT ballotId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteIneffectiveVotesByDate
Description

Deletes votes ineffective before the given date.

Parametersosid.calendaring.DateTimedatea date
Returnosid.transaction.batch.DeleteResponseListthe delete responses
ErrorsNULL_ARGUMENT date is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodaliasVotes
Description

Adds an Id to a Vote for the purpose of creating compatibility. The primary Id of the Vote is determined by the provider. The new Id is an alias to the primary Id. If the alias is a pointer to another vote, it is reassigned to the given vote Id.

Parametersosid.transaction.batch.AliasRequestListaliasRequeststhe alias requests
Returnosid.transaction.batch.AliasResponseListthe alias responses
ErrorsNULL_ARGUMENT aliasRequests is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.