web stats
External Javascript BasePath - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 04-10-2012, 12:01 PM
owright owright is offline
Mirth Newb
 
Join Date: Aug 2011
Posts: 6
owright is on a distinguished road
Default External Javascript BasePath

Hello Mirth Community,

I am trying to specify a base path in the External Javascript path textbox and cannot seem to do it. Is there a way to hack one in?

I was trying:
$("MirthConnectInstallDir")\custom-script\mine.js
$(MirthConnectInstallDir)\custom-script\mine.js

where MirthConnectInstallDir is defined in my global and channel Map.

Thank you for your time.
Reply With Quote
  #2  
Old 04-10-2012, 12:06 PM
owright owright is offline
Mirth Newb
 
Join Date: Aug 2011
Posts: 6
owright is on a distinguished road
Default

OK so I suppose just having, "custom-script\mine.js" works fine.

However, I would still like to know if there is a way to make a base path work with this though.
Reply With Quote
  #3  
Old 04-11-2012, 01:15 AM
mourisj mourisj is offline
Mirth Guru
 
Join Date: Feb 2007
Location: Luxembourg
Posts: 398
mourisj is an unknown quantity at this point
Default

In fact, you can use any path accessible on your network.
Like '//myfilserver/myshare$/myfolder/mysubflolder' or any other.
This will be an absolute path, this is good if you need to access the same script from different servers.
If you do not start your path with slashes, it will be relative to the installation directory.

If you use backslashes, you eventually need to escape them by doubling them, so the above path would be '\\\\myfilserver\\myshare$\\myfolder\\mysubflolder '
__________________
JJ Mouris
FFE Luxembourg
IT-Department
Reply With Quote
  #4  
Old 04-11-2012, 05:39 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 3,573
narupley is on a distinguished road
Default

As far as using a variable in that external script path, I don't think there's in "easy" way to do it, but you could have something in the deploy script that iterates through each step of every transformer, checks whether it's an External Script step, and if it is, runs a TemplateValueReplacer against the path property. Then the deploy script would need to save and redeploy the channel (an infinite loop would be avoided by only redeploying if any changes were made).

It's ugly, but it'd work. Of course, if the global variable you want to use is, for example, set earlier in the channel and then used in a later External Script transformer step, then that method wouldn't avail you.
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 -7. The time now is 05:39 PM.


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