@RequestParam(required = false) String version,
@RequestParam String processDefId,
@RequestParam String participantId,
@RequestParam(value = "value", required = false) String value) throws UnsupportedEncodingException, IOException {
Plugin plugin = null;
AppDefinition appDef = appService.getAppDefinition(appId, version);
PackageDefinition packageDef = appDef.getPackageDefinition();
processDefId = WorkflowUtil.getProcessDefIdWithoutVersion(processDefId);
if (value != null && value.trim().length() > 0) {
plugin = pluginManager.getPlugin(value);
} else {
if (packageDef != null) {
PackageParticipant participant = packageDef.getPackageParticipant(processDefId, participantId);
plugin = pluginManager.getPlugin(participant.getValue());
if (participant.getPluginProperties() != null && participant.getPluginProperties().trim().length() > 0) {
if (!(plugin instanceof PropertyEditable)) {
Map propertyMap = new HashMap();
propertyMap = CsvUtil.getPluginPropertyMap(participant.getPluginProperties());
map.addAttribute("propertyMap", propertyMap);
} else {
map.addAttribute("properties", PropertyUtil.propertiesJsonLoadProcessing(participant.getPluginProperties()));
}
}
}
}
if (plugin != null) {
PluginDefaultProperties pluginDefaultProperties = pluginDefaultPropertiesDao.loadById(value, appDef);
if (pluginDefaultProperties != null) {
if (!(plugin instanceof PropertyEditable)) {
Map defaultPropertyMap = new HashMap();
String properties = pluginDefaultProperties.getPluginProperties();
if (properties != null && properties.trim().length() > 0) {
defaultPropertyMap = CsvUtil.getPluginPropertyMap(properties);
}
map.addAttribute("defaultPropertyMap", defaultPropertyMap);
} else {
map.addAttribute("defaultProperties", PropertyUtil.propertiesJsonLoadProcessing(pluginDefaultProperties.getPluginProperties()));
}
}
}
if (plugin instanceof PropertyEditable) {
map.addAttribute("propertyEditable", (PropertyEditable) plugin);
}
String url = request.getContextPath() + "/web/console/app/" + appId + "/" + version + "/processes/" + URLEncoder.encode(processDefId, "UTF-8") + "/participant/" + participantId + "/submit/plugin?param_value=" + plugin.getClass().getName();
map.addAttribute("plugin", plugin);
map.addAttribute("actionUrl", url);
return "console/plugin/pluginConfig";