Interface BlogAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
BlogBatchAdminSession

public interface BlogAdminSession extends OsidSession

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.

  • Method Details

    • canCreateBlogs

      boolean canCreateBlogs()
      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.
      Returns:
      false if Blog creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateBlogWithRecordTypes

      boolean canCreateBlogWithRecordTypes(Type[] blogRecordTypes)
      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.
      Parameters:
      blogRecordTypes - array of blog record types
      Returns:
      true if Blog creation using the specified Types is supported, false otherwise
      Throws:
      NullArgumentException - blogRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getBlogFormForCreate

      BlogForm getBlogFormForCreate(Type[] blogRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the blog form for creating new blogs.
      Parameters:
      blogRecordTypes - array of blog record types
      Returns:
      the blog form
      Throws:
      NullArgumentException - blogRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createBlog

      Creates a new Blog .
      Parameters:
      blogForm - the forms for this Blog
      Returns:
      the new Blog
      Throws:
      IllegalStateException - blogForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - blogForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - blogForm did not originate from getBlogFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateBlogs

      boolean canUpdateBlogs()
      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.
      Returns:
      false if Blog modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getBlogFormForUpdate

      Gets the blog form for updating an existing blog. A new blog form should be requested for each update transaction.
      Parameters:
      blogId - the Id of the Blog
      Returns:
      the blog form
      Throws:
      NotFoundException - blogId is not found
      NullArgumentException - blogId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateBlog

      void updateBlog(BlogForm blogForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing blog.
      Parameters:
      blogForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - blogForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - blogId or blogForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - blogForm did not originate from getBlogFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteBlogs

      boolean canDeleteBlogs()
      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.
      Returns:
      false if Blog deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteBlog

      Deletes a Blog .
      Parameters:
      blogId - the Id of the Blog to remove
      Throws:
      NotFoundException - blogId not found
      NullArgumentException - blogId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageBlogAliases

      boolean canManageBlogAliases()
      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.
      Returns:
      false if Blog aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasBlog

      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 .
      Parameters:
      blogId - the Id of a Blog
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is in use as a primary Id
      NotFoundException - blogId not found
      NullArgumentException - blogId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.