JPO Guidelines for Getting Object List

You can write and configure JPOs to get the list of objects to display in the table page.

A JPO program object for getting an object list must follow these rules:


  • The JPO program must define a method with the name specified in the href parameter using the form: program=<program name>:<method name>.
  • The method takes an input argument as a HashMap. The HashMap contains the details of the request parameters available to the JSP page. Every parameter is available as a key/value pair in the HashMap. In addition, a parameter called languageStr is available to get the language setting (such as en, fr, ja, etc).
  • The method returns a MapList containing the list objects. This MapList contains a list of HashMaps with the values of OIDs and RelIDs. Every HashMap contains the value for OID and RelID belonging to one table row.

This is the structure of each HashMap belonging to a table row:


  • Key "id" is assigned to the business object Id (OID) to use in the table row.
  • Key "id[connection]" is assigned to the relationship id (RelID) to use (if required) for the table row.

For example:

MapList
Object Key Value

HashMap 1

id

Value

id[connection]

Value

HashMap 2

id

Value

id[connection]

Value

. . .

id

Value

id[connection]

Value

HashMap n

id

Value

id[connection]

Value

Here is a JPO function template:

public static Object methodName(Context context, String[] args) 
throws Exception
{
    HashMap paramMap = (HashMap)JPO.unpackArgs(args);
    MapList objectList = new MapList();
// Get the required parameter values from  "paramMap" - if 
required
String languageStr = (String)paramMap.get("languageStr");
String objectId = (String)paramMap.get("objectId");
    String selectedFilter = 
(String)paramMap.get("selectedFilter");
// Get the object elements - OIDs and RELIDs  using Beans or ADK 
methods
    // Build the MapList with List of HashMaps containg OIDs and 
RelIDS
    return objectList;
}