Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

Introduction

This document describes the steps to create a plugin to change the labels in UI and error messages. This guide is intended for developers or technical IT staff.

Steps

  1. Download the sample plugin.
  2. Extract the downloaded plugin zip into a directory. Lets say $PLUGIN_HOME to exploded directory. 
  3. Change UI labels :- We need to add key and value of the labels into en.js file. It will override the default labels specified in OpenSpecimen. Follow below steps 
    1. Open the file $PLUGIN_HOME/src/main/webapp/app/i18n/en.js
    2. Suppose we want to change below labels to 
      1. "Collection Protocols" to "Studies"
      2. "Create Collection Protocol" to "Create Study"
      3. "Title" to "Study Name"
    3.  Add below JSON into opened en.js file. For keys of the values search in en.js file of the OS code with existing name. 

      {
      	"cp": {
            "list": "Studies",
            "create_cp_title": "Create Study",
            "title": "Study Name"
        }
      }
  4. Change server error messages :- We need to change the messages specified in messages.properties file. It will override the default messages specified in OpenSpecimen.
    1.  Open the file $PLUGIN_HOME/src/main/resources/errors/messages.properties
    2. Suppose we want to change below error message 
      1. "Collection Protocol with same title {0} already exists." => "Study with same title {0} already exists."
      2. Add below property in opened messages.properties file. For keys of the messages search in messages.properties file of the OS code with existing message. 

        cp_dup_title=Study with same title {0} already exists.
  5. To create the plugin jar, execute the below commands from $PLUGIN_HOME directory :
    gradle clean; gradle build
  6. The plugin jar will get created at ${PLUGIN_HOME}/build/libs/os-messages-1.0.0.jar
  7. Copy create jar and paste into plugins directory
  8. Restart the tomcat. 



  • No labels