com.sas.hls.drug.project
Interface ProjectService


public interface ProjectService

Project service provides methods to manage the life cycle of a project and get information about a project. A user with appropriate authorization can create, delete, update or get project details using the appropriate methods of this service. A project is defined within an organization context and the context is required for creating and getting information about a project.


Method Summary
 Project createProject(OrganizationDescriptor organizationContext, String projectName, List<Attribute> attributes)
          Create a project within the specified organization.
 void deleteProject(ProjectDescriptor project)
          Delete the specified project.
 List<AttributeDefinition> getAttributeDefinitionsForProject()
          Get the set of definitions for attributes defined for project type including system and extended attribute types.
 List<AttributeDefinition> getAttributeDefinitionsForProjectType()
          Deprecated. As of Java API 1.7. Replaced with getAttributeDefinitionsForProject().
 List<Attribute> getCreationAttributesForProject()
          Get the set of attributes that can be used for creating a project.
 List<Attribute> getCreationAttributesForProjectType()
          Deprecated. As of Java API 1.7. Replaced with getCreationAttributesForProject().
 Project getProjectByIdentifier(String projectIdentifier)
          Get a project using its unique identifier in the system.
 Project getProjectByName(OrganizationDescriptor organization, String projectName)
          Get project by specifying the organization context and name within that context.
 ProjectDescriptor getProjectDescriptorByIdentifier(String projectIdentifier)
          Get a light-weight representation of a project using its unique identifier in the system.
 ProjectDescriptor getProjectDescriptorByName(OrganizationDescriptor organization, String projectName)
          Get a light-weight representation of a project by specifying the organization context and name within that context.
 List<ProjectDescriptor> getProjectDescriptorsByOrganization(OrganizationDescriptor organization)
          Get light-weight representations of all projects associated with the given organization context.
 List<Project> getProjectsByOrganization(OrganizationDescriptor organization)
          Get all projects associated with the given organization context.
 boolean projectExists(OrganizationDescriptor organization, String projectName)
          Test the existence of a project by its organization context and name.
 Project renameProject(Project project, String newName)
          Rename the specified project with the new name specified.
 Project setProjectState(ProjectDescriptor projectDescriptor, State state, String comment, boolean includeAnalyses)
          Set the state for the project
 Project updateProject(Project project)
          Update a project.
 

Method Detail

createProject

Project createProject(OrganizationDescriptor organizationContext,
                      String projectName,
                      List<Attribute> attributes)
                      throws OrganizationNotFoundException,
                             ProjectExistsException
Create a project within the specified organization. The user creating this project will be the default owner of the project.

Parameters:
organizationContext - Organization with which this project will be associated
projectName - Name of the project
attributes - A collection of Attribute objects associated with the Project type that can be specified at project creation. Use getCreationAttributesForProjectType() to get the collection of creation attributes.
Returns:
The newly created project.
Throws:
OrganizationNotFoundException - The specified organization does not exist in the system
ProjectExistsException - A project already exists in the system with that name and parent organization.

updateProject

Project updateProject(Project project)
                      throws ProjectNotFoundException
Update a project. Information that can be updated with this method are the Project Lead and editable attributes such as Description.

Parameters:
project - The project to be updated.
Returns:
The updated project
Throws:
ProjectNotFoundException - Thrown if a project with the specified identifier does not exist in the system.
See Also:
ProjectDescriptor.setAttributes(List), Project.setLead(String)

getProjectByIdentifier

Project getProjectByIdentifier(String projectIdentifier)
                               throws ProjectNotFoundException
Get a project using its unique identifier in the system.

Parameters:
projectIdentifier - The unique identifier representing this project.
Returns:
The desired project.
Throws:
ProjectNotFoundException - A project with the specified identifier does not exist in the system.

getProjectDescriptorByIdentifier

ProjectDescriptor getProjectDescriptorByIdentifier(String projectIdentifier)
                                                   throws ProjectNotFoundException
Get a light-weight representation of a project using its unique identifier in the system.

Parameters:
projectIdentifier - The unique identifier representing this project.
Returns:
The desired projectDescriptor.
Throws:
ProjectNotFoundException - A project with the specified identifier does not exist in the system.

getProjectByName

Project getProjectByName(OrganizationDescriptor organization,
                         String projectName)
                         throws ProjectNotFoundException
Get project by specifying the organization context and name within that context.

Parameters:
organization - The parent organization of the project.
projectName - The name of the project
Returns:
Project The desired project.
Throws:
ProjectNotFoundException - A project with the specified name does not exist in the specified organization.

getProjectDescriptorByName

ProjectDescriptor getProjectDescriptorByName(OrganizationDescriptor organization,
                                             String projectName)
                                             throws ProjectNotFoundException
