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

Using the setInfopadRequest service

To send infopad requests to the servlet, you may request values from infopads in a granularity of a single slot, or an infopad cell. Requests are grouped together into a Vector for performance reasons. Due to this, even if you only want the values from one infopad cell or slot, then you must package it in a Vector. Then for each request you want to send, encapsulate it in a Hashtable. The name of the infopad you want to query is stored with the key "Tablename" and the value is the actual name of the infopad. The row you want to query is stored with the key "Row" and the value is either the row name or the row number. The column you want to query 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 is packaged with the key "Slot" and the value is the slot name. If you want to have the entire cell returned, then use the key "Slot" and the value is "*".
Once you have packaged your requests, you may open a connection to the servlet, and send the Vector. You can send the request to the following URL:
<hostname>BPM Manage API/com.tdiinc.BPM Manage APIr.ApplicationServlet.ApplicationServlet?serviceType=setInfopadRequest
Note: Remember to append the registration string 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. Then you can use the requestInfopadValues service to retrieve the results.
The following example of using the setInfopadRequest service shows how the "&" is used to connect the registrationString to the URL.
Vector updates = new Vector();
Hashtable newValues = new Hashtable();
newValues.put("Tablename","NewTable");
newValues.put("Row","1");
newValues.put("Column","1");
newValues.put("Slot","count");
updates.addElement(newValues);
newValues = new Hashtable();
newValues.put("Tablename","NewTable");
newValues.put("Row","2");
newValues.put("Column","5");
newValues.put("Slot","slot1");
updates.addElement(newValues);
newValues = new Hashtable();
newValues.put("Tablename","NewTable");
newValues.put("Row","3");
newValues.put("Column","2");
newValues.put("Slot","slot2");
updates.addElement(newValues);
URL url = new URL("http://hawaii/BPM Manage API/com.tdiinc.BPM Manage APIr.
ApplicationServlet.Servlet.ApplicationServlet?serviceType=
setInfopadRequest&"+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();
ObjectInputStreaminputFromServlet = new ObjectInputStream(con.getInputStream());
inputFromServlet.close();