Interface CompositionRepositoryAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Compositions to
Repository objects. A Composition may be associated with
multiple Repository objects. Removing the last reference to a
Composition is the equivalent of deleting it. Each
Repository may have its own authorizations governing who is allowed to
operate on it.
Moving or adding a reference of a Composition to another
Repository is not a copy operation (eg: does not change its
Id ).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignCompositionToRepository(Id compositionId, Id repositoryId) Adds an existingCompositionto aRepository.booleanTests if this user can alter composition/repository mappings.booleancanAssignCompositionsToRepository(Id repositoryId) Tests if this user can alter composition/repository mappings.getAssignableRepositoryIds(Id repositoryId) Gets a list of repositories including and under the given repository node in which any composition can be assigned.getAssignableRepositoryIdsForComposition(Id repositoryId, Id compositionId) Gets a list of repositories including and under the given repository node in which a specific composition can be assigned.voidreassignCompositionToRepository(Id compositionId, Id fromRepositoryId, Id toRepositoryId) Moves aCompositionfrom oneRepositoryto another.voidunassignCompositionFromRepository(Id compositionId, Id repositoryId) RemovesCompositionfrom aRepository.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
-
canAssignCompositions
boolean canAssignCompositions()Tests if this user can alter composition/repository 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.
-
canAssignCompositionsToRepository
Tests if this user can alter composition/repository 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:
repositoryId- theIdof theRepository- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-repositoryIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableRepositoryIds
Gets a list of repositories including and under the given repository node in which any composition can be assigned.- Parameters:
repositoryId- theIdof theRepository- Returns:
- list of assignable repository
Ids - Throws:
NullArgumentException-repositoryIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableRepositoryIdsForComposition
IdList getAssignableRepositoryIdsForComposition(Id repositoryId, Id compositionId) throws OperationFailedException Gets a list of repositories including and under the given repository node in which a specific composition can be assigned.- Parameters:
repositoryId- theIdof theRepositorycompositionId- theIdof theComposition- Returns:
- list of assignable repository
Ids - Throws:
NullArgumentException-repositoryIdorcompositionIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignCompositionToRepository
void assignCompositionToRepository(Id compositionId, Id repositoryId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingCompositionto aRepository.- Parameters:
compositionId- theIdof theCompositionrepositoryId- theIdof theRepository- Throws:
AlreadyExistsException-compositionIdalready assigned torepositoryIdNotFoundException-compositionIdorrepositoryIdnot foundNullArgumentException-compositionIdorrepositoryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignCompositionFromRepository
void unassignCompositionFromRepository(Id compositionId, Id repositoryId) throws NotFoundException, OperationFailedException, PermissionDeniedException RemovesCompositionfrom aRepository.- Parameters:
compositionId- theIdof theCompositionrepositoryId- theIdof theRepository- Throws:
NotFoundException-compositionIdorrepositoryIdnot found orcompositionIdnot assigned torepositoryIdNullArgumentException-compositionIdorrepositoryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignCompositionToRepository
void reassignCompositionToRepository(Id compositionId, Id fromRepositoryId, Id toRepositoryId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves aCompositionfrom oneRepositoryto another. Mappings to otherRepositoriesare unaffected.- Parameters:
compositionId- theIdof theCompositionfromRepositoryId- theIdof the currentRepositorytoRepositoryId- theIdof the destinationRepository- Throws:
AlreadyExistsException-compositionIdalready assigned totoRepositoryIdNotFoundException-compositionId, fromRepositoryId, ortoRepositoryIdnot found orcompositionIdnot mapped tofromRepositoryIdNullArgumentException-compositionId, fromRepositoryId, ortoRepositoryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-