Announcement

Collapse
No announcement yet.

External Javascript as Resources ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • External Javascript as Resources ?

    Hello,

    I know that it is possible adding an external javascript file to a transformer with absolute path like this

    I know that is is also possible adding a file that is located in Mirth Connect\custom-lib path


    I need to add javascript files that are in a configurable folder, may be in resources folder, but I can not use it :

    Caused by: java.io.FileNotFoundException: File 'mylib\script.js' does not exist

    I also try using velocity ${'mypath'} but it does not work

    Could you help me ?

    Best regard, S├ębastien

  • #2
    One possibility would be to place the following line of code in the channel deploy script:
    Code:
    var externalScript = eval ("" + FileUtil.read(configurationMap.get('dynamicRootPath') + "/some/relative/path/yourScript.js"));
    This would read an external script with a dynamic root path that is configured in the configuration map and make it available to the channel.

    Comment

    Working...
    X