Class ProjectLineListController


  • @Controller
    @RequestMapping("/projects/{projectId}/linelist")
    public class ProjectLineListController
    extends java.lang.Object
    Handles requests for the metadata in a project
    • 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 specific MetadataTemplate
      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 templates
      java.util.List<MetadataTemplateField> getMetadaFieldsForTemplate​(java.lang.Long templateId)
      Get the metadata fields for a specific template
      java.util.List<MetadataTemplate> getMetadataTemplates​(long projectId, java.util.Locale locale)
      Get a List of MetadataTemplates for a specific Project
      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)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 current Project
        templateId - Long id for the current template
        model - 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 current Project
        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 of MetadataTemplateField 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 project
        templateName - String name for the new template
        fields - 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)
        Get a List of MetadataTemplates for a specific Project
        Parameters:
        projectId - Long identifier for a Project
        locale - users current Locale
        Returns:
        List of MetadataTemplate
      • 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)
        Parameters:
        projectId - identifier for the current Project
        fields - List of String names of MetadataTemplateField
        name - String name for the new template.
        templateId - ID of the template to update. Will create new template if null
        locale - 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 specific MetadataTemplate
        Parameters:
        projectId - Long identifier for a Project
        templateId - Long identifier for a MetadataTemplate
        locale - Locale
        Returns:
        Map of success message.