OSID Logo
OSID Specifications
repository package
Version 3.0.0
Interfaceosid.repository.AssetContentAdminSession
Implementsosid.OsidSession
Implemented Byosid.repository.batch.AssetContentBatchAdminSession
Used Byosid.repository.RepositoryManager
osid.repository.RepositoryProxyManager
Description

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 .

MethodgetRepositoryId
Description

Gets the Repository Id associated with this session.

Returnosid.id.Idthe Repository Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetRepository
Description

Gets the Repository associated with this session.

Returnosid.repository.Repositorythe repository
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateAssetContents
Description

Tests if this user can create AssetContents . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an AssetContent will result in a PERMISSION_DENIED. Th is is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.

Returnbooleanfalse if AssetContent creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateAssetContentWithRecordTypes
Description

Tests if this user can create a single AssetContent using the desired record types. While RepositoryManager.getAssetContentRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific AssetContent . Providing an empty array tests if an AssetContent can be created with no records.

Parametersosid.type.Type[]assetContentRecordTypesarray of asset content record types
Returnbooleantrue if AssetContent creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENTassetContentRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetAssetContentFormForCreate
Description

Gets the asset content form for creating new asset contents. A new form should be requested for each create transaction.

Parametersosid.id.IdassetIdan asset Id
osid.type.Type[]assetContentRecordTypesarray of asset content record types
Returnosid.repository.AssetContentFormthe asset content form
ErrorsNOT_FOUNDasetId is not found
NULL_ARGUMENTassetId or assetContentRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateAssetContent
Description

Creates a new AssetContent .

Parametersosid.repository.AssetContentFormassetContentFormthe form for this AssetContent
Returnosid.repository.AssetContentthe new AssetContent
ErrorsILLEGAL_STATEassetContentForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENTassetContentForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDassetContentForm did not originate from getAssetContentFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateAssetContents
Description

Tests if this user can update AssetContents . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an AssetContent will result in a PERMISSION_DENIED. Th is is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.

Returnbooleanfalse if AssetContent modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetAssetContentFormForUpdate
Description

Gets the asset content form for updating an existing asset content. A new asset content form should be requested for each update transaction.

Parametersosid.id.IdassetContentIdthe Id of the AssetContent
Returnosid.repository.AssetContentFormthe asset content form
ErrorsNOT_FOUNDassetContentId is not found
NULL_ARGUMENTassetContentId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateAssetContent
Description

Updates an existing asset content.

Parametersosid.repository.AssetContentFormassetContentFormthe form containing the elements to be updated
ErrorsILLEGAL_STATEassetContentForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENTassetContentForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDassetContentForm did not originate from getAssetContentFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteAssetContents
Description

Tests if this user can delete AssetContents . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an AssetContent will result in a PERMISSION_DENIED. Th is is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.

Returnbooleanfalse if AssetContent deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteAssetContent
Description

Deletes an AssetContent .

Parametersosid.id.IdassetContentIdthe Id of the AssetContent to remove
ErrorsNOT_FOUNDassetContentId not found
NULL_ARGUMENTassetContentId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageAssetContentAliases
Description

Tests if this user can manage Id aliases for AssetContents A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED .This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.

Returnbooleanfalse if AssetContent aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasAssetContent
Description

Adds an Id to an AssetContent for the purpose of creating compatibility. The primary Id of the AssetContent is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another asset content, it is reassigned to the given asset content Id .

Parametersosid.id.IdassetContentIdthe Id of an AssetContent
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTSaliasId is already assigned
NOT_FOUNDassetContentId not found
NULL_ARGUMENTassetContentId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.