| | |
| | | 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; |
| | |
| | | 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 |