General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › Custom Menu to run Java App
-
tgoglia April 11, 2012 at 5:45 pm
Custom Menu to run Java App
April 11, 2012 at 5:45 pmParticipants 0Replies 1Last Activity 10 years, 10 months agoHey All,
My team is moving to a new content manage system and will be using XMetal Author to edit content. I need to create an XMetal plugin in Java to communicate between the new CMS and our legacy system (both of which already have webservice clients written in Java).I just want to confirm that in order to do this I MUST get a copy of both Visual Studio and XMetal developer. Is there another way to run the XMetal Java API Toolkit?
Thanks,
Toddtgoglia July 25, 2012 at 11:20 pm
Reply to: Custom Menu to run Java App
July 25, 2012 at 11:20 pmIn case anyone finds this, I thought I'd post my solution. As far as I can tell, its the only way to achieve what we're trying to do.
You don't actually need XMetal Developer or MS Visual Studio to develop against the XMetal API. You do, however, need two jar files that are only available via XMetal Developer: SQJavaAPI.jar and dom2.jar . Once I added these .jars to my project I was able to code and build my project in Eclipse. When testing in eclipse, I go the error message “No SQJNILib in java.library.path”, so I had to run the application from the commandline instead of the IDE.
I added menu items by creating a javascript macro file(.mcr ) in the XMetaL ‘Startup’ folder [C:Program Files (x86)XMetaL 6.0AuthorStartUp for me]. Such files uses the Windows Scripting Host, so I was able to call my java app using the RUN command as follows;
var cmd = [command line text goes here]
WshShell = new ActiveXObject(“WScript.Shell”);
WshShell.Run (cmd,1,false); -
AuthorPosts
- You must be logged in to reply to this topic.