OSID Logo
OSID Specifications
profile package
Version 3.0.0
Release Candidate Preview
Interfaceosid.profile.ProfileItemAdminSession
Implementsosid.OsidSession
Description

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

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

The delete operations delete ProfileItems. To unmap a ProfileItem from the current Profile the ProfileItemProfileAssignmentSession should be used. These delete operations attempt to remove the ProfileItem itself thus removing it from all known Profile catalogs.

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

MethodgetProfileId
Description

Gets the Profile Id associated with this session.

Returnosid.id.Idthe Profile Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetProfile
Description

Gets the Profile associated with this session.

Returnosid.profile.Profilethe Profile associated with this session
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateProfileItems
Description

Tests if this user can create ProfileItems. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a ProfileItem 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 ProfileItem creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateProfileItemWithRecordTypes
Description

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

Parametersosid.type.Type[]profileItemRecordTypesarray of profile item record types
Returnboolean true if ProfileItem creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT profileItemRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetProfileItemFormForCreate
Description

Gets the profile item form for creating new profile items. A new form should be requested for each create transaction.

Parametersosid.type.Type[]profileItemRecordTypesarray of profile item record types
Returnosid.profile.ProfileItemFormthe profile item form
ErrorsNULL_ARGUMENT profileItemRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form with requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateProfileItem
Description

Creates a new ProfileItem.

Parametersosid.profile.ProfileItemFormprofileItemFormthe form for this ProfileItem
Returnosid.profile.ProfileItemthe new ProfileItem
ErrorsILLEGAL_STATE profileItemForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT profileItemForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED profileItemForm did not originate from getProfileItemFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateProfileItems
Description

Tests if this user can update ProfileItems. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a ProfileItem 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 profile item modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetProfileItemFormForUpdate
Description

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

Parametersosid.id.IdprofileItemIdthe Id of the ProfileItem
Returnosid.profile.ProfileItemFormthe profile item form
ErrorsNOT_FOUND profileItemId is not found
NULL_ARGUMENT profileItemId is null
OPERATION_FAILEDunable to complete request
CompliancemandatoryThis method must be implemented.
MethodupdateProfileItem
Description

Updates an existing profile item.

Parametersosid.profile.ProfileItemFormprofileItemFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE profileItemForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT profileItemForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED profileItemForm did not originate from getProfileItemFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteProfileItems
Description

Tests if this user can delete ProfileItems. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a ProfileItem 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 ProfileItem deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteProfileItem
Description

Deletes the ProfileItem identified by the given Id.

Parametersosid.id.IdprofileItemIdthe Id of the ProfileItem to delete
ErrorsNOT_FOUNDa ProfileItem was not found identified by the given Id
NULL_ARGUMENT profileItemId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageProfileItemAliases
Description

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

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

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