Interface AssetContentBatchAdminSession
- All Superinterfaces:
AssetContentAdminSession, AutoCloseable, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes AssetContents in
bulk. 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
geAssetContentFormsForCreate() specifying the desired assets and
record Types or none if no record Types are needed. Each
of the returned AssetContentForms 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 an 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.
The AssetContentForms returned from
getAssetContentFormsForCreate() may be linked to the originating request
through the peer Ids of the AssetContentForm . In the case
where there may be duplicates, any AssetContentForm of the same
peer Ids may be used for a create operation.
Once a batch of AssetContentForms are submitted for create, a
CreateResponse is returned for each AssetContentForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createAssetContents() ,
errors specific to an individual AssetContentForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating AssetContentForm through the
AssetContentForm Id .
For updates, AssetContentForms are requested to the
AssetContent Id that is to be updated using
getAssetContentFormsForUpdate() where the reference Id in the
AssetContentForm may be used to link the request. Similarly, the
AssetForm 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.
Once a batch of AssetContentForms are submitted for update, an
UpdateResponse is returned for each AssetContentForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateAssetContents() ,
errors specific to an individual AssetContentForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating AssetContentForm through the
AssetContentForm Id .
The delete operations delete AssetContents in bulk. 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. Bulk delete operations
return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasAssetContents(AliasRequestList aliasRequests) Adds anIdto anAssetContentfor the purpose of creating compatibility.createAssetContents(AssetContentBatchFormList assetContentForms) Creates a new set ofAssetContents.Deletes allAssetsin thisRepository.deleteAssetContents(IdList assetContentIds) Deletes asset contents for the givenIds.deleteAssetContentsForAsset(Id assetId) Deletes asset contents for the given asset.getAssetContentFormsForCreate(IdList assetIds, Type[] assetContentRecordTypes) Gets the asset forms for creating a bunch of new asset contents.getAssetContentFormsForUpdate(IdList assetContentIds) Gets the asset content forms for updating an existing set of asset contents.updateAssetContents(AssetContentBatchFormList assetContentForms) Updates existing asset contents.Methods inherited from interface AssetContentAdminSession
aliasAssetContent, canCreateAssetContents, canCreateAssetContentWithRecordTypes, canDeleteAssetContents, canManageAssetContentAliases, canUpdateAssetContents, createAssetContent, deleteAssetContent, getAssetContentFormForCreate, getAssetContentFormForUpdate, getRepository, getRepositoryId, updateAssetContentModifier 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
-
getAssetContentFormsForCreate
AssetBatchFormList getAssetContentFormsForCreate(IdList assetIds, Type[] assetContentRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the asset forms for creating a bunch of new asset contents. A form is retrieved for each supp;lied assetId.- Parameters:
assetIds- a list of assetIdsassetContentRecordTypes- array of asset content record types to be included in each create operation or an empty list if none- Returns:
- the asset forms
- Throws:
NotFoundException- anassetIdis not foundNullArgumentException-assetIdsorassetContentRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createAssetContents
CreateResponseList createAssetContents(AssetContentBatchFormList assetContentForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofAssetContents. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
assetContentForms- the asset content forms- Returns:
- the create responses
- Throws:
NullArgumentException-assetContentFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getAssetContentFormsForUpdate
AssetContentBatchFormList getAssetContentFormsForUpdate(IdList assetContentIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the asset content forms for updating an existing set of asset contents. A new asset content form should be requested for each update transaction.- Parameters:
assetContentIds- theIdsof theAssetContents- Returns:
- the asset content forms
- Throws:
NotFoundException- anassetContentIdis not foundNullArgumentException-assetContentIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateAssetContents
UpdateResponseList updateAssetContents(AssetContentBatchFormList assetContentForms) throws OperationFailedException, PermissionDeniedException Updates existing asset contents. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
assetContentForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-assetContentFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllAssetContents
DeleteResponseList deleteAllAssetContents() throws OperationFailedException, PermissionDeniedExceptionDeletes allAssetsin thisRepository.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAssetContents
DeleteResponseList deleteAssetContents(IdList assetContentIds) throws OperationFailedException, PermissionDeniedException Deletes asset contents for the givenIds.- Parameters:
assetContentIds- theIdsof the asset contents to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-assetContentIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAssetContentsForAsset
DeleteResponseList deleteAssetContentsForAsset(Id assetId) throws OperationFailedException, PermissionDeniedException Deletes asset contents for the given asset.- Parameters:
assetId- anIdof the asset- Returns:
- the delete responses
- Throws:
NullArgumentException-assetIdOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasAssetContents
AliasResponseList aliasAssetContents(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anAssetContentfor the purpose of creating compatibility. The primaryIdof theAssetContentis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another asset content, it is reassigned to the given asset contentId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-