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

This session creates and removes ballot constrainers. The data for create and update is provided via the BallotConstrainerForm.

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.
MethodcanCreateBallotConstrainer
Description

Tests if this user can create ballot constrainers. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a BallotConstrainer will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.

Returnboolean false if BallotConstrainer creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateBallotConstrainerWithRecordTypes
Description

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

Parametersosid.type.Type[]ballotConstrainerRecordTypesarray of ballot constrainer record types
Returnboolean true if BallotConstrainer creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT ballotConstrainerRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetBallotConstrainerFormForCreate
Description

Gets the ballot constrainer form for creating new ballot constrainers. A new form should be requested for each create transaction.

Parametersosid.type.Type[]ballotConstrainerRecordTypesarray of ballot constrainer record types
Returnosid.voting.rules.BallotConstrainerFormthe ballot constrainer form
ErrorsNULL_ARGUMENT ballotConstrainerRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateBallotConstrainer
Description

Creates a new BallotConstrainer.

Parametersosid.voting.rules.BallotConstrainerFormballotConstrainerFormthe form for this BallotConstrainer
Returnosid.voting.rules.BallotConstrainerthe new BallotConstrainer
ErrorsILLEGAL_STATE ballotConstrainerForm already used for a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT ballotConstrainerForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED ballotConstrainerForm did not originate from getBallotConstrainerFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateBallotConstrainers
Description

Tests if this user can update ballot constrainers. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a BallotConstrainer will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.

Returnboolean false if BallotConstrainer modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetBallotConstrainerFormForUpdate
Description

Gets the ballot constrainer form for updating an existing ballot constrainer. A new ballot constrainer form should be requested for each update transaction.

Parametersosid.id.IdballotConstrainerIdthe Id of the BallotConstrainer
Returnosid.voting.rules.BallotConstrainerFormthe ballot constrainer form
ErrorsNOT_FOUND ballotConstrainerId is not found
NULL_ARGUMENT ballotConstrainerId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateBallotConstrainer
Description

Updates an existing ballot constrainer.

Parametersosid.voting.rules.BallotConstrainerFormballotConstrainerFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE ballotConstrainerForm already used for an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT ballotConstrainerForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED ballotConstrainerForm did not originate from getBallotConstrainerFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteBallotConstrainers
Description

Tests if this user can delete ballot constrainers. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a BallotConstrainer will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.

Returnboolean false if BallotConstrainer deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteBallotConstrainer
Description

Deletes a BallotConstrainer.

Parametersosid.id.IdballotConstrainerIdthe Id of the BallotConstrainer to remove
ErrorsNOT_FOUND ballotConstrainerId not found
NULL_ARGUMENT ballotConstrainerId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageBallotConstrainerAliases
Description

Tests if this user can manage Id aliases for ballot constrainers. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.

Returnboolean false if BallotConstrainer aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasBallotConstrainer
Description

Adds an Id to a BallotConstrainer for the purpose of creating compatibility. The primary Id of the BallotConstrainer is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another ballot constrainer. it is reassigned to the given ballot constrainer Id.

Parametersosid.id.IdballotConstrainerIdthe Id of a BallotConstrainer
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND ballotConstrainerId not found
NULL_ARGUMENT ballotConstrainerId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.