It's all about the answers!

Ask a question

Calling a Runnable Jar from DNG Extension


Vaibhav S (106354) | asked Jun 13 '19, 1:27 a.m.

 Hi,


I have created a sample DNG Extension which I am able to add on my Dashboard.

I also have created a DNG Utility using OSLC which does some cleanup manipulations on DNG Artifacts depending on given scenarios. This Utility I am able to run as satndalone Runnable Jar.

Now i want to call this Utility as a Widget from DNG Dashboard. For the same i found that it needs to be done from a JS file of Widget, but couldnt find the exact process to be followed for the same,

Please let me know about it or any reference link for the same so as to how to call a runnable jar from JS file of Widget and deploying the Jar as well.

Please let me know in case of any issues.


Thanks
Vaibhav

Accepted answer


permanent link
Matthias Buettgen (23612332) | answered Jun 13 '19, 12:08 p.m.
Hi,

You should think about creating a web service out of your jar and deploy this to an application server. We recently did the same in one of our projects. Once you have done this, you can call the web service from the widget using the gadget.io library and get the advantage that a user's session key is embedded into the request. So your service can run in the user's context.

Regards
Matthias
Vaibhav S selected this answer as the correct answer

Comments
Vaibhav S commented Jul 12 '19, 1:26 a.m.

Thanks Matthias .

 

One other answer



permanent link
Vaibhav S (106354) | answered Sep 25 '19, 10:35 p.m.

 Hi, this is the code i used for above query:


<?xml version='1.0' encoding='UTF-8' ?>
<Module>
<ModulePrefs title='DNG Cleanup Widget' height='250' scrolling='true'>
<Require feature='com.ibm.rdm.rm.api'></Require>
</ModulePrefs>
<Content type='html'>
<![CDATA[
<html>
   <head>
   </head>
   <body>
   Click on this Button to Run DNG Cleanup Utility
   <button onclick="myFunction()">Click me</button>
    
    <script >
    function myFunction() { 
    alert("Start DNG Cleanup Utility"); 
    var wshShell = new ActiveXObject("WScript.Shell");  
    alert("Creating Active X Object 3"); 
    wshShell.Run("D:/dev/Executables/run.bat");
}
</script>
   </body>
</html>
]]>
</Content>
</Module>

you will need to Enable the Active X objects in your Browser.

Thanks
Vaibhav

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.