OSID Logo
OSID Specifications
forum package
Version 3.0.0
Release Candidate Preview
Interfaceosid.forum.PostAdminSession
Implementsosid.OsidSession
Description

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

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

The delete operations delete Posts. To unmap a Post from the current Forum, the PostForumAssignmentSession should be used. These delete operations attempt to remove the Post itself thus removing it from all known Forum catalogs.

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

MethodgetForumId
Description

Gets the Forum Id associated with this session.

Returnosid.id.Idthe Forum Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetForum
Description

Gets the Forum associated with this session.

Returnosid.forum.Forumthe forum
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreatePosts
Description

Tests if this user can create Posts. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Post 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 Post creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreatePostWithRecordTypes
Description

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

Parametersosid.type.Type[]postRecordTypesarray of post record types
Returnboolean true if Post creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT postRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetPostFormForCreate
Description

Gets the post form for creating new posts. A new form should be requested for each create transaction.

Parametersosid.type.Type[]postRecordTypesarray of post record types
Returnosid.forum.PostFormthe post form
ErrorsNULL_ARGUMENT postRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreatePost
Description

Creates a new Post.

Parametersosid.forum.PostFormpostFormthe form for this Post
Returnosid.forum.Postthe new Post
ErrorsILLEGAL_STATE postForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT postForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED postForm did not originate from getPostFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdatePosts
Description

Tests if this user can update Posts. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Post 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 Post modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetPostFormForUpdate
Description

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

Parametersosid.id.IdpostIdthe Id of the Post
Returnosid.forum.PostFormthe post form
ErrorsNOT_FOUND postId is not found
NULL_ARGUMENT postId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdatePost
Description

Updates an existing post.

Parametersosid.forum.PostFormpostFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE postForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT postForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED postForm did not originate from getPostFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeletePosts
Description

Tests if this user can delete Posts A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Post 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 Post deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeletePost
Description

Deletes a Post.

Parametersosid.id.IdpostIdthe Id of the Post to remove
ErrorsNOT_FOUND postId not found
NULL_ARGUMENT postId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManagePostAliases
Description

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

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

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