Commit 1e0c7239 authored by doc@bgerp.org's avatar doc@bgerp.org

p12197 Add groups JEXL with isolation fix, group IDs in editor, refactoring.

parent acbaec81
F: Update process groups with 'isolation.process' enabled.
F: Show group IDs in process type editor.
C: Trim whitespaces in HTTP request parameters.
......@@ -62,7 +62,7 @@ public class ConfigDAO extends CommonDAO {
}
query.append(SQL_ORDER_BY);
query.append("title");
query.append(getMySQLLimit(page));
query.append(getPageLimit(page));
PreparedStatement ps = con.prepareStatement(query.toString());
ResultSet rs = ps.executeQuery();
......
......@@ -1410,7 +1410,7 @@ public class ProcessDAO extends CommonDAO {
public void updateProcessGroups(Set<ProcessGroup> processGroups, int processId) throws Exception {
if (history) {
Process oldValue = getProcess(processId);
Process oldValue = new ProcessDAO(con).getProcess(processId);
Process newValue = oldValue.clone();
newValue.setProcessGroups(processGroups);
logProcessChange(newValue, oldValue);
......
......@@ -129,6 +129,7 @@ public class DynActionForm extends ActionForm implements DynaBean, DynaClass {
public DynActionForm(User user) {
this.user = user;
this.permission = ParameterMap.EMPTY;
}
public HttpServletRequest getHttpRequest() {
......@@ -370,7 +371,7 @@ public class DynActionForm extends ActionForm implements DynaBean, DynaClass {
public String getParam(String name, String defaultValue, boolean defaultSet) {
String value = param.get(name);
if (value != null)
return value;
return value.trim();
if (defaultSet)
setParam(name, defaultValue);
return defaultValue;
......@@ -422,21 +423,15 @@ public class DynActionForm extends ActionForm implements DynaBean, DynaClass {
}
public int getParamInt(String name, int defaultValue) {
return Utils.parseInt(param.get(name), defaultValue);
return Utils.parseInt(getParam(name), defaultValue);
}
public int getParamInt(String name) {
return Utils.parseInt(param.get(name));
return getParamInt(name, 0);
}
public long getParamLong(String name, long defaultValue) {
String value = param.get(name);
if (Utils.isBlankString(value)) {
return defaultValue;
}
return Long.parseLong(value);
return Utils.parseLong(getParam(name), defaultValue);
}
public long getParamLong(String name) {
......@@ -448,7 +443,7 @@ public class DynActionForm extends ActionForm implements DynaBean, DynaClass {
}
public boolean getParamBoolean(String name) {
return Utils.parseBoolean(getParam(name), false);
return getParamBoolean(name, false);
}
/**
......
......@@ -4,6 +4,7 @@ import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.math.BigDecimal;
import java.util.AbstractMap;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
......@@ -12,24 +13,23 @@ import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Pattern;
import org.apache.log4j.Logger;
import ru.bgcrm.dynamic.DynamicClassManager;
import ru.bgcrm.model.BGMessageException;
import ru.bgerp.util.Log;
/**
* Исходный map параметров. Его главная функция - #{@link ParameterMap#get(String, String)}.
* Остальные используют эту функцию для парсинга значений.
*/
public abstract class ParameterMap extends AbstractMap<String, String> {
private static final Logger log = Logger.getLogger(ParameterMap.class);
private static final Log log = Log.getLog();
/**
* Конфигурации, разбираются при первом обращении и кешируются далее.
*/
protected volatile ConcurrentHashMap<Class<?>, Config> configMap;
public static class DefaultParameterMap extends ParameterMap {
private static class DefaultParameterMap extends ParameterMap {
protected Map<String, String> data;
public DefaultParameterMap(Map<String, String> data) {
......@@ -48,6 +48,8 @@ public abstract class ParameterMap extends AbstractMap<String, String> {
}
}
public static ParameterMap EMPTY = new DefaultParameterMap(Collections.emptyMap());
protected String mapPrint = null;
public abstract String get(String key, String def);
......
......@@ -26,7 +26,7 @@
<ui:select-mult
id="${tabsId}-${item.id}" hiddenName="${hiddenName}"
showId="1" style="width:100%;"
showId="true" style="width:100%;"
styleClass="layout-height-rest" list="${list}" values="${values}"/>
</c:forEach>
</u:sc>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment