Interface AssetContentRepositoryAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign AssetContents to
Repository mappings. An AssetContent may appear in
multiple Repository catalogs and removing the last reference to an
AssetContent is the equivalent of deleting it. Each
Repository may have its own authorizations governing who is allowed to
operate on it.
Adding a reference of an AssetContent to another
Repository is n ot a copy operation (eg: does not change its Id
).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignAssetContentToRepository(Id assetContentId, Id repositoryId) Adds an existingAssetContentto aRepository.booleanTests if this user can alter asset content/repository mappings.booleancanAssignAssetContentToRepository(Id repositoryId) Tests if this user can alter asset content/repository mappings.getAssignableRepositoryIds(Id repositoryId) Gets a list of repositories including and under the given repository node in which any asset content can be assigned.getAssignableRepositoryIdsForAssetContent(Id repositoryId, Id assetContentId) Gets a list of repositories including and under the given repository node in which a specific asset content can be assigned.voidreassignAssetContentToRepository(Id assetContentId, Id fromRepositoryId, Id toRepositoryId) Moves anAssetContentfrom oneRepositoryto another.voidunassignAssetContentFromRepository(Id assetContentId, Id repositoryId) Removes anAssetContentfrom 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
-
canAssignAssetContents
boolean canAssignAssetContents()Tests if this user can alter asset content/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.
-
canAssignAssetContentToRepository
Tests if this user can alter asset content/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 asset content 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.
-
getAssignableRepositoryIdsForAssetContent
IdList getAssignableRepositoryIdsForAssetContent(Id repositoryId, Id assetContentId) throws OperationFailedException Gets a list of repositories including and under the given repository node in which a specific asset content can be assigned.- Parameters:
repositoryId- theIdof theRepositoryassetContentId- theIdof theAssetContent- Returns:
- list of assignable repository
Ids - Throws:
NullArgumentException-repositoryIdorassetContentIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignAssetContentToRepository
void assignAssetContentToRepository(Id assetContentId, Id repositoryId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingAssetContentto aRepository.- Parameters:
assetContentId- theIdof theAssetContentrepositoryId- theIdof theRepository- Throws:
AlreadyExistsException-assetContentIdis already assigned torepositoryIdNotFoundException-assetContentIdorrepositoryIdnot foundNullArgumentException-assetContentIdorrepositoryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignAssetContentFromRepository
void unassignAssetContentFromRepository(Id assetContentId, Id repositoryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes anAssetContentfrom aRepository.- Parameters:
assetContentId- theIdof theAssetContentrepositoryId- theIdof theRepository- Throws:
NotFoundException-assetContentIdorrepositoryIdnot found orassetContentIdnot assigned torepositoryIdNullArgumentException-assetContentIdorrepositoryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignAssetContentToRepository
void reassignAssetContentToRepository(Id assetContentId, Id fromRepositoryId, Id toRepositoryId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves anAssetContentfrom oneRepositoryto another. Mappings to otherRepositoriesare unaffected.- Parameters:
assetContentId- theIdof theAssetContentfromRepositoryId- theIdof the currentRepositorytoRepositoryId- theIdof the destinationRepository- Throws:
AlreadyExistsException-assetContentIdalready assigned totorepositoryIdNotFoundException-assetContentId, fromRepositoryId, ortoRepositoryeIdnot found orassetContentIdnot mapped tofromRepositoryIdNullArgumentException-assetContentId, fromRepositoryId, ortoRepositoryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-