IBM Enterprise Records, Version 5.1.+            

XML forms of methods

The RM Java™ API interfaces provide both object and XML forms of their methods. In XML forms, you pass an integer array as input, and the methods return data as XML-formatted strings. You can call the XML versions of methods to retrieve XML, which is suitable for mapping data to fields in the user interface. You can also pass XML strings to a method as input parameters.

The RM Java API provides two XML forms of methods: RMObjectStore.getClassificationSchemesXML and RecordFolder.getContaineesXML. The RMObjectStore.getClassificationSchemesXML method retrieves an XML string, which represents a collection of classification schemes that are contained within a particular RM object store. Specify the properties to retrieve in the asArrPropNames array. If you specify a property that is not present in the ClassificationScheme object, that property is ignored. If the asArrPropNames parameter is null or an empty array, this method returns all properties for all the ClassificationScheme objects. For example, the following code snippet retrieves the names and authors of all classification schemes as an XML string:
//Returns an XML representation of the properties array passed 
String getPropertiesCollection(RMObjectStore aoObjectStore)    
{ 
   // Creates a String array of the names and authors of the classification schemes 
   // available in the object store. 
   String [] props = new String []{RMProperty.RECORD_FOLDER_NAME, RMProperty.AUTHOR}; 
   String XML = aoObjectStore.getClassificationSchemesXML(props); 
   Return XML; 
}
The RecordFolder.getContaineesXML method retrieves all of the objects within a container object. To filter the objects retrieved using the getContainees method, you can pass the RM object types and properties as parameters, as shown in the following code:
// Returns an XML representation of properties for the RM entity whose types are passed. 
// If the properties collection is null or empty, returns all the readily-available properties
// of that RM entity. 
String getEntityCollection(RecordFolder aoFolder)
{ 
   int [] rmTypes = new int[]{ RMType.RM_TYPE_ELECTRONICRECORD }; 
   // False indicates that hidden objects are not included in the XML output. 
   String XML = aoFolder.getContaineesXML(rmTypes, null, false); 
   return XML; 
}


Feedback

Last updated: August 2011


© Copyright IBM Corporation 2011.
This information center is powered by Eclipse technology. (http://www.eclipse.org)