Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a userutil package to extensions that allow them to include classes to be imported by the transformer #3405

Closed
rbeckman-nextgen opened this issue May 11, 2020 · 5 comments
Milestone

Comments

@rbeckman-nextgen
Copy link
Collaborator

@rbeckman-nextgen rbeckman-nextgen commented May 11, 2020

Imported Issue. Original Details:
Jira Issue Key: MIRTH-3508
Reporter: wayneh
Created: 2014-10-29T17:11:48.000-0700

@rbeckman-nextgen rbeckman-nextgen added this to the 3.2.0 milestone May 11, 2020
@rbeckman-nextgen
Copy link
Collaborator Author

@rbeckman-nextgen rbeckman-nextgen commented May 11, 2020

Here's one solution:

In JavaScriptBuilder we can just preemptively import all possible userutil packages from plugin packages. If we iterate through the currently loaded plugins and import "com.mirth.connect.plugins.pluginPath.userutil", there's nothing else the core server needs to do. Then you can just add a userutil package to your extension and it will automatically be included in JavaScript contexts when the server starts up.

I think right now the path attribute always happens to be equal to the plugins.* package name, with the exception of datatypes, where it's "datatype-*". So we may want to standardize/enforce this so the path attribute must be the same as the plugin subpackage name. Or, we could add a separate, standard way for extensions to provide a fully-qualified userutil package name instead of using the path attribute.

Imported Comment. Original Details:
Author: narupley
Created: 2014-10-30T09:09:41.000-0700

@rbeckman-nextgen
Copy link
Collaborator Author

@rbeckman-nextgen rbeckman-nextgen commented May 11, 2020

Importing packages seems easy enough, but what about providing a Javadoc for extension packages. Definitely more of a nice-to-have, but it would be quite useful.

Imported Comment. Original Details:
Author: wayneh
Created: 2015-01-08T11:41:17.000-0800

@rbeckman-nextgen
Copy link
Collaborator Author

@rbeckman-nextgen rbeckman-nextgen commented May 11, 2020

I created MIRTH-3617 to track adding Javadoc pages. That will be somewhat more complex, unless each extension's page is completely isolated from each other (and the main Javadoc).

Imported Comment. Original Details:
Author: narupley
Created: 2015-02-09T14:13:51.000-0800

@rbeckman-nextgen
Copy link
Collaborator Author

@rbeckman-nextgen rbeckman-nextgen commented May 11, 2020

Revision 7596: Added a new userutilPackages field to MetaData so that extensions can specify packages to auto-import in JavaScript contexts. JavaScriptBuilder is now also iterating through the metadata and calling importPackage for each one specified.

Imported Comment. Original Details:
Author: narupley
Created: 2015-02-09T14:30:27.000-0800

@rbeckman-nextgen
Copy link
Collaborator Author

@rbeckman-nextgen rbeckman-nextgen commented May 11, 2020

Verified that classes in packages deemed to be "userutil" packages by extensions will be accessible directly within the JavaScript scope without requiring Packages.

Imported Comment. Original Details:
Author: wayneh
Created: 2015-02-13T18:11:44.000-0800

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.