Interface ReplyAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
ReplyBatchAdminSession
This session creates, updates, and deletes Replies . 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
Reply , a ReplyForm is requested using
getReplyFormForCreate() specifying the desired post and record
Types or none if no record Types are needed. The returned
ReplyForm 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 ReplyForm is submiited to a create operation, it cannot be
reused with another create operation unless the first operation was
unsuccessful. Each ReplyForm corresponds to an attempted
transaction.
For updates, ReplyForms are requested to the Reply
Id that is to be updated using getReplyFormForUpdate() .
Similarly, the ReplyForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
ReplyForm can only be used once for a successful update and cannot
be reused.
The delete operations delete Replies . To unmap a
Reply from the current Forum , the
ReplyForumAssignmentSession should be used. These delete operations
attempt to remove the Reply 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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasReply(Id replyId, Id aliasId) Adds anIdto aReplyfor the purpose of creating compatibility.booleanTests if this user can create hournal entries.booleancanCreateReplyWithRecordTypes(Type[] replyRecordTypes) Tests if this user can create a singleReplyusing the desired record types.booleanTests if this user can delete replies.booleanTests if this user can manageIdaliases forComnents.booleanTests if this user can update replies.createReply(ReplyForm replyForm) Creates a newReply.voiddeleteReply(Id replyId) Deletes anReply.getForum()Gets theForumassociated with this session.Gets theForumIdassociated with this session.getReplyFormForCreateToPost(Id postId, Type[] replyRecordTypes) Gets the reply form for creating new replies to a post.getReplyFormForCreateToReply(Id replyId, Type[] replyRecordTypes) Gets the reply form for creating new replies to another reply.getReplyFormForUpdate(Id replyId) Gets the reply form for updating an existing reply.voidupdateReply(ReplyForm replyForm) Updates an existing reply.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
-
getForumId
Id getForumId()Gets theForumIdassociated with this session.- Returns:
- the
Forum Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getForum
Gets theForumassociated with this session.- Returns:
- the forum
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateReplies
boolean canCreateReplies()Tests if this user can create hournal entries. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aReplywill 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:
falseifReplycreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateReplyWithRecordTypes
Tests if this user can create a singleReplyusing the desired record types. WhileForumManager.getReplyRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificReply. Providing an empty array tests if aReplycan be created with no records.- Parameters:
replyRecordTypes- array of reply record types- Returns:
trueifReplycreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-replyRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getReplyFormForCreateToPost
ReplyForm getReplyFormForCreateToPost(Id postId, Type[] replyRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the reply form for creating new replies to a post. A new form should be requested for each create transaction.- Parameters:
postId- theIdfor the postreplyRecordTypes- array of reply record types- Returns:
- the reply form
- Throws:
NotFoundException-postIdis not foundNullArgumentException-postIdorreplyRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
getReplyFormForCreateToReply
ReplyForm getReplyFormForCreateToReply(Id replyId, Type[] replyRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the reply form for creating new replies to another reply. A new form should be requested for each create transaction.- Parameters:
replyId- theIdfor the replyreplyRecordTypes- array of reply record types- Returns:
- the reply form
- Throws:
NotFoundException-replyIdis not foundNullArgumentException-replyIdorreplyRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createReply
Creates a newReply.- Parameters:
replyForm- the form for thisReply- Returns:
- the new
Reply - Throws:
IllegalStateException-replyFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-replyFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-replyFormdid not originate fromgetReplyFormForCreateToPost()orgetReplyFormForCreateToReply()- Compliance:
mandatory- This method must be implemented.
-
canUpdateReplies
boolean canUpdateReplies()Tests if this user can update replies. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aReplywill 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:
falseifReplymodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getReplyFormForUpdate
ReplyForm getReplyFormForUpdate(Id replyId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the reply form for updating an existing reply. A new reply form should be requested for each update transaction.- Parameters:
replyId- theIdof theReply- Returns:
- the reply form
- Throws:
NotFoundException-replyIdis not foundNullArgumentException-replyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateReply
Updates an existing reply.- Parameters:
replyForm- the form containing the elements to be updated- Throws:
IllegalStateException-replyFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-replyFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-replyFormdid not originate fromgetReplyFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteReplies
boolean canDeleteReplies()Tests if this user can delete replies. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anReplywill 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:
falseifReplydeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteReply
void deleteReply(Id replyId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anReply.- Parameters:
replyId- theIdof theReplyto remove- Throws:
NotFoundException-replyIdnot foundNullArgumentException-replyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageReplyAliases
boolean canManageReplyAliases()Tests if this user can manageIdaliases forComnents. 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:
falseifReplyaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasReply
void aliasReply(Id replyId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aReplyfor the purpose of creating compatibility. The primaryIdof theReplyis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another reply, it is reassigned to the given replyId.- Parameters:
replyId- theIdof aReplyaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-replyIdnot foundNullArgumentException-replyIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-