Examples
The code snippets given below demonstrate how to call the different methods.
- Example 1 - This sample is for fetching the list of all sections present in an application.
Fetch Section List of particular application
try {
...
ZCApplication firstApp = appList.get(0);
List<ZCSection> sections =
ZOHOCreatorUtil.getApplicationDetails(firstApp);
} catch (ZCException e) {
e.printStackTrace();
// Handle Error
}
- Example 2 - This sample is for fetching the meta-data of a particular form.
Accessing Form
try {
...
ZCSection firstSection = sections.get(0);
ZCComponent firstComponent =
firstSection.getComponents().get(0);
if(firstComponent.getType().equals(ZCComponentType.FORM)){
ZCForm form = FormUtil.getForm(firstComponent);
}
} catch (ZCException e) {
e.printStackTrace();
// Handle Error
}
- Example 3 - This sample is for fetching the meta-data of a particular report.
Accessing Report
try {
...
ZCSection firstSection = sections.get(0);
ZCComponent firstComponent =
firstSection.getComponents().get(0);
if(firstComponent.getType().equals(ZCComponentType.REPORT)){
ZCReport report = ReportUtil.getReport(firstComponent);
}
} catch (ZCException e) {
e.printStackTrace();
// Handle Error
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
