OSID Logo
OSID Specifications
voting package
Version 3.0.0
Interfaceosid.voting.CandidatePollsAssignmentSession
Implementsosid.OsidSession
Used Byosid.voting.VotingManager
osid.voting.VotingProxyManager
Description

This session provides methods to re-assign Candidates to Polls . A Candidate may map to multiple Polls objects and removing the last reference to a Candidate is the equivalent of deleting it. Each Polls may have its own authorizations governing who is allowed to operate on it.

Moving or adding a reference of a Candidate to another Polls is not a copy operation (eg: does not change its Id ).

MethodcanAssignCandidates
Description

Tests if this user can alter candidate/polls mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping 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 assignment operations to unauthorized users.

Returnbooleanfalse if mapping is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanAssignCandidatesToPolls
Description

Tests if this user can alter candidate/polls mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping 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 assignment operations to unauthorized users.

Parametersosid.id.IdpollsIdthe Id of the Polls
Returnbooleanfalse if mapping is not authorized, true otherwise
ErrorsNULL_ARGUMENTpollsId is null
CompliancemandatoryThis method must be implemented.
MethodgetAssignablePollsIds
Description

Gets a list of polls including and under the given polls node in which any candidate can be assigned.

Parametersosid.id.IdpollsIdthe Id of the Polls
Returnosid.id.IdListlist of assignable polls Ids
ErrorsNULL_ARGUMENTpollsId is null
OPERATION_FAILEDunable to complete request
CompliancemandatoryThis method must be implemented.
MethodgetAssignablePollsIdsForCandidate
Description

Gets a list of polls including and under the given polls node in which a specific candidate can be assigned.

Parametersosid.id.IdpollsIdthe Id of the Polls
osid.id.IdcandidateIdthe Id of the Candidate
Returnosid.id.IdListlist of assignable polls Ids
ErrorsNULL_ARGUMENTpollsId or candidateId is null
OPERATION_FAILEDunable to complete request
CompliancemandatoryThis method must be implemented.
MethodassignCandidateToPolls
Description

Adds an existing Candidate to a Polls .

Parametersosid.id.IdcandidateIdthe Id of the Candidate
osid.id.IdpollsIdthe Id of the Polls
ErrorsALREADY_EXISTScandidateId is already assigned to pollsId
NOT_FOUNDcandidateId or pollsId not found
NULL_ARGUMENTcandidateId or pollsId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodunassignCandidateFromPolls
Description

Removes a Candidate from a Polls .

Parametersosid.id.IdcandidateIdthe Id of the Candidate
osid.id.IdpollsIdthe Id of the Polls
ErrorsNOT_FOUNDcandidateId or pollsId not found or candidateId not assigned to pollsId
NULL_ARGUMENTcandidateId or pollsId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodreassignCandidateToPolls
Description

Moves a Candidate from one Polls to another. Mappings to other Polls are unaffected.

Parametersosid.id.IdcandidateIdthe Id of the Candidate
osid.id.IdfromPollsIdthe Id of the current Polls
osid.id.IdtoPollsIdthe Id of the destination Polls
ErrorsALREADY_EXISTScandidateId already assigned to toPollsId
NOT_FOUNDcandidateId, fromPollsId , or toPollsId not found or candidateId not mapped to fromPollsId
NULL_ARGUMENTcandidateId, fromPollsId , or toPollsId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.