OSID Logo
OSID Specifications
blogging package
Version 3.0.0
Release Candidate Preview
Interfaceosid.blogging.BlogAdminSession
Implementsosid.OsidSession
Description

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

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

The delete operations delete Blogs. This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

MethodcanCreateBlogs
Description

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

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

Parametersosid.type.Type[]blogRecordTypesarray of blog record types
Returnboolean true if Blog creation using the specified Types is supported, false otherwise
ErrorsNULL_ARGUMENT blogRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetBlogFormForCreate
Description

Gets the blog form for creating new blogs.

Parametersosid.type.Type[]blogRecordTypesarray of blog record types
Returnosid.blogging.BlogFormthe blog form
ErrorsNULL_ARGUMENT blogRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateBlog
Description

Creates a new Blog.

Parametersosid.blogging.BlogFormblogFormthe forms for this Blog
Returnosid.blogging.Blogthe new Blog
ErrorsILLEGAL_STATE blogForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT blogForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED blogForm did not originate from getBlogFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateBlogs
Description

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

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

Parametersosid.id.IdblogIdthe Id of the Blog
Returnosid.blogging.BlogFormthe blog form
ErrorsNOT_FOUND blogId is not found
NULL_ARGUMENT blogId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateBlog
Description

Updates an existing blog.

Parametersosid.blogging.BlogFormblogFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE blogForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT blogId or blogForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED blogForm did not originate from getBlogFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteBlogs
Description

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

Deletes a Blog.

Parametersosid.id.IdblogIdthe Id of the Blog to remove
ErrorsNOT_FOUND blogId not found
NULL_ARGUMENT blogId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageBlogAliases
Description

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

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

Parametersosid.id.IdblogIdthe Id of a Blog
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is in use as a primary Id
NOT_FOUND blogId not found
NULL_ARGUMENT blogId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.