Class UIProjectsService
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.ria.web.services.UIProjectsService
-
@Component public class UIProjectsService extends java.lang.Object
A utility class for formatting responses for the project members page UI.
-
-
Constructor Summary
Constructors Constructor Description UIProjectsService(ProjectService projectService, SampleService sampleService, org.springframework.context.MessageSource messageSource, ProjectOwnerPermission projectOwnerPermission, ManageLocalProjectSettingsPermission projectMembersPermission, MetadataTemplateService metadataTemplateService, UserService userService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Long
createProject(CreateProjectRequest request)
Create a new project based on a request sent by the UI.void
deleteProject(java.lang.Long projectId)
Delete a projectTableResponse
getPagedProjects(TableRequest tableRequest, java.lang.Boolean isAdmin)
Get the table contents for the projects listing table based on the user and table request.java.util.List<Project>
getPotentialProjectsToShareTo(long currentId)
Get a list of projects that the user can share sample to.ProjectDetailsResponse
getProjectInfo(java.lang.Long projectId, java.util.Locale locale)
Get information about a project as well as permissionsjava.util.List<Role>
getProjectRoles(java.util.Locale locale)
Get a list of all roles available on a projectjava.lang.String
updateProcessingCoverage(Coverage coverage, java.lang.Long projectId, java.util.Locale locale)
Update the minimum, maximum coverage or genome size for a project.java.lang.String
updateProcessingPriority(java.lang.Long projectId, AnalysisSubmission.Priority priority, java.util.Locale locale)
Update the priority for a projects automated pipelines.java.lang.String
updateProjectDetails(java.lang.Long projectId, UpdateProjectAttributeRequest request, java.util.Locale locale)
Update a field within the project details.
-
-
-
Constructor Detail
-
UIProjectsService
@Autowired public UIProjectsService(ProjectService projectService, SampleService sampleService, org.springframework.context.MessageSource messageSource, ProjectOwnerPermission projectOwnerPermission, ManageLocalProjectSettingsPermission projectMembersPermission, MetadataTemplateService metadataTemplateService, UserService userService)
-
-
Method Detail
-
createProject
public java.lang.Long createProject(CreateProjectRequest request) throws EntityExistsException, javax.validation.ConstraintViolationException
Create a new project based on a request sent by the UI.- Parameters:
request
-CreateProjectRequest
containing (at the very least) the name for the project- Returns:
- the identifier for the newly created project
- Throws:
EntityExistsException
- if the project already exists.javax.validation.ConstraintViolationException
- if there was a constraint violation with the parameters passed.
-
getProjectRoles
public java.util.List<Role> getProjectRoles(java.util.Locale locale)
Get a list of all roles available on a project- Parameters:
locale
- -Locale
- Returns:
- list of roles and their internationalized strings
-
getPagedProjects
public TableResponse getPagedProjects(TableRequest tableRequest, java.lang.Boolean isAdmin)
Get the table contents for the projects listing table based on the user and table request.- Parameters:
tableRequest
- -TableRequest
isAdmin
- - whether this is the full administration table or a user listing.- Returns:
TableResponse
with the current list of projects
-
getProjectInfo
public ProjectDetailsResponse getProjectInfo(java.lang.Long projectId, java.util.Locale locale) throws AjaxItemNotFoundException
Get information about a project as well as permissions- Parameters:
projectId
- - The project to get info forlocale
- Current users locale- Returns:
ProjectDetailsResponse
- Throws:
AjaxItemNotFoundException
- if project cannot be found
-
updateProjectDetails
public java.lang.String updateProjectDetails(java.lang.Long projectId, UpdateProjectAttributeRequest request, java.util.Locale locale) throws UpdateException
Update a field within the project details.- Parameters:
projectId
-Long
identifier for the projectrequest
-UpdateProjectAttributeRequest
details about which field to updatelocale
-Locale
for the currently logged in user- Returns:
String
explaining to the user the results of the update.- Throws:
UpdateException
- thrown if the update cannot be performed
-
updateProcessingPriority
public java.lang.String updateProcessingPriority(java.lang.Long projectId, AnalysisSubmission.Priority priority, java.util.Locale locale) throws UpdateException
Update the priority for a projects automated pipelines.- Parameters:
projectId
- Identifier for a projectpriority
- updatedAnalysisSubmission.Priority
for running automated workflowslocale
- currently logged in users locale- Returns:
- Message to user about the status of the priority update
- Throws:
UpdateException
- thrown if the update cannot be performed
-
updateProcessingCoverage
public java.lang.String updateProcessingCoverage(Coverage coverage, java.lang.Long projectId, java.util.Locale locale) throws UpdateException
Update the minimum, maximum coverage or genome size for a project.- Parameters:
coverage
- Details about the update to either the minimum/maximum coverage or genome sizeprojectId
- identifier for aProject
locale
- Currently logged in users locale- Returns:
- message to the user about the result of the update
- Throws:
UpdateException
- thrown if there was an error updated the coverage.
-
deleteProject
public void deleteProject(java.lang.Long projectId) throws EntityNotFoundException
Delete a project- Parameters:
projectId
- identifier for the project to delete- Throws:
EntityNotFoundException
- thrown if the identifier does not exist in the database
-
-