| Interface | osid.repository.AssetAdminSession | ||
|---|---|---|---|
| Implements | osid.OsidSession | ||
| Description | 
                 This session creates, updates, and deletes   Create and update operations differ in their usage. To 
                create an   For updates,   The delete operations delete   This session includes an   The view of the administrative methods defined in this 
                session is determined by the provider. For an instance of this 
                session where no repository has been specified, it may not be 
                parallel to the  Example create: 
                     
                     
                     if (!session.canCreateAssets()) {
                         return "asset creation not permitted";
                     }
                     
                     Type types[1];
                     types[0] = assetPhotographType; 
                     if (!session.canCreateAssetWithRecordTypes(types)) {
                         return "creating an asset with a photograph type is not supported";
                     }
                     
                     AssetForm form = session.getAssetFormForCreate();
                     Metadata metadata = form.getDisplayNameMetadata();
                     if (metadata.isReadOnly()) {
                         return "cannot set display name";
                     }
                     
                     form.setDisplayName("my photo");
                     
                     PhotographRecordForm photoForm = (PhotographRecordForn) form.getRecordForm(assetPhotogaphType);
                     Metadata metadata = form.getApertureMetadata();
                     if (metadata.isReadOnly()) {
                         return ("cannot set aperture");
                     }
                     
                     photoForm.setAperture("5.6");
                     if (!form.isValid()) {
                         return form.getValidationMessage();
                     }
                     
                     Asset newAsset = session.createAsset(form);
                     
                                 
                     
                
                 | ||
| Method | getRepositoryId | ||
| Description | 
                     Gets the   | ||
| Return | osid.id.Id | the  Repository Id  associated with this session  | |
| Compliance | mandatory | This method must be implemented. | |
| Method | getRepository | ||
| Description | 
                     Gets the   | ||
| Return | osid.repository.Repository | the  Repository  associated with this session  | |
| Errors | OPERATION_FAILED | unable to complete request | |
| PERMISSION_DENIED | authorization failure | ||
| Compliance | mandatory | This method must be implemented. | |
| Method | canCreateAssets | ||
| Description | 
                     Tests if this user can create   | ||
| Return | boolean |  false  if  Asset  creation is not authorized, 
 true  otherwise  | |
| Compliance | mandatory | This method must be implemented. | |
| Method | canCreateAssetWithRecordTypes | ||
| Description | 
                     Tests if this user can create a single   | ||
| Parameters | osid.type.Type[] | assetRecordTypes | array of asset record types | 
| Return | boolean |  true  if  Asset  creation using the specified 
record  Types  is supported,  false  otherwise  | |
| Errors | NULL_ARGUMENT |  assetRecordTypes  is  null   |                 |
| Compliance | mandatory | This method must be implemented. | |
| Method | getAssetFormForCreate | ||
| Description | 
                     Gets the asset form for creating new assets. A new form should be requested for each create transaction.  | ||
| Parameters | osid.type.Type[] | assetRecordTypes | array of asset record types | 
| Return | osid.repository.AssetForm | the asset form | |
| Errors | NULL_ARGUMENT |  assetRecordTypes  is  null   |                 |
| OPERATION_FAILED | unable to complete request | ||
| PERMISSION_DENIED | authorization failure | ||
| UNSUPPORTED | unable to get form for requested record types | ||
| Compliance | mandatory | This method must be implemented. | |
| Method | createAsset | ||
| Description | 
                     Creates a new   | ||
| Parameters | osid.repository.AssetForm | assetForm | the form for this  Asset   | 
| Return | osid.repository.Asset | the new  Asset   | |
| Errors | ILLEGAL_STATE |  assetForm  already used in a create transaction  |                 |
| INVALID_ARGUMENT | one or more of the form elements is invalid | ||
| NULL_ARGUMENT |  assetForm  is  null   |                 ||
| OPERATION_FAILED | unable to complete request | ||
| PERMISSION_DENIED | authorization failure | ||
| UNSUPPORTED |  assetForm  did not originate from  
getAssetFormForCreate()   |                 ||
| Compliance | mandatory | This method must be implemented. | |
| Method | canUpdateAssets | ||
| Description | 
                     Tests if this user can update   | ||
| Return | boolean |  false  if  Asset  modification is not 
authorized,  true  otherwise  | |
| Compliance | mandatory | This method must be implemented. | |
| Method | getAssetFormForUpdate | ||
| Description | 
                     Gets the asset form for updating an existing asset. A new asset form should be requested for each update transaction.  | ||
| Parameters | osid.id.Id | assetId | the  Id  of the  Asset   | 
| Return | osid.repository.AssetForm | the asset form | |
| Errors | NOT_FOUND |  assetId  is not found  |                 |
| NULL_ARGUMENT |  assetId  is null  |                 ||
| OPERATION_FAILED | unable to complete request | ||
| PERMISSION_DENIED | authorization failure | ||
| Compliance | mandatory | This method must be implemented. | |
| Method | updateAsset | ||
| Description | 
                     Updates an existing asset.  | ||
| Parameters | osid.repository.AssetForm | assetForm | the form containing the elements to be updated | 
| Errors | ILLEGAL_STATE |  assetForm  already used in anupdate transaction  |                 |
| INVALID_ARGUMENT | the form contains an invalid value | ||
| NULL_ARGUMENT |  assetForm  is  null   |                 ||
| OPERATION_FAILED | unable to complete request | ||
| PERMISSION_DENIED | authorization failure | ||
| UNSUPPORTED |  assetForm  did not originate from  
getAssetFormForUpdate()   |                 ||
| Compliance | mandatory | This method must be implemented. | |
| Method | canDeleteAssets | ||
| Description | 
                     Tests if this user can delete   | ||
| Return | boolean |  false  if  Asset  deletion is not authorized, 
 true  otherwise  | |
| Compliance | mandatory | This method must be implemented. | |
| Method | deleteAsset | ||
| Description | 
                     Deletes an   | ||
| Parameters | osid.id.Id | assetId | the  Id  of the  Asset  to remove  | 
| Errors | NOT_FOUND |  assetId  not found  |                 |
| NULL_ARGUMENT |  assetId  is  null   |                 ||
| OPERATION_FAILED | unable to complete request | ||
| PERMISSION_DENIED | authorization failure | ||
| Compliance | mandatory | This method must be implemented. | |
| Method | canManageAssetAliases | ||
| Description | 
                     Tests if this user can manage   | ||
| Return | boolean |  false  if  Asset  aliasing is not authorized, 
 true  otherwise  | |
| Compliance | mandatory | This method must be implemented. | |
| Method | aliasAsset | ||
| Description | 
                     Adds an   | ||
| Parameters | osid.id.Id | assetId | the  Id  of an  Asset   | 
osid.id.Id | aliasId | the alias  Id   | |
| Errors | ALREADY_EXISTS |  aliasId  is already assigned  |                 |
| NOT_FOUND |  assetId  not found  |                 ||
| NULL_ARGUMENT |  assetId  or  aliasId  is  null   |                 ||
| OPERATION_FAILED | unable to complete request | ||
| PERMISSION_DENIED | authorization failure | ||
| Compliance | mandatory | This method must be implemented. | |
| Method | canCreateAssetContent | ||
| Description | 
                     Tests if this user can create content for   | ||
| Return | boolean |  false  if  Asset  content creation is not 
authorized,  true  otherwise  | |
| Compliance | mandatory | This method must be implemented. | |
| Method | canCreateAssetContentWithRecordTypes | ||
| Description | 
                     Tests if this user can create an   | ||
| Parameters | osid.type.Type[] | assetContentRecordTypes | array of asset content record types | 
| Return | boolean |  true  if  AssetContent  creation using the 
specified  Types  is supported,  false  otherwise  | |
| Errors | NULL_ARGUMENT |  assetContentRecordTypes  is  null   |                 |
| Compliance | mandatory | This method must be implemented. | |
| Method | getAssetContentFormForCreate | ||
| Description | 
                     Gets an asset content form for creating new assets.  | ||
| Parameters | osid.id.Id | assetId | the  Id  of an  Asset   | 
osid.type.Type[] | assetContentRecordTypes | array of asset content record types | |
| Return | osid.repository.AssetContentForm | the asset content form | |
| Errors | NOT_FOUND |  assetId  is not found  |                 |
| NULL_ARGUMENT |  assetId  or  assetContentRecordTypes  is  
null   |                 ||
| OPERATION_FAILED | unable to complete request | ||
| PERMISSION_DENIED | authorization failure | ||
| UNSUPPORTED | unable to get form for requested record types | ||
| Compliance | mandatory | This method must be implemented. | |
| Method | createAssetContent | ||
| Description | 
                     Creates new   | ||
| Parameters | osid.repository.AssetContentForm | assetContentForm | the form for this  AssetContent   | 
| Return | osid.repository.AssetContent | the new  AssetContent   | |
| Errors | ILLEGAL_STATE |  assetContentForm  already used in a create transaction  |                 |
| INVALID_ARGUMENT | one or more of the form elements is invalid | ||
| NULL_ARGUMENT |  assetContentForm  is  null   |                 ||
| OPERATION_FAILED | unable to complete request | ||
| PERMISSION_DENIED | authorization failure | ||
| UNSUPPORTED |  assetContentForm  did not originate from  
getAssetContentFormForCreate()   |                 ||
| Compliance | mandatory | This method must be implemented. | |
| Method | canUpdateAssetContents | ||
| Description | 
                     Tests if this user can update   | ||
| Return | boolean |  false  if  AssetContent  modification is not 
authorized,  true  otherwise  | |
| Compliance | mandatory | This method must be implemented. | |
| Method | getAssetContentFormForUpdate | ||
| Description | 
                     Gets the asset content form for updating an existing asset content. A new asset content form should be requested for each update transaction.  | ||
| Parameters | osid.id.Id | assetContentId | the  Id  of the  AssetContent   | 
| Return | osid.repository.AssetContentForm | the asset content form | |
| Errors | NOT_FOUND |  assetContentId  is not found  |                 |
| NULL_ARGUMENT |  assetContentId  is  null   |                 ||
| OPERATION_FAILED | unable to complete request | ||
| Compliance | mandatory | This method must be implemented. | |
| Method | updateAssetContent | ||
| Description | 
                     Updates an existing asset content.  | ||
| Parameters | osid.repository.AssetContentForm | assetContentForm | the form containing the elements to be updated | 
| Errors | ILLEGAL_STATE |  assetContentForm  already used in an update transaction  |                 |
| INVALID_ARGUMENT | the form contains an invalid value | ||
| NULL_ARGUMENT |  assetForm  is  null   |                 ||
| OPERATION_FAILED | unable to complete request | ||
| PERMISSION_DENIED | authorization failure | ||
| UNSUPPORTED |  assetContentForm  did not originate from  
getAssetContentFormForUpdate()   |                 ||
| Compliance | mandatory | This method must be implemented. | |
| Method | canDeleteAssetContents | ||
| Description | 
                     Tests if this user can delete   | ||
| Return | boolean |  false  if  AssetContent  deletion is not 
authorized,  true  otherwise  | |
| Compliance | mandatory | This method must be implemented. | |
| Method | deleteAssetContent | ||
| Description | 
                     Deletes content from an   | ||
| Parameters | osid.id.Id | assetContentId | the  Id  of the  AssetContent   | 
| Errors | NOT_FOUND |  assetContentId  is not found  |                 |
| NULL_ARGUMENT |  assetContentId  is  null   |                 ||
| OPERATION_FAILED | unable to complete request | ||
| PERMISSION_DENIED | authorization failure | ||
| Compliance | mandatory | This method must be implemented. | |