OSID Logo
OSID Specifications
personnel package
Version 3.0.0
Release Candidate Preview
Interfaceosid.personnel.AppointmentAdminSession
Implementsosid.OsidSession
Description

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

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

The delete operations delete Appointments. To unmap an Appointment from the current Realm, the AppointmentRealmAssignmentSession should be used. These delete operations attempt to remove the Appointment itself thus removing it from all known Realm catalogs.

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

MethodgetRealmId
Description

Gets the Realm Id associated with this session.

Returnosid.id.Idthe Realm Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetRealm
Description

Gets the Realm associated with this session.

Returnosid.personnel.Realmthe realm
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateAppointments
Description

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

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

Parametersosid.type.Type[]appointmentRecordTypesarray of appointment record types
Returnboolean true if Appointment creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT appointmentRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetAppointmentFormForCreate
Description

Gets the appointment form for creating new appointments. A new form should be requested for each create transaction.

Parametersosid.id.IdpersonIdthe person Id
osid.id.IdpositionIdthe position Id
osid.type.Type[]appointmentRecordTypesarray of appointment record types to be included in the create operation or an empty list if none
Returnosid.personnel.AppointmentFormthe appointment form
ErrorsNOT_FOUND personId or positionId is not found
NULL_ARGUMENT personId, positionId, or appointmentRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDcannot get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateAppointment
Description

Creates a new Appointment.

Parametersosid.personnel.AppointmentFormappointmentFormthe form for this Appointment
Returnosid.personnel.Appointmentthe new Appointment
ErrorsILLEGAL_STATE appointmentForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT appointmentForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED appointmentForm did not originate from getAppointmentFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateAppointments
Description

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

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

Parametersosid.id.IdappointmentIdthe Id of the Appointment
Returnosid.personnel.AppointmentFormthe appointment form
ErrorsNOT_FOUND appointmentId is not found
NULL_ARGUMENT appointmentId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateAppointment
Description

Updates an existing appointment.

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

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

Deletes an Appointment.

Parametersosid.id.IdappointmentIdthe Id of the Appointment to remove
ErrorsNOT_FOUND appointmentId not found
NULL_ARGUMENT appointmentId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageAppointmentAliases
Description

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

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

Parametersosid.id.IdappointmentIdthe Id of an Appointment
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is in use as a primary Id
NOT_FOUND appointmentId not found
NULL_ARGUMENT appointmentId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.