OSID Logo
OSID Specifications
recipe package
Version 3.0.0
Release Candidate Preview
Interfaceosid.recipe.ProcedureAdminSession
Implementsosid.OsidSession
Description

This session creates, updates, and deletes Procedures. 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 a Procedure, a ProcedureForm is requested using getProcedureFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned ProcedureForm 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 ProcedureForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each ProcedureForm corresponds to an attempted transaction.

For updates, ProcedureForms are requested to the Procedure Id that is to be updated using getProcedureFormForUpdate(). Similarly, the ProcedureForm has metadata about the data that can be updated and it can perform validation before submitting the update. The ProcedureForm can only be used once for a successful update and cannot be reused.

The delete operations delete Procedures. To unmap a Procedure from the current Cookbook, the ProcedureCookbookAssignmentSession should be used. These delete operations attempt to remove the Procedure itself thus removing it from all known Cookbook catalogs.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

MethodgetCookbookId
Description

Gets the Cookbook Id associated with this session.

Returnosid.id.Idthe Cookbook Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetCookbook
Description

Gets the Cookbook associated with this session.

Returnosid.recipe.Cookbookthe cookbook
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateProcedures
Description

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

Returnboolean false if Procedure creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateProcedureWithRecordTypes
Description

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

Parametersosid.type.Type[]procedureRecordTypesarray of procedure record types
Returnboolean true if Procedure creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT procedureRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetProcedureFormForCreate
Description

Gets the procedure form for creating new procedures. A new form should be requested for each create transaction.

Parametersosid.type.Type[]procedureRecordTypesarray of procedure record types
Returnosid.recipe.ProcedureFormthe procedure form
ErrorsNULL_ARGUMENT procedureRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateProcedure
Description

Creates a new Procedure.

Parametersosid.recipe.ProcedureFormprocedureFormthe form for this Procedure
Returnosid.recipe.Procedurethe new Procedure
ErrorsILLEGAL_STATE procedureForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT procedureForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED procedureForm did not originate from getProcedureFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateProcedures
Description

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

Returnboolean false if Procedure modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanUpdateProcedure
Description

Tests if this user can update a specified Procedure. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating the Procedure will result in a PERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.

Parametersosid.id.IdprocedureIdthe Id of the Procedure
Returnboolean false if procedure modification is not authorized, true otherwise
ErrorsNULL_ARGUMENT procedureId is null
CompliancemandatoryThis method must be implemented.
Provider Notes

If the procedureId is not found, then it is acceptable to return false to indicate the lack of an update available.

MethodgetProcedureFormForUpdate
Description

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

Parametersosid.id.IdprocedureIdthe Id of the Procedure
Returnosid.recipe.ProcedureFormthe procedure form
ErrorsNOT_FOUND procedureId is not found
NULL_ARGUMENT procedureId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateProcedure
Description

Updates an existing procedure.

Parametersosid.recipe.ProcedureFormprocedureFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE procedureForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT procedureId or procedureForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED procedureForm did not originate from getProcedureFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteProcedures
Description

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

Returnboolean false if Procedure deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanDeleteProcedure
Description

Tests if this user can delete a specified Procedure. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting the Procedure will result in a PERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.

Parametersosid.id.IdprocedureIdthe Id of the Procedure
Returnboolean false if deletion of this Procedure is not authorized, true otherwise
ErrorsNULL_ARGUMENT procedureId is null
CompliancemandatoryThis method must be implemented.
Provider Notes

If the procedureId is not found, then it is acceptable to return false to indicate the lack of a delete available.

MethoddeleteProcedure
Description

Deletes a Procedure.

Parametersosid.id.IdprocedureIdthe Id of the Procedure to remove
ErrorsNOT_FOUND procedureId not found
NULL_ARGUMENT procedureId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteProcedures
Description

Deletes all Procedures in this Cookbook.

ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageProcedureAliases
Description

Tests if this user can manage Id aliases for Comnents. 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.

Returnboolean false if Procedure aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasProcedure
Description

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

Parametersosid.id.IdprocedureIdthe Id of a Procedure
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND procedureId not found
NULL_ARGUMENT procedureId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.