Class ProjectLineListController
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.ria.web.projects.metadata.ProjectLineListController
-
@Controller @RequestMapping("/projects/{projectId}/linelist") public class ProjectLineListController extends java.lang.Object
Handles requests for the metadata in a project
-
-
Constructor Summary
Constructors Constructor Description ProjectLineListController(ProjectService projectService, SampleService sampleService, MetadataTemplateService metadataTemplateService, ProjectControllerUtils utils, org.springframework.context.MessageSource messageSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>
deleteMetadataTemplate(java.lang.Long projectId, java.lang.Long templateId, java.util.Locale locale)
Ajax request handler for deleting a specificMetadataTemplate
java.lang.String
getLineListPage(java.lang.Long projectId, java.lang.Long templateId, org.springframework.ui.Model model, java.security.Principal principal)
Get the page to display the project samples linelist.java.lang.String
getLinelistTemplatePage(java.lang.Long projectId, org.springframework.ui.Model model, java.util.Locale locale, java.security.Principal principal)
Get the page to create new linelist templatesjava.util.List<MetadataTemplateField>
getMetadaFieldsForTemplate(java.lang.Long templateId)
Get the metadata fields for a specific templatejava.util.List<MetadataTemplate>
getMetadataTemplates(long projectId, java.util.Locale locale)
java.util.Map<java.lang.String,java.lang.Object>
saveLinelistTemplate(java.lang.Long projectId, java.lang.String templateName, java.util.List<java.util.Map<java.lang.String,java.lang.String>> fields)
Save a new line list template.java.util.Map<java.lang.String,java.lang.Object>
saveMetadataTemplate(long projectId, java.lang.String name, java.util.List<java.lang.String> fields, java.lang.Long templateId, java.util.Locale locale)
Save a list aMetadataTemplateField
as aMetadataTemplate
-
-
-
Constructor Detail
-
ProjectLineListController
@Autowired public ProjectLineListController(ProjectService projectService, SampleService sampleService, MetadataTemplateService metadataTemplateService, ProjectControllerUtils utils, org.springframework.context.MessageSource messageSource)
-
-
Method Detail
-
getLineListPage
@RequestMapping("") public java.lang.String getLineListPage(@PathVariable java.lang.Long projectId, @RequestParam(required=false) java.lang.Long templateId, org.springframework.ui.Model model, java.security.Principal principal)
Get the page to display the project samples linelist.- Parameters:
projectId
-Long
identifier for the currentProject
templateId
-Long
id for the current templatemodel
-Model
principal
-Principal
currently logged in user.- Returns:
String
path to the current page.
-
getLinelistTemplatePage
@RequestMapping("/linelist-templates") public java.lang.String getLinelistTemplatePage(@PathVariable java.lang.Long projectId, org.springframework.ui.Model model, java.util.Locale locale, java.security.Principal principal)
Get the page to create new linelist templates- Parameters:
projectId
-Long
identifier for the currentProject
model
-Model
locale
-Locale
principal
-Principal
- Returns:
String
path to the page.
-
getMetadaFieldsForTemplate
@RequestMapping("/upload/metadatafields") @ResponseBody public java.util.List<MetadataTemplateField> getMetadaFieldsForTemplate(@RequestParam java.lang.Long templateId)
Get the metadata fields for a specific template- Parameters:
templateId
-Long
identifier for a template- Returns:
List
list ofMetadataTemplateField
for a template.
-
saveLinelistTemplate
@RequestMapping(value="/linelist-templates/save-template/{templateName}", consumes="application/json", method=POST) @ResponseBody public java.util.Map<java.lang.String,java.lang.Object> saveLinelistTemplate(@PathVariable java.lang.Long projectId, @PathVariable java.lang.String templateName, @RequestBody java.util.List<java.util.Map<java.lang.String,java.lang.String>> fields)
Save a new line list template.- Parameters:
projectId
-Long
id for the current projecttemplateName
-String
name for the new templatefields
- The fields to save to the template- Returns:
- The result of saving.
-
getMetadataTemplates
@RequestMapping(value="/templates", method=GET, produces="application/json") @ResponseBody public java.util.List<MetadataTemplate> getMetadataTemplates(@PathVariable long projectId, java.util.Locale locale)
- Parameters:
projectId
-Long
identifier for aProject
locale
- users currentLocale
- Returns:
List
ofMetadataTemplate
-
saveMetadataTemplate
@RequestMapping(value="/templates", method=POST) @ResponseBody public java.util.Map<java.lang.String,java.lang.Object> saveMetadataTemplate(@PathVariable long projectId, @RequestParam java.lang.String name, @RequestParam("fields[]") java.util.List<java.lang.String> fields, @RequestParam(required=false) java.lang.Long templateId, java.util.Locale locale)
Save a list aMetadataTemplateField
as aMetadataTemplate
- Parameters:
projectId
- identifier for the currentProject
fields
-List
ofString
names ofMetadataTemplateField
name
-String
name for the new template.templateId
- ID of the template to update. Will create new template if nulllocale
- Locale of teh logged in user- Returns:
- the saved
MetadataTemplate
and a response message
-
deleteMetadataTemplate
@RequestMapping(value="/templates/{templateId}", method=DELETE) @ResponseBody public java.util.Map<java.lang.String,java.lang.String> deleteMetadataTemplate(@PathVariable java.lang.Long projectId, @PathVariable java.lang.Long templateId, java.util.Locale locale)
Ajax request handler for deleting a specificMetadataTemplate
- Parameters:
projectId
-Long
identifier for aProject
templateId
-Long
identifier for aMetadataTemplate
locale
-Locale
- Returns:
Map
of success message.
-
-