No announcement yet.

Inject JavaScript functions via Extensions/Plugins

  • Filter
  • Time
  • Show
Clear All
new posts

  • Inject JavaScript functions via Extensions/Plugins

    I'm searching to inject predefined JavaScript functions (like createSegmentAfter(), getArrayOrXmlLength() ) via an Extension / Plugin in all JavaScript contexts on the server side of Mirth Connect

    Actually, we want to add 'read-only' code templates. (Code templates that can't changed anymore in the Mirth Connect Administrator)

    I've found in the Source Code of 'connect-development' that these predefined functions (that are now automatically shipped with mirth) are injected via the ' er' class.

    I've already found how to add Code Templates on the Client side via the CodeTemplatePlugin but when you add these code templates at the client side, the functions are not injected at the server side, so when you add Code Templates via the CodeTemplatePlugin, you can only use the this for Drag and drop Code Templates?

    Someone that can help me or have done something like this?

    codeTemplatePlugin.png defcodetemplates.png

  • #2
    Just a note that the paid plugin "User Authorization" does support read only code templates by role name for others reading the post.
    Last edited by pacmano; 11-26-2021, 12:31 PM.
    Diridium Technologies, Inc.


    • #3
      I believe you are correct that you can only add "drag-and-drop" type code templates via the plugin. I think the idea is to implement functionality in java, and then provide the client code templates for calling the java library.