public interface WorkAdminSession extends OsidSession
This session creates, updates, and deletes Work.
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
Work.
a WorkForm
is requested using
getWorkFormForCreate()
specifying the desired relationship peers
and record Types
or none if no record Types
are needed. The returned WorkForm
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 WorkForm
is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
WorkForm
corresponds to an attempted transaction.
For updates, WorkForms
are requested to the Work
Id
that is to be updated using
getWorkFormForUpdate().
Similarly, the WorkForm
has
metadata about the data that can be updated and it can perform validation
before submitting the update. The WorkForm
can only be used
once for a successful update and cannot be reused.
The delete operations delete Work.
To unmap a
Work
from the current Foundry,
the
WorkFoundryAssignmentSession
should be used. These delete
operations attempt to remove the Work
itself thus removing
it from all known Foundry
catalogs.
This session includes an Id
aliasing mechanism to
assign an external Id
to an internally assigned Id.
Modifier and Type | Method and Description |
---|---|
void |
aliasWork(Id workId,
Id aliasId)
Adds an
Id to a Work for the purpose of
creating compatibility. |
boolean |
canCreateWorks()
Tests if this user can create
Works. |
boolean |
canCreateWorkWithRecordTypes(Type[] workRecordTypes)
Tests if this user can create a single
Work using the
desired record types. |
boolean |
canDeleteWorks()
Tests if this user can delete
Works. |
boolean |
canManageWorkAliases()
Tests if this user can manage
Id aliases for
Works. |
boolean |
canManageWorkStatus()
Tests if this user can change
Work status. |
boolean |
canMoveWork()
Tests if this user can move
Work among jobs. |
boolean |
canUpdateWorks()
Tests if this user can update
Works. |
void |
completeWork(Id workId)
Marks work as complete.
|
Work |
createWork(WorkForm workForm)
Creates a new
Work. |
void |
deleteWork(Id workId)
Deletes a
Work. |
Foundry |
getFoundry()
Gets the
Foundry associated with this session. |
Id |
getFoundryId()
Gets the
Foundry Id associated with this
session. |
WorkForm |
getWorkFormForCreate(Id jobId,
Type[] workRecordTypes)
Gets the work form for creating new work.
|
WorkForm |
getWorkFormForUpdate(Id workId)
Gets the work form for updating an existing work.
|
void |
moveWork(Id workId,
Id jobId)
Moves work to another job.
|
void |
reopenWork(Id workId)
Marks work as incomplete.
|
void |
updateWork(WorkForm workForm)
Updates an existing work.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getFoundryId()
Foundry
Id
associated with this
session. Foundry Id
associated with this sessionmandatory
- This method must be implemented. Foundry getFoundry() throws OperationFailedException, PermissionDeniedException
Foundry
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateWorks()
Works.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating a Work
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer create operations to an
unauthorized user. false
if Work
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateWorkWithRecordTypes(Type[] workRecordTypes)
Work
using the
desired record types. While
ResourcingManager.getWorkRecordTypes()
can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Work.
Providing an
empty array tests if a Work
can be created with no
records.workRecordTypes
- array of work record types true
if Work
creation using the
specified record Types
is supported,
false
otherwiseNullArgumentException
- workRecordTypes
is null
mandatory
- This method must be implemented. WorkForm getWorkFormForCreate(Id jobId, Type[] workRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
jobId
- a job Id
workRecordTypes
- array of work record typesNotFoundException
- jobId
is not foundNullArgumentException
- jobId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Work createWork(WorkForm workForm) throws OperationFailedException, PermissionDeniedException
Work.
workForm
- the form for this Work
Work
IllegalStateException
- workForm
already
used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- workForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- workForm
did not
orginiate from getWorkFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateWorks()
Works.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Work
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer update operations to an
unauthorized user. false
if Work
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. WorkForm getWorkFormForUpdate(Id workId) throws NotFoundException, OperationFailedException, PermissionDeniedException
workId
- the Id
of the Work
NotFoundException
- workId
is not foundNullArgumentException
- workId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateWork(WorkForm workForm) throws OperationFailedException, PermissionDeniedException
workForm
- the form containing the elements to be updatedIllegalStateException
- workForm
already
used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- workForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- workForm
did not
orginiate from getWorkFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteWorks()
Works.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting a Work
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer delete operations to an
unauthorized user. false
if Work
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteWork(Id workId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Work.
workId
- the Id
of the Work
to
removeNotFoundException
- workId
not foundNullArgumentException
- workId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageWorkAliases()
Id
aliases for
Works.
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 Work
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasWork(Id workId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Work
for the purpose of
creating compatibility. The primary Id
of the
Work
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the alias is
a pointer to another work, it is reassigned to the given work
Id.
workId
- the Id
of a Work
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- workId
not foundNullArgumentException
- workId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canMoveWork()
Work
among jobs. A return
of true does not guarantee successful authorization. A return of false
indicates that it is known deleting a Work
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer move operations to an
unauthorized user. false
if Work
moving is not
authorized, true
otherwisemandatory
- This method must be implemented. void moveWork(Id workId, Id jobId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
workId
- the work Id
jobId
- the new job Id
AlreadyExistsException
- work already part of jobNotFoundException
- jobId
or
workId
is not foundNullArgumentException
- jobId
or
workId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageWorkStatus()
Work
status. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting a Work
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer status operations to an
unauthorized user. false
if Work
status is not
authorized, true
otherwisemandatory
- This method must be implemented. void completeWork(Id workId) throws NotFoundException, OperationFailedException, PermissionDeniedException
workId
- the work Id
NotFoundException
- workId
is not foundNullArgumentException
- workId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void reopenWork(Id workId) throws NotFoundException, OperationFailedException, PermissionDeniedException
workId
- the work Id
NotFoundException
- workId
is not foundNullArgumentException
- workId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.