Interface EntryBlogAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Entries to
Blogs . An Entry may map to multiple Blog objects and
removing the last reference to an Entry is the equivalent of
deleting it. Each Blog may have its own authorizations governing
who is allowed to operate on it.
Moving or adding a reference of a Entry to another
Blog is not a copy operation (eg: does not change its Id ).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignEntryToBlog(Id entryId, Id blogId) Adds an existingEntryto aBlog.booleanTests if this user can alter entry/blog mappings.booleancanAssignEntriesToBlog(Id blogId) Tests if this user can alter entry/blog mappings.getAssignableBlogIds(Id blogId) Gets a list of blogs including and under the given blogs node in which any entry can be assigned.getAssignableBlogIdsForEntry(Id blogId, Id entryId) Gets a list of blogs including and under the given blog node in which a specific entry can be assigned.voidreassignEntryToBlog(Id entryId, Id fromBlogId, Id toBlogId) Moves anEntryfrom oneBlogto another.voidunassignEntryFromBlog(Id entryId, Id blogId) Removes anEntryfrom aBlog.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
-
canAssignEntries
boolean canAssignEntries()Tests if this user can alter entry/blog mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Returns:
falseif mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignEntriesToBlog
Tests if this user can alter entry/blog mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Parameters:
blogId- theIdof theBlog- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-blogIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableBlogIds
Gets a list of blogs including and under the given blogs node in which any entry can be assigned.- Parameters:
blogId- theIdof theBlog- Returns:
- list of assignable blog
Ids - Throws:
NullArgumentException-blogIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableBlogIdsForEntry
Gets a list of blogs including and under the given blog node in which a specific entry can be assigned.- Parameters:
blogId- theIdof theBlogentryId- theIdof theEntry- Returns:
- list of assignable blog
Ids - Throws:
NullArgumentException-blogIdorentryIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignEntryToBlog
void assignEntryToBlog(Id entryId, Id blogId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingEntryto aBlog.- Parameters:
entryId- theIdof theEntryblogId- theIdof theBlog- Throws:
AlreadyExistsException-entryIdis already assigned toblogIdNotFoundException-entryIdorblogIdnot foundNullArgumentException-entryIdorblogIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignEntryFromBlog
void unassignEntryFromBlog(Id entryId, Id blogId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes anEntryfrom aBlog.- Parameters:
entryId- theIdof theEntryblogId- theIdof theBlog- Throws:
NotFoundException-entryIdorblogIdnot found orentryIdnot assigned toblogIdNullArgumentException-entryIdorblogIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignEntryToBlog
void reassignEntryToBlog(Id entryId, Id fromBlogId, Id toBlogId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves anEntryfrom oneBlogto another. Mappings to otherBlogsare unaffected.- Parameters:
entryId- theIdof theEntryfromBlogId- theIdof the currentBlogtoBlogId- theIdof the destinationBlog- Throws:
AlreadyExistsException-entryIdalready assigned totoBlogIdNotFoundException-entryId, fromBlogId, ortoBlogIdnot found orentryIdnot mapped tofromBlogIdNullArgumentException-entryId, fromBlogId, ortoBlogIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-