Interface TextPressAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Texts to
Press mappings. A Text may appear in multiple Press
objects and removing the last reference to a Text is the
equivalent of deleting it. Each Press may have its own
authorizations governing who is allowed to operate on it.
Adding a reference of a Text to another Press is not a
copy operation (eg: does not change its Id ).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignTextToPress(Id textId, Id pressId) Adds an existingTextto aPress.booleanTests if this user can alter text/press mappings.booleancanAssignTextsToPress(Id pressId) Tests if this user can alter text/press mappings.getAssignablePressIds(Id pressId) Gets a list of presses including and under the given press node in which any text can be assigned.getAssignablePressIdsForText(Id pressId, Id textId) Gets a list of presses including and under the given press node in which a specific text can be assigned.voidreassignTextToPress(Id textId, Id fromPressId, Id toPressId) Moves aTextfrom onePressto another.voidunassignTextFromPress(Id textId, Id pressId) Removes aTextfrom aPress.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
-
canAssignTexts
boolean canAssignTexts()Tests if this user can alter text/press 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 press that may opt not to offer assignment operations to unauthorized users.- Returns:
falseif lexicon is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignTextsToPress
Tests if this user can alter text/press 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 press that may opt not to offer assignment operations to unauthorized users.- Parameters:
pressId- theIdof thePress- Returns:
falseif lexicon is not authorized,trueotherwise- Throws:
NullArgumentException-pressIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignablePressIds
Gets a list of presses including and under the given press node in which any text can be assigned.- Parameters:
pressId- theIdof thePress- Returns:
- list of assignable press
Ids - Throws:
NullArgumentException-pressIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignablePressIdsForText
Gets a list of presses including and under the given press node in which a specific text can be assigned.- Parameters:
pressId- theIdof thePresstextId- theIdof theText- Returns:
- list of assignable press
Ids - Throws:
NullArgumentException-pressIdortextIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignTextToPress
void assignTextToPress(Id textId, Id pressId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingTextto aPress.- Parameters:
textId- theIdof theTextpressId- theIdof thePress- Throws:
AlreadyExistsException-textIdis slready assigned topressIdNotFoundException-textIdorpressIdnot foundNullArgumentException-textIdorpressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignTextFromPress
void unassignTextFromPress(Id textId, Id pressId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aTextfrom aPress.- Parameters:
textId- theIdof theTextpressId- theIdof thePress- Throws:
NotFoundException-textIdorpressIdnot found ortextIdnot assigned topressIdNullArgumentException-textIdorpressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignTextToPress
void reassignTextToPress(Id textId, Id fromPressId, Id toPressId) throws NotFoundException, OperationFailedException, PermissionDeniedException Moves aTextfrom onePressto another. Mappings to otherPressesare unaffected.- Parameters:
textId- theIdof theTextfromPressId- theIdof the currentPresstoPressId- theIdof the destinationPress- Throws:
NotFoundException-textId, fromPressId, ortoPressIdnot found ortextIdnot mapped tofromPressIdNullArgumentException-textId, fromPressId, ortoPressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-