public interface OfficeAdminSession extends OsidSession
This session creates, updates, and deletes Offices. 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
Office, an OfficeForm is requested using
getOfficeFormForCreate() specifying the desired record
Types or none if no record Types are needed.
The returned OfficeForm 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 OfficeForm is submiited to
a create operation, it cannot be reused with another create operation
unless the first operation was unsuccessful. Each OfficeForm
corresponds to an attempted transaction.
For updates, OfficeForms are requested to the
Office Id that is to be updated using
getOfficeFormForUpdate(). Similarly, the OfficeForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The OfficeForm can
only be used once for a successful update and cannot be reused.
The delete operations delete Offices.
This session includes an Id aliasing mechanism to
assign an external Id to an internally assigned Id.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasOffice(Id officeId,
Id aliasId)
Adds an
Id to an Office for the purpose
of creating compatibility. |
boolean |
canCreateOffices()
Tests if this user can create
Offices. |
boolean |
canCreateOfficeWithRecordTypes(Type[] officeRecordTypes)
Tests if this user can create a single
Office using the
desired record types. |
boolean |
canDeleteOffices()
Tests if this user can delete
Offices. |
boolean |
canManageOfficeAliases()
Tests if this user can manage
Id aliases for
Offices. |
boolean |
canUpdateOffices()
Tests if this user can update
Offices. |
Office |
createOffice(OfficeForm officeForm)
Creates a new
Office. |
void |
deleteOffice(Id officeId)
Deletes an
Office. |
OfficeForm |
getOfficeFormForCreate(Type[] officeRecordTypes)
Gets the office form for creating new offices.
|
OfficeForm |
getOfficeFormForUpdate(Id officeId)
Gets the office form for updating an existing office.
|
void |
updateOffice(OfficeForm officeForm)
Updates an existing office
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseboolean canCreateOffices()
Offices. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating an Office. 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. false if Office creation is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreateOfficeWithRecordTypes(Type[] officeRecordTypes)
Office using the
desired record types. While
WorkflowManager.getOfficeRecordTypes() can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Office. Providing an
empty array tests if an Office can be created with no
records.officeRecordTypes - array of office record types true if Office creation using
the specified record Types is supported,
false otherwiseNullArgumentException - officeRecordTypes
is null mandatory - This method must be implemented. OfficeForm getOfficeFormForCreate(Type[] officeRecordTypes) throws OperationFailedException, PermissionDeniedException
officeRecordTypes - array of office record typesNullArgumentException - officeRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Office createOffice(OfficeForm officeForm) throws OperationFailedException, PermissionDeniedException
Office. officeForm - the form for this Office Office IllegalStateException - officeForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - officeForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - officeForm did
not originate from getOfficeFormForCreate() mandatory - This method must be implemented. boolean canUpdateOffices()
Offices. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating an Office 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. false if Office modification is
not authorized, true otherwisemandatory - This method must be implemented. OfficeForm getOfficeFormForUpdate(Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
officeId - the Id of the Office NotFoundException - officeId is not
foundNullArgumentException - officeId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateOffice(OfficeForm officeForm) throws OperationFailedException, PermissionDeniedException
officeForm - the form containing the elements to be updatedIllegalStateException - officeForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - officeForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - officeForm did
not originate from getOfficeFormForUpdate() mandatory - This method must be implemented. boolean canDeleteOffices()
Offices. A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting an Office 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. false if Office deletion is not
authorized, true otherwisemandatory - This method must be implemented. void deleteOffice(Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Office. officeId - the Id of the Office to
removeNotFoundException - officeId not foundNullArgumentException - officeId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageOfficeAliases()
Id aliases for
Offices. 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. false if Office aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasOffice(Id officeId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to an Office for the purpose
of creating compatibility. The primary Id of the
Office is determined by the provider. The new Id
performs as an alias to the primary Id. officeId - the Id of an Office aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - officeId not foundNullArgumentException - officeId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.