OSID Logo
OSID Specifications
relationship package
Version 3.0.0
Release Candidate Preview
Interfaceosid.relationship.FamilyAdminSession
Implementsosid.OsidSession
Description

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

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

The delete operations delete Families.

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

MethodcanCreateFamilies
Description

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

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

Parametersosid.type.Type[]familyRecordTypesarray of family record types
Returnboolean true if Family creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT familyRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetFamilyFormForCreate
Description

Gets the family form for creating new families. A new form should be requested for each create transaction.

Parametersosid.type.Type[]familyRecordTypesarray of family record types
Returnosid.relationship.FamilyFormthe family form
ErrorsNULL_ARGUMENT familyRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateFamily
Description

Creates a new Family.

Parametersosid.relationship.FamilyFormfamilyFormthe form for this Family.
Returnosid.relationship.Familythe new Family
ErrorsILLEGAL_STATE familyForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT familyForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED familyForm did not originate from getFamilyFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateFamilies
Description

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

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

Parametersosid.id.IdfamilyIdthe Id of the Family
Returnosid.relationship.FamilyFormthe family form
ErrorsNOT_FOUND familyId is not found
NULL_ARGUMENT familyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateFamily
Description

Updates an existing family.

Parametersosid.relationship.FamilyFormfamilyFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE familyForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT familyId or familyForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED familyForm did not originate from getFamilyFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteFamilies
Description

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

Deletes a Family.

Parametersosid.id.IdfamilyIdthe Id of the Family to remove
ErrorsNOT_FOUND familyId not found
NULL_ARGUMENT familyId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageFamilyAliases
Description

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

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

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