Interface ProjectAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
ProjectBatchAdminSession
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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasProject(Id projectId, Id aliasId) Adds anIdto aProjectfor the purpose of creating compatibility.booleanTests if this user can createProjects.booleancanCreateProjectWithRecordTypes(Type[] projectRecordTypes) Tests if this user can create a singleProjectusing the desired record types.booleanTests if this user can deleteProjectsA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forProjects.booleanTests if this user can updateProjects.createProject(ProjectForm projectForm) Creates a newProject.voiddeleteProject(Id projectId) Deletes aProject.Gets theCampusassociated with this session.Gets theCampusIdassociated with this session.getProjectFormForCreate(Id buildingId, Type[] projectRecordTypes) Gets the project form for creating new projects.getProjectFormForUpdate(Id projectId) Gets the project form for updating an existing project.voidupdateProject(ProjectForm projectForm) Updates an existing project.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getCampusId
Id getCampusId()Gets theCampusIdassociated with this session.- Returns:
- the
Campus Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getCampus
Gets theCampusassociated with this session.- Returns:
- the campus
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateProjects
boolean canCreateProjects()Tests if this user can createProjects. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aProjectwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifProjectcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateProjectWithRecordTypes
Tests if this user can create a singleProjectusing the desired record types. WhileRoomConstructionManager.getProjectRecordTypes()can be used to examine which record interfaces are supported, this method tests which record(s) are required for creating a specificProject. Providing an empty array tests if aProjectcan be created with no records.- Parameters:
projectRecordTypes- array of project record types- Returns:
trueifProjectcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-projectRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getProjectFormForCreate
ProjectForm getProjectFormForCreate(Id buildingId, Type[] projectRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the project form for creating new projects. A new form should be requested for each create transaction.- Parameters:
buildingId- theIdof the buildingprojectRecordTypes- array of project record types- Returns:
- the project form
- Throws:
NotFoundException-buildngIdis not foundNullArgumentException-buildngIdorprojectRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get from for requested record types- Compliance:
mandatory- This method must be implemented.
-
createProject
Project createProject(ProjectForm projectForm) throws OperationFailedException, PermissionDeniedException Creates a newProject.- Parameters:
projectForm- the form for thisProject- Returns:
- the new
Project - Throws:
IllegalStateException-projectFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-projectFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-projectFormdid not originate fromgetProjectFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateProjects
boolean canUpdateProjects()Tests if this user can updateProjects. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aProjectwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifProjectmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getProjectFormForUpdate
ProjectForm getProjectFormForUpdate(Id projectId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the project form for updating an existing project. A new project form should be requested for each update transaction.- Parameters:
projectId- theIdof theProject- Returns:
- the project form
- Throws:
NotFoundException-projectIdis not foundNullArgumentException-projectIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateProject
void updateProject(ProjectForm projectForm) throws OperationFailedException, PermissionDeniedException Updates an existing project.- Parameters:
projectForm- the form containing the elements to be updated- Throws:
IllegalStateException-projectFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-projectFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-projectFormdid not originate fromgetProjectFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteProjects
boolean canDeleteProjects()Tests if this user can deleteProjectsA return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aProjectwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifProjectdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteProject
void deleteProject(Id projectId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aProject.- Parameters:
projectId- theIdof theProjectto remove- Throws:
NotFoundException-projectIdnot foundNullArgumentException-projectIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageProjectAliases
boolean canManageProjectAliases()Tests if this user can manageIdaliases forProjects. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifProjectaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasProject
void aliasProject(Id projectId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aProjectfor the purpose of creating compatibility. The primaryIdof theProjectis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another project, it is reassigned to the given projectId.- Parameters:
projectId- theIdof aProjectaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-projectIdnot foundNullArgumentException-projectIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-