Class ProjectSamplesMetadataTemplateController
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.ria.web.projects.metadata.ProjectSamplesMetadataTemplateController
-
@Controller @RequestMapping("/projects/{projectId}/metadata-templates") public class ProjectSamplesMetadataTemplateController extends java.lang.Object
Handles requests forMetadataTemplate
s in aProject
-
-
Constructor Summary
Constructors Constructor Description ProjectSamplesMetadataTemplateController(ProjectService projectService, ProjectControllerUtils projectControllerUtils, MetadataTemplateService metadataTemplateService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
deleteMetadataTemplate(java.lang.Long projectId, java.lang.Long templateId)
Delete aMetadataTemplate
within aProject
void
downloadTemplate(java.lang.Long templateId, javax.servlet.http.HttpServletResponse response)
Download aMetadataTemplate
as an Excel file.java.util.List<java.lang.String>
getMetadataKeysForProject(java.lang.String query)
Search all Metadata keys available for adding to a template.java.lang.String
getMetadataTemplateListPage(java.lang.Long projectId, org.springframework.ui.Model model, java.security.Principal principal)
Get the page to create a newMetadataTemplate
java.lang.String
getMetadataTemplatePage(java.lang.Long projectId, java.lang.Long templateId, java.security.Principal principal, org.springframework.ui.Model model)
Get a the page for a specificMetadataTemplate
java.lang.String
saveMetadataTemplate(java.lang.Long projectId, java.lang.Long id, java.lang.String name, java.util.List<java.lang.String> fields)
Save or update aMetadataTemplate
within aProject
-
-
-
Constructor Detail
-
ProjectSamplesMetadataTemplateController
@Autowired public ProjectSamplesMetadataTemplateController(ProjectService projectService, ProjectControllerUtils projectControllerUtils, MetadataTemplateService metadataTemplateService)
-
-
Method Detail
-
getMetadataTemplateListPage
@RequestMapping("/new") public java.lang.String getMetadataTemplateListPage(@PathVariable java.lang.Long projectId, org.springframework.ui.Model model, java.security.Principal principal)
Get the page to create a newMetadataTemplate
- Parameters:
projectId
-Long
identifier for aProject
model
-Model
spring page modelprincipal
-Principal
currently logged in user- Returns:
String
path to the new template page
-
getMetadataTemplatePage
@RequestMapping("/{templateId}") public java.lang.String getMetadataTemplatePage(@PathVariable java.lang.Long projectId, @PathVariable java.lang.Long templateId, java.security.Principal principal, org.springframework.ui.Model model)
Get a the page for a specificMetadataTemplate
- Parameters:
projectId
-Long
identifier for aProject
templateId
-Long
identifier for aMetadataTemplate
principal
-Principal
currently logged in usermodel
-Model
spring page model- Returns:
String
path to template page
-
saveMetadataTemplate
@RequestMapping(value="/save", method=POST) public java.lang.String saveMetadataTemplate(@PathVariable java.lang.Long projectId, @RequestParam java.lang.Long id, @RequestParam java.lang.String name, @RequestParam java.util.List<java.lang.String> fields)
Save or update aMetadataTemplate
within aProject
- Parameters:
projectId
-Long
identifier for a projectid
-Long
identifier for a templatename
-String
name for the templatefields
-List
of fields names- Returns:
String
result
-
deleteMetadataTemplate
@RequestMapping(value="/delete/{templateId}", method=POST) public java.lang.String deleteMetadataTemplate(@PathVariable java.lang.Long projectId, @PathVariable java.lang.Long templateId)
Delete aMetadataTemplate
within aProject
- Parameters:
projectId
-Long
identifier for aProject
templateId
-Long
identifier for aMetadataTemplate
- Returns:
String
redirects to project - settings - metadata templates
-
downloadTemplate
@RequestMapping("/{templateId}/excel") public void downloadTemplate(@PathVariable java.lang.Long templateId, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
Download aMetadataTemplate
as an Excel file.- Parameters:
templateId
-Long
identifier for aMetadataTemplate
response
-HttpServletResponse
- Throws:
java.io.IOException
- thrown if output stream cannot be used.
-
getMetadataKeysForProject
@RequestMapping("/fields") @ResponseBody public java.util.List<java.lang.String> getMetadataKeysForProject(@RequestParam("q") java.lang.String query)
Search all Metadata keys available for adding to a template.- Parameters:
query
- the query to search for- Returns:
- a list of keys matching the query
-
-