public interface ForumAdminSession extends OsidSession
This session creates, updates, and deletes Forums.
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
Forum,
a ForumForm
is requested using
getForumFormForCreate()
specifying the desired record Types
or none if no record Types
are needed. The returned
ForumForm
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 ForumForm
is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each ForumForm
corresponds to an attempted transaction.
For updates, ForumForms
are requested to the
Forum
Id
that is to be updated using
getForumFormForUpdate().
Similarly, the ForumForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The ForumForm
can
only be used once for a successful update and cannot be reused.
The delete operations delete Forums.
This session includes an Id
aliasing mechanism to
assign an external Id
to an internally assigned Id.
Modifier and Type | Method and Description |
---|---|
void |
aliasForum(Id forumId,
Id aliasId)
Adds an
Id to a Forum for the purpose of
creating compatibility. |
boolean |
canCreateForums()
Tests if this user can create
Forums. |
boolean |
canCreateForumWithRecordTypes(Type[] forumRecordTypes)
Tests if this user can create a single
Forum using the
desired record types. |
boolean |
canDeleteForums()
Tests if this user can delete
Forums A return of true
does not guarantee successful authorization. |
boolean |
canManageForumAliases()
Tests if this user can manage
Id aliases for
Forums. |
boolean |
canUpdateForums()
Tests if this user can update
Forums. |
Forum |
createForum(ForumForm forumForm)
Creates a new
Forum. |
void |
deleteForum(Id forumId)
Deletes a
Forum. |
ForumForm |
getForumFormForCreate(Type[] forumRecordTypes)
Gets the forum form for creating new forums.
|
ForumForm |
getForumFormForUpdate(Id forumId)
Gets the forum form for updating an existing forum.
|
void |
updateForum(ForumForm forumForm)
Updates an existing forum.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
boolean canCreateForums()
Forums.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating a Forum
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. false
if Forum
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateForumWithRecordTypes(Type[] forumRecordTypes)
Forum
using the
desired record types. While ForumManager.getForumRecordTypes()
can be used to examine which records are supported, this
method tests which record(s) are required for creating a specific
Forum.
Providing an empty array tests if a Forum
can be created with no records.forumRecordTypes
- array of forum record types true
if Forum
creation using the
specified record Types
is supported,
false
otherwiseNullArgumentException
- forumRecordTypes
is null
mandatory
- This method must be implemented. ForumForm getForumFormForCreate(Type[] forumRecordTypes) throws OperationFailedException, PermissionDeniedException
forumRecordTypes
- array of forum record typesNullArgumentException
- forumRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Forum createForum(ForumForm forumForm) throws OperationFailedException, PermissionDeniedException
Forum.
forumForm
- the form for this Forum
Forum
IllegalStateException
- forumForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- forumForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- forumForm
did not
originate from getForumFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateForums()
Forums.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Forum
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. false
if Forum
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. ForumForm getForumFormForUpdate(Id forumId) throws NotFoundException, OperationFailedException, PermissionDeniedException
forumId
- the Id
of the Forum
NotFoundException
- forumId
is not foundNullArgumentException
- forumId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateForum(ForumForm forumForm) throws OperationFailedException, PermissionDeniedException
forumForm
- the form containing the elements to be updatedIllegalStateException
- forumForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- forumForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- forumForm
did not
originate from getForumFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteForums()
Forums
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting a Forum
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. false
if Forum
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteForum(Id forumId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Forum.
forumId
- the Id
of the Forum
to
removeNotFoundException
- forumId
not foundNullArgumentException
- forumId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageForumAliases()
Id
aliases for
Forums.
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. false
if Forum
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasForum(Id forumId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Forum
for the purpose of
creating compatibility. The primary Id
of the
Forum
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the alias is
a pointer to another forum, it is reassigned to the given forum
Id.
forumId
- the Id
of a Forum
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- forumId
not foundNullArgumentException
- forumId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.