public interface ReplyAdminSession extends OsidSession
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.
Modifier and Type | Method and Description |
---|---|
void |
aliasReply(Id replyId,
Id aliasId)
Adds an
Id to a Reply for the purpose of
creating compatibility. |
boolean |
canCreateReplies()
Tests if this user can create hournal entries.
|
boolean |
canCreateReplyWithRecordTypes(Type[] replyRecordTypes)
Tests if this user can create a single
Reply using the
desired record types. |
boolean |
canDeleteReplies()
Tests if this user can delete replies.
|
boolean |
canManageReplyAliases()
Tests if this user can manage
Id aliases for
Comnents. |
boolean |
canUpdateReplies()
Tests if this user can update replies.
|
Reply |
createReply(ReplyForm replyForm)
Creates a new
Reply. |
void |
deleteReply(Id replyId)
Deletes an
Reply. |
Forum |
getForum()
Gets the
Forum associated with this session. |
Id |
getForumId()
Gets the
Forum Id associated with this
session. |
ReplyForm |
getReplyFormForCreateToPost(Id postId,
Type[] replyRecordTypes)
Gets the reply form for creating new replies to a post.
|
ReplyForm |
getReplyFormForCreateToReply(Id replyId,
Type[] replyRecordTypes)
Gets the reply form for creating new replies to another reply.
|
ReplyForm |
getReplyFormForUpdate(Id replyId)
Gets the reply form for updating an existing reply.
|
void |
updateReply(ReplyForm replyForm)
Updates an existing reply.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getForumId()
Forum
Id
associated with this
session. Forum Id
associated with this sessionmandatory
- This method must be implemented. Forum getForum() throws OperationFailedException, PermissionDeniedException
Forum
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateReplies()
Reply
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 Reply
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateReplyWithRecordTypes(Type[] replyRecordTypes)
Reply
using the
desired record types. While ForumManager.getReplyRecordTypes()
can be used to examine which records are supported, this
method tests which record(s) are required for creating a specific
Reply.
Providing an empty array tests if a Reply
can be created with no records.replyRecordTypes
- array of reply record types true
if Reply
creation using the
specified record Types
is supported,
false
otherwiseNullArgumentException
- replyRecordTypes
is null
mandatory
- This method must be implemented. ReplyForm getReplyFormForCreateToPost(Id postId, Type[] replyRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
postId
- the Id
for the postreplyRecordTypes
- array of reply record typesNotFoundException
- postId
is not foundNullArgumentException
- postId
or
replyRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. ReplyForm getReplyFormForCreateToReply(Id replyId, Type[] replyRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
replyId
- the Id
for the replyreplyRecordTypes
- array of reply record typesNotFoundException
- replyId
is not foundNullArgumentException
- replyId
or
replyRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Reply createReply(ReplyForm replyForm) throws OperationFailedException, PermissionDeniedException
Reply.
replyForm
- the form for this Reply
Reply
IllegalStateException
- replyForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- replyForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- replyForm
did not
originate from getReplyFormForCreateToPost()
or
getReplyFormForCreateToReply()
mandatory
- This method must be implemented. boolean canUpdateReplies()
Reply
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 Reply
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. ReplyForm getReplyFormForUpdate(Id replyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
replyId
- the Id
of the Reply
NotFoundException
- replyId
is not foundNullArgumentException
- replyId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateReply(ReplyForm replyForm) throws OperationFailedException, PermissionDeniedException
replyForm
- the form containing the elements to be updatedIllegalStateException
- replyForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- replyForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- replyForm
did not
originate from getReplyFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteReplies()
Reply
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 Reply
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteReply(Id replyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Reply.
replyId
- the Id
of the Reply
to
removeNotFoundException
- replyId
not foundNullArgumentException
- replyId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageReplyAliases()
Id
aliases for
Comnents.
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 Reply
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasReply(Id replyId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Reply
for the purpose of
creating compatibility. The primary Id
of the
Reply
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the alias is
a pointer to another reply, it is reassigned to the given reply
Id.
replyId
- the Id
of a Reply
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- replyId
not foundNullArgumentException
- replyId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.