Try OpenEdge Now
skip to main content
Application Developer's Guide
Developing management applications to control infopads : Creating a Java applet : Using the updateInfopad service
 

Using the updateInfopad service

To send infopad updates to the servlet, you may update values from infopads in a granularity of a single slot, or an infopad cell. Updates are grouped together into a Vector for performance reasons, even if you only want to update the values from one infopad cell or slot, then for each update you want to send, encapsulate it in a Hashtable. The name of the infopad you want to update is stored with the key "Tablename" and the value is the actual name of the infopad. The row you want to update is stored with the key "Row" and the value is either the row name or the row number. The column you want to update is stored with the key "Column" and the value is either the column name or the column number. The slot whose value you want to return should be packaged with the slot name as the key and the updated value as the value. Only those slots that you want updated, should be placed into the Hashtable. Once you have packaged your updates, you may open a connection to the servlet, and send the Vector.
You can send the update request to the following URL:
"<hostname>/BPM Manage API/com.tdiinc.BPM Manage APIr.ApplicationServlet.Servlet.
ApplicationServlet? serviceType=updateInfopad"
Note: Remember to append the registration string to the URL.
The following example shows how the "&" is used to connect the registrationString to the URL. The variable registrationString contains the sessionID inserted into one of the applet’s parameter tags. You can then use the getParameter ("") method to get the actual value, passing it the name of the parameter containing the sessionID.
The following is an example of how to use the updateInfopad service:
Vector updates = new Vector();
    for (int i=1;i<6;i++)
        for (int j=1;j<6;j++)
            Hashtable firstupdate = new Hashtable();
    
            firstupdate.put("Tablename","NewTable");
            firstupdate.put("Row",String.valueOf(i));
            firstupdate.put("Column",String.valueOf(j));
            firstupdate.put("count","10");
            firstupdate.put("slot1","15");
            firstupdate.put("slot2","25");
            firstupdate.put("slot3","13.6");
    
            updates.addElement(firstupdate);
        }
    
URL url = new URL("http://hawaii/BPM Manage API/com.tdiinc.BPM Manage APIr.ApplicationServlet.Servlet.
ApplicationServlet?serviceType=updateInfopad&"+registrationString);
URLConnection con = url.openConnection();
con.setDoInput(true);
con.setDoOutput(true);
con.setRequestProperty("Content-Type","application/octet-stream");
ObjectOutputStream out= new ObjectOutputStream(con.getOutputStream());
out.writeObject(updates);
out.flush();
out.close();
ObjectInputStream inputFromServlet = new ObjectInputStream(con.getInputStream());
ObjectInputStreaminputFromServlet.close();