Commit 4a9d88d8 by WeiCong

增加bd提前退出交易机制

parent 60001fbe
...@@ -5,7 +5,7 @@ public class ExitTransactionException extends RuntimeException { ...@@ -5,7 +5,7 @@ public class ExitTransactionException extends RuntimeException {
private String errorCode; private String errorCode;
public ExitTransactionException(String message, String errorCode) { public ExitTransactionException(String errorCode,String message) {
super(message); super(message);
this.errorCode = errorCode; this.errorCode = errorCode;
} }
......
...@@ -9,6 +9,7 @@ import org.sss.common.impl.AbstractNullPresentation; ...@@ -9,6 +9,7 @@ import org.sss.common.impl.AbstractNullPresentation;
import org.sss.common.impl.ProxyDatafield; import org.sss.common.impl.ProxyDatafield;
import org.sss.common.model.*; import org.sss.common.model.*;
import org.sss.exception.ContainerException; import org.sss.exception.ContainerException;
import org.sss.presentation.noui.api.exception.ExitTransactionException;
import org.sss.presentation.noui.api.request.NoUiRequest; import org.sss.presentation.noui.api.request.NoUiRequest;
import org.sss.presentation.noui.api.response.ErrorCodes; import org.sss.presentation.noui.api.response.ErrorCodes;
import org.sss.presentation.noui.common.Constants; import org.sss.presentation.noui.common.Constants;
...@@ -27,341 +28,340 @@ import java.util.List; ...@@ -27,341 +28,340 @@ import java.util.List;
import java.util.Map; import java.util.Map;
public class NoUiPresentation extends AbstractNullPresentation { public class NoUiPresentation extends AbstractNullPresentation {
private static final Log log = LogFactory.getLog(NoUiPresentation.class); private static final Log log = LogFactory.getLog(NoUiPresentation.class);
// public final Map<IModuleList<?>, List<RowOpItem>> tableRowMap = new // public final Map<IModuleList<?>, List<RowOpItem>> tableRowMap = new
// HashMap<IModuleList<?>, List<RowOpItem>>(); // HashMap<IModuleList<?>, List<RowOpItem>>();
// public final Map<IAttribute<?>, String> formatMap = new // public final Map<IAttribute<?>, String> formatMap = new
// HashMap<IAttribute<?>, String>(); // HashMap<IAttribute<?>, String>();
// public final Map<IAttribute<?>, String> messageMap = new // public final Map<IAttribute<?>, String> messageMap = new
// HashMap<IAttribute<?>, String>(); // HashMap<IAttribute<?>, String>();
// public final Map<IAttribute<?>, String> hintMap = new // public final Map<IAttribute<?>, String> hintMap = new
// HashMap<IAttribute<?>, String>(); // HashMap<IAttribute<?>, String>();
// public final List<IModuleList<?>> tableModifyList = new // public final List<IModuleList<?>> tableModifyList = new
// ArrayList<IModuleList<?>>(); // ArrayList<IModuleList<?>>();
// public final List<IAttribute<?>> modifyList = new // public final List<IAttribute<?>> modifyList = new
// ArrayList<IAttribute<?>>(); // ArrayList<IAttribute<?>>();
// public final List<IAttribute<?>> visibleList = new // public final List<IAttribute<?>> visibleList = new
// ArrayList<IAttribute<?>>(); // ArrayList<IAttribute<?>>();
// public final List<IAttribute<?>> codeValuesList = new // public final List<IAttribute<?>> codeValuesList = new
// ArrayList<IAttribute<?>>(); // ArrayList<IAttribute<?>>();
public IPanel popupPanel = null;
private Map<String, Object> codetable = new HashMap<>(); public String transactionName = null;
private NoUiRequest noUiRequest; public boolean clearFlag = false;
public boolean newTabFlag = false;
private Map<String, Object> error = new HashMap<>(); public Boolean logoutFlag = null;
private Map<String, Object> modifyMap = new HashMap<>(); private Map<String, Object> codetable = new HashMap<>();
private NoUiRequest noUiRequest;
// public final List<IAttribute<?>> enableList = new private Map<String, Object> error = new HashMap<>();
// ArrayList<IAttribute<?>>(); private Map<String, Object> modifyMap = new HashMap<>();
// public final List<IAttribute<?>> requiredList = new // public final List<IAttribute<?>> enableList = new
// ArrayList<IAttribute<?>>(); // ArrayList<IAttribute<?>>();
private String message = null; // 弹出的message // public final List<IAttribute<?>> requiredList = new
private String message_code = ErrorCodes.SUCCESS; // ArrayList<IAttribute<?>>();
public IPanel popupPanel = null; private String message = null; // 弹出的message
@Override private String message_code = ErrorCodes.SUCCESS;
public void close(IPanel panel) throws ContainerException { private boolean isChain = false;
// TODO Auto-generated method stub
super.close(panel); public NoUiPresentation(NoUiContext context, NoUiRequest noUiRequest) {
} this.ctx = context;
this.noUiRequest = noUiRequest;
@Override }
public void popupOnly(IPanel panel) throws ContainerException {
// TODO Auto-generated method stub @Override
super.popupOnly(panel); public void close(IPanel panel) throws ContainerException {
} // TODO Auto-generated method stub
super.close(panel);
@Override }
public Object readFromSession(String name) {
return ((NoUiContext)this.ctx).getRedisLoginInfo().getContextMap().get(name); @Override
} public void popupOnly(IPanel panel) throws ContainerException {
// TODO Auto-generated method stub
@Override super.popupOnly(panel);
public void showMainPanel() throws ContainerException { }
} @Override
public Object readFromSession(String name) {
@Override return ((NoUiContext) this.ctx).getRedisLoginInfo().getContextMap().get(name);
public void showPanel(IPanel panel) throws ContainerException { }
super.showPanel(panel);
} @Override
public void showMainPanel() throws ContainerException {
@Override
public void writeToSession(String name, Object value) { }
((NoUiContext)this.ctx).getRedisLoginInfo().getContextMap().put(name, value);
} @Override
public void showPanel(IPanel panel) throws ContainerException {
public String transactionName = null; super.showPanel(panel);
public boolean clearFlag = false; }
public boolean newTabFlag = false;
private boolean isChain = false; @Override
public Boolean logoutFlag = null; public void writeToSession(String name, Object value) {
((NoUiContext) this.ctx).getRedisLoginInfo().getContextMap().put(name, value);
public String getMessageCode() { }
return this.message_code;
} public String getMessageCode() {
return this.message_code;
public String getMessage() { }
return this.message;
} public String getMessage() {
return this.message;
public boolean isChain() { }
return isChain;
} public boolean isChain() {
return isChain;
public NoUiPresentation(NoUiContext context, NoUiRequest noUiRequest) { }
this.ctx = context;
this.noUiRequest = noUiRequest; public synchronized void dispose() {
} if (disposed) {
return;
public synchronized void dispose() { }
if (disposed) { clearRequest();
return; super.dispose();
} }
clearRequest();
super.dispose(); public final boolean noError() throws ContainerException {
} return error.isEmpty();
}
public final boolean noError() throws ContainerException {
return error.isEmpty(); public final void clearRequest() throws ContainerException {
} // tableRowMap.clear();
// formatMap.clear();
public final void clearRequest() throws ContainerException { // messageMap.clear();
// tableRowMap.clear(); // hintMap.clear();
// formatMap.clear(); // tableModifyList.clear();
// messageMap.clear(); // modifyList.clear();
// hintMap.clear(); // visibleList.clear();
// tableModifyList.clear(); // codeValuesList.clear();
// modifyList.clear(); // enableList.clear();
// visibleList.clear(); // requiredList.clear();
// codeValuesList.clear(); popupPanel = null;
// enableList.clear(); transactionName = null;
// requiredList.clear(); logoutFlag = null;
popupPanel = null; }
transactionName = null;
logoutFlag = null; public final void chain(String transactionName) throws ContainerException {
} chain(transactionName, false, false);
}
public final void chain(String transactionName) throws ContainerException {
chain(transactionName, false, false); public void chain(String transactionName, boolean clearFlag, boolean newTabFlag) {
} this.transactionName = transactionName;
this.clearFlag = clearFlag;
public void chain(String transactionName, boolean clearFlag, boolean newTabFlag) { this.newTabFlag = newTabFlag;
this.transactionName = transactionName; isChain = true;
this.clearFlag = clearFlag; }
this.newTabFlag = newTabFlag;
isChain = true; public void logout() throws ContainerException {
} logoutFlag = true;
}
public void logout() throws ContainerException {
logoutFlag = true; public final void popup(IPanel popupPanel) {
} // this.popupPanel = popupPanel;
popupPanel.invokeDefaultRules(this.ctx);
public final void popup(IPanel popupPanel) { }
// this.popupPanel = popupPanel;
popupPanel.invokeDefaultRules(this.ctx); // @SuppressWarnings({ "rawtypes", "unchecked" })
} // private final void mapPut(Map paramMap, IAttribute paramIAttribute,
// String paramString1, String paramString2, Object... paramVarArgs) {
// @SuppressWarnings({ "rawtypes", "unchecked" }) // for (int i = 0; i < paramVarArgs.length; i++) {
// private final void mapPut(Map paramMap, IAttribute paramIAttribute, // if ((paramVarArgs[i] instanceof String)) {
// String paramString1, String paramString2, Object... paramVarArgs) { // paramVarArgs[i] = getI18nValue((String) paramVarArgs[i]);
// for (int i = 0; i < paramVarArgs.length; i++) { // }
// if ((paramVarArgs[i] instanceof String)) { // }
// paramVarArgs[i] = getI18nValue((String) paramVarArgs[i]); // String str = MessageFormat.format(getI18nValue(paramString2),
// } // paramVarArgs);
// } // if (paramString1 != null) {
// String str = MessageFormat.format(getI18nValue(paramString2), // paramIAttribute.setAttribute(paramString1, str);
// paramVarArgs); // }
// if (paramString1 != null) { // paramMap.put(paramIAttribute, str);
// paramIAttribute.setAttribute(paramString1, str); //
// } // if ((paramIAttribute instanceof IDatafield)) {
// paramMap.put(paramIAttribute, str); // log.info(String.format("error field url %s.", new Object[] {
// // ((IDatafield<?>) paramIAttribute).getUrl() }));
// if ((paramIAttribute instanceof IDatafield)) { // }
// log.info(String.format("error field url %s.", new Object[] { //
// ((IDatafield<?>) paramIAttribute).getUrl() })); // if ((paramIAttribute instanceof IBaseObject)) {
// } // error.put(((IBaseObject) paramIAttribute).getUrl(), str);
// // }
// if ((paramIAttribute instanceof IBaseObject)) { //
// error.put(((IBaseObject) paramIAttribute).getUrl(), str); // }
// }
// @SuppressWarnings("rawtypes")
// } public final void error(IAttribute paramIAttribute, String paramString, Object... paramVarArgs) throws ContainerException {
@SuppressWarnings("rawtypes") paramIAttribute = handleProxyField(paramIAttribute);
public final void error(IAttribute paramIAttribute, String paramString, Object... paramVarArgs) throws ContainerException { // mapPut(messageMap, paramIAttribute, null, paramString, paramVarArgs);
for (int i = 0; i < paramVarArgs.length; i++) {
paramIAttribute = handleProxyField(paramIAttribute); if ((paramVarArgs[i] instanceof String)) {
// mapPut(messageMap, paramIAttribute, null, paramString, paramVarArgs); paramVarArgs[i] = getI18nValue((String) paramVarArgs[i]);
for (int i = 0; i < paramVarArgs.length; i++) { }
if ((paramVarArgs[i] instanceof String)) { }
paramVarArgs[i] = getI18nValue((String) paramVarArgs[i]); String str = MessageFormat.format(getI18nValue(paramString), paramVarArgs);
} if ((paramIAttribute instanceof IBaseObject)) {
} error.put(((IBaseObject) paramIAttribute).getUrl(), str);
String str = MessageFormat.format(getI18nValue(paramString), paramVarArgs); }
if ((paramIAttribute instanceof IBaseObject)) { if ((log.isDebugEnabled()) && ((paramIAttribute instanceof IDatafield))) {
error.put(((IBaseObject) paramIAttribute).getUrl(), str); log.info(String.format("error field url %s.", new Object[]{((IDatafield<?>) paramIAttribute).getUrl()}));
} }
if ((log.isDebugEnabled()) && ((paramIAttribute instanceof IDatafield))) { }
log.info(String.format("error field url %s.", new Object[] { ((IDatafield<?>) paramIAttribute).getUrl() }));
} @SuppressWarnings("rawtypes")
} public final void setHint(IAttribute paramIAttribute, String paramString, Object... paramVarArgs) throws ContainerException {
// mapPut(hintMap, paramIAttribute, "HINT", paramString, paramVarArgs);
@SuppressWarnings("rawtypes") }
public final void setHint(IAttribute paramIAttribute, String paramString, Object... paramVarArgs) throws ContainerException {
// mapPut(hintMap, paramIAttribute, "HINT", paramString, paramVarArgs); public boolean message(MessageType paramMessageType, String paramString, Object paramObject) {
} if(paramObject instanceof ExitTransactionException){
throw ExitTransactionException.class.cast(paramObject);
public boolean message(MessageType paramMessageType, String paramString, Object paramObject) throws ContainerException { }
if(paramMessageType.equals(MessageType.ERROR) && (paramObject instanceof Throwable)) if (paramMessageType.equals(MessageType.ERROR) && (paramObject instanceof Throwable)) {
{ //记录异常日志
//记录异常日志 TxInfo.recordException((Throwable) paramObject);
TxInfo.recordException((Throwable)paramObject); }
}
String str1 = "";
String str1 = ""; try {
try { if ((paramObject instanceof String)) {
if ((paramObject instanceof String)) { str1 = (String) paramObject;
str1 = (String) paramObject; } else if ((paramObject instanceof Throwable)) {
} else if ((paramObject instanceof Throwable)) { File localFile = new File(getRootPath(), "dump");
File localFile = new File(getRootPath(), "dump"); if (!localFile.exists())
if (!localFile.exists()) localFile.mkdirs();
localFile.mkdirs(); String str2 = new SimpleDateFormat("yyyyMMddHHmmss.SSS").format(new Date()) + ".log";
String str2 = new SimpleDateFormat("yyyyMMddHHmmss.SSS").format(new Date()) + ".log"; PrintStream localPrintStream = new PrintStream(new FileOutputStream(new File(localFile, str2)));
PrintStream localPrintStream = new PrintStream(new FileOutputStream(new File(localFile, str2))); ((Throwable) paramObject).printStackTrace(localPrintStream);
((Throwable) paramObject).printStackTrace(localPrintStream); localPrintStream.close();
localPrintStream.close(); str1 = String.format(getI18nValue("eibs", "error.message"), new Object[]{((Throwable) paramObject).getMessage(), str2});
str1 = String.format(getI18nValue("eibs", "error.message"), new Object[] { ((Throwable) paramObject).getMessage(), str2 }); log.error("事件触发异常:" + ((Throwable) paramObject).getMessage(), (Throwable) paramObject);
log.error("事件触发异常:"+((Throwable) paramObject).getMessage(),(Throwable)paramObject); } else if (paramObject != null) {
} else if (paramObject != null) { str1 = paramObject.toString();
str1 = paramObject.toString(); }
}
if (paramString == null) {
if (paramString == null) { paramString = getI18nValue("eibs", "error.title");
paramString = getI18nValue("eibs", "error.title"); }
} if ((!StringUtils.isEmpty(paramString)) && paramString.matches("E[0-9]{4}")) {
if ((!StringUtils.isEmpty(paramString)) && paramString.matches("E[0-9]{4}")) { this.message_code = paramString;
this.message_code = paramString; }
} /*
/*
* if (MessageType.ERROR.equals(paramMessageType)) { * if (MessageType.ERROR.equals(paramMessageType)) {
* log.error(StringUtils.isEmpty(paramString) ? str1 : str1 + ":" + * log.error(StringUtils.isEmpty(paramString) ? str1 : str1 + ":" +
* paramString); } * paramString); }
*/ */
this.message = str1; this.message = str1;
// log.debug(paramString + "--" + paramObject); // log.debug(paramString + "--" + paramObject);
} catch (Exception e) { } catch (Exception e) {
if ((paramObject instanceof Throwable)) { if ((paramObject instanceof Throwable)) {
log.error("dump message error", (Throwable) paramObject); log.error("dump message error", (Throwable) paramObject);
} }
log.warn("function message error", e); log.warn("function message error", e);
} }
return false; return false;
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public final void setRequired(IAttribute paramIAttribute) throws ContainerException { public final void setRequired(IAttribute paramIAttribute) throws ContainerException {
paramIAttribute.setAttribute("REQUIRED", Boolean.valueOf(true)); paramIAttribute.setAttribute("REQUIRED", Boolean.valueOf(true));
// if (!requiredList.contains(paramIAttribute)) { // if (!requiredList.contains(paramIAttribute)) {
// requiredList.add(paramIAttribute); // requiredList.add(paramIAttribute);
// } // }
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public void setNotRequired(IAttribute paramIAttribute) throws ContainerException { public void setNotRequired(IAttribute paramIAttribute) throws ContainerException {
paramIAttribute.setAttribute("REQUIRED", Boolean.valueOf(false)); paramIAttribute.setAttribute("REQUIRED", Boolean.valueOf(false));
// if (!requiredList.contains(paramIAttribute)) { // if (!requiredList.contains(paramIAttribute)) {
// requiredList.add(paramIAttribute); // requiredList.add(paramIAttribute);
// } // }
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public boolean isRequired(IAttribute paramIAttribute) throws ContainerException { public boolean isRequired(IAttribute paramIAttribute) throws ContainerException {
Boolean localBoolean = (Boolean) paramIAttribute.getAttribute("REQUIRED"); Boolean localBoolean = (Boolean) paramIAttribute.getAttribute("REQUIRED");
return localBoolean == null ? false : localBoolean.booleanValue(); return localBoolean == null ? false : localBoolean.booleanValue();
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public final void enable(IAttribute paramIAttribute) throws ContainerException { public final void enable(IAttribute paramIAttribute) throws ContainerException {
paramIAttribute.setAttribute("ENABLE", Boolean.valueOf(true)); paramIAttribute.setAttribute("ENABLE", Boolean.valueOf(true));
// if (!enableList.contains(paramIAttribute)) { // if (!enableList.contains(paramIAttribute)) {
// enableList.add(paramIAttribute); // enableList.add(paramIAttribute);
// } // }
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public final void disable(IAttribute paramIAttribute) throws ContainerException { public final void disable(IAttribute paramIAttribute) throws ContainerException {
paramIAttribute.setAttribute("ENABLE", Boolean.valueOf(false)); paramIAttribute.setAttribute("ENABLE", Boolean.valueOf(false));
// if (!enableList.contains(paramIAttribute)) { // if (!enableList.contains(paramIAttribute)) {
// enableList.add(paramIAttribute); // enableList.add(paramIAttribute);
// } // }
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public final boolean isEnabled(IAttribute paramIAttribute) throws ContainerException { public final boolean isEnabled(IAttribute paramIAttribute) throws ContainerException {
Boolean localBoolean = (Boolean) paramIAttribute.getAttribute("ENABLE"); Boolean localBoolean = (Boolean) paramIAttribute.getAttribute("ENABLE");
return localBoolean == null ? true : localBoolean.booleanValue(); return localBoolean == null ? true : localBoolean.booleanValue();
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public final void visible(IAttribute paramIAttribute) throws ContainerException { public final void visible(IAttribute paramIAttribute) throws ContainerException {
paramIAttribute.setAttribute("VISIBLE", Boolean.valueOf(true)); paramIAttribute.setAttribute("VISIBLE", Boolean.valueOf(true));
// if (!visibleList.contains(paramIAttribute)) { // if (!visibleList.contains(paramIAttribute)) {
// visibleList.add(paramIAttribute); // visibleList.add(paramIAttribute);
// } // }
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public final void invisible(IAttribute paramIAttribute) throws ContainerException { public final void invisible(IAttribute paramIAttribute) throws ContainerException {
paramIAttribute.setAttribute("VISIBLE", Boolean.valueOf(false)); paramIAttribute.setAttribute("VISIBLE", Boolean.valueOf(false));
// if (!visibleList.contains(paramIAttribute)) { // if (!visibleList.contains(paramIAttribute)) {
// visibleList.add(paramIAttribute); // visibleList.add(paramIAttribute);
// } // }
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public final boolean isVisible(IAttribute paramIAttribute) throws ContainerException { public final boolean isVisible(IAttribute paramIAttribute) throws ContainerException {
Boolean localBoolean = (Boolean) paramIAttribute.getAttribute("VISIBLE"); Boolean localBoolean = (Boolean) paramIAttribute.getAttribute("VISIBLE");
return localBoolean == null ? true : localBoolean.booleanValue(); return localBoolean == null ? true : localBoolean.booleanValue();
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public final void setModified(IAttribute paramIAttribute) throws ContainerException { public final void setModified(IAttribute paramIAttribute) throws ContainerException {
//paramIAttribute.setAttribute("MODIFY", Boolean.valueOf(true)); //paramIAttribute.setAttribute("MODIFY", Boolean.valueOf(true));
setModified(paramIAttribute, true); setModified(paramIAttribute, true);
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public final void resetModified(IAttribute paramIAttribute) throws ContainerException { public final void resetModified(IAttribute paramIAttribute) throws ContainerException {
// paramIAttribute.setAttribute("MODIFY", Boolean.valueOf(false)); // paramIAttribute.setAttribute("MODIFY", Boolean.valueOf(false));
setModified(paramIAttribute, false); setModified(paramIAttribute, false);
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public final boolean isModified(IAttribute paramIAttribute) throws ContainerException { public final boolean isModified(IAttribute paramIAttribute) throws ContainerException {
Boolean localBoolean = (Boolean) paramIAttribute.getAttribute("MODIFY"); Boolean localBoolean = (Boolean) paramIAttribute.getAttribute("MODIFY");
return localBoolean == null ? false : localBoolean.booleanValue(); return localBoolean == null ? false : localBoolean.booleanValue();
} }
private IAttribute handleProxyField(IAttribute paramIAttribute) { private IAttribute handleProxyField(IAttribute paramIAttribute) {
while (paramIAttribute instanceof ProxyDatafield) { while (paramIAttribute instanceof ProxyDatafield) {
paramIAttribute = ((ProxyDatafield) paramIAttribute).getHost(); paramIAttribute = ((ProxyDatafield) paramIAttribute).getHost();
log.info("proxy url=" + ((IBaseObject) paramIAttribute).getUrl()); log.info("proxy url=" + ((IBaseObject) paramIAttribute).getUrl());
} }
return paramIAttribute; return paramIAttribute;
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public final void setValues(IAttributeValue paramIAttributeValue, List<CodetableItem> paramList) throws ContainerException { public final void setValues(IAttributeValue paramIAttributeValue, List<CodetableItem> paramList) throws ContainerException {
paramIAttributeValue = (IAttributeValue) handleProxyField(paramIAttributeValue); paramIAttributeValue = (IAttributeValue) handleProxyField(paramIAttributeValue);
codetable.put(((IBaseObject) paramIAttributeValue).getUrl(), paramList); codetable.put(((IBaseObject) paramIAttributeValue).getUrl(), paramList);
paramIAttributeValue.setAttribute("CODEVALUES", paramList); paramIAttributeValue.setAttribute("CODEVALUES", paramList);
/* /*
* if (((paramIAttributeValue instanceof IBaseObject)) && * if (((paramIAttributeValue instanceof IBaseObject)) &&
* (!this.codeValuesList.contains(paramIAttributeValue))) { IBaseObject * (!this.codeValuesList.contains(paramIAttributeValue))) { IBaseObject
...@@ -370,13 +370,13 @@ public class NoUiPresentation extends AbstractNullPresentation { ...@@ -370,13 +370,13 @@ public class NoUiPresentation extends AbstractNullPresentation {
* *
* } * }
*/ */
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public final void listRowChange(IModuleList paramIModuleList, RowOpType paramRowOpType, int paramInt1, int paramInt2) throws ContainerException { public final void listRowChange(IModuleList paramIModuleList, RowOpType paramRowOpType, int paramInt1, int paramInt2) throws ContainerException {
// if (!tableModifyList.contains(paramIModuleList)) { // if (!tableModifyList.contains(paramIModuleList)) {
// tableModifyList.add(paramIModuleList); // tableModifyList.add(paramIModuleList);
// } // }
/* /*
* List<Map<String, Object>> dataList = new ArrayList<Map<String, * List<Map<String, Object>> dataList = new ArrayList<Map<String,
* Object>>(); for (int i = 0; i < paramIModuleList.size(); i++) { * Object>>(); for (int i = 0; i < paramIModuleList.size(); i++) {
...@@ -388,169 +388,169 @@ public class NoUiPresentation extends AbstractNullPresentation { ...@@ -388,169 +388,169 @@ public class NoUiPresentation extends AbstractNullPresentation {
* data.put(paramIModuleList.getUrl(), dataList); * data.put(paramIModuleList.getUrl(), dataList);
*/ */
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public final void setDescription(IDatafield paramIDatafield, String paramString) { public final void setDescription(IDatafield paramIDatafield, String paramString) {
paramIDatafield.setAttribute("DESCRIPTION", paramString); paramIDatafield.setAttribute("DESCRIPTION", paramString);
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public void setChartArguments(IAttributeValue paramIAttributeValue, Object[] paramArrayOfObject) { public void setChartArguments(IAttributeValue paramIAttributeValue, Object[] paramArrayOfObject) {
paramIAttributeValue.setAttribute("ARGS", paramArrayOfObject); paramIAttributeValue.setAttribute("ARGS", paramArrayOfObject);
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public void setViewType(IAttributeValue paramIAttributeValue, ViewType paramViewType, int paramInt) { public void setViewType(IAttributeValue paramIAttributeValue, ViewType paramViewType, int paramInt) {
setViewType(paramIAttributeValue, paramViewType, 1, paramInt, -1); setViewType(paramIAttributeValue, paramViewType, 1, paramInt, -1);
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public void setViewType(IAttributeValue paramIAttributeValue, ViewType paramViewType, int paramInt1, int paramInt2, int paramInt3) { public void setViewType(IAttributeValue paramIAttributeValue, ViewType paramViewType, int paramInt1, int paramInt2, int paramInt3) {
paramIAttributeValue.setAttribute("VIEWTYPE", paramViewType); paramIAttributeValue.setAttribute("VIEWTYPE", paramViewType);
if (paramInt1 > 1) { if (paramInt1 > 1) {
paramIAttributeValue.setAttribute("COLSPAN", Integer.valueOf(paramInt1)); paramIAttributeValue.setAttribute("COLSPAN", Integer.valueOf(paramInt1));
} }
if (paramInt2 > 0) { if (paramInt2 > 0) {
paramIAttributeValue.setAttribute("WIDTH", Integer.valueOf(paramInt2)); paramIAttributeValue.setAttribute("WIDTH", Integer.valueOf(paramInt2));
} }
if (paramInt3 > 0) { if (paramInt3 > 0) {
paramIAttributeValue.setAttribute("HEIGHT", Integer.valueOf(paramInt3)); paramIAttributeValue.setAttribute("HEIGHT", Integer.valueOf(paramInt3));
} }
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public void setViewAttribute(IAttributeValue paramIAttributeValue, int paramInt1, int paramInt2, List<CodetableItem> paramList) { public void setViewAttribute(IAttributeValue paramIAttributeValue, int paramInt1, int paramInt2, List<CodetableItem> paramList) {
if (paramInt1 > 0) { if (paramInt1 > 0) {
paramIAttributeValue.setAttribute("LENGTH", Integer.valueOf(paramInt1)); paramIAttributeValue.setAttribute("LENGTH", Integer.valueOf(paramInt1));
} }
if (paramInt2 > 0) { if (paramInt2 > 0) {
paramIAttributeValue.setAttribute("LINE", Integer.valueOf(paramInt2)); paramIAttributeValue.setAttribute("LINE", Integer.valueOf(paramInt2));
} }
if ((paramList != null) && (!paramList.isEmpty())) { if ((paramList != null) && (!paramList.isEmpty())) {
paramIAttributeValue.setAttribute("CODEVALUES", paramList); paramIAttributeValue.setAttribute("CODEVALUES", paramList);
} }
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public void setViewFormat(IAttributeValue paramIAttributeValue, String paramString) { public void setViewFormat(IAttributeValue paramIAttributeValue, String paramString) {
if (!ContainerUtils.isEmpty(paramString)) { if (!ContainerUtils.isEmpty(paramString)) {
if (!(paramIAttributeValue instanceof IBaseObject)) { if (!(paramIAttributeValue instanceof IBaseObject)) {
paramIAttributeValue.setAttribute("FORMAT", paramString); paramIAttributeValue.setAttribute("FORMAT", paramString);
} else { } else {
// IBaseObject localIBaseObject = (IBaseObject) // IBaseObject localIBaseObject = (IBaseObject)
// paramIAttributeValue; // paramIAttributeValue;
// this.formatMap.put(localIBaseObject, paramString); // this.formatMap.put(localIBaseObject, paramString);
} }
} }
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public void setViewStyle(IAttribute paramIAttribute, String paramString1, String paramString2) { public void setViewStyle(IAttribute paramIAttribute, String paramString1, String paramString2) {
if (paramString1 != null) { if (paramString1 != null) {
paramIAttribute.setAttribute("STYLE", paramString1); paramIAttribute.setAttribute("STYLE", paramString1);
} }
if (paramString2 != null) { if (paramString2 != null) {
paramIAttribute.setAttribute("STYLECLASS", paramString2); paramIAttribute.setAttribute("STYLECLASS", paramString2);
} }
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public void setHeaderAttribute(IAttributeValue paramIAttributeValue, int paramInt1, int paramInt2) { public void setHeaderAttribute(IAttributeValue paramIAttributeValue, int paramInt1, int paramInt2) {
setHeaderAttribute(paramIAttributeValue, paramInt1, paramInt2, 1); setHeaderAttribute(paramIAttributeValue, paramInt1, paramInt2, 1);
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public void setHeaderAttribute(IAttributeValue paramIAttributeValue, int paramInt1, int paramInt2, int paramInt3) { public void setHeaderAttribute(IAttributeValue paramIAttributeValue, int paramInt1, int paramInt2, int paramInt3) {
if (paramInt1 > 0) { if (paramInt1 > 0) {
paramIAttributeValue.setAttribute("WIDTH", Integer.valueOf(paramInt1)); paramIAttributeValue.setAttribute("WIDTH", Integer.valueOf(paramInt1));
} }
if (paramInt2 > 1) { if (paramInt2 > 1) {
paramIAttributeValue.setAttribute("COLSPAN", Integer.valueOf(paramInt2)); paramIAttributeValue.setAttribute("COLSPAN", Integer.valueOf(paramInt2));
} }
if (paramInt3 > 1) { if (paramInt3 > 1) {
paramIAttributeValue.setAttribute("ROWSPAN", Integer.valueOf(paramInt3)); paramIAttributeValue.setAttribute("ROWSPAN", Integer.valueOf(paramInt3));
} }
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
private final void setModified(IAttribute paramIAttribute, boolean paramBoolean) { private final void setModified(IAttribute paramIAttribute, boolean paramBoolean) {
paramIAttribute = handleProxyField(paramIAttribute); paramIAttribute = handleProxyField(paramIAttribute);
modifyMap.put(((IBaseObject) paramIAttribute).getUrl(), paramIAttribute); modifyMap.put(((IBaseObject) paramIAttribute).getUrl(), paramIAttribute);
} }
@Override @Override
public ICodetable getCodetableInstance() throws ContainerException { public ICodetable getCodetableInstance() throws ContainerException {
return NoUiUtils.tbl; return NoUiUtils.tbl;
} }
@Override @Override
public II18n getI18nInstance() throws ContainerException { public II18n getI18nInstance() throws ContainerException {
return NoUiUtils.i18n; return NoUiUtils.i18n;
} }
@Override @Override
public IFilter getPasswordFilter() throws ContainerException { public IFilter getPasswordFilter() throws ContainerException {
return NoUiUtils.passwordFilter; return NoUiUtils.passwordFilter;
} }
@Override @Override
public String getRootPath() throws ContainerException { public String getRootPath() throws ContainerException {
// return // return
// localFile.getParentFile().getParentFile().getParentFile().getAbsolutePath(); // localFile.getParentFile().getParentFile().getParentFile().getAbsolutePath();
return NoUiUtils.rootPath; return NoUiUtils.rootPath;
} }
@Override @Override
public boolean isBackground() throws ContainerException { public boolean isBackground() throws ContainerException {
return false; return false;
} }
@Override @Override
public boolean isDebugMode() throws ContainerException { public boolean isDebugMode() throws ContainerException {
return NoUiUtils.debugMode; return NoUiUtils.debugMode;
} }
@Override @Override
public void saveDisplay(IPanel[] panels, String fileName, String cssUrl, String jsUrl) throws ContainerException { public void saveDisplay(IPanel[] panels, String fileName, String cssUrl, String jsUrl) throws ContainerException {
saveDisplay(panels, fileName); saveDisplay(panels, fileName);
} }
@Override @Override
public void saveDisplay(IPanel[] panels, String fileName) throws ContainerException { public void saveDisplay(IPanel[] panels, String fileName) throws ContainerException {
try { try {
Map<String, ?> map = noUiRequest.getSaveDisplayMap(); Map<String, ?> map = noUiRequest.getSaveDisplayMap();
String data = new Gson().toJson(map); String data = new Gson().toJson(map);
FileUtils.write(new File(fileName), data, Constants.ENCODING); FileUtils.write(new File(fileName), data, Constants.ENCODING);
} catch (IOException e) { } catch (IOException e) {
log.error("save dispaly error", e); log.error("save dispaly error", e);
} }
} }
public Map<String, Object> getCodetable() { public Map<String, Object> getCodetable() {
return codetable; return codetable;
} }
public Map<String, Object> getError() { public void setCodetable(Map<String, Object> codetable) {
return error; this.codetable = codetable;
} }
public void setCodetable(Map<String, Object> codetable) { public Map<String, Object> getError() {
this.codetable = codetable; return error;
} }
public void setError(Map<String, Object> error) { public void setError(Map<String, Object> error) {
this.error = error; this.error = error;
} }
public Map<String, Object> getModifyMap() { public Map<String, Object> getModifyMap() {
return modifyMap; return modifyMap;
} }
public void setModifyMap(Map<String, Object> modifyMap) { public void setModifyMap(Map<String, Object> modifyMap) {
this.modifyMap = modifyMap; this.modifyMap = modifyMap;
} }
} }
...@@ -188,14 +188,15 @@ public abstract class AbstractCommonController { ...@@ -188,14 +188,15 @@ public abstract class AbstractCommonController {
ret = ResultUtil.result(NoUiPresentationUtil.retCode(context), NoUiPresentationUtil.retMsg(context), afterReturnData,paginationData, ret = ResultUtil.result(NoUiPresentationUtil.retCode(context), NoUiPresentationUtil.retMsg(context), afterReturnData,paginationData,
NoUiPresentationUtil.handleErrorReturnData(context, alias), NoUiPresentationUtil.handleCodeTableReturnData(context, alias), noUiVersion.getVersion()); NoUiPresentationUtil.handleErrorReturnData(context, alias), NoUiPresentationUtil.handleCodeTableReturnData(context, alias), noUiVersion.getVersion());
} }
catch (ExitTransactionException exitTrans)
{
ret = ResultUtil.result(exitTrans.getErrorCode(), exitTrans.getMessage(), "service error", noUiVersion.getVersion());
}
catch (Throwable e) { catch (Throwable e) {
log.error("OnClick command error", e); if(e.getCause() instanceof ExitTransactionException){
ret = ResultUtil.result(ErrorCodes.ERROR, "hander error", "service error", noUiVersion.getVersion()); ExitTransactionException exitTrans=ExitTransactionException.class.cast(e.getCause());
TxInfo.recordException(e); ret = ResultUtil.result(exitTrans.getErrorCode(), exitTrans.getMessage(), exitTrans.getMessage(), noUiVersion.getVersion());
}else{
log.error("OnClick command error", e);
ret = ResultUtil.result(ErrorCodes.ERROR, "hander error", "service error", noUiVersion.getVersion());
TxInfo.recordException(e);
}
} finally { } finally {
if (context != null) { if (context != null) {
//context.getSupport().disconnect(); //context.getSupport().disconnect();
......
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