Skip to main content
10-Marble
April 12, 2017
Question

Get the selected items from Java API

  • April 12, 2017
  • 1 reply
  • 4046 views

How do I get the selected items in the client from the Java API?

Is there an im-command or is the only way to use System.getenv("MKSSI_ISSUE0")?

1 reply

17-Peridot
April 23, 2017

Yes, this is - to my knowledge - the way how we do it in Java.

1-Visitor
April 24, 2017

Hello Volker,

please could you explaine how it works, maybe with some Java code?

Thanks in advance,

Bernd

17-Peridot
May 6, 2017

Hello Bernd,

we assume that we have a custom program written in Java that is executed using the custom menu entry in Integrity.

So the call behind the custom menu will be ..\jre\bin\java -jar ..\myJavaProgram.jar

To recognize now the items or documents that we have selected before the menu call, you can write the following code:

    public static String getDocumentID() {

        return System.getenv("MKSSI_DOCUMENT") == null ? "" : System.getenv("MKSSI_DOCUMENT");

    }  

    public static String getHostName() {

        return System.getenv("MKSSI_HOST") == null ? "" : System.getenv("MKSSI_HOST");

    }   

    public static String getPort() {

        return System.getenv("MKSSI_PORT") == null ? "" : System.getenv("MKSSI_PORT");

    }  

    public static String getUser() {

        return System.getenv("MKSSI_USER") == null ? "" : System.getenv("MKSSI_USER");

    }         

    public static String getIssue0() {

        return System.getenv("MKSSI_ISSUE0") == null ? "0" : System.getenv("MKSSI_ISSUE0");

    }  

Using it, you can get the Integrity details of the items selected. MKSSI_ISSUE0 can also be a list when you have multiple items selected. (MKSSI_ISSUE1, MKSSI_ISSUE2 etc.)

Does this help?

Volker