web stats
External Javascript as Resources ? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-24-2017, 05: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 ?

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

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.
Reply With Quote
Reply

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 12:14 AM.


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