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

This session creates, updates, and deletes Polls. 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 Polls, a PollsForm is requested using getPollsFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned PollsForm 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 PollsForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each PollsForm corresponds to an attempted transaction.

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

The delete operations delete Polls.

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

MethodcanCreatePolls
Description

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

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

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

Parametersosid.type.Type[]pollsRecordTypesarray of polls record types
Returnboolean true if Polls creation using the specified Types is supported, false otherwise
ErrorsNULL_ARGUMENT pollsRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetPollsFormForCreate
Description

Gets the polls form for creating new polls.

Parametersosid.type.Type[]pollsRecordTypesarray of polls record types
Returnosid.voting.PollsFormthe polls form
ErrorsNULL_ARGUMENT pollsRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form with requested record types
CompliancemandatoryThis method must be implemented.
MethodcreatePolls
Description

Creates a new Polls.

Parametersosid.voting.PollsFormpollsFormthe form for this Polls
Returnosid.voting.Pollsthe new Polls
ErrorsILLEGAL_STATE pollsForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT pollsForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED pollsForm did not originate from getPollsFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdatePolls
Description

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

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

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

Parametersosid.id.IdpollsIdthe Id of the Polls
Returnosid.voting.PollsFormthe polls form
ErrorsNOT_FOUND pollsId is not found
NULL_ARGUMENT pollsId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdatePolls
Description

Updates an existing polls.

Parametersosid.voting.PollsFormpollsFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE pollsForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT pollsId or pollsForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED pollsForm did not originate from getPollsFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeletePolls
Description

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

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

Deletes a Polls.

Parametersosid.id.IdpollsIdthe Id of the Polls to remove
ErrorsNOT_FOUND pollsId not found
NULL_ARGUMENT pollsId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManagePollsAliases
Description

Tests if this user can manage Id aliases for Polls. 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 Polls aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasPolls
Description

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

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