package xin.glue.ui.G.G06; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import com.posdata.glue.biz.activity.PosActivity; import com.posdata.glue.biz.constants.PosBizControlConstants; import com.posdata.glue.component.layout.PosMessageLayoutIF; import com.posdata.glue.context.PosContext; import com.posdata.glue.dao.vo.PosParameter; import com.posdata.glue.dao.vo.PosRow; import com.posdata.glue.dao.vo.PosRowSet; import com.posdata.glue.msg.PosMESMessageImpl; import com.posdata.glue.msg.PosMessageAttributeDefinition; import com.posdata.glue.msg.PosMessageDefinition; import com.posdata.glue.util.log.PosLog; import com.posdata.glue.util.log.PosLogFactory; public class XinMessageLayoutEdit extends PosActivity { private final PosLog log = PosLogFactory.getLogger(getClass()); public String runActivity(PosContext context) { log.logInfo("======== XinMessageLayoutEdit start " ); String[] TC_ID = (String[])context.get("TC_ID"); log.logInfo("======== XinMessageLayoutEdit TC_ID:"+TC_ID[0] ); List list = new ArrayList(); String sSeqNo = null; String sMsgid = null; String sMsgName = null; String sMsgType = null; String sMsgLen = null; String sDataValue = null; PosParameter param1 = new PosParameter(); param1.setWhereClauseParameter(0, TC_ID[0]); PosRowSet msgVO = this.getDao("mesdao").find("UIG060010_MSG_EDIT.select", param1); if ( msgVO.hasNext() ) { while(msgVO.hasNext()) { PosRow msgROW = msgVO.next(); sSeqNo = (String)msgROW.getAttribute("SEQ_NO"); sMsgid = (String)msgROW.getAttribute("MSG_ID"); sMsgName = (String)msgROW.getAttribute("MSG_NAME"); sMsgType = (String)msgROW.getAttribute("DATA_TYPE"); sMsgLen = (String)msgROW.getAttribute("DATA_LEN"); sDataValue = (String)msgROW.getAttribute("DATA_VALUE"); /* int numSeq = Integer.parseInt(sSeqNo); if (numSeq < 10) { sSeqNo = "00"+sSeqNo; } else if (numSeq < 100) { sSeqNo = "0"+sSeqNo; } */ HashMap map = new HashMap(200,6) ; list.add(map); map.put("SEQ_NO" , sSeqNo ); map.put("MSG_ID" , sMsgid ); map.put("MSG_NAME" , sMsgName ); map.put("DATA_TYPE" , sMsgType ); map.put("DATA_LEN" , sMsgLen ); map.put("DATA_VALUE", sDataValue); } } else { PosMessageLayoutIF layout = (PosMessageLayoutIF) PosContext.getBeanFactory().getBeanObject("layout"); PosContext ctx = new PosContext(); PosMESMessageImpl message = new PosMESMessageImpl(); message.setTCID(TC_ID[0]); ctx.setMessage(message); PosMessageDefinition def = layout.getAttributes(ctx); int attrsLength = def.getLength(); for (int i=0; i