Home Forums General XMetaL Discussion Calling Java classes from XMetaL Reply To: Calling Java classes from XMetaL

Derek Read

Reply to: Calling Java classes from XMetaL

It might be possible to use one of the browser-based methods that you will find if you search for “javascript to java communication” or “java to javascript communication”.

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).

Regardless of where the HTML page is, it could have a Java applet embedded in it, and the methods for communicating between Java and javascript (my first paragraph) might then be useful (though in the case of IE it is really actually JScript). In order to communicate between the HTML page itself and XMetaL Author you would then need to instantiate XMetaL Author using COM from the HTML page in order to pass messages to it (this is not handled automatically just because IE is embedded within the Resource Manager).

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):

com4j
https://com4j.dev.java.net/
“The goal of the project is to provide a better integration of Java and COM. “

j-Interop
http://sourceforge.net/projects/j-interop/
“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.”

Reply

Products
Downloads
Support