try {
OCApp app = getApplication();
_OCAbstractManager abstractManager = app.findManager(metaType);
_OCCommonMetadataObject commonMetadataObject = abstractManager.getMetadata();
EventManager manager = getEventManager();
Date sDate = null;
if (startDate != null) {
sDate = dateFormat.parse(startDate);
}
Date eDate = null;
if (endDate != null) {
eDate = dateFormat.parse(endDate);
}
EEventLogLevel logLevel = app.findVarset(
EEventLogLevel.class.getSimpleName()
+ "."
+ eventLevel.toUpperCase()
);
Document res = manager.getEventLog(sDate, eDate, new EEventLogLevel[]{logLevel}, new String[]{eventType}, new _OCCommonMetadataObject[]{ commonMetadataObject });
return res;
} catch (Exception e) {
throw new WebApplicationException(e);