OSID Logo
OSID Specifications
contact package
Version 3.1.0
Interfaceosid.contact.ContactAdminSession
Implementsosid.OsidSession
Implemented Byosid.contact.batch.ContactBatchAdminSession
Used Byosid.contact.ContactManager
osid.contact.ContactProxyManager
Description

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

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

The delete operations delete Addresses. To unmap a Contact from the current AddressBook, the ContactAddressBookAssignmentSession should be used. These delete operations attempt to remove the Address itself thus removing it from all known ContactForm catalogs.

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

MethodgetAddressBookId
Description

Gets the AddressBook Id associated with this session.

Returnosid.id.Id the AddressBook Id associated with this session
Compliancemandatory This method must be implemented.
MethodgetAddressBook
Description

Gets the AddressBook associated with this session.

Returnosid.contact.AddressBook the address book
ErrorsOPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcanCreateContacts
Description

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

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

Parametersosid.type.Type[]contactRecordTypes array of contact record types
Returnboolean true if Contact creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT contactRecordTypes is null
Compliancemandatory This method must be implemented.
MethodgetContactFormForCreate
Description

Gets the contact form for creating new contacts. A new form should be requested for each create transaction.

Parametersosid.id.IdaddressId the Id for the address
osid.id.IdreferenceId the Id for the reference
osid.type.Type[]contactRecordTypes array of contact record types
Returnosid.contact.ContactForm the contact form
ErrorsNOT_FOUND addressId is not found
NULL_ARGUMENT addressId, referenceId, or contactRecordTypes is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED unable to get form for requested record types
Compliancemandatory This method must be implemented.
MethodcreateContact
Description

Creates a new Contact.

Parametersosid.contact.ContactFormcontactForm the form for this Contact
Returnosid.contact.Contact the new Contact
ErrorsILLEGAL_STATE contactForm already used in a create transaction
INVALID_ARGUMENT one or more of the form elements is invalid
NULL_ARGUMENT contactForm is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED contactForm did not originate from getContactFormForCreate()
Compliancemandatory This method must be implemented.
MethodcanUpdateContacts
Description

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

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

Parametersosid.id.IdcontactId the Id of the Contact
Returnosid.contact.ContactForm the contact form
ErrorsNOT_FOUND contactId is not found
NULL_ARGUMENT contactId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodupdateContact
Description

Updates an existing contact.

Parametersosid.contact.ContactFormcontactForm the form containing the elements to be updated
ErrorsILLEGAL_STATE contactForm already used in an update transaction
INVALID_ARGUMENT the form contains an invalid value
NULL_ARGUMENT contactForm is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED contactForm did not originate from getContactFormForUpdate()
Compliancemandatory This method must be implemented.
MethodcanDeleteContacts
Description

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

Deletes a Contact.

Parametersosid.id.IdcontactId the Id of the Contact to remove
ErrorsNOT_FOUND contactId not found
NULL_ARGUMENT contactId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcanManageContactAliases
Description

Tests if this user can manage Id aliases for Contacts. 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 Contact aliasing is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodaliasContact
Description

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

Parametersosid.id.IdcontactId the Id of a Contact
osid.id.IdaliasId the alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND contactId not found
NULL_ARGUMENT contactId or aliasId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.