* @throws SAXException
* @throws IOException
*/
public Document getEventLog(Date startDate, Date endDate, EEventLogLevel[] eventLevels, String[] eventTypes, _OCCommonMetadataObject[] metadataObject) throws JIException, ParserConfigurationException, SAXException, IOException {
// prepare parameters
OCStructure structure = appInstance.newStructure();
//setup event's filtraton
if (eventTypes != null && eventTypes.length > 0) {
OCArray array = appInstance.newArray();
for (String eventName : eventTypes) {
array.add(new OCVariant(eventName));
}
structure.insert(FLD_EVENT, array);
}
// setup start date filtration
if (startDate != null) {
structure.insert(FLD_START_DATE, startDate);
}
// setup end date filtration
if (endDate != null) {
structure.insert(FLD_END_DATE, endDate);
}
// setup metadata filtration
if (metadataObject != null && metadataObject.length > 0) {
OCArray array = appInstance.newArray();
for (_OCCommonMetadataObject cmo : metadataObject) {
OCVariant variant = new OCVariant(cmo);
array.add(variant);
}
structure.insert(FLD_METADATA, array);
}
// insert levels' condition
if (eventLevels != null && eventLevels.length > 0) {
OCArray array = appInstance.newArray();
for (EEventLogLevel level : eventLevels) {
OCVariant variant = new OCVariant(level);
array.add(variant);
}
structure.insert(FLD_EVENT_LEVEL, array);
}
return getEventLog(structure);
}