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

This session provides methods to re-assign Contacts to AddressBooks. A Contact may map to multiple AddressBooks and removing the last reference to a Contact is the equivalent of deleting it. Each AddressBook may have its own authorizations governing who is allowed to operate on it.

Adding a reference of a Contact to another AddressBook is not a copy operation (eg: does not change its Id ).

MethodcanAssignContacts
Description

Tests if this user can alter contact/address book mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.

Returnboolean false if mapping is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanAssignContactsToAddressBook
Description

Tests if this user can alter contact/address book mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.

Parametersosid.id.IdaddressBookIdthe Id of the AddressBook
Returnboolean false if mapping is not authorized, true otherwise
ErrorsNULL_ARGUMENT addressBookId is null
CompliancemandatoryThis method must be implemented.
MethodgetAssignableAddressBookIds
Description

Gets a list of address books including and under the given address book node in which any contact can be assigned.

Parametersosid.id.IdaddressBookIdthe Id of the AddressBook
Returnosid.id.IdListlist of assignable address book Ids
ErrorsNULL_ARGUMENT addressBookId is null
OPERATION_FAILEDunable to complete request
CompliancemandatoryThis method must be implemented.
MethodgetAssignableAddressBookIdsForContact
Description

Gets a list of address books including and under the given address book node in which a specific contact can be assigned.

Parametersosid.id.IdaddressBookIdthe Id of the AddressBook
osid.id.IdcontactIdthe Id of the Contact
Returnosid.id.IdListlist of assignable address book Ids
ErrorsNULL_ARGUMENT addressBookId or contactId is null
OPERATION_FAILEDunable to complete request
CompliancemandatoryThis method must be implemented.
MethodassignContactToAddressBook
Description

Adds an existing Contact to an AddressBook.

Parametersosid.id.IdcontactIdthe Id of the Contact
osid.id.IdaddressBookIdthe Id of the AddressBook
ErrorsALREADY_EXISTS contactId is already assigned to addressBookId
NOT_FOUND contactId or addressBookId not found
NULL_ARGUMENT contactId or addressBookId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodunassignContactFromAddressBook
Description

Removes a Contact from an AddressBook.

Parametersosid.id.IdcontactIdthe Id of the Contact
osid.id.IdaddressBookIdthe Id of the AddressBook
ErrorsNOT_FOUND contactId or addressBookId not found or contactId not assigned to addressBookId
NULL_ARGUMENT contactId or addressBookId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodreassignContactToAddressBook
Description

Moves a Contact from one AddressBook to another. Mappings to other AddressBooks are unaffected.

Parametersosid.id.IdcontactIdthe Id of the Contact
osid.id.IdfromAddressBookIdthe Id of the current AddressBook
osid.id.IdtoAddressBookIdthe Id of the destination AddressBook
ErrorsNOT_FOUND contactId, fromAddressBookId, or toAddressBookId not found or contactId not mapped to fromAddressBookId
NULL_ARGUMENT contactId, fromAddressBookId, or toAddressBookId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.