‎11-07-2012 05:39 PM
Hi,
Has anyone already tried to set a web site post-generation script with a Java macro? Is it possible at all?
In my environment (Mega 2009 SP5) the VB macro as post generation script works fine, but not the java one.
Regards
Solved! Go to Solution.
‎19-07-2016 09:38 PM
How is this correct?
MegaRoot myMacro = root.currentEnvironment().getMacro("MyVBMacro_iden​tifier");
myMacro.callMethod("Name_of_my_sub","args");
You are calling get macro without a cast to the MegaRoot object. In Java this does not work.
‎09-08-2012 02:34 PM
Hi Wahid,
I'm sorry that it doesn't help you.
I think there is no other option for your problem than following the case openend by Jérôme.
Regards
‎09-08-2012 10:17 AM
Hi Patrick,
Thanks for your reply. Unfortunately, it isn’t the solution for my problem. My script is implemented in Java, configured as a Java macro. I simply miss the feature to use this macro as a post-generation script for my website.
I attach my simple Java macro and a screen shot of my settings.
Regards
Wahid Bashirazad
‎19-07-2012 04:45 PM - edited ‎19-07-2012 04:51 PM
Hi,
Due to the API, it's possible to call a VB Script macro from your Java code. Indeed, if your VB macro for website post-generation is working, you can use the following code to use it from your Java code :
/* root is a MegaRoot object * MyMacro_identifier is the identifier ~AbsId[Short Name] */ MegaRoot myMacro = root.currentEnvironment().getMacro("MyVBMacro_identifier"); myMacro.callMethod("Name_of_my_sub","args");
If you the method you want to call in your VB macro is a sub, use callMethod. If it's a function, use callFunction.
Please, refer to the Javadoc of mj_api.jar, under MegaCurrentEnvironment for more information about getMacro function.
I hope it helps.
Regards,
‎18-07-2012 02:24 PM
Hello Wahid
OK.
This ID: CR 31538 will enable to follow this issue
We will keep you informed.
Can you add attachments regarding you case your case (screen error, MEGA error log, java code of the macro) to this topic. This will enable us to check if your macro can run after CP change.
‎18-07-2012 12:41 PM
Hi Jerome,
Thanks for your reply. It's still an issue for us and will be nice to have this feature with the next CP.
Best regards
Wahid
‎18-07-2012 09:50 AM
Hello again
If this is an issue for you we can consider this support (use java macro for post processing web sites) for the next CP of MEGA 2009 SP5. It is planned mid october 2012.
Tell us if you are interested.
‎16-07-2012 05:29 PM
Hello wbashirazad
Only VB script macros have been qualified for post generation of a web site
Java macro have not been qualified.