Example JPO Code For Custom Expand Filter

The JPO should expand the structure 1 level at a time, even when a larger value (such as 2 or 3) is selected as the expand level. If you define a custom expand text value, the JPO is responsible for filtering the objects returned based on that value.

This code shows the structure of an expandProgram JPO:

public MapList expandJPOName (Context context, String[] args) 
throws Exception
{
 // Get input HashMap
//requestMap-contains all the request parameters, including the 
key parameters like objectId, relId, languageStr and custom 
filter, expand filter field values, default level to expand, 
HashMap requestMap = (HashMap)JPO.upackArgs(args);
// Get object id
String sObjectId = paramMap.get("ObjectId");
// Get expand level
String sLevel = requestMap.get("Expand Level");
// Do necessary logic to process the level info and then return 
the expanded objects
/*
**
** The code to use object id & level to get expanded objects
**
**
*/
// Return modified MapList
return mapList ;