Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Download the sample plugin.
  2. Extract the downloaded plugin in to a folder and delete jar file. Eg. os-sample-plugin

    Code Block
    languagebash
    $ jar -xvf os-sample-plugin.jar


  3. To change a field name appearing in UI, edit file os-sample-plugin/test/META-INF/resources/os-plugin/i18n/en.js and add add previous and new name of the field which needs to be changed in the key value format. Eg. To  change Change the field name 'Short Title field in Distribution protocol to appear as ' to 'Request ID' of Distribution protocol.

    Code Block
    languagejs
    {
    "dp" : {
        "short_title": "Request ID"
      }
    }


  4. Save and exit os-sample-plugin/test/META-INF/resources/os-plugin/i18n/en.js the file.The en.js file will change the value in UI. To  change the a field in backend and in Templates message.properties needs to be updated.

Change the field name from BO templates

To change the field anem from the BO templates, user has to be update the message.properties file.

Follow below steps to update the message.properties file:

  1. Edit os-sample-plugin/os-plugin-jar/errors/message.properties to change the value of field in backend. Search
  2. the
  3. for the field name that needs to be changed. 

  4. eg. If dp_short_title should be  Request ID instead of Short Title. 
  5. Eg. Change the field name 'Short Title' to 'Request ID' of Distribution protocol.
  1. Code Block
    languagebash
    dp_short_title = Short Title 

    Replace Short Title with Request ID.

    Code Block
    languagebash
    dp_short_title = Request ID


  2. Save and exit message.properties
  3. Create new plugin using given command:  

    Code Block
    languagebash
    $jar -cf os-sample-plugin.jar META-INF/ pluginContext.xml errors/ pluginApiContext.xml pluginContext.xml
    


  4. Copy the newly created plugin to $OS_HOME/plugins/  and restart OpenSpecimen service.

...