web stats
External Javascript as Resources ? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Thread Tools Display Modes
Old 03-24-2017, 06:50 AM
Omega1863 Omega1863 is offline
What's HL7?
Join Date: Mar 2017
Posts: 2
Omega1863 is on a distinguished road
Default External Javascript as Resources ?


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
Reply With Quote
Old 03-27-2017, 04:18 AM
odo odo is offline
OBX.3 Kenobi
Join Date: Feb 2017
Location: Luxembourg
Posts: 144
odo is on a distinguished road

One possibility would be to place the following line of code in the channel deploy script:
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.
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -8. The time now is 05:43 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation