}
protected void executePlugin(AuditTrail auditTrail) {
Collection<Plugin> pluginList = pluginManager.list(AuditTrailPlugin.class);
for (Plugin plugin : pluginList) {
AuditTrailPlugin p = (AuditTrailPlugin) plugin;
try {
AppDefinition appDef = AppUtil.getCurrentAppDefinition();
if (appDef != null) {
PluginDefaultPropertiesDao pluginDefaultPropertiesDao = (PluginDefaultPropertiesDao) AppUtil.getApplicationContext().getBean("pluginDefaultPropertiesDao");
PluginDefaultProperties pluginDefaultProperties = pluginDefaultPropertiesDao.loadById(plugin.getClass().getName(), appDef);
if (pluginDefaultProperties != null) {
Map propertiesMap = new HashMap();
if (!(plugin instanceof PropertyEditable)) {
propertiesMap = CsvUtil.getPluginPropertyMap(pluginDefaultProperties.getPluginProperties());
} else {
String json = pluginDefaultProperties.getPluginProperties();
//process basic hash variable
json = AppUtil.processHashVariable(json, null, StringUtil.TYPE_JSON, null);
propertiesMap = PropertyUtil.getPropertiesValueFromJson(json);
}
propertiesMap.put("auditTrail", auditTrail);
propertiesMap.put("pluginManager", pluginManager);
p.execute(propertiesMap);
}
}
} catch (Exception e) {
LogUtil.error(getClass().getName(), e, "Error executing audit trail plugin " + p.getClass().getName());
}
}
}