Interface AssetContentAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
AssetContentBatchAdminSession
This session creates, updates, and deletes AssetContents . 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 an
AssetContent , an AssetContentForm is requested using
getAssetContentFormForCreate() specifying the desired asset and
record Types or none if no record Types are needed. The
returned AssetContentForm 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 AssetContentForm is submiited to a
create operation, it cannot be reused with another create operation unless
the first operation was unsuccessful. Each AssetContentForm
corresponds to an attempted transaction.
For updates, AssetContentForms are requested to the
AssetContent Id that is to be updated using
getAssetContentFormForUpdate() . Similarly, the AssetContentForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The AssetContentForm can
only be used once for a successful update and cannot be reused.
The delete operations delete AssetContents . To unmap an
AssetContent from the current Repository , the
AssetContentRepositoryAssignmentSession should be used. These delete
operations attempt to remove the AssetContent itself thus removing
it from all known Repository catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id .
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasAssetContent(Id assetContentId, Id aliasId) Adds anIdto anAssetContentfor the purpose of creating compatibility.booleanTests if this user can createAssetContents.booleancanCreateAssetContentWithRecordTypes(Type[] assetContentRecordTypes) Tests if this user can create a singleAssetContentusing the desired record types.booleanTests if this user can deleteAssetContents.booleanTests if this user can manageIdaliases forAssetContentsA return of true does not guarantee successful authorization.booleanTests if this user can updateAssetContents.createAssetContent(AssetContentForm assetContentForm) Creates a newAssetContent.voiddeleteAssetContent(Id assetContentId) Deletes anAssetContent.getAssetContentFormForCreate(Id assetId, Type[] assetContentRecordTypes) Gets the asset content form for creating new asset contents.getAssetContentFormForUpdate(Id assetContentId) Gets the asset content form for updating an existing asset content.Gets theRepositoryassociated with this session.Gets theRepositoryIdassociated with this session.voidupdateAssetContent(AssetContentForm assetContentForm) Updates an existing asset content.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
-
getRepositoryId
Id getRepositoryId()Gets theRepositoryIdassociated with this session.- Returns:
- the
Repository Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getRepository
Gets theRepositoryassociated with this session.- Returns:
- the repository
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateAssetContents
boolean canCreateAssetContents()Tests if this user can createAssetContents. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anAssetContentwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifAssetContentcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateAssetContentWithRecordTypes
Tests if this user can create a singleAssetContentusing the desired record types. WhileRepositoryManager.getAssetContentRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificAssetContent. Providing an empty array tests if anAssetContentcan be created with no records.- Parameters:
assetContentRecordTypes- array of asset content record types- Returns:
trueifAssetContentcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-assetContentRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getAssetContentFormForCreate
AssetContentForm getAssetContentFormForCreate(Id assetId, Type[] assetContentRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the asset content form for creating new asset contents. A new form should be requested for each create transaction.- Parameters:
assetId- an assetIdassetContentRecordTypes- array of asset content record types- Returns:
- the asset content form
- Throws:
NotFoundException-asetIdis not foundNullArgumentException-assetIdorassetContentRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createAssetContent
AssetContent createAssetContent(AssetContentForm assetContentForm) throws OperationFailedException, PermissionDeniedException Creates a newAssetContent.- Parameters:
assetContentForm- the form for thisAssetContent- Returns:
- the new
AssetContent - Throws:
IllegalStateException-assetContentFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-assetContentFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-assetContentFormdid not originate fromgetAssetContentFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateAssetContents
boolean canUpdateAssetContents()Tests if this user can updateAssetContents. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anAssetContentwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifAssetContentmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getAssetContentFormForUpdate
AssetContentForm getAssetContentFormForUpdate(Id assetContentId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the asset content form for updating an existing asset content. A new asset content form should be requested for each update transaction.- Parameters:
assetContentId- theIdof theAssetContent- Returns:
- the asset content form
- Throws:
NotFoundException-assetContentIdis not foundNullArgumentException-assetContentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateAssetContent
void updateAssetContent(AssetContentForm assetContentForm) throws OperationFailedException, PermissionDeniedException Updates an existing asset content.- Parameters:
assetContentForm- the form containing the elements to be updated- Throws:
IllegalStateException-assetContentFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-assetContentFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-assetContentFormdid not originate fromgetAssetContentFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteAssetContents
boolean canDeleteAssetContents()Tests if this user can deleteAssetContents. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anAssetContentwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifAssetContentdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteAssetContent
void deleteAssetContent(Id assetContentId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anAssetContent.- Parameters:
assetContentId- theIdof theAssetContentto remove- Throws:
NotFoundException-assetContentIdnot foundNullArgumentException-assetContentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageAssetContentAliases
boolean canManageAssetContentAliases()Tests if this user can manageIdaliases forAssetContentsA return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED.This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifAssetContentaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasAssetContent
void aliasAssetContent(Id assetContentId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anAssetContentfor the purpose of creating compatibility. The primaryIdof theAssetContentis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another asset content, it is reassigned to the given asset contentId.- Parameters:
assetContentId- theIdof anAssetContentaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-assetContentIdnot foundNullArgumentException-assetContentIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-