OSID Logo
OSID Specifications
voting rules package
Version 3.0.0
Interfaceosid.voting.rules.VoteEnablerAdminSession
Implementsosid.OsidSession
Used Byosid.voting.rules.VotingRulesManager
osid.voting.rules.VotingRulesProxyManager
Description

This session creates, updates, and deletes VoteEnablers . The data for create and update is provided by the consumer via the form object. OsidForms are requested for each create or update and may not be reused.

Create and update operations differ in their usage. To create a VoteEnabler , a VoteEnablerForm is requested using getVoteEnablerFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned VoteEnablerForm 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 the VoteEnablerForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each VoteEnablerForm corresponds to an attempted transaction.

For updates, VoteEnablerForms are requested to the VoteEnabler Id that is to be updated using getVoteEnablerFormForUpdate() . Similarly, the VoteEnablerForm has metadata about the data that can be updated and it can perform validation before submitting the update. The VoteEnablerForm can only be used once for a successful update and cannot be reused.

The delete operations delete VoteEnablers . To unmap a VoteEnabler from the current Polls , the VoteEnablerPollsAssignmentSession should be used. These delete operations attempt to remove the VoteEnabler itself thus removing it from all known Polls catalogs.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id .

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

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

Returnbooleanfalse if VoteEnabler creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateVoteEnablerWithRecordTypes
Description

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

Parametersosid.type.Type[]voteEnablerRecordTypesarray of vote enabler record types
Returnbooleantrue if VoteEnabler creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENTvoteEnablerRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetVoteEnablerFormForCreate
Description

Gets the vote enabler form for creating new vote enablers. A new form should be requested for each create transaction.

Parametersosid.type.Type[]voteEnablerRecordTypesarray of vote enabler record types
Returnosid.voting.rules.VoteEnablerFormthe vote enabler form
ErrorsNULL_ARGUMENTvoteEnablerRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateVoteEnabler
Description

Creates a new VoteEnabler .

Parametersosid.voting.rules.VoteEnablerFormvoteEnablerFormthe form for this VoteEnabler
Returnosid.voting.rules.VoteEnablerthe new VoteEnabler
ErrorsILLEGAL_STATEvoteEnablerForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENTvoteEnablerForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDvoteEnablerForm did not originate from getVoteEnablerFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateVoteEnablers
Description

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

Returnbooleanfalse if VoteEnabler modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetVoteEnablerFormForUpdate
Description

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

Parametersosid.id.IdvoteEnablerIdthe Id of the VoteEnabler
Returnosid.voting.rules.VoteEnablerFormthe vote enabler form
ErrorsNOT_FOUNDvoteEnablerId is not found
NULL_ARGUMENTvoteEnablerId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateVoteEnabler
Description

Updates an existing vote enabler.

Parametersosid.voting.rules.VoteEnablerFormvoteEnablerFormthe form containing the elements to be updated
ErrorsILLEGAL_STATEvoteEnablerForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENTvoteEnablerForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDvoteEnablerForm did not originate from getVoteEnablerFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteVoteEnablers
Description

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

Returnbooleanfalse if VoteEnabler deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteVoteEnabler
Description

Deletes a VoteEnabler .

Parametersosid.id.IdvoteEnablerIdthe Id of the VoteEnabler to remove
ErrorsNOT_FOUNDvoteEnablerId not found
NULL_ARGUMENTvoteEnablerId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageVoteEnablerAliases
Description

Tests if this user can manage Id aliases for VoteEnablers 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.

Returnbooleanfalse if VoteEnabler aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasVoteEnabler
Description

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

Parametersosid.id.IdvoteEnablerIdthe Id of a VoteEnabler
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTSaliasId is already assigned
NOT_FOUNDvoteEnablerId not found
NULL_ARGUMENTvoteEnablerId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.