Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/model/PLDefination.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,494 @@ package com.vci.model; /** * @author ludc * @date 2024/9/5 10:47 */ public class PLDefination { /** * 1:å¯¼èªæ ; 2:主å 容åº; 3:页ç¾åº */ private int type = 0; private String id = ""; private String name = ""; private String description = ""; /** * æ¾ç¤ºå±æ§ */ private String showAbs = ""; /** * åé符 */ private String separator = ""; /** * æ¾ç¤ºlink屿§ */ private String showLinkAbs = ""; /** * æç´¢ç®æ */ private String searchTarger = ""; /** * 模æ¿ç±»å */ private String templateType = ""; /** * æ¾ç¤ºç±»å */ private String showType = ""; /** * 模æ¿ID */ private String templateId = ""; /** * éæ©æ¹å */ private String orientation = ""; /** * æææ§ */ private String validity = ""; /** * æåºå段 */ private String orderField = ""; /** * æåºæ¹å */ private String orderMode = ""; /** * è¿åæ°æ®æ¡ç® */ private String returnRows = ""; /** * æ§å¶è·¯å¾ */ private String controlPath = ""; /** * å±å¼å½¢å¼:é级ï¼1ï¼å ¨é¨å±å¼0 */ private String expandMode = ""; /** * 龿¥ç±»å */ private String linkType = ""; /** * æ¯å¦æ¾ç¤ºå¾æ */ private String isShowImage = ""; /** * æ å±ç¤ºå */ private String expandCols = ""; /** * æ¾ç¤ºå 容 */ private String showContent = ""; /** * ç±»å */ private String showContentType = ""; /** * å ³ç³» */ private String showContentRelation = ""; /** * table */ private String showContentTable = ""; /** * å¯¼èªæ ç±»å 1代表folder 2代表è§è² 3ä»£è¡¨ä¸æ¾ç¤º */ private String navigatorType = ""; /** * äºä»¶key */ private String eventKey = ""; /** * äºä»¶èªå®ä¹ç±»å ¨è·¯å¾ */ private String eventValue = ""; /** * æ ¹èç¹æ¾ç¤ºå 容 */ private String rootContent = ""; /** * <p>UIè§£æå¨ï¼ç¨åå·;åéåç»å¼ï¼å³:java_csãjava_bsãnet_csãnet_bsãmobile_csãmobile_bs</p> * <p>弿 ¼å¼ç¤ºä¾ï¼java_cs:xxx;java_bs:xxx;net_cs:xxx;net_bs:xxx;mobile_cs:xx;mobile_bs:xxx; </p> */ private String uiParser = ""; /** * <p>æ©å±å±æ§ï¼ç¨åå·;åéåç»å¼ï¼æ¯ç»ç¨åå·:åéæ©å±å±æ§åç§°ä¸æ©å±å±æ§å¼ï¼å¯ä»¥å®ä¹ä»»æç»</p> * <p>弿 ¼å¼ç¤ºä¾ï¼ext1:xx;ext2;ext3:xx;ext4:xxx;extn:xxx;</p> */ private String extAttr = ""; /** * ç»ä»¶ä¸è®¾ç½®çæ¥è¯¢æ¨¡æ¿åç§° */ private String queryTemplateName = ""; /** * åUIçä¸å¡ç±»å */ private String subUiObjType = ""; /** * å ³èåUI */ private String subUILayout = ""; public String getEventKey() { return eventKey; } public void setEventKey(String eventKey) { this.eventKey = eventKey; } public String getEventValue() { return eventValue; } public void setEventValue(String eventValue) { this.eventValue = eventValue; } public int getType() { return type; } public void setType(int type) { this.type = type; } public String getShowAbs() { return showAbs; } public void setShowAbs(String showAbs) { this.showAbs = showAbs; } public String getSeparator() { return separator; } public void setSeparator(String separator) { this.separator = separator; } public String getShowLinkAbs() { return showLinkAbs; } public void setShowLinkAbs(String showLinkAbs) { this.showLinkAbs = showLinkAbs; } public String getSearchTarger() { return searchTarger; } public void setSearchTarger(String searchTarger) { this.searchTarger = searchTarger; } public String getTemplateType() { return templateType; } public void setTemplateType(String templateType) { this.templateType = templateType; } public String getShowType() { return showType; } public void setShowType(String showType) { this.showType = showType; } public String getTemplateId() { return templateId; } public void setTemplateId(String templateId) { this.templateId = templateId; } public String getOrientation() { return orientation; } public void setOrientation(String orientation) { this.orientation = orientation; } public String getValidity() { return validity; } public void setValidity(String validity) { this.validity = validity; } public String getOrderField() { return orderField; } public void setOrderField(String orderField) { this.orderField = orderField; } public String getOrderMode() { return orderMode; } public void setOrderMode(String orderMode) { this.orderMode = orderMode; } public String getReturnRows() { return returnRows; } public void setReturnRows(String returnRows) { this.returnRows = returnRows; } public String getControlPath() { return controlPath; } public void setControlPath(String controlPath) { this.controlPath = controlPath; } public String getExpandMode() { return expandMode; } public void setExpandMode(String expandMode) { this.expandMode = expandMode; } public String getLinkType() { return linkType; } public void setLinkType(String linkType) { this.linkType = linkType; } public String getIsShowImage() { return isShowImage; } public void setIsShowImage(String isShowImage) { this.isShowImage = isShowImage; } public String getExpandCols() { return expandCols; } public void setExpandCols(String expandCols) { this.expandCols = expandCols; } public String getShowContent() { return showContent; } public void setShowContent(String showContent) { this.showContent = showContent; } public String getShowContentType() { return showContentType; } public void setShowContentType(String showContentType) { this.showContentType = showContentType; } public String getShowContentRelation() { return showContentRelation; } public void setShowContentRelation(String showContentRelation) { this.showContentRelation = showContentRelation; } public String getShowContentTable() { return showContentTable; } public void setShowContentTable(String showContentTable) { this.showContentTable = showContentTable; } public String getNavigatorType() { return navigatorType; } public void setNavigatorType(String navigatorType) { this.navigatorType = navigatorType; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } /** * è¿å æ ¹èç¹ æ¾ç¤ºå 容 * @return */ public String getRootContent() { return rootContent; } /** * 设置 æ ¹èç¹ æ¾ç¤ºå 容 * @param rootContent æ ¹èç¹æ¾ç¤ºå 容 */ public void setRootContent(String rootContent) { this.rootContent = rootContent; } /** * è¿å * <p>UIè§£æå¨ï¼ç¨åå·;åéåç»å¼ï¼å³:java_csãjava_bsãnet_csãnet_bsãmobile_csãmobile_bs</p> * <p>弿 ¼å¼ç¤ºä¾ï¼java_cs:xxx;java_bs:xxx;net_cs:xxx;net_bs:xxx;mobile_cs:xx;mobile_bs:xxx; </p> * @return */ public String getUiParser() { return uiParser; } /** * è¿å * <p>UIè§£æå¨ï¼ç¨åå·;åéåç»å¼ï¼å³:java_csãjava_bsãnet_csãnet_bsãmobile_csãmobile_bs</p> * <p>弿 ¼å¼ç¤ºä¾ï¼java_cs:xxx;java_bs:xxx;net_cs:xxx;net_bs:xxx;mobile_cs:xx;mobile_bs:xxx; </p> * @param uiParser */ public void setUiParser(String uiParser) { this.uiParser = uiParser; } /** * è¿å * <p>æ©å±å±æ§ï¼ç¨åå·;åéåç»å¼ï¼æ¯ç»ç¨åå·:åéæ©å±å±æ§åç§°ä¸æ©å±å±æ§å¼ï¼å¯ä»¥å®ä¹ä»»æç»</p> * <p>弿 ¼å¼ç¤ºä¾ï¼ext1:xx;ext2;ext3:xx;ext4:xxx;extn:xxx;</p> * @return */ public String getExtAttr() { return extAttr; } /** * 设置 * <p>æ©å±å±æ§ï¼ç¨åå·;åéåç»å¼ï¼æ¯ç»ç¨åå·:åéæ©å±å±æ§åç§°ä¸æ©å±å±æ§å¼ï¼å¯ä»¥å®ä¹ä»»æç»</p> * <p>弿 ¼å¼ç¤ºä¾ï¼ext1:xx;ext2;ext3:xx;ext4:xxx;extn:xxx;</p> */ public void setExtAttr(String extAttr) { this.extAttr = extAttr; } /** * 设置 å¨ç»ä»¶ä¸è®¾ç½®çæ¥è¯¢æ¨¡æ¿åç§° * @return */ public String getQueryTemplateName() { return queryTemplateName; } /** * è¿åå¨ç»ä»¶ä¸å®ä¹çæ¥è¯¢æ¨¡æ¿åç§° * @param queryTemplateName */ public void setQueryTemplateName(String queryTemplateName) { this.queryTemplateName = queryTemplateName; } /** * @return the subUiBtName */ public String getSubUiObjType() { return subUiObjType; } /** * @param subUiBtName the subUiBtName to set */ public void setSubUiObjType(String subUiBtName) { this.subUiObjType = subUiBtName; } /** * @return the subUILayout */ public String getSubUILayout() { return subUILayout; } /** * @param subUILayout the subUILayout to set */ public void setSubUILayout(String subUILayout) { this.subUILayout = subUILayout; } } Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PLDefinationVO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,226 @@ package com.vci.pagemodel; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.util.Map; /** * @author ludc * @date 2024/9/5 11:45 */ @Data @AllArgsConstructor @NoArgsConstructor public class PLDefinationVO { /** * 1:å¯¼èªæ ; 2:主å 容åº; 3:页ç¾åº */ private int type = 0; private String id = ""; private String name = ""; private String description = ""; /** * æ¾ç¤ºå±æ§ */ private String showAbs = ""; /** * åé符 */ private String separator = ""; /** * æ¾ç¤ºlink屿§ */ private String showLinkAbs = ""; /** * æç´¢ç®æ ï¼æç´¢ç±»åï¼æ¬å¯¹è±¡å±æ§ï¼1ï¼å ³èå¯¹è±¡å±æ§ï¼2 */ private String searchTarger = ""; /** * 模æ¿ç±»å: table:1 custom:2 treetable:3 from:4 tree:5 UILayout:6 */ private String templateType = ""; /** * æ¾ç¤ºç±»å */ private String showType = ""; /** * 模æ¿ID */ private String templateId = ""; /** * éæ©æ¹å */ private String orientation = ""; /** * æææ§ */ private String validity = ""; /** * æåºå段 */ private String orderField = ""; /** * æåºæ¹å */ private String orderMode = ""; /** * è¿åæ°æ®æ¡ç® */ private String returnRows = ""; /** * æ§å¶è·¯å¾ */ private String controlPath = ""; /** * å±å¼å½¢å¼ */ private String expandMode = ""; /** * ä¸å¡ç±»å */ private String btmType = ""; /** * 龿¥ç±»å */ private String linkType = ""; /** * æ ¹èç¹æ¾ç¤ºè¡¨è¾¾å¼ */ private String showExpressionRoot = ""; /** * æ èç¹æ¾ç¤ºè¡¨è¾¾å¼ */ private String showExpression = ""; /** * åç §æ 设置 */ private String refTreeSet = ""; /** * æ¯å¦æ¾ç¤ºå¾æ */ private String isShowImage = ""; /** * æ å±ç¤ºå */ private String expandCols = ""; /** * æ¾ç¤ºå 容 */ private String showContent = ""; /** * ç±»å */ private String showContentType = ""; /** * å ³ç³» */ private String showContentRelation = ""; /** * table */ private String showContentTable = ""; /** * å¯¼èªæ ç±»å 1代表folder 2代表è§è² 3ä»£è¡¨ä¸æ¾ç¤º */ private String navigatorType = ""; /** * äºä»¶key */ private String eventKey = ""; /** * äºä»¶èªå®ä¹ç±»å ¨è·¯å¾ */ private String eventValue = ""; /** * æ ¹èç¹æ¾ç¤ºå 容 */ private String rootContent = ""; /** * <p>UIè§£æå¨ï¼ç¨åå·;åéåç»å¼ï¼å³:java_csãjava_bsãnet_csãnet_bsãmobile_csãmobile_bs</p> * <p>弿 ¼å¼ç¤ºä¾ï¼java_cs:xxx;java_bs:xxx;net_cs:xxx;net_bs:xxx;mobile_cs:xx;mobile_bs:xxx; </p> */ private String uiParser = ""; /** * <p>æ©å±å±æ§ï¼ç¨åå·;åéåç»å¼ï¼æ¯ç»ç¨åå·:åéæ©å±å±æ§åç§°ä¸æ©å±å±æ§å¼ï¼å¯ä»¥å®ä¹ä»»æç»</p> * <p>弿 ¼å¼ç¤ºä¾ï¼ext1:xx;ext2;ext3:xx;ext4:xxx;extn:xxx;</p> */ private String extAttr = ""; /** * æ¥è¯¢å¯¹è±¡ç±»å */ private String qryType; /** * ç»ä»¶ä¸è®¾ç½®çæ¥è¯¢æ¨¡æ¿åç§° */ private String queryTemplateName = ""; /** * åUIçä¸å¡ç±»å */ private String subUIObjType = ""; /** * å ³èåUI */ private String subUILayout = ""; /** * UIå®ä¹ */ private String uiLayout; /** * ç¼å· */ private String seq; /** * åºåé 置页é¢ä¸»é® */ private String tabPageOId; /** * äºä»¶é®å¼å¯¹ */ private Map<String,String> eventMap; } Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/PLUILayoutCloneVO.java
@@ -16,9 +16,9 @@ public class PLUILayoutCloneVO { /** * å éç®æ ä¸»é® * å éç®æ ä¸å¡ç±»ååç§° */ private String cloneTargetOid; private String cloneTargetName; /** * å éçæºå¯¹è±¡çä¿¡æ¯ Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/UIManagerController.java
@@ -1,10 +1,13 @@ package com.vci.web.controller; import com.vci.corba.common.PLException; import com.vci.corba.portal.data.PLTabPage; import com.vci.corba.portal.data.PLUILayout; import com.vci.dto.OsBtmTypeDTO; import com.vci.pagemodel.PLUILayoutCloneVO; import com.vci.starter.web.annotation.controller.VciUnCheckRight; import com.vci.starter.web.annotation.log.VciBusinessLog; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.BaseQueryObject; import com.vci.starter.web.pagemodel.BaseResult; import com.vci.starter.web.util.VciBaseUtil; @@ -14,8 +17,12 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Arrays; import java.util.List; /** * UIå®ä¹æ§å¶å± @@ -121,9 +128,9 @@ * @return å é¤ç»æ */ @DeleteMapping("/delUIContextData") public BaseResult delUIContextData(String[] oids){ public BaseResult delUIContextData(String[] oids,String plRelatedType){ try { return uiManagerService.delUIContextData(oids) ? BaseResult.success("UIä¸ä¸æå 餿åï¼"):BaseResult.fail("UIä¸ä¸æå é¤å¤±è´¥ï¼"); return uiManagerService.delUIContextData(oids,plRelatedType) ? BaseResult.success("UIä¸ä¸æå 餿åï¼"):BaseResult.fail("UIä¸ä¸æå é¤å¤±è´¥ï¼"); } catch (PLException e) { e.printStackTrace(); String exceptionMessage = "å é¤UIä¸ä¸ææ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); @@ -137,10 +144,10 @@ * pluiLayoutCloneVO å éåæ°å¯¹è±¡ * @return å éç»æ */ @PostMapping("/cloneUiContextData") public BaseResult cloneUiContextData(@RequestBody PLUILayoutCloneVO pluiLayoutCloneVO){ @PostMapping("/cloneUIContextData") public BaseResult cloneUIContextData(@RequestBody PLUILayoutCloneVO pluiLayoutCloneVO){ try { return uiManagerService.cloneUiContextData(pluiLayoutCloneVO) ? BaseResult.success("UIä¸ä¸æå éæåï¼"):BaseResult.fail("UIä¸ä¸æå é失败ï¼"); return uiManagerService.cloneUIContextData(pluiLayoutCloneVO) ? BaseResult.success("UIä¸ä¸æå éæåï¼"):BaseResult.fail("UIä¸ä¸æå é失败ï¼"); } catch (PLException e) { e.printStackTrace(); String exceptionMessage = "UIä¸ä¸æå éæ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); @@ -149,6 +156,114 @@ } } /** * 导åºUIä¸ä¸æ * name 龿¥ç±»ååç§° * @return */ @GetMapping("/expUIContextData") public void expUIContextData(String[] oids, HttpServletResponse response) throws PLException, IOException { uiManagerService.expUIContextData(oids, response); } /** * å¯¼å ¥UIä¸ä¸æ * @param file ä¸ä¼ çæä»¶ * @return */ @PostMapping("/impUiContextData") public BaseResult impUIContextData(MultipartFile file){try { return uiManagerService.impUIContextData(file); }catch (Throwable e) { throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e); } } /** * æ ¹æ®ä¸ä¸æIDååºåç±»åï¼æé¡ºåºè·åå½ååºåçtab页 * @param contextId * @param areaType * @return */ @GetMapping( "/getTabByContextIdAndType") @VciBusinessLog(operateName = "æ ¹æ®ä¸ä¸æIDååºåç±»åï¼æé¡ºåºè·åå½ååºåçtab页") public BaseResult<List<PLTabPage>> getTabByContextIdAndType(String contextId, int areaType){ try { return BaseResult.dataList(uiManagerService.getTabByContextIdAndType(contextId,areaType)); }catch (Exception e) { e.printStackTrace(); String exceptionMessage = "æ ¹æ®ä¸ä¸æIDååºåç±»åï¼æé¡ºåºè·åå½ååºåçtabæ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); logger.error(exceptionMessage); return BaseResult.fail(exceptionMessage); } } /** * å建åºåæ°æ® * @param plTabPage * @return ä¿åç»æ */ @PostMapping("/addTabData") public BaseResult addTabData(@RequestBody PLTabPage plTabPage){ try { return uiManagerService.addTabData(plTabPage) ? BaseResult.success("å建æåï¼"):BaseResult.fail("å建失败ï¼"); } catch (Exception e) { e.printStackTrace(); String exceptionMessage = "å建æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); logger.error(exceptionMessage); return BaseResult.fail(exceptionMessage); } } /** * ä¿®æ¹åºåæ°æ® * @param plTabPage * @return ä¿®æ¹ç»æ */ @PutMapping("/updateTabData") public BaseResult updateTabData(@RequestBody PLTabPage plTabPage){ try { return uiManagerService.updateTabData(plTabPage) ? BaseResult.success("ä¿®æ¹æåï¼"):BaseResult.fail("ä¿®æ¹å¤±è´¥ï¼"); } catch (Exception e) { e.printStackTrace(); String exceptionMessage = "ä¿®æ¹æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); logger.error(exceptionMessage); return BaseResult.fail(exceptionMessage); } } /** * UIè§£æç±»æ£åæ£æ¥ * @param extAttr * @return */ @GetMapping("/checkTabPageExtAttrIsOk") public BaseResult checkTabPageExtAttrIsOk(String extAttr){ try { return uiManagerService.checkTabPageExtAttrIsOk(extAttr); }catch (Exception e) { e.printStackTrace(); String exceptionMessage = "UIè§£æç±»æ£åæ£æ¥æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); logger.error(exceptionMessage); return BaseResult.fail(exceptionMessage); } } /** * å 餿°æ® * @param oids * @return */ @DeleteMapping("/deleteTabData") public BaseResult deleteTabData(String[] oids){ try { return uiManagerService.deleteTabData(oids) ? BaseResult.success("å 餿åï¼"):BaseResult.fail("å é¤å¤±è´¥ï¼"); } catch (PLException e) { e.printStackTrace(); String exceptionMessage = "å 餿¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); logger.error(exceptionMessage); return BaseResult.fail(exceptionMessage); } } } Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebBtmTypeController.java
@@ -386,7 +386,6 @@ * @return */ @PostMapping("/impData") @VciUnCheckRight public BaseResult impData(MultipartFile file){try { return btmService.impData(file); }catch (Throwable e) { Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/UIManagerServiceI.java
@@ -1,13 +1,20 @@ package com.vci.web.service; import com.vci.corba.common.PLException; import com.vci.corba.portal.data.PLPageDefination; import com.vci.corba.portal.data.PLTabPage; import com.vci.corba.portal.data.PLUILayout; import com.vci.model.PLDefination; import com.vci.pagemodel.PLDefinationVO; import com.vci.pagemodel.PLUILayoutCloneVO; import com.vci.starter.web.pagemodel.BaseQueryObject; import com.vci.starter.web.pagemodel.BaseResult; import com.vci.starter.web.pagemodel.DataGrid; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; /** * @author ludc @@ -43,20 +50,93 @@ * æ ¹æ®ä¸»é®åä¸å¡ç±»åoidå é¤uiä¸ä¸ææ°æ® * @return */ boolean delUIContextData(String[] oids) throws PLException; boolean delUIContextData(String[] oids,String plRelatedType) throws PLException; /** * å éuiä¸ä¸æ * @param pluiLayoutCloneVO * @return */ boolean cloneUiContextData(PLUILayoutCloneVO pluiLayoutCloneVO) throws PLException; boolean cloneUIContextData(PLUILayoutCloneVO pluiLayoutCloneVO) throws PLException; /** * 导åºuiä¸ä¸æ(å¾éçè¦å¯¼åºçæ§å¶åºçæ°æ®) * oids * @return */ void expUiContextData(String[] oids, HttpServletResponse response) throws PLException, IOException; void expUIContextData(String[] oids, HttpServletResponse response) throws PLException, IOException; /** * å¯¼å ¥UIä¸ä¸æ * @param file * @return */ BaseResult impUIContextData(MultipartFile file); //åºåç¸å ³æ¥è¯¢ãæ·»å ãå é¤ãä¿®æ¹çæ¥å£ /** * æ ¹æ®ä¸ä¸æIDååºåç±»åï¼æé¡ºåºè·åå½ååºåçtab页 */ List<PLTabPage> getTabByContextIdAndType(String contextId, int areaType) throws PLException; /** * æ·»å åºåæ°æ® * @param plTabPage * @return */ boolean addTabData(PLTabPage plTabPage) throws PLException; /** * ä¿®æ¹åºåæ°æ® * @param plTabPage * @return */ boolean updateTabData(PLTabPage plTabPage) throws PLException; /** * å é¤åºåæ°æ® * @param oids * @return */ boolean deleteTabData(String[] oids) throws PLException; /** * æ£æ¥æ©å±å±æ§æ°æ®æ ¼å¼æ¯å¦åè§ï¼å¹¶ç»åºæç¤º * @param extAttr * @return */ BaseResult checkTabPageExtAttrIsOk(String extAttr); //页é¢è®¾è®¡ç¸å ³æ¥å£ /** * æ¥è¯¢é¡µé¢è®¾è®¡å®ä¹ * @param plPageContextOId * @return */ List<PLPageDefination> getPLPageDefinations(String plPageContextOId); /** * æ·»å 页é¢å®ä¹ * @param pd * @return */ boolean addPageDefination(PLDefinationVO pd) throws Throwable; /** * ä¿®æ¹é¡µé¢å®ä¹ * @param pd * @return */ boolean updatePageDefination(PLDefinationVO pd) throws Throwable; /** * å é¤é¡µé¢å®ä¹ * @param oids * @return */ boolean delPageDefination(String[] oids) throws PLException; //é ç½®æé®ç¸å ³æ¥å£ } Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
@@ -1,14 +1,17 @@ package com.vci.web.service.impl; import com.sun.jnlp.ApiDialog; import com.vci.client.mw.ClientContextVariable; import com.vci.common.qt.object.QTConstants; import com.vci.common.utility.ObjectUtility; import com.vci.corba.common.PLException; import com.vci.corba.portal.PortalService; import com.vci.corba.portal.data.*; import com.vci.model.PLDefination; import com.vci.pagemodel.PLDefinationVO; import com.vci.pagemodel.PLUILayoutCloneVO; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.pagemodel.BaseQueryObject; import com.vci.starter.web.pagemodel.BaseResult; import com.vci.starter.web.pagemodel.DataGrid; import com.vci.starter.web.pagemodel.SessionInfo; import com.vci.starter.web.util.VciBaseUtil; @@ -17,17 +20,21 @@ import com.vci.web.util.Func; import com.vci.web.util.PlatformClientUtil; import com.vci.web.util.UITools; import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import javax.swing.*; import javax.swing.text.JTextComponent; import java.io.IOException; import java.util.Arrays; import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.*; import java.util.regex.Pattern; import java.util.stream.Collectors; /** * UIå®ä¹æå¡çé¢ç¸å ³æ¥å£ @@ -42,6 +49,7 @@ */ @Resource private PlatformClientUtil platformClientUtil; /** * æ¥å¿ */ @@ -100,7 +108,6 @@ try { //uiä¸ä¸æå¯¹è±¡æ ¡éª canContinue(pluiLayout); String code = pluiLayout.plCode; String name = pluiLayout.plName; boolean isExist = nameOrCodeIsExist(pluiLayout, false); @@ -181,9 +188,9 @@ * @return */ @Override public boolean delUIContextData(String[] oids) throws PLException { public boolean delUIContextData(String[] oids,String plRelatedType) throws PLException { VciBaseUtil.alertNotNull(oids,"å¾ å é¤ç对象å表"); //å 餿¹æ³ä¸æå ³èæ°æ®å é¤çæä½é»è¾ //å 餿¹æ³ä¸æå ³èæ°æ®å é¤çæä½é»è¾,使¯è¿ä¸ªæ¹æ³åå¨é®é¢å°±æ¯å é¤çæ°æ®å¹¶æ²¡æå°ç¼åçä¸è¥¿æ¸ çå¹²å return platformClientUtil.getUIService().deletePLUILayoutByOidsForCascade(oids); } @@ -193,7 +200,7 @@ * @return */ @Override public boolean cloneUiContextData(PLUILayoutCloneVO pluiLayoutCloneVO) throws PLException { public boolean cloneUIContextData(PLUILayoutCloneVO pluiLayoutCloneVO) throws PLException { VciBaseUtil.alertNotNull( pluiLayoutCloneVO,"å éåæ°å¯¹è±¡", pluiLayoutCloneVO.getSourcePLUILayout(),"å éçæºå¯¹è±¡ä¿¡æ¯", @@ -202,8 +209,9 @@ ); PLUILayout pluiLayout = new PLUILayout(); PLUILayout sourcePLUILayout = pluiLayoutCloneVO.getSourcePLUILayout(); pluiLayout.plRelatedType = pluiLayoutCloneVO.getCloneTargetName(); //妿鿩å éç®æ ï¼åå éå°éæ©çç±»åä¸ï¼å¦ææ²¡æéæ©å éç®æ ï¼åå éå°å½åç±»åä¸ if(Func.isBlank(pluiLayoutCloneVO.getCloneTargetOid())){ if(Func.isBlank(pluiLayoutCloneVO.getCloneTargetName())){ pluiLayout.plRelatedType = sourcePLUILayout.plRelatedType; } //å éçåç§°åuiä¸ä¸æç¼å·æ¥é @@ -223,6 +231,9 @@ this.checkCodeName(pluiLayout); //1ãå ä¿åuiä¸ä¸æ boolean res = platformClientUtil.getUIService().savePLUILayout(pluiLayout); if(!res){ return res; } //2ãåèèåèç¹çå é PLTabPage[] pages = platformClientUtil.getUIService().getPLTabPagesByPageDefinationOId(sourcePLUILayout.plOId); //æ§å¶åºèç¹åå ¶åèç¹çå é if(pages == null){ @@ -241,9 +252,477 @@ } } /** * 导åºuiä¸ä¸æ(å¾éçè¦å¯¼åºçæ§å¶åºçæ°æ®) * oids * @return */ @Override public void expUiContextData(String[] oids, HttpServletResponse response) throws PLException, IOException { public void expUIContextData(String[] oids, HttpServletResponse response) throws PLException, IOException { } /** * å¯¼å ¥UIä¸ä¸æ * @param file * @return */ @Override public BaseResult impUIContextData(MultipartFile file) { return null; } /** * æ ¹æ®ä¸ä¸æIDååºåç±»åï¼æé¡ºåºè·åå½ååºåçtab页 */ @Override public List<PLTabPage> getTabByContextIdAndType(String contextId, int areaType) throws PLException { VciBaseUtil.alertNotNull(contextId,"ä¸ä¸æä¸»é®",areaType,"åºåç±»å"); PLTabPage[] plTabPages = platformClientUtil.getUIService().getTabPagesByContextIdAndType(contextId, (short) areaType); return Arrays.asList(plTabPages); } /** * æ·»å åºåæ°æ® * @param plTabPage * @return */ @Override public boolean addTabData(PLTabPage plTabPage) throws PLException { VciBaseUtil.alertNotNull(plTabPage,"æ·»å åºåæ°æ®"); SessionInfo sessionInfo = WebThreadLocalUtil.getCurrentUserSessionInfoInThread(); plTabPage.plCreateUser = sessionInfo.getUserId(); plTabPage.plModifyUser = sessionInfo.getUserId(); plTabPage.plOId = ObjectUtility.getNewObjectID36(); //æ°å¢åä¿®æ¹åæ£æ¥ï¼åºéç´æ¥æåºå¼å¸¸ checkEdit(plTabPage); return platformClientUtil.getUIService().savePLTabPage(plTabPage); } /** * ä¿®æ¹åºåæ°æ® * @param plTabPage * @return */ @Override public boolean updateTabData(PLTabPage plTabPage) throws PLException { VciBaseUtil.alertNotNull(plTabPage,"æ·»å åºåæ°æ®"); SessionInfo sessionInfo = WebThreadLocalUtil.getCurrentUserSessionInfoInThread(); plTabPage.plModifyUser = sessionInfo.getUserId(); //æ°å¢åä¿®æ¹åæ£æ¥ï¼åºéç´æ¥æåºå¼å¸¸ checkEdit(plTabPage); return platformClientUtil.getUIService().updatePLTabPage(plTabPage); } /** * å é¤åºåæ°æ® * @param oids * @return */ @Override public boolean deleteTabData(String[] oids) throws PLException { VciBaseUtil.alertNotNull(oids,"å¾ å é¤ç主é®å表"); return platformClientUtil.getUIService().deletePLTabPageByOidsForCascade(oids); } /** * æ©å±å±æ§åè§æ£æµ * @param extAttr * @return */ public BaseResult checkTabPageExtAttrIsOk(String extAttr){ // æ°æ®æ ¼å¼ï¼ext1:xx;ext2;ext3:xx;ext4:xxx;extn:xxx; boolean res = checkExtValIsOk(extAttr); return res ? BaseResult.success(true,"æ©å±å±æ§æ°æ®æ ¼å¼æ£ç¡®ï¼"):BaseResult.fail("æ©å±å±æ§æ°æ®æ ¼å¼ä¸æ£ç¡®ï¼ï¼"); } /** * æ¥è¯¢é¡µé¢è®¾è®¡å®ä¹ * @param plPageContextOId * @return */ @Override public List<PLPageDefination> getPLPageDefinations(String plPageContextOId) { return null; } /** * æ·»å 页é¢å®ä¹ * @param pdVO * @return */ @Override public boolean addPageDefination(PLDefinationVO pdVO) throws Throwable { VciBaseUtil.alertNotNull(pdVO,"页é¢å®ä¹å¯¹è±¡",pdVO.getSeq(),"ç¼å·",pdVO.getName(),"åç§°"); PLDefination d = new PLDefination(); PLPageDefination pd = new PLPageDefination(); pd.plTabPageOId = pdVO.getTabPageOId(); pd.plOId = ObjectUtility.getNewObjectID36(); //ä¸è½ä¸ºç©ºå±æ§æ£æ¥ if(!this.baseInfoIsOk(pd,false)){ return false; } pd.name = pdVO.getName().trim(); pd.seq = Short.valueOf(pdVO.getSeq().trim()); pd.desc = pdVO.getDescription(); pd.plType = Short.parseShort(pdVO.getTemplateType()); d.setName(pdVO.getName().trim()); d.setUiParser(pdVO.getUiParser().trim()); d.setExtAttr(pdVO.getExtAttr().trim()); d.setTemplateType(pdVO.getTemplateType()); //åç§°åç¼å·æ¥é newPLDefinationIsOk(pdVO, false); // æ£æ¥å个类åä¸çæ°æ®æ¯å¦è¾å ¥æææ,ä¸å ±6ç§ç±»åæç±»åæ£éª short plType = pd.plType; switch (plType){ //Table(è¡¨æ ¼) case 1: //From(表å) case 4: TableComptCheckInput tci = new TableComptCheckInput( pdVO.getSearchTarger() ,pdVO.getBtmType() ,pdVO.getLinkType() ,pdVO.getTemplateId() ,pdVO.getQueryTemplateName() ); if(!tci.checkInputIsOk()){ return false; } d = tci.getNewPLDefination(d); break; //Custom(èªå®ä¹æ¨¡æ¿) case 2: //åªæ£æ¥æ§å¶è·¯å¾ä¸è½ä¸ºç©º,æé®é¢ä¼ç´æ¥æ¥é CustomComptCheckInput ccci = new CustomComptCheckInput(pdVO.getControlPath()); if(!ccci.checkInputIsOk()){ return false; } d = ccci.getNewPLDefination(d); break; //TreeTable(æ 表) case 3: TreeTableComptCheckInput ttcci = new TreeTableComptCheckInput( pdVO.getSearchTarger() ,pdVO.getBtmType() ,pdVO.getLinkType() ,pdVO.getTemplateId() ,pdVO.getQueryTemplateName() ,pdVO.getExpandCols() ,pdVO.getExpandMode() ); if(!ttcci.checkInputIsOk()){ return false; } d = ttcci.getNewPLDefination(d); break; //Tree(æ ) case 5: TreeComptCheckInput tcci = new TreeComptCheckInput( pdVO.getBtmType(), pdVO.getLinkType(), pdVO.getQueryTemplateName(), pdVO.getShowExpressionRoot(), pdVO.getShowExpression(), pdVO.getRefTreeSet(), pdVO.getSeparator(), pdVO.getExpandMode() ); if(!tcci.checkInputIsOk()){ return false; } d = tcci.getNewPLDefination(d); break; //UILayout(UIå®ä¹) case 6: UILayoutComptCheckInput ulci = new UILayoutComptCheckInput( pdVO.getSearchTarger(), pdVO.getBtmType(), pdVO.getUiLayout(), pdVO.getQueryTemplateName(), pdVO.getQryType() ); if(!ulci.checkInputIsOk()){ return false; } d = ulci.getNewPLDefination(d); break; } d = setEventDataToPLDefination(d,pdVO); //转xmlèµå¼å°plDefinationä¸ pd.plDefination = UITools.getPLDefinationText(d); //æ§è¡ä¿å return platformClientUtil.getUIService().savePLPageDefination(pd); } /** * ä¿®æ¹é¡µé¢å®ä¹ * @param pdVO * @return */ @Override public boolean updatePageDefination(PLDefinationVO pdVO) throws Throwable { /*PLPageDefination pd = getPageDefination(); PLDefination d = UITools.getPLDefination(pd.plDefination); //ä¸è½ä¸ºç©ºå±æ§æ£æ¥ if(!this.baseInfoIsOk(pd,true)){ return false; } setUIValueToObject(pd, d); this.newPLDefinationIsOk(pdVO, true); // æ£æ¥å个ç»ä»¶å é¨çæ°æ®æ¯å¦ææ int plType = pdVO.getType(); switch (plType){ //Table(è¡¨æ ¼) case 1: //From(表å) case 4: TableComptCheckInput tci = new TableComptCheckInput( pdVO.getSearchTarger() ,pdVO.getBtmType() ,pdVO.getLinkType() ,pdVO.getTemplateId() ,pdVO.getQueryTemplateName() ); if(!tci.checkInputIsOk()){ return false; } d = tci.getNewPLDefination(d); break; //Custom(èªå®ä¹æ¨¡æ¿) case 2: //åªæ£æ¥æ§å¶è·¯å¾ä¸è½ä¸ºç©º,æé®é¢ä¼ç´æ¥æ¥é CustomComptCheckInput ccci = new CustomComptCheckInput(pdVO.getControlPath()); if(!ccci.checkInputIsOk()){ return false; } d = ccci.getNewPLDefination(d); break; //TreeTable(æ 表) case 3: TreeTableComptCheckInput ttcci = new TreeTableComptCheckInput( pdVO.getSearchTarger() ,pdVO.getBtmType() ,pdVO.getLinkType() ,pdVO.getTemplateId() ,pdVO.getQueryTemplateName() ,pdVO.getExpandCols() ,pdVO.getExpandMode() ); if(!ttcci.checkInputIsOk()){ return false; } d = ttcci.getNewPLDefination(d); break; //Tree(æ ) case 5: TreeComptCheckInput tcci = new TreeComptCheckInput( pdVO.getBtmType(), pdVO.getLinkType(), pdVO.getQueryTemplateName(), pdVO.getShowExpressionRoot(), pdVO.getShowExpression(), pdVO.getRefTreeSet(), pdVO.getSeparator(), pdVO.getExpandMode() ); if(!tcci.checkInputIsOk()){ return false; } d = tcci.getNewPLDefination(d); break; //UILayout(UIå®ä¹) case 6: UILayoutComptCheckInput ulci = new UILayoutComptCheckInput( pdVO.getSearchTarger(), pdVO.getBtmType(), pdVO.getUiLayout(), pdVO.getQueryTemplateName(), pdVO.getQryType() ); if(!ulci.checkInputIsOk()){ return false; } d = ulci.getNewPLDefination(d); break; } d = comptPanel.getNewPLDefination(d); d = setEventDataToPLDefination(d,pdVO); pd.plDefination = UITools.getPLDefinationText(d);*/ boolean res = true;//platformClientUtil.getUIService().updatePLPageDefination(pd); return res; } /** * å¤çé ç½®çeventäºä»¶ * @param d * @param pdVO * @return */ private PLDefination setEventDataToPLDefination(PLDefination d,PLDefinationVO pdVO){ Map<String, String> eventMap = pdVO.getEventMap(); if(Func.isNotEmpty(eventMap)){ String eventKey = eventMap.keySet().stream().collect(Collectors.joining(",")); d.setEventKey(eventKey); String eventValue = eventMap.values().stream().collect(Collectors.joining(",")); d.setEventValue(eventValue); }else{ d.setEventKey(""); d.setEventValue(""); } return d; } private boolean baseInfoIsOk(PLPageDefination pd, boolean isEdit) throws PLException{ boolean res = false; if(!checkRequiredIsOk("åç§°", pd.name)){ return false; } //shortç±»åçå°±ä¸ç¨æ£æ¥äº /*else if(!checkRequiredIsOk("ç¼å·", pd.seq)){ return false; }*/ res = true; return res; } private boolean checkRequiredIsOk(String tip, String txt) throws PLException { boolean res = false; if(Func.isBlank(txt)){ throw new PLException("500", new String[]{tip + " ä¸è½ä¸ºç©ºï¼"}); } else { res = true; } return res; } /** * å é¤é¡µé¢å®ä¹ * @param oids * @return */ @Override public boolean delPageDefination(String[] oids) throws PLException { VciBaseUtil.alertNotNull(oids,"å é¤ç页é¢å®ä¹ä¸»é®"); boolean res = platformClientUtil.getUIService().deletePLUILayoutByOidsForCascade(oids); return res; } /** * 页é¢å®ä¹åç§°åç¼å·æ¥é * @param pd * @param isEdit * @throws PLException */ private void newPLDefinationIsOk(PLDefinationVO pd, boolean isEdit) throws PLException{ boolean res = false; boolean nameExist = false; boolean seqExist = false; PLPageDefination[] pds = platformClientUtil.getUIService().getPLPageDefinationsByPageContextOId(pd.getTabPageOId()); for (PLPageDefination pdGet : pds) { if(!isEdit){ if(pd.getName().equals(pdGet.name)){ nameExist = true; } else if(Short.parseShort(pd.getSeq()) == pdGet.seq){ seqExist = true; } } else { if(!pd.getId().equals(pdGet.plOId)){ if(pd.getName().equals(pdGet.name)){ nameExist = true; } else if(Short.parseShort(pd.getSeq()) == pdGet.seq){ seqExist = true; } } } if(nameExist || seqExist){ break; } } if(nameExist){ throw new VciBaseException("åç§°å·²ç»åå¨ï¼"); } if(seqExist){ throw new VciBaseException("ç¼å·å·²ç»åå¨ï¼"); } } /** * ç»åºå䏿·»å æ°æ®åæ ¡éª * @param plTabPage * @return */ private void checkEdit(PLTabPage plTabPage) throws PLException { /*if(plTabPage.plSeq >= 0){ throw new VciBaseException("åºå·ä¸è½ä¸ºç©º!"); }else if(!isNumber(plseq.getText().trim())){ throw new VciBaseException("åºå·åªè½æ¯æ°åï¼è¯·éæ°å¡«å!"); }*/ if(!checkTabPageUIParserIsOk(plTabPage)){ throw new VciBaseException("UIè§£æç±»æ ¼å¼ä¸æ£ç¡®ï¼è¯·éæ°å¡«å!"); } //ç¬ç«åºæ¥åç¬åä¸ä¸ªæ¥å£è®©å端è¿è¡è°ç¨ /*else if(!checkTabPageExtAttrIsOk(plTabPage)){ //ç»åºæç¤ºï¼å¯¹äºmpmé ç½®å¯ä»¥å è®¸å ¶ä¿åï¼å ·ä½è§£æmpmèªå·±æ§å¶ by liucq int confirm = VCIOptionPane.showConfirmDialog(PLTApplication.frame, "æ©å±å±æ§æ°æ®æ ¼å¼ä¸æ£ç¡®\næ¯å¦ç»§ç»ä¿åï¼", "ç³»ç»æç¤º", JOptionPane.YES_NO_OPTION); }*/ PLTabPage[] tps = platformClientUtil.getUIService().getTabPagesByContextIdAndType(plTabPage.plContextOId, plTabPage.plAreaType); for (PLTabPage tp : tps) { if(tp.plSeq == plTabPage.plSeq && !tp.plOId.equals(plTabPage.plOId)){ throw new VciBaseException("åºå·éå¤ï¼"); } if(tp.plName.equalsIgnoreCase(plTabPage.plName) && !tp.plOId.equals(plTabPage.plOId)){ throw new VciBaseException("åç§°éå¤ï¼"); } if(tp.plCode.equalsIgnoreCase(plTabPage.plCode) && !tp.plOId.equals(plTabPage.plOId)){ throw new VciBaseException("页é¢ç¼ç éå¤ï¼"); } } } /** * æ£æ¥UIè§£æç±»æ¯å¦åè§ * @param tabPage * @return */ private boolean checkTabPageUIParserIsOk(PLTabPage tabPage){ // æ°æ®æ ¼å¼ï¼ java_cs:xxx;java_bs:xxx;net_cs:xxx;net_bs:xxx;mobile_cs:xx;mobile_bs:xxx; String uiParser = tabPage.plUIParser; return checkExtValIsOk(uiParser); } /** * UIè§£æç±»æ£åæ£æ¥ * @param value * @return */ private boolean checkExtValIsOk(String value){ boolean res = true; if(value == null || "".equals(value)){ return res; } Pattern ptn = Pattern.compile("([\\w\\.\\_\\-\\+]+:[\\w\\.\\_\\-\\+]+(;)?)+"); res = ptn.matcher(value).matches(); return res; } /** @@ -344,7 +823,7 @@ //æ¥è¯¢åä¸ä¸å¡ç±»åä¸çuiä¸ä¸æï¼ç¶åæ¥é PLUILayout[] plpagelayoutdefinations = platformClientUtil.getUIService().getPLUILayoutsByRelatedType(pluiLayout.plRelatedType); int length = plpagelayoutdefinations.length; for (int i =0;i<length;i++){ for (int i =0; i<length; i++){ String code = plpagelayoutdefinations[i].plCode; String name = plpagelayoutdefinations[i].plName; String ids = plpagelayoutdefinations[i].plOId; @@ -355,9 +834,8 @@ break; } } } else { if (code.equalsIgnoreCase(code) || name.equals(name)){ }else { if (code.equalsIgnoreCase(pluiLayout.plCode) || name.equals(pluiLayout.plName)){ res = true; break; } @@ -366,4 +844,679 @@ return res; } //åºç¡å ¬å ±æ£æ¥æ¥å£ private abstract class BaseComptInter { /** * å ¬å ±æ ¡éªæ¹æ³ * @return * @throws PLException */ public abstract boolean checkInputIsOk() throws PLException; /** * æ ¹æ®ç±»åä¸å设置ä¸åç屿§ * @param d * @return */ public abstract PLDefination getNewPLDefination(PLDefination d); /** * éç©ºæ£æ¥ * @param tip * @param txt * @return */ protected boolean checkRequiredIsOk(String tip, String txt){ boolean res = false; if(Func.isBlank(txt)){ throw new VciBaseException(tip + " ä¸è½ä¸ºç©ºï¼"); } else { res = true; } return res; } /** * æ£æ¥BtmTypeè¾å ¥æ¯å¦ææ * @param tipName æç¤ºçä¿¡æ¯ * @param btmName ä¸å¡ç±»åå * @return */ protected boolean checkBtmTypeTxtIsOk(String tipName, String btmName) throws PLException { boolean res = false; if(tipName == null) return true; if(btmName == null) return true; if(!checkRequiredIsOk(tipName, btmName)){ res = false; } else if(!checkBtmNameIsExist(tipName, btmName)){ res = false; } else { res = true; } return res; } /** * æ£æ¥ä¸å¡ç±»åæ¯å¦åå¨ * @param tip * @param btmName * @return */ protected boolean checkBtmNameIsExist(String tip, String btmName) throws PLException { boolean res = false; String sql = "select count(1) count_ from plbtmtype bt where bt.name='" + btmName.trim() + "'"; res = checkCountNotEqualZero(sql); if(!res){ throw new PLException("500", new String[]{String.format("%s %s æ æï¼", tip, btmName)}); } else { res = true; } return res; } /** * æ§è¡sqlï¼æ£æ¥æ¯å¦æè¿åå¼ * @param sql * @return */ protected boolean checkCountNotEqualZero(String sql){ boolean res = false; try{ String[][] kvss = platformClientUtil.getQueryService().queryBySqlWithoutKey(sql); res = Integer.valueOf(kvss[0][0]) > 0; }catch(Exception ex){ ex.printStackTrace(); } return res; } /** * æ£æ¥è¡¨åè¾å ¥æ¯å¦ææ * @param tip * @param txtVIName * @param btmLinkType * @return */ protected boolean checkPortalVITxtIsOk(String tip, String txtVIName, String btmLinkType) throws PLException { boolean res = false; if(tip == null) return true; if(txtVIName == null) return true; if(!checkRequiredIsOk(tip, txtVIName)){ res = false; } else if(!checkPortalVIIsExist(tip, txtVIName, btmLinkType)){ res = false; } else { res = true; } return res; } /** * æ£æ¥æ¨¡æ¿ * @param tip * @param txtVIName * @param btmLinkType * @return */ protected boolean checkPortalVIIsExist(String tip, String txtVIName, String btmLinkType) throws PLException { boolean res = false; String sql = "select count(1) count_ from plportalvi vi " + "where vi.typename='" + btmLinkType.trim() + "' " + "and vi.viname='" + txtVIName.trim() + "'"; res = checkCountNotEqualZero(sql); if(!res){ throw new PLException("500", new String[]{String.format("%s %s æ æï¼", tip, txtVIName)}); } else { res = true; } return res; } /** * æ£æ¥æ¥è¯¢æ¨¡æ¿è¾å ¥æ¯å¦ææ * @param tip è¾å ¥æ¡çåç§°ï¼ç¨æ¥æç¤º * @param txtQTName æ¥è¯¢æ¨¡æ¿ * @param btmLinkType * @return */ protected boolean checkQTNameTxtIsOk(String tip, String txtQTName, String btmLinkType) throws PLException { boolean res = false; if(tip == null) return true; if(txtQTName == null) return true; if(!checkRequiredIsOk(tip, txtQTName)){ res = false; } else if(Func.isBlank(txtQTName) && !checkQTIsExist(tip, txtQTName, btmLinkType)){ res = false; } else { res = true; } return res; } /** * æ£æ¥è¡¨åè¾å ¥æ¯å¦ææ * @param tip * @param uiName * @param btmLinkType * @return */ protected boolean checkUILayoutTxtIsOk(String tip, String uiName, String btmLinkType) throws PLException { boolean res = false; if(tip == null) return true; if(uiName == null) return true; if(!checkRequiredIsOk(tip, uiName)){ res = false; } else if(!checkUILayoutIsExist(tip, uiName, btmLinkType)){ res = false; } else { res = true; } return res; } private boolean checkUILayoutIsExist(String tip, String uiName, String txtType) throws PLException { boolean res = false; String sql = "select count(1) count_ from PLUILAYOUT ui " + "where ui.PLRELATEDTYPE='" + txtType.trim() + "' " + "and ui.plcode='" + uiName.trim() + "'"; res = checkCountNotEqualZero(sql); if(!res){ throw new PLException("500", new String[]{String.format("%s %s æ æï¼", tip, uiName)}); } else { res = true; } return res; } /** * æ£æ¥å½åè¾å ¥çæ¥è¯¢æ¨¡æ¿æ¯å¦åå¨ * @param tip * @param txtQTName * @param txtType * @return */ protected boolean checkQTIsExist(String tip, String txtQTName, String txtType) throws PLException { boolean res = false; String sql = "select count(1) count_ from PL_QTEMPLATE qt " + "where qt.btmname ='" + txtType.trim() + "' " + "and qt.qtname='" + txtQTName.trim() + "'"; if(!res){ throw new PLException("500", new String[]{String.format("%s %s æ æï¼", tip, txtQTName)}); } else { res = true; } return res; } /** * æ£æ¥LinkTypeè¾å ¥æ¯å¦ææ * @param tip * @param linkTypeName * @return */ protected boolean checkLinkTypeTxtIsOk(String tip, String linkTypeName) throws PLException { boolean res = false; if(tip == null) return true; if(linkTypeName == null) return true; if(!checkRequiredIsOk(tip, linkTypeName)){ res = false; } else if(!checkLinkTypeIsExist(tip, linkTypeName)){ res = false; } else { res = true; } return res; } private boolean checkLinkTypeIsExist(String tip, String linkTypeName) throws PLException { boolean res = false; String sql = "select count(1) count_ from pllinktype lt " + "where lt.name ='" + linkTypeName.trim() + "'"; res = checkCountNotEqualZero(sql); if(!res){ throw new PLException("500", new String[]{String.format("%s %s æ æï¼", tip, linkTypeName)}); } else { res = true; } return res; } } //模æ¿ç±»å为Customç±»åæ¶æ ¡éªè¾å ¥ @AllArgsConstructor @NoArgsConstructor private class CustomComptCheckInput extends BaseComptInter{ /** * æ§å¶è·¯å¾ */ private String ctrlPath; @Override public boolean checkInputIsOk() throws PLException { boolean res = true; if(!checkRequiredIsOk(this.ctrlPath)){ res = false; } return res; } /** * æ§å¶è·¯å¾å¿ è¾æ£æ¥ * @param ctrlPath * @return */ protected boolean checkRequiredIsOk(String ctrlPath) throws PLException { boolean res = false; String text = ctrlPath.trim(); if(Func.isBlank(text)){ throw new PLException("500", new String[]{"æ§å¶è·¯å¾ä¸è½ä¸ºç©ºï¼"}); } else { res = true; } return res; } @Override public PLDefination getNewPLDefination(PLDefination d) { if(d == null){ d = new PLDefination(); } d.setControlPath(ctrlPath); return d; } } @AllArgsConstructor @NoArgsConstructor private class TableComptCheckInput extends BaseComptInter{ /** * æç´¢ç±»åï¼æ¬å¯¹è±¡å±æ§ï¼1ï¼å ³èå¯¹è±¡å±æ§ï¼2 */ private String searchTarger; /** * ä¸å¡ç±»å */ private String btmType; /** * 龿¥ç±»å */ private String linkType; /** * éæ©æ¨¡æ¿ */ private String txtVIName; /** * æ¥è¯¢æ¨¡æ¿ */ private String txtQTName; @Override public boolean checkInputIsOk() throws PLException { boolean res = false; if(searchTarger.equals("1")){ res = checkBtmTypeInputIsOk(btmType,txtVIName,txtQTName); } else if(searchTarger.equals("2")){ res = checkLinkTypeInputIsOk(txtVIName,txtQTName,btmType); } return res; } @Override public PLDefination getNewPLDefination(PLDefination d) { if(d == null){ d = new PLDefination(); } if("1".equals(searchTarger)){ d.setSearchTarger("1"); d.setShowType(btmType.trim()); d.setTemplateId(txtVIName); d.setQueryTemplateName(txtQTName); } else if("2".equals(searchTarger)){ d.setSearchTarger("2"); d.setShowType(btmType); d.setLinkType(linkType); d.setTemplateId(txtVIName); d.setQueryTemplateName(txtQTName); } return d; } /** * æ£æ¥ä¸å¡ç±»åæ¯å¦è¾å ¥ï¼æ¯å¦åå¨ * @param txtVIName * @param btmType * @param txtQTName * @return */ private boolean checkBtmTypeInputIsOk(String btmType,String txtVIName/*éæ©æ¨¡æ¿*/,String txtQTName/*æ¥è¯¢æ¨¡æ¿*/) throws PLException { boolean res = false; if(!super.checkBtmTypeTxtIsOk("ä¸å¡ç±»å", btmType)){ res = false; } else if(!super.checkPortalVITxtIsOk("éæ©æ¨¡æ¿", txtVIName, btmType)){ res = false; } else if(!super.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", txtQTName, btmType)){ res = false; } else { res = true; } return res; } /** * æ£æ¥é¾æ¥ç±»åæ¯å¦è¾å ¥ï¼æ¯å¦åå¨ * @param txtVIName * @param txtQTName * @param btmType * @return */ private boolean checkLinkTypeInputIsOk(String txtVIName/*éæ©çæ¨¡æ¿*/,String txtQTName/*æ¥è¯¢æ¨¡æ¿*/,String btmType) throws PLException { boolean res = false; if(!(this.checkBtmTypeTxtIsOk("ç®æ 对象", linkType))){ res = false; } else if(!(this.checkPortalVITxtIsOk("éæ©æ¨¡æ¿", txtVIName, linkType))){ res = false; } else if(!(this.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", txtQTName, linkType))){ res = false; } else { res = true; } return res; } } @AllArgsConstructor @NoArgsConstructor private class TreeTableComptCheckInput extends BaseComptInter{ /** * æç´¢ç±»åï¼æ¬å¯¹è±¡å±æ§ï¼1ï¼å ³èå¯¹è±¡å±æ§ï¼2 */ private String searchTarger; /** * ä¸å¡ç±»å */ private String btmType; /** * 龿¥ç±»å */ private String linkType; /** * éæ©æ¨¡æ¿ */ private String txtVIName; /** * æ¥è¯¢æ¨¡æ¿ */ private String txtQTName; /** * æ å½¢ç»æå±å¼å */ private String expandCols; /** * å±å¼å½¢å¼ï¼é级å±å¼ 1ï¼å ¨é¨å±å¼ 0 */ private String expandMode; @Override public boolean checkInputIsOk() throws PLException { boolean res = false; if(searchTarger.equals("1")){ res = this.checkBtmTypeInputIsOk(); } else if(searchTarger.equals("2")){ res = checkLinkTypeInputIsOk(); } return res; } @Override public PLDefination getNewPLDefination(PLDefination d) { if(d == null){ d = new PLDefination(); } //屿§èµå¼éå ï¼æä»¥è¿å¿æ¹åäºé»è¾ d.setSearchTarger(searchTarger); d.setShowType(btmType); d.setTemplateId(txtVIName); d.setQueryTemplateName(txtQTName); d.setExpandCols(expandCols); d.setExpandMode(expandMode); if("2".equals(searchTarger)){ d.setLinkType(linkType); } return d; } private boolean checkBtmTypeInputIsOk() throws PLException { boolean res = false; if(!(super.checkBtmTypeTxtIsOk("顶级èç¹æ¾ç¤ºç±»å", btmType))){ res = false; } else if(!(super.checkPortalVITxtIsOk("éæ©æ¨¡æ¿", txtVIName, btmType))){ res = false; } else if(!(super.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", txtQTName , btmType))){ res = false; } else { res = true; } return res; } private boolean checkLinkTypeInputIsOk() throws PLException { boolean res = false; if(!(super.checkBtmTypeTxtIsOk("顶级èç¹æ¾ç¤ºç±»å", linkType))){ res = false; } else if(!(super.checkPortalVITxtIsOk("éæ©æ¨¡æ¿", txtVIName, linkType))){ res = false; } else if(!(super.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", txtQTName, linkType))){ res = false; } else { res = true; } return res; } } @AllArgsConstructor @NoArgsConstructor private class TreeComptCheckInput extends BaseComptInter{ /** * ä¸å¡ç±»å */ private String btmType; /** * 龿¥ç±»å */ private String linkType; /** * æ¥è¯¢æ¨¡æ¿ */ private String queryTemplateName; /** * æ ¹èç¹æ¾ç¤ºè¡¨è¾¾å¼ */ private String showExpressionRoot; /** * æ èç¹æ¾ç¤ºè¡¨è¾¾å¼ */ private String showExpression; /** * åç §æ 设置 */ private String refTreeSet; /** * åé符 */ private String splitChar; /** * å±å¼æ¹å¼ï¼é级å±å¼ 1ï¼å ¨é¨å±å¼ 0 */ private String expandMode; @Override public boolean checkInputIsOk() throws PLException { return checkBtmTypeInputIsOk(); } @Override public PLDefination getNewPLDefination(PLDefination d) { if(d == null){ d = new PLDefination(); } d.setShowType(btmType); d.setLinkType(linkType); d.setTemplateId(queryTemplateName); d.setRootContent(showExpressionRoot.trim()); d.setShowAbs(showExpression.trim()); d.setShowLinkAbs(refTreeSet.trim()); d.setSeparator(splitChar.trim()); d.setExpandMode(expandMode); return d; } private boolean checkBtmTypeInputIsOk() throws PLException { boolean res = false; if(!(super.checkBtmTypeTxtIsOk("ä¸å¡ç±»å", btmType))){ res = false; return res; } // 龿¥ç±»åä¸ä¸ºç©ºæ¶ï¼éè¦åæ¶æ£æ¥é¾æ¥ç±»åå龿¥ç±»åä¸çæ¥è¯¢æ¨¡æ¿æ¯å¦ææ if(Func.isBlank(linkType)){ if(!(super.checkLinkTypeTxtIsOk("龿¥ç±»å", linkType))){ res = false; return res; } else if(!(super.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", queryTemplateName, linkType))){ res = false; return res; } } else { // 龿¥ç±»å为空æ¶ï¼åªéè¦æ£æ¥ä¸å¡ç±»åä¸çæ¥è¯¢æ¨¡æ¿æ¯å¦ææ if(!(super.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", queryTemplateName, btmType))){ res = false; return res; } } if(!super.checkRequiredIsOk("æ ¹èç¹æ¾ç¤ºè¡¨è¾¾å¼", showExpressionRoot)){ res = false; } else if(!super.checkRequiredIsOk("æ èç¹æ¾ç¤ºè¡¨è¾¾å¼", showExpression)){ res = false; } else if(!super.checkRequiredIsOk("åç §æ 设置", refTreeSet)){ res = false; } else { res = true; } return res; } } @AllArgsConstructor @NoArgsConstructor private class UILayoutComptCheckInput extends BaseComptInter{ /** * æç´¢ç±»åï¼æ¬å¯¹è±¡å±æ§ï¼1ï¼å ³èå¯¹è±¡å±æ§ï¼2 * æ¥è¯¢ç±»å乿¯èµå¼å°è¿ä¸ªå±æ§ä¸ï¼ ä¸å¡ç±»åï¼1ï¼é¾æ¥ç±»åï¼2 */ private String searchTarger; /** * 对象类å */ private String uiBtmType; /** * UIå®ä¹ */ private String uiLayout; /** * æ¥è¯¢æ¨¡æ¿ */ private String queryTemplateName; /** * æ¥è¯¢å¯¹è±¡ç±»å */ private String qryType; @Override public boolean checkInputIsOk() throws PLException{ return checkUILayoutInputIsOk(); } @Override public PLDefination getNewPLDefination(PLDefination d) { if (d == null) { d = new PLDefination(); } d.setSearchTarger(searchTarger); d.setSubUiObjType(uiBtmType.trim()); d.setSubUILayout(uiLayout.trim()); if (searchTarger.equals("1")) { d.setShowType(qryType.trim()); } else { d.setLinkType(qryType.trim()); } d.setQueryTemplateName(queryTemplateName.trim()); return d; } private boolean checkUILayoutInputIsOk() throws PLException { boolean res = false; if (!(super.checkBtmTypeTxtIsOk("对象类å", uiBtmType))) { res = false; } else if (!(super.checkUILayoutTxtIsOk("UIå®ä¹", uiLayout, uiBtmType))) { res = false; } else if (!(super.checkQTNameTxtIsOk("æ¥è¯¢æ¨¡æ¿", queryTemplateName, qryType))) { res = false; } else { res = true; } return res; } } } Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/util/UITools.java
@@ -4,6 +4,8 @@ import java.util.Iterator; import java.util.List; import com.vci.corba.portal.data.PLPageDefination; import com.vci.model.PLDefination; import com.vci.model.PRMDO; import com.vci.model.PRMItemDO; import org.apache.commons.lang3.StringUtils; @@ -437,238 +439,238 @@ throw e; } } // /** // * å°ä»æ°æ®åºä¸è¯»åçxmlææ¬è½¬åæå¯¹åºçPLDefination对象 // * @param text // * @return // * @throws Throwable // */ // public static PLDefination getPLDefination(String text) throws Throwable{ // try{ // Document document = null; // document = DocumentHelper.parseText(text); // if(document == null){ // return null; // } // PLDefination obj = new PLDefination(); // Element root = document.getRootElement(); // if(root != null){ // String elementText = root.elementText(PLDefinationConstants.TYPE); // if(elementText == null || elementText.equals("")){ // elementText = "0"; // } // obj.setType(Integer.parseInt(elementText)); // // elementText = root.elementText(PLDefinationConstants.SHOWABS); // obj.setShowAbs(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.SEPARATOR); // obj.setSeparator(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.SHOWLINKABS); // obj.setShowLinkAbs(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.SEARCHTARGET); // obj.setSearchTarger(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.TEMPLATETYPE); // obj.setTemplateType(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.SHOWTYPE); // obj.setShowType(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.TEMPLATEID); // obj.setTemplateId(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.ORIENTATION); // obj.setOrientation(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.VALIDITY); // obj.setValidity(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.ORDERFIELD); // obj.setOrderField(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.ORDERMODE); // obj.setOrderMode(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.RETURNROWS); // obj.setReturnRows(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.CONTROLPATH); // obj.setControlPath(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.EXPANDMODE); // obj.setExpandMode(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.LINKTYPE); // obj.setLinkType(elementText == null ? "" : elementText); // // // elementText = root.elementText(PLDefinationConstants.ISSHOWIMAGE); // obj.setIsShowImage(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.EXPANDCOLS); // obj.setExpandCols(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.SHOWCONTENT); // obj.setShowContent(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.SHOWCONTENTTYPE); // obj.setShowContentType(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.SHOWCONTENTRELATION); // obj.setShowContentRelation(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.SHOWCONTENTTABLE); // obj.setShowContentTable(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.NAVIGATORTYPE); // obj.setNavigatorType(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.EVENTKEY); // obj.setEventKey(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.EVENTVALUE); // obj.setEventValue(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.ROOTCONTENT); // obj.setRootContent(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.UIPARSER); // obj.setUiParser(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.EXTATTR); // obj.setExtAttr(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.QUERYTEMPLATENAME); // obj.setQueryTemplateName(elementText == null ? "" : elementText); // // elementText = root.elementText(PLDefinationConstants.SUBUILAYOUT); // obj.setSubUILayout(elementText == null ? "" : elementText); // } // return obj; // }catch(Throwable e){ // e.printStackTrace(); // throw e; // } // } // // /** // * å°PLDefination对象转åæxmlææ¬ // * @param obj // * @return // * @throws Throwable // */ // public static String getPLDefinationText(PLDefination obj) throws Throwable{ // try{ // if(obj == null){ // return ""; // } // // Document doc = DocumentHelper.createDocument(); // Element rootNode = doc.addElement(PLDefinationConstants.PLDEFINATION); // // Element node = rootNode.addElement(PLDefinationConstants.TYPE); // node.setText(String.valueOf(obj.getType())); // // node = rootNode.addElement(PLDefinationConstants.SHOWABS); // node.setText(obj.getShowAbs()); // // node = rootNode.addElement(PLDefinationConstants.SEPARATOR); // node.setText(obj.getSeparator()); // // node = rootNode.addElement(PLDefinationConstants.SHOWLINKABS); // node.setText(obj.getShowLinkAbs()); // // node = rootNode.addElement(PLDefinationConstants.SEARCHTARGET); // node.setText(obj.getSearchTarger()); // // node = rootNode.addElement(PLDefinationConstants.TEMPLATETYPE); // node.setText(obj.getTemplateType()); // // node = rootNode.addElement(PLDefinationConstants.SHOWTYPE); // node.setText(obj.getShowType()); // // node = rootNode.addElement(PLDefinationConstants.TEMPLATEID); // node.setText(obj.getTemplateId()); // // node = rootNode.addElement(PLDefinationConstants.ORIENTATION); // node.setText(obj.getOrientation()); // // node = rootNode.addElement(PLDefinationConstants.VALIDITY); // node.setText(obj.getValidity()); // // node = rootNode.addElement(PLDefinationConstants.ORDERFIELD); // node.setText(obj.getOrderField()); // // node = rootNode.addElement(PLDefinationConstants.ORDERMODE); // node.setText(obj.getOrderMode()); // // node = rootNode.addElement(PLDefinationConstants.RETURNROWS); // node.setText(obj.getReturnRows()); // // node = rootNode.addElement(PLDefinationConstants.CONTROLPATH); // node.setText(obj.getControlPath()); // // node = rootNode.addElement(PLDefinationConstants.EXPANDMODE); // node.setText(obj.getExpandMode()); // // node = rootNode.addElement(PLDefinationConstants.LINKTYPE); // node.setText(obj.getLinkType()); // // node = rootNode.addElement(PLDefinationConstants.ISSHOWIMAGE); // node.setText(obj.getIsShowImage()); // // node = rootNode.addElement(PLDefinationConstants.EXPANDCOLS); // node.setText(obj.getExpandCols()); // // node = rootNode.addElement(PLDefinationConstants.SHOWCONTENT); // node.setText(obj.getShowContent()); // // node = rootNode.addElement(PLDefinationConstants.SHOWCONTENTTYPE); // node.setText(obj.getShowContentType()); // // node = rootNode.addElement(PLDefinationConstants.SHOWCONTENTRELATION); // node.setText(obj.getShowContentRelation()); // // node = rootNode.addElement(PLDefinationConstants.SHOWCONTENTTABLE); // node.setText(obj.getShowContentTable()); // // node = rootNode.addElement(PLDefinationConstants.NAVIGATORTYPE); // node.setText(obj.getNavigatorType()); // // node = rootNode.addElement(PLDefinationConstants.EVENTKEY); // node.setText(obj.getEventKey()); // // node = rootNode.addElement(PLDefinationConstants.EVENTVALUE); // node.setText(obj.getEventValue()); // // node = rootNode.addElement(PLDefinationConstants.ROOTCONTENT); // node.setText(obj.getRootContent()); // // node = rootNode.addElement(PLDefinationConstants.UIPARSER); // node.setText(obj.getUiParser()); // // node = rootNode.addElement(PLDefinationConstants.EXTATTR); // node.setText(obj.getExtAttr()); // // node = rootNode.addElement(PLDefinationConstants.QUERYTEMPLATENAME); // node.setText(obj.getQueryTemplateName()); // // node = rootNode.addElement(PLDefinationConstants.SUBUIOBJTYPE); // node.setText(obj.getSubUiObjType()); // // node = rootNode.addElement(PLDefinationConstants.SUBUILAYOUT); // node.setText(obj.getSubUILayout()); // // return doc.asXML(); // }catch(Throwable e){ // throw e; // } // // } /** * å°PLDefination对象转åæxmlææ¬ * @param obj * @return * @throws Throwable */ public static String getPLDefinationText(PLDefination obj) throws Throwable{ try{ if(obj == null){ return ""; } Document doc = DocumentHelper.createDocument(); Element rootNode = doc.addElement(PLDefinationConstants.PLDEFINATION); Element node = rootNode.addElement(PLDefinationConstants.TYPE); node.setText(String.valueOf(obj.getType())); node = rootNode.addElement(PLDefinationConstants.SHOWABS); node.setText(obj.getShowAbs()); node = rootNode.addElement(PLDefinationConstants.SEPARATOR); node.setText(obj.getSeparator()); node = rootNode.addElement(PLDefinationConstants.SHOWLINKABS); node.setText(obj.getShowLinkAbs()); node = rootNode.addElement(PLDefinationConstants.SEARCHTARGET); node.setText(obj.getSearchTarger()); node = rootNode.addElement(PLDefinationConstants.TEMPLATETYPE); node.setText(obj.getTemplateType()); node = rootNode.addElement(PLDefinationConstants.SHOWTYPE); node.setText(obj.getShowType()); node = rootNode.addElement(PLDefinationConstants.TEMPLATEID); node.setText(obj.getTemplateId()); node = rootNode.addElement(PLDefinationConstants.ORIENTATION); node.setText(obj.getOrientation()); node = rootNode.addElement(PLDefinationConstants.VALIDITY); node.setText(obj.getValidity()); node = rootNode.addElement(PLDefinationConstants.ORDERFIELD); node.setText(obj.getOrderField()); node = rootNode.addElement(PLDefinationConstants.ORDERMODE); node.setText(obj.getOrderMode()); node = rootNode.addElement(PLDefinationConstants.RETURNROWS); node.setText(obj.getReturnRows()); node = rootNode.addElement(PLDefinationConstants.CONTROLPATH); node.setText(obj.getControlPath()); node = rootNode.addElement(PLDefinationConstants.EXPANDMODE); node.setText(obj.getExpandMode()); node = rootNode.addElement(PLDefinationConstants.LINKTYPE); node.setText(obj.getLinkType()); node = rootNode.addElement(PLDefinationConstants.ISSHOWIMAGE); node.setText(obj.getIsShowImage()); node = rootNode.addElement(PLDefinationConstants.EXPANDCOLS); node.setText(obj.getExpandCols()); node = rootNode.addElement(PLDefinationConstants.SHOWCONTENT); node.setText(obj.getShowContent()); node = rootNode.addElement(PLDefinationConstants.SHOWCONTENTTYPE); node.setText(obj.getShowContentType()); node = rootNode.addElement(PLDefinationConstants.SHOWCONTENTRELATION); node.setText(obj.getShowContentRelation()); node = rootNode.addElement(PLDefinationConstants.SHOWCONTENTTABLE); node.setText(obj.getShowContentTable()); node = rootNode.addElement(PLDefinationConstants.NAVIGATORTYPE); node.setText(obj.getNavigatorType()); node = rootNode.addElement(PLDefinationConstants.EVENTKEY); node.setText(obj.getEventKey()); node = rootNode.addElement(PLDefinationConstants.EVENTVALUE); node.setText(obj.getEventValue()); node = rootNode.addElement(PLDefinationConstants.ROOTCONTENT); node.setText(obj.getRootContent()); node = rootNode.addElement(PLDefinationConstants.UIPARSER); node.setText(obj.getUiParser()); node = rootNode.addElement(PLDefinationConstants.EXTATTR); node.setText(obj.getExtAttr()); node = rootNode.addElement(PLDefinationConstants.QUERYTEMPLATENAME); node.setText(obj.getQueryTemplateName()); node = rootNode.addElement(PLDefinationConstants.SUBUIOBJTYPE); node.setText(obj.getSubUiObjType()); node = rootNode.addElement(PLDefinationConstants.SUBUILAYOUT); node.setText(obj.getSubUILayout()); return doc.asXML(); }catch(Throwable e){ throw e; } } /** * å°ä»æ°æ®åºä¸è¯»åçxmlææ¬è½¬åæå¯¹åºçPLDefination对象 * @param text * @return * @throws Throwable */ public static PLDefination getPLDefination(String text) throws Throwable{ try{ Document document = null; document = DocumentHelper.parseText(text); if(document == null){ return null; } PLDefination obj = new PLDefination(); Element root = document.getRootElement(); if(root != null){ String elementText = root.elementText(PLDefinationConstants.TYPE); if(elementText == null || elementText.equals("")){ elementText = "0"; } obj.setType(Integer.parseInt(elementText)); elementText = root.elementText(PLDefinationConstants.SHOWABS); obj.setShowAbs(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.SEPARATOR); obj.setSeparator(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.SHOWLINKABS); obj.setShowLinkAbs(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.SEARCHTARGET); obj.setSearchTarger(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.TEMPLATETYPE); obj.setTemplateType(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.SHOWTYPE); obj.setShowType(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.TEMPLATEID); obj.setTemplateId(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.ORIENTATION); obj.setOrientation(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.VALIDITY); obj.setValidity(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.ORDERFIELD); obj.setOrderField(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.ORDERMODE); obj.setOrderMode(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.RETURNROWS); obj.setReturnRows(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.CONTROLPATH); obj.setControlPath(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.EXPANDMODE); obj.setExpandMode(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.LINKTYPE); obj.setLinkType(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.ISSHOWIMAGE); obj.setIsShowImage(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.EXPANDCOLS); obj.setExpandCols(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.SHOWCONTENT); obj.setShowContent(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.SHOWCONTENTTYPE); obj.setShowContentType(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.SHOWCONTENTRELATION); obj.setShowContentRelation(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.SHOWCONTENTTABLE); obj.setShowContentTable(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.NAVIGATORTYPE); obj.setNavigatorType(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.EVENTKEY); obj.setEventKey(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.EVENTVALUE); obj.setEventValue(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.ROOTCONTENT); obj.setRootContent(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.UIPARSER); obj.setUiParser(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.EXTATTR); obj.setExtAttr(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.QUERYTEMPLATENAME); obj.setQueryTemplateName(elementText == null ? "" : elementText); elementText = root.elementText(PLDefinationConstants.SUBUILAYOUT); obj.setSubUILayout(elementText == null ? "" : elementText); } return obj; }catch(Throwable e){ e.printStackTrace(); throw e; } } /** * å°ARRAY转åæLIST