Hello,
I'm starting Weasis successfully in my application via a dynamically generated JNLP. What I would like is to pass a custom argument to Weasis and set it as System.Property, just as I believe some Weasis settings are done, so I can access it through Weasis runtime and do some internal actions my applications needs, like relating a study in my DB, and so on.
I managed to do it when I start Weasis from eclipse.
Example: I write the following "Program arguments" in Run Configurations:
$dicom:get -l "/home/myUser/image_9118081578888301667.dcm"
pwlmMedicalReportID=123
And then i changed the code a little bit in WeasisLauncher.java, starting in Line 391. I'm sure that this is a messy way to do it, but it did the job.
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
m_tracker.open();
Object commandSession = getCommandSession(m_tracker
.getService());
if (commandSession != null) {
// execute the commands from main argv
for (StringBuffer command : commandList) {
commandSession_execute(commandSession, command);
// beginning of my code
String parameter = "pwlmMedicalReportID=";
int index = command.indexOf(parameter);
if (index != 1) {
int subStringIndex = index + parameter.length();
String value = command
.substring(subStringIndex);
System.setProperty("pwlmMedicalReportID",
value);
}
// end of my code
}
commandSession_close(commandSession);
}
I first tried to pass arguments like: -VMPpwlmMedicalReportID but no success.
But I can't figure much as how the WebstartLauncher parse arguments. Some struggle with the code and java console gave me a clue that Felix is doing this, but I doesn't have a clue about Felix.
My ideal scenario would be something like this: (End of my JNLP)
<!-- Main class -->
<application-desc main-class="org.weasis.launcher.WebstartLauncher">
<!-- Example for opening dicom files from URLs -->
<argument>$dicom:get -l #{param.studyURL}</argument>
<argument>-VMPpwlmMedicalReportID="#{param.pwlmMedicalReportID}"</argument>
</application-desc>
Sorry for the trouble, as I'm really basically doing all the job by trial and error.
Thanks in advance,
Diego.