Skip to Content
Author's profile photo Former Member

Using the JNet graphics package with the portal

The JNet graphics package provides some funky graphics, such as the end to end monitoring display functions within PI (the product formerly known as XI). This blog is going to describe how to create some graphics through the JNet package, to present a display such as this:


This shows the SAP systems connected to an EP7 portal, in this case, one of our SAP training portal servers. Once displayed, the user can drag the boxes around and print the output and other fun things.

We need to get a few files into our NetWeaver Developer Studio project. They are available as attachments to SAP Note 783083. The specific files we need are JNet.jar and y.jar. Start by downloading these to a local drive.

Now, in your NWDS project, create a new folder under dist. I called mine pagelet and then I used the import function to add the 2 jar files to this folder.

The code I wrote is based on a portal component I wrote earlier that allowed me to see the SAP systems that are connected to my portal and show their details in a tree format. I have worked from this code.

The main activities are to create a specially formatted XML file, which I create in the pagelet folder as I know I can access it from JNet. The filename is based on the current date and time. Here’s the code to create the first part of the XML file:

     private BufferedWriter makeJNetHeader(IPortalComponentRequest request) {

          String pubPath = request.getPublicResourcePath();

          Date now = new Date();

          nowL = new Long(now.getTime());

          BufferedWriter out = null;

          String SID = System.getProperty(“SAPSYSTEMNAME”).toString();

          try {

               File file =

                    new File(

                         pubPath + “
temp” + nowL.toString() + “.xml”);

               out =

                    new BufferedWriter(

                         new OutputStreamWriter(new FileOutputStream(file), “UTF8”));

out.write(” “);

} catch (Exception e) {};
return out;

Basically it writes some special tags that will be processed by JNet at run time. One of these is the top level object, which is my portal. I’m going to hang my systems off this object. These are implemented as nodes.

For each system I want to display, I need to generate some tags.

     public void addSystem(IPortalComponentResponse response,

               BufferedWriter out,

               int counter, String system,String type, String SID, String client



          int col = 100+counter*200;

          Integer I = new Integer(col);

          try {


                    “<node type=\”BCNode\” id=\””system“\”>”);


SID“/”client” “type“”);
system“</label> “);

               out.write(“</node> “);


                    “<edge type=\”BCLink\” id=\”l”system “\”>”);


Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      Blog Post Author
      I have put together an example PAR file that makes use of the graphics library. The file can be downloaded from here until the end of 2006 (I hope!). The portal component shows graphically user/group/role assignments. I have tried it with recent support packages of EP7 and EP6 with no real problems. It's quite a big PAR file, as it contains the libraries required.

      Good luck!

      Author's profile photo Former Member
      Former Member
      Hello Michael,

      Would it be possible to send me the par file that makes use of JNet library? The par file that you posted in SDN is not available anymore.

      Thank you so much.

      Best regards,

      Author's profile photo Former Member
      Former Member
      Blog Post Author
      I think this is the one...
      It should be OK until the end of June 2008
      Author's profile photo Former Member
      Former Member
      The PAR file expired. Can you provide a new download location?
      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Try this
      Author's profile photo Former Member
      Former Member
      Can we get the par file again?
      best Regards,