Get a light-weight representation of a project by specifying the organization context and name within that context.

Parameters:
organization - The parent organization of the project.
projectName - The name of the project
Returns:
The desired project descriptor.
Throws:
ProjectNotFoundException - A project with the specified name does not exist in the specified organization.

getProjectDescriptorsByOrganization

List<ProjectDescriptor> getProjectDescriptorsByOrganization(OrganizationDescriptor organization)
                                                            throws OrganizationNotFoundException
Get light-weight representations of all projects associated with the given organization context.

Parameters:
organization - The parent organization of the projects.
Returns:
A list of project descriptors for all projects in the organization.
Throws:
OrganizationNotFoundException - The specified organization does not exist.

getProjectsByOrganization

List<Project> getProjectsByOrganization(OrganizationDescriptor organization)
                                        throws OrganizationNotFoundException
Get all projects associated with the given organization context.

Parameters:
organization - The parent organization of the projects.
Returns:
A list of all projects in the organization.
Throws:
OrganizationNotFoundException - The specified organization does not exist.

projectExists

boolean projectExists(OrganizationDescriptor organization,
                      String projectName)
Test the existence of a project by its organization context and name.

Parameters:
organization - The parent organization of the project.
projectName - The name of the project in question.
Returns:
true if the project exists and user is authorized to view this project, false otherwise

deleteProject

void deleteProject(ProjectDescriptor project)
                   throws ProjectNotFoundException
Delete the specified project. The user needs to have delete permissions granted in order to delete a project. The deleted project will be moved to the trashcan and reside there until a user with appropriate authorization can permanently delete it.

Parameters:
project - The project to be deleted.
Throws:
ProjectNotFoundException - The project to be deleted does not exist.

renameProject

Project renameProject(Project project,
                      String newName)
                      throws ProjectNotFoundException,
                             ProjectRenameException
Rename the specified project with the new name specified. The user needs to have properties write permission granted in order to rename a project.

Parameters:
project - The project to be renamed.
newName - The new name for the project.
Returns:
The renamed project.
Throws:
ProjectNotFoundException - The project to be deleted does not exist.
ProjectRenameException - The project can not be given the specified name.

getCreationAttributesForProjectType

@Deprecated
List<Attribute> getCreationAttributesForProjectType()
                                                    throws TypeNotFoundException
Deprecated. As of Java API 1.7. Replaced with getCreationAttributesForProject().

Get the set of attributes that can be used for creating a project.

Returns:
List of Attribute objects that includes system and extended attributes that may be specified while creating a project. The name fields are initialized while the value fields are set to a null value and may be set before passing it into the create method.
Throws:
TypeNotFoundException

getCreationAttributesForProject

List<Attribute> getCreationAttributesForProject()
                                                throws TypeNotFoundException
Get the set of attributes that can be used for creating a project.

Returns:
List of Attribute objects that includes system and extended attributes that may be specified while creating a project. The name fields are initialized while the value fields are set to a null value and may be set before passing it into the create method.
Throws:
TypeNotFoundException

getAttributeDefinitionsForProjectType

@Deprecated
List<AttributeDefinition> getAttributeDefinitionsForProjectType()
                                                                throws TypeNotFoundException
Deprecated. As of Java API 1.7. Replaced with getAttributeDefinitionsForProject().

Get the set of definitions for attributes defined for project type including system and extended attribute types. Each attribute definition will provide attribute metadata such as attribute name, display name, is attribute required, is the attribute user-editable, its type and other relevant information

Returns:
List of attribute definitions
Throws:
TypeNotFoundException

getAttributeDefinitionsForProject

List<AttributeDefinition> getAttributeDefinitionsForProject()
                                                            throws TypeNotFoundException
Get the set of definitions for attributes defined for project type including system and extended attribute types. Each attribute definition will provide attribute metadata such as attribute name, display name, is attribute required, is the attribute user-editable, its type and other relevant information

Returns:
List of attribute definitions
Throws:
TypeNotFoundException

setProjectState

Project setProjectState(ProjectDescriptor projectDescriptor,
                        State state,
                        String comment,
                        boolean includeAnalyses)
                        throws ProjectNotFoundException,
                               ProjectStateException
Set the state for the project

Parameters:
projectDescriptor - The light-weight representation of the project
state - The state to set on the project
comment - Optionally, a comment about the state change
includeAnalyses - Whether to apply the state change to analyses as well
Returns:
The project with the new state
Throws:
ProjectNotFoundException - The project does not exist.
ProjectStateException - The project state could not be set.


Copyright (c) 2016, SAS Institute Inc., Cary, NC, USA