public interface ProjectAdminSession extends OsidSession
This session creates, updates, and deletes Projects.
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
Project,
a ProjectForm
is requested using
getProjectFormForCreate()
specifying the desired building and
record Types
or none if no record Types
are
needed. The returned ProjectForm
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 ProjectForm
is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
ProjectForm
corresponds to an attempted transaction.
For updates, ProjectForms
are requested to the
Project
Id
that is to be updated using
getProjectFormForUpdate().
Similarly, the ProjectForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The ProjectForm
can only be used once for a successful update and cannot be reused.
The delete operations delete Projects.
To unmap a
Project
from the current Campus,
the
ProjectCampusAssignmentSession
should be used. These delete
operations attempt to remove the Project
itself thus
removing it from all known Campus
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 |
aliasProject(Id projectId,
Id aliasId)
Adds an
Id to a Project for the purpose
of creating compatibility. |
boolean |
canCreateProjects()
Tests if this user can create
Projects. |
boolean |
canCreateProjectWithRecordTypes(Type[] projectRecordTypes)
Tests if this user can create a single
Project using
the desired record interface types. |
boolean |
canDeleteProjects()
Tests if this user can delete
Projects A return of true
does not guarantee successful authorization. |
boolean |
canManageProjectAliases()
Tests if this user can manage
Id aliases for
Projects. |
boolean |
canUpdateProjects()
Tests if this user can update
Projects. |
Project |
createProject(ProjectForm projectForm)
Creates a new
Project. |
void |
deleteProject(Id projectId)
Deletes a
Project. |
Campus |
getCampus()
Gets the
Campus associated with this session. |
Id |
getCampusId()
Gets the
Campus Id associated with this
session. |
ProjectForm |
getProjectFormForCreate(Id buildingId,
Type[] projectRecordTypes)
Gets the project form for creating new projects.
|
ProjectForm |
getProjectFormForUpdate(Id projectId)
Gets the project form for updating an existing project.
|
void |
updateProject(ProjectForm projectForm)
Updates an existing project.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getCampusId()
Campus
Id
associated with this
session. Campus Id
associated with this sessionmandatory
- This method must be implemented. Campus getCampus() throws OperationFailedException, PermissionDeniedException
Campus
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateProjects()
Projects.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Project
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 Project
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateProjectWithRecordTypes(Type[] projectRecordTypes)
Project
using
the desired record interface types. While
RoomConstructionManager.getProjectRecordTypes()
can be used to
examine which record interfaces are supported, this method tests which
record(s) are required for creating a specific Project.
Providing an empty array tests if a Project
can be
created with no records.projectRecordTypes
- array of project record types true
if Project
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- projectRecordTypes
is null
mandatory
- This method must be implemented. ProjectForm getProjectFormForCreate(Id buildingId, Type[] projectRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
buildingId
- the Id
of the buildingprojectRecordTypes
- array of project record typesNotFoundException
- buildngId
is not
foundNullArgumentException
- buildngId
or
projectRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get from for requested
record typesmandatory
- This method must be implemented. Project createProject(ProjectForm projectForm) throws OperationFailedException, PermissionDeniedException
Project.
projectForm
- the form for this Project
Project
IllegalStateException
- projectForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- projectForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- projectForm
did
not originate from getProjectFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateProjects()
Projects.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a Project
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 Project
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. ProjectForm getProjectFormForUpdate(Id projectId) throws NotFoundException, OperationFailedException, PermissionDeniedException
projectId
- the Id
of the Project
NotFoundException
- projectId
is not
foundNullArgumentException
- projectId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateProject(ProjectForm projectForm) throws OperationFailedException, PermissionDeniedException
projectForm
- the form containing the elements to be updatedIllegalStateException
- projectForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- projectForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- projectForm
did
not originate from getProjectFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteProjects()
Projects
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting a Project
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 Project
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteProject(Id projectId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Project.
projectId
- the Id
of the Project
to removeNotFoundException
- projectId
not foundNullArgumentException
- projectId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageProjectAliases()
Id
aliases for
Projects.
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 Project
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasProject(Id projectId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Project
for the purpose
of creating compatibility. The primary Id
of the
Project
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the
alias is a pointer to another project, it is reassigned to the given
project Id.
projectId
- the Id
of a Project
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- projectId
not foundNullArgumentException
- projectId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.