Interface ForumAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
ForumBatchAdminSession
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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasForum(Id forumId, Id aliasId) Adds anIdto aForumfor the purpose of creating compatibility.booleanTests if this user can createForums.booleancanCreateForumWithRecordTypes(Type[] forumRecordTypes) Tests if this user can create a singleForumusing the desired record types.booleanTests if this user can deleteForumsA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forForums.booleanTests if this user can updateForums.createForum(ForumForm forumForm) Creates a newForum.voiddeleteForum(Id forumId) Deletes aForum.getForumFormForCreate(Type[] forumRecordTypes) Gets the forum form for creating new forums.getForumFormForUpdate(Id forumId) Gets the forum form for updating an existing forum.voidupdateForum(ForumForm forumForm) Updates an existing forum.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
canCreateForums
boolean canCreateForums()Tests if this user can createForums. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aForumwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifForumcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateForumWithRecordTypes
Tests if this user can create a singleForumusing the desired record types. WhileForumManager.getForumRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificForum. Providing an empty array tests if aForumcan be created with no records.- Parameters:
forumRecordTypes- array of forum record types- Returns:
trueifForumcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-forumRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getForumFormForCreate
ForumForm getForumFormForCreate(Type[] forumRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the forum form for creating new forums. A new form should be requested for each create transaction.- Parameters:
forumRecordTypes- array of forum record types- Returns:
- the forum form
- Throws:
NullArgumentException-forumRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createForum
Creates a newForum.- Parameters:
forumForm- the form for thisForum- Returns:
- the new
Forum - Throws:
IllegalStateException-forumFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-forumFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-forumFormdid not originate fromgetForumFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateForums
boolean canUpdateForums()Tests if this user can updateForums. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aForumwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifForummodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getForumFormForUpdate
ForumForm getForumFormForUpdate(Id forumId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the forum form for updating an existing forum. A new forum form should be requested for each update transaction.- Parameters:
forumId- theIdof theForum- Returns:
- the forum form
- Throws:
NotFoundException-forumIdis not foundNullArgumentException-forumIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateForum
Updates an existing forum.- Parameters:
forumForm- the form containing the elements to be updated- Throws:
IllegalStateException-forumFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-forumFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-forumFormdid not originate fromgetForumFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteForums
boolean canDeleteForums()Tests if this user can deleteForumsA return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aForumwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifForumdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteForum
void deleteForum(Id forumId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aForum.- Parameters:
forumId- theIdof theForumto remove- Throws:
NotFoundException-forumIdnot foundNullArgumentException-forumIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageForumAliases
boolean canManageForumAliases()Tests if this user can manageIdaliases forForums. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifForumaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasForum
void aliasForum(Id forumId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aForumfor the purpose of creating compatibility. The primaryIdof theForumis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another forum, it is reassigned to the given forumId.- Parameters:
forumId- theIdof aForumaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-forumIdnot foundNullArgumentException-forumIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-