OSID Logo
OSID Specifications
billing package
Version 3.0.0
Release Candidate Preview
Interfaceosid.billing.CategoryAdminSession
Implementsosid.OsidSession
Description

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

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

The delete operations delete Categories. To unmap a Category from the current Business, the CategoryBusinessAssignmentSession should be used. These delete operations attempt to remove the Category itself thus removing it from all known Business catalogs.

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

MethodgetBusinessId
Description

Gets the Business Id associated with this session.

Returnosid.id.Idthe Business Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetBusiness
Description

Gets the Business associated with this session.

Returnosid.billing.Businessthe business
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateCategories
Description

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

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

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

Parametersosid.type.Type[]categoryRecordTypesarray of category record types
Returnboolean true if Category creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT categoryRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetCategoryFormForCreate
Description

Gets the category form for creating new categories. A new form should be requested for each create transaction.

Parametersosid.type.Type[]categoryRecordTypesarray of category record types
Returnosid.billing.CategoryFormthe category form
ErrorsNULL_ARGUMENT categoryRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateCategory
Description

Creates a new Category.

Parametersosid.billing.CategoryFormcategoryFormthe form for this Category
Returnosid.billing.Categorythe new Category
ErrorsILLEGAL_STATE categoryForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT categoryForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED entryForm did not originate from getCategoryFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateCategories
Description

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

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

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

Parametersosid.id.IdcategoryIdthe Id of the Category
Returnosid.billing.CategoryFormthe category form
ErrorsNOT_FOUND categoryId is not found
NULL_ARGUMENT categoryId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateCategory
Description

Updates an existing category.

Parametersosid.billing.CategoryFormcategoryFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE categoryForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT categoryForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED entryForm did not originate from getCategoryFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteCategories
Description

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

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

Deletes a Category.

Parametersosid.id.IdcategoryIdthe Id of the Category to remove
ErrorsNOT_FOUND categoryId not found
NULL_ARGUMENT categoryId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageCategoryAliases
Description

Tests if this user can manage Id aliases for Categories. 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 Category aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasCategory
Description

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

Parametersosid.id.IdcategoryIdthe Id of a Category
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is in use as a primary Id
NOT_FOUND categoryId not found
NULL_ARGUMENT categoryId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.