Class UIMetadataService


  • @Component
    public class UIMetadataService
    extends java.lang.Object
    Service for Metadata Templates in the user interface
    • Constructor Detail

      • UIMetadataService

        @Autowired
        public UIMetadataService​(ProjectService projectService,
                                 MetadataTemplateService templateService,
                                 org.springframework.context.MessageSource messageSource)
    • Method Detail

      • updateMetadataTemplate

        public java.lang.String updateMetadataTemplate​(MetadataTemplate template,
                                                       java.util.Locale locale)
                                                throws java.lang.Exception
        Update details within a MetadataTemplate
        Parameters:
        template - Updated MetadataTemplate to save
        locale - Current users Locale
        Returns:
        text to display to the user about the result of the update
        Throws:
        java.lang.Exception - if there is an error updating the template
      • deleteMetadataTemplate

        public java.lang.String deleteMetadataTemplate​(java.lang.Long templateId,
                                                       java.lang.Long projectId,
                                                       java.util.Locale locale)
                                                throws java.lang.Exception
        Remove a MetadataTemplate from a Project
        Parameters:
        templateId - Identifier for a MetadataTemplate to remove
        projectId - Identifier for a Project
        locale - Current users Locale
        Returns:
        text to display to the user about the result of removing the template
        Throws:
        java.lang.Exception - if there is an error deleting the template
      • getMetadataFieldRestrictions

        public java.util.List<SelectOption> getMetadataFieldRestrictions​(java.util.Locale locale)
        Get the list of all metadata restrictions that belong to the current project.
        Parameters:
        locale - Current users Locale
        Returns:
        List of metadata fields restrictions
      • updateMetadataProjectField

        public java.lang.String updateMetadataProjectField​(java.lang.Long projectId,
                                                           java.lang.Long fieldId,
                                                           ProjectMetadataRole newRole,
                                                           java.util.Locale locale)
        Update a restriction level on a metadata field for a project
        Parameters:
        projectId - Identifier for the project
        fieldId - Identifier for the metadata field
        newRole - New project role to set the field to
        locale - Current users Locale
        Returns:
        Message to user on the status of the update
      • setDefaultMetadataTemplate

        public java.lang.String setDefaultMetadataTemplate​(java.lang.Long templateId,
                                                           java.lang.Long projectId,
                                                           java.util.Locale locale)
                                                    throws java.lang.Exception
        Set the default MetadataTemplate for a Project
        Parameters:
        templateId - Identifier for a MetadataTemplate
        projectId - Identifier for a Project
        locale - Current users Locale
        Returns:
        text to display to user about the result of updating the default metadata template
        Throws:
        java.lang.Exception - if there is an error updating the default metadata template for a project
      • getProjectMetadataRoles

        public java.util.List<Role> getProjectMetadataRoles​(java.util.Locale locale)
        Get a list of all metadata roles
        Parameters:
        locale - current users Locale
        Returns:
        List of metadata roles that are available to the suer