OSID Logo
OSID Specifications
contact package
Version 3.0.0
Release Candidate Preview
Interfaceosid.contact.AddressBookAdminSession
Implementsosid.OsidSession
Description

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

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

The delete operations delete AddressBooks.

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

MethodcanCreateAddressBooks
Description

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

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

Parametersosid.type.Type[]addressBookRecordTypesarray of address book types
Returnboolean true if AddressBook creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT addressBookRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetAddressBookFormForCreate
Description

Gets the address book form for creating new address books. A new form should be requested for each create transaction.

Parametersosid.type.Type[]addressBookRecordTypesarray of address book types
Returnosid.contact.AddressBookFormthe address book form
ErrorsNULL_ARGUMENT addressBookRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateAddressBook
Description

Creates a new AddressBook.

Parametersosid.contact.AddressBookFormaddressBookFormthe form for this AddressBook
Returnosid.contact.AddressBookthe new AddressBook
ErrorsILLEGAL_STATE addressBookForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT addressBookForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED addressBookForm did not originate from getAddressBookFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateAddressBooks
Description

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

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

Parametersosid.id.IdaddressBookIdthe Id of the AddressBook
Returnosid.contact.AddressBookFormthe address book form
ErrorsNOT_FOUND addressBookId is not found
NULL_ARGUMENT addressBookId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateAddressBook
Description

Updates an existing address book.

Parametersosid.contact.AddressBookFormaddressBookFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE addressBookForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT addressBookId or addressBookForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED addressBookForm did not originate from getAddressBookFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteAddressBooks
Description

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

Deletes an AddressBook.

Parametersosid.id.IdaddressBookIdthe Id of the AddressBook to remove
ErrorsNOT_FOUND addressBookId not found
NULL_ARGUMENT addressBookId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageAddressBookAliases
Description

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

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

Parametersosid.id.IdaddressBookIdthe Id of an AddressBook
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND addressBookId not found
NULL_ARGUMENT addressBookId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.