General XMetaL Discussion
paul_cpwr December 11, 2008 at 11:36 pm
Calling Java classes from XMetaLDecember 11, 2008 at 11:36 pmParticipants 7Replies 8Last Activity 13 years, 6 months ago
We would like to leverage a Java program as a part of our XMetaL workflow. Specifically, we want a macro in XMetaL to invoke an external Java class and act on the return value. JScript and VBScript are not well suited to this task. Has anybody used the Python or Perl script support in XMetaL (according to the data sheet) to invoke external Java classes?
Alternatively, is there some other better solution?
Thank you for your help.
Compuware Corporationgihyunlee December 12, 2008 at 11:11 pm
Reply to: Calling Java classes from XMetaLDecember 12, 2008 at 11:11 pm
If you are set in using Java, I believe you can do this using the XMetaL Java API Toolkit.
If you are open to options, you can create a ActiveX control (using say C#) which I integrates easily into XMetaL.
I'm mainly a Java developer but the C#/ActiveX route was much simpler to implement and integrate with our XMetaL customizations.paul_cpwr December 13, 2008 at 12:11 am
Reply to: Calling Java classes from XMetaLDecember 13, 2008 at 12:11 am
My understanding is that the XMetaL Java API Toolkit is an API for using Java code to access XMetaL. I want the opposite. I need XMetaL customizations to call external Java methods and act on the returns from those methods.
More specifically, we have an desktop Java application that we need to integrate with our XMetaL customizations. I'd prefer to access it directly via Java but this is impossible via VBScript and JScript. I'm looking into the possibility of embedding Java into Perl (Inline::Java module) and running the Perl script in XMetaL. The other possibility is using Python and JPype to access Java classes from a Python script that could be run from within XMetaL.
Compuware CorporationDerek Read January 16, 2009 at 1:39 am
Reply to: Calling Java classes from XMetaLJanuary 16, 2009 at 1:39 am
Going from XMetaL (which is COM based) to Java requires the use of “COM to Java bridge” software. I believe there are several solutions available on the market.paul_cpwr January 16, 2009 at 5:02 pm
Reply to: Calling Java classes from XMetaLJanuary 16, 2009 at 5:02 pm
The Java-to-COM bridge is certainly a possibility. Unfortunately, the robust implementations of these tools are all commercial and some of them are rather expensive.
Since we can control the code in the Java application that is the target of the integration, we have devised a new strategy. We will code a component in the Java application that will expose itself as a web service (or web container/servlet). Then we'll edit our XMetaL JScript use the Microsoft.XMLHTTP ActiveXObject, available in JScript, to call the webservice/servlet and act on the response.
We have yet to implement this solution, though it appears that other JScript developers have been able to make this work.Derek Read January 16, 2009 at 7:28 pm
Reply to: Calling Java classes from XMetaLJanuary 16, 2009 at 7:28 pm
Sounds like a really smart (and inexpensive) idea to me if you can get it working.jsmart February 12, 2009 at 11:57 pm
Reply to: Calling Java classes from XMetaLFebruary 12, 2009 at 11:57 pm
Forget Java – the answer is in the Journalist COM sample. The
COM allows developers to link to the Class Library. Our
team has done extensions with COM for Grammar Checks, Content tagging
and Translations. Results in COM are very fast performance,
Java is too slow.
We are happy to share the simple COM tricks or custom development
offline send mail to [email protected].Ying_Wu January 12, 2010 at 1:39 pm
Reply to: Calling Java classes from XMetaLJanuary 12, 2010 at 1:39 pm
We are trying to customize XMetaL to call Java methods. The Java class Jar file and XMetaL are installed on the same computer.
Does anyone have experience calling Java in XMetaL with any script language?
Thanks. Ying Wu, LexisNexisDerek Read January 12, 2010 at 11:44 pm
Reply to: Calling Java classes from XMetaLJanuary 12, 2010 at 11:44 pm
From the XMetaL Author side you can use XMetaL Author's APIs to navigate to an HTML page in the Resource Manager (ResourceManager.Assets.WebBrowser), or embed IE in a new tab (ResourceManager.AddTab()) and then use IE's native Navigate() method to open an HTML page (effectively the same result but on a different tab than the Assets tab).
I have not actually tried to do these things so I'm not sure how difficult it would be to actually implement this or that it could really work. However, perhaps others reading this forum have and can help out.
The following projects may also help (keeping in mind that XMetaL Author is a COM server):
“The goal of the project is to provide a better integration of Java and COM. “
“Implementation of DCOM wire protocol (MSRPC) to enable development of Pure Bi-Directional, Non-Native Java applications which can interoperate with any COM component. The implementation is itself purely in Java and does not use JNI to provide COM access.”
- You must be logged in to reply to this topic.