Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   /* 
    * Copyright (C) 2010---2013 星星(wuweixing)<349446658@qq.com>
    * 
    * This file is part of Wabacus 
    * 
    * Wabacus is free software: you can redistribute it and/or modify
    * it under the terms of the GNU Lesser General Public License as published by
    * the Free Software Foundation, either version 3 of the License, or
    * (at your option) any later version.
   *
   * This program is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public License
   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
   */
  package com.wabacus.config.component;
  
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  
  import org.dom4j.Element;
  
 
 {
     private static Log log=LogFactory.getLog(ComponentConfigLoadManager.class);
 
     private static List<IntegerlstDefaultPageSize;
 
     public static void loadApplicationsConfigFiles(BufferedInputStream bisReportFile,String jsFileUrl,String jsFilePath,
             Map<String,MapmLocalResourcesTempthrows Exception
     {
         Document doc=XmlAssistant.getInstance().loadXmlDocument(bisReportFile);
         Element root=doc.getRootElement();
         if(root==null)
         {
             .warn("报表配置文件"+jsFilePath+"内容为空!!!");
             return;
         }
         Element eleLocalResources=XmlAssistant.getInstance().getSingleElementByName(root,"local-resources");
         if(eleLocalResources!=null)
         {
             Map mLocalDefineResources=new HashMap();
             Map mLocalResources=new HashMap();
             List lstLocalResources=eleLocalResources.elements("resource-file");
             List<StringlstLocalResourceFiles=ConfigLoadManager.getListConfigFilePaths(lstLocalResources);
             if(lstLocalResourceFiles!=null&&lstLocalResourceFiles.size()>0)
             {
                 Map mResultsTmp;
                 for(String file:lstLocalResourceFiles)
                 {
                     if(file==null||file.trim().equals("")) continue;
                     String tempKey=file.trim().toLowerCase();
                     mResultsTmp=mLocalResourcesTemp.get(tempKey);
                     if(mResultsTmp==null)
                     {
                         mResultsTmp=ConfigLoadManager.loadResourceFile(file);
                         if(mResultsTmp==nullcontinue;
                         mLocalResourcesTemp.put(tempKey,mResultsTmp);
                     }
                     String key=Tools.copyMapData(mResultsTmp,mLocalResources,true);
                     if(key!=null)
                     {
                         throw new WabacusConfigLoadingException("在报表配置文件的local_resource文件中,name属性为"+key+"的资源存在重复,加载配置文件失败");
                     }
                 }
                 if(mLocalResources.size()>0)
                 {
                     mLocalResources=Config.getInstance().getResources().replace(mLocalResources);
                     Config.getInstance().getResources().getMLocalResources().put(jsFileUrl,mLocalResources);
                 }
             }
             Element eleLocalDefineResources=eleLocalResources.element("resources");
             if(eleLocalDefineResources!=null)
             {
                 mLocalDefineResources=ConfigLoadManager.loadXmlResources(eleLocalDefineResources);
                 if(mLocalDefineResources!=null&&mLocalDefineResources.size()>0)
                 {
                     mLocalDefineResources=Config.getInstance().getResources().replace(mLocalDefineResources);
                     Config.getInstance().getResources().getMLocalDefineResources().put(jsFileUrl,mLocalDefineResources);
                 }
             }
         }
         Config.getInstance().getMLocalCss().put(jsFileUrl,ConfigLoadManager.loadCssfiles(root.element("local-cssfiles")));
         Config.getInstance().getMLocalJavascriptFiles().put(jsFileUrl,ConfigLoadManager.loadJsfiles(root.element("local-jsfiles")));
 
         List lstPagesElement=XmlAssistant.getInstance().getElementsByName(root,"page");
         if(lstPagesElement==null||lstPagesElement.size()==0)
         {
             .warn("报表配置文件没有配置报表!!!");
             return;
         }
         for(int i=0;i<lstPagesElement.size();i++)
         {
             Element elePage=(Element)lstPagesElement.get(i);
             if(elePage!=null)
             {
                 XmlElementBean elePageBean=XmlAssistant.getInstance().parseXmlValueToXmlBean(elePage);
                 loadPageConfig(jsFileUrl,jsFilePath,elePageBean);
             }
         }
     }
 
     private static void loadPageConfig(String jsFileUrl,String jsFilePath,XmlElementBean elePageBean)
     {
         PageBean pbean=new PageBean(null,"page");
         pbean.setJsFilePath(jsFilePath);
         pbean.setJsFileUrl(jsFileUrl);
         pbean.setReportfile_key(jsFileUrl);
         loadComponentCommonConfig(elePageBean,pbean);
         ..put(pbean.getId(),pbean);
         try
         {
             loadContainerCommonConfig(elePageBean,pbean);
             String css=elePageBean.attributeValue("css");
             if(css!=null)
             {
                 String[] cssArray=Tools.parseStringToArray(css,",");
                 if(cssArray.length>0)
                 {
                     for(int k=0;k<cssArray.length;k++)
                     {
                         if(cssArray[k]==null||cssArray[k].trim().equals("")) continue;
                         if(!cssArray[k].toLowerCase().trim().startsWith("http://"))
                         {
                             cssArray[k]=.+cssArray[k];
                             cssArray[k]=Tools.replaceAll(cssArray[k],"//","/");
                         }
                         pbean.addMyCss(cssArray[k]);
                     }
                 }
             }
             String js=elePageBean.attributeValue("js");
             if(js!=null)
             {
                 List<StringlstJsTmp=Tools.parseStringToList(js,",",false);
                 if(lstJsTmp.size()>0)
                 {
                     for(String jsTmp:lstJsTmp)
                     {
                         if(jsTmp==null||jsTmp.trim().equals("")) continue;
                         int loadorder=0;
                         if(jsTmp.trim().startsWith("[")&&jsTmp.indexOf("]")>0)
                         {
                             loadorder=Integer.parseInt(jsTmp.substring(1,jsTmp.indexOf("]")).trim());
                             jsTmp=jsTmp.substring(jsTmp.indexOf("]")+1).trim();
                         }
                         if(!jsTmp.trim().startsWith(.)&&!jsTmp.trim().toLowerCase().startsWith("http://"))
                         {
                             jsTmp=Tools.replaceAll(.+"/"+jsTmp,"//","/");
                         }
                         pbean.addMyJavascriptFile(jsTmp,loadorder);
                     }
                 }
             }
             String personalizeclass=elePageBean.attributeValue("personalizeclass");
             if(personalizeclass!=null&&!personalizeclass.trim().equals(""))
             {
                 Object obj=null;
                 try
                 {
                     obj=..loadClassByCurrentLoader(personalizeclass).newInstance();
                 }catch(Exception e)
                 {
                     throw new WabacusConfigLoadingException("页面"+pbean.getId()+"配置的personalizeclass:"+personalizeclass+"类对象实例化失败",e);
                 }
                 if(!(obj instanceof IPagePersonalizePersistence))
                 {
                     throw new WabacusConfigLoadingException("页面"+pbean.getId()+"配置的personalizeclass:"+personalizeclass+"没有实现"
                             +IPagePersonalizePersistence.class.getName()+"接口");
                 }
                 pbean.setPersonalizeObj((IPagePersonalizePersistence)obj);
             }
 
             String checkpermission=elePageBean.attributeValue("checkpermission");
             if(checkpermission==null||(!checkpermission.trim().toLowerCase().equals("true")&&!checkpermission.trim().toLowerCase().equals("false")))
             {
                 pbean.setCheckPermission(Config.getInstance().getSystemConfigValue("default-checkpermission",true));
             }else
             {
                 pbean.setCheckPermission(Boolean.parseBoolean(checkpermission.toLowerCase().trim()));
             }
             loadPageInterceptor(elePageBean,pbean);
         }catch(Exception e)
         {
             throw new WabacusConfigLoadingException("加载页面"+pbean.getId()+"失败",e);
         }
     }
 
     private static void loadPageInterceptor(XmlElementBean elePageBean,PageBean pbean)
     {
         String interceptor=elePageBean.attributeValue("interceptor");
         if(interceptor!=null&&!interceptor.trim().equals(""))
         {
             List<StringlstInterceptors=Tools.parseStringToList(interceptor,";",false);
             Class clsTmp;
             Object objTmp;
             for(String interceptorTmp:lstInterceptors)
             {
                 if(interceptorTmp.equals("")) continue;
                 clsTmp=..loadClassByCurrentLoader(interceptorTmp);
                 try
                 {
                     objTmp=clsTmp.newInstance();
                 }catch(Exception e)
                 {
                     throw new WabacusConfigLoadingException("实例化页面"+pbean.getId()+"的拦截器"+interceptorTmp+"失败",e);
                 }
                 if(!(objTmp instanceof AbsPageInterceptor))
                 {
                     throw new WabacusConfigLoadingException("页面"+pbean.getId()+"的拦截器"+interceptorTmp+"没有继承"+AbsPageInterceptor.class.getName()+"类");
                 }
                 pbean.addInterceptor((AbsPageInterceptor)objTmp);
             }
         }
         XmlElementBean eleInterceptorBean=elePageBean.getChildElementByName("interceptor");
         if(eleInterceptorBean!=null)
         {
             List<StringlstImportPackages=ConfigLoadAssistant.getInstance().loadImportsConfig(eleInterceptorBean);
             XmlElementBean elePreAction=eleInterceptorBean.getChildElementByName("preaction");
             String preaction=null;
             if(elePreAction!=null)
             {
                 preaction=elePreAction.getContent();
             }
             preaction=preaction==null?"":preaction.trim();
 
             XmlElementBean eleBeforesaveAction=eleInterceptorBean.getChildElementByName("beforesave");
             String beforesaveaction=null;
             if(eleBeforesaveAction!=nullbeforesaveaction=eleBeforesaveAction.getContent();
             beforesaveaction=beforesaveaction==null?"":beforesaveaction.trim();
 
             XmlElementBean eleAftersaveAction=eleInterceptorBean.getChildElementByName("aftersave");
             String aftersaveaction=null;
             if(eleAftersaveAction!=nullaftersaveaction=eleAftersaveAction.getContent();
             aftersaveaction=aftersaveaction==null?"":aftersaveaction.trim();
 
             XmlElementBean elePostAction=eleInterceptorBean.getChildElementByName("postaction");
             String postaction=null;
             if(elePostAction!=null)
             {
                 postaction=elePostAction.getContent();
             }
             postaction=postaction==null?"":postaction.trim();
             if(!preaction.equals("")||!postaction.equals("")||!beforesaveaction.equals("")||!aftersaveaction.equals(""))
             {
                 Class c=ComponentAssistant.getInstance().buildPageInterceptorClass(pbean,lstImportPackages,preaction,beforesaveaction,
                         aftersaveaction,postaction);
                 try
                 {
                     pbean.addInterceptor((AbsPageInterceptor)c.newInstance());
                 }catch(Exception e)
                 {
                     throw new WabacusConfigLoadingException("为页面"+pbean.getId()+"生成拦截器类失败",e);
                 }
             }
 
         }
     }
 
     public static void loadComponentCommonConfig(XmlElementBean eleComponent,IComponentConfigBean acbean)
     {
         String id=eleComponent.attributeValue("id");
         String title=eleComponent.attributeValue("title");
         String subtitle=eleComponent.attributeValue("subtitle");
         String titlealign=eleComponent.attributeValue("titlealign");
         String parenttitle=eleComponent.attributeValue("parenttitle");
         String parentsubtitle=eleComponent.attributeValue("parentsubtitle");
         String width=eleComponent.attributeValue("width");
         String height=eleComponent.attributeValue("height");
         String align=eleComponent.attributeValue("align");
         String valign=eleComponent.attributeValue("valign");
         String top=eleComponent.attributeValue("top");
         String bottom=eleComponent.attributeValue("bottom");
         String left=eleComponent.attributeValue("left");
         String right=eleComponent.attributeValue("right");
         String scrollstyle=eleComponent.attributeValue("scrollstyle");
         String dataexport=eleComponent.attributeValue("dataexport");
         String contextmenu=eleComponent.attributeValue("contextmenu");
         String onload=eleComponent.attributeValue("onload");
         acbean.mergeAttrs(eleComponent.getMPropertiesClone());
         if(id==null||id.trim().equals(""))
         {
             throw new WabacusConfigLoadingException("没有为页面"+acbean.getPageBean().getId()+"中子组件配置id属性");
         }
         {
             throw new WabacusConfigLoadingException("页面"+acbean.getPageBean().getId()+"中子元素的id属性"+id+"不合法,不能出现如下字符:"
                     +.);
         }
         id=id.trim();
         if(acbean.getParentContainer()==null)
         {//如果当前是加载顶层<page/>配置信息
             if(..containsKey(id))
             {
                 throw new WabacusConfigLoadingException("配置的<page/>的id属性:"+id+"存在重复");
             }
         }else
         {
             if(id.equals(acbean.getPageBean().getId()))
             {
                 throw new WabacusConfigLoadingException("id为"+acbean.getPageBean().getId()+"的页面中,存在本同ID的子组件");
             }
             List<StringlstAllChildIds=..get(acbean.getPageBean().getId());
             if(lstAllChildIds==null)
             {
                 lstAllChildIds=new ArrayList<String>();
                 ..put(acbean.getPageBean().getId(),lstAllChildIds);
             }else if(lstAllChildIds.contains(id))
             {
                 throw new WabacusConfigLoadingException("id为"+acbean.getPageBean().getId()+"的页面中,子组件ID:"+id+"存在重复");
             }
             lstAllChildIds.add(id);
         }
         acbean.setId(id.trim());
         if(title!=null)
         {
             acbean.setTitle(Config.getInstance().getResourceString(null,acbean.getPageBean(),title,true));
         }
         if(subtitle!=null)
         {
             acbean.setSubtitle(Config.getInstance().getResourceString(null,acbean.getPageBean(),subtitle,true));
         }
         if(titlealign!=null)
         {
             titlealign=titlealign.toLowerCase().trim();
             acbean.setTitlealign(titlealign.trim());
         }
         if(parenttitle!=null)
         {
             acbean.setParenttitle(Config.getInstance().getResourceString(null,acbean.getPageBean(),parenttitle,true));
         }
         if(parentsubtitle!=null)
         {
             acbean.setParentSubtitle(parentsubtitle.trim());
         }
         if(top!=null)
         {
             acbean.setTop(getRealHtmlSizeValueByConfig(top.trim()));
         }
         if(bottom!=null)
         {
             acbean.setBottom(getRealHtmlSizeValueByConfig(bottom.trim()));
         }
         if(left!=null)
         {
             acbean.setLeft(getRealHtmlSizeValueByConfig(left.trim()));
         }
         if(right!=null)
         {
             acbean.setRight(getRealHtmlSizeValueByConfig(right.trim()));
         }
         if(width!=null)
         {
             acbean.setWidth(getRealHtmlSizeValueByConfig(width.trim()));
         }
         if(height!=null)
         {
             acbean.setHeight(getRealHtmlSizeValueByConfig(height.trim()));
         }
         if(align!=null)
         {
             acbean.setAlign(align.trim());
         }
         if(valign!=null)
         {
             acbean.setValign(valign.trim());
         }
         DataExportsConfigBean debean=acbean.getDataExportsBean();
         if(debean==nulldebean=new DataExportsConfigBean(acbean);
         if(dataexport!=null)
         {
             acbean.setDataExportsBean(debean);
             dataexport=dataexport.trim();
             if(dataexport.equals(""))
             {
                 debean.setLstAutoDataExportTypes(null);
             }else
             {
                 debean.setLstAutoDataExportTypes(Tools.parseStringToList(dataexport,"|"));
             }
         }
         XmlElementBean eleDataExportsBean=eleComponent.getChildElementByName("dataexports");
         if(eleDataExportsBean!=null)
         {
             acbean.setDataExportsBean(debean);
             debean.loadConfig(eleDataExportsBean);
         }
         if(scrollstyle!=null)
         {
             scrollstyle=scrollstyle.toLowerCase().trim();
             if(scrollstyle.equals(""))
             {
                 acbean.setScrollstyle(null);
             }else if(!..contains(scrollstyle))
             {
                 throw new WabacusConfigLoadingException("为组件"+acbean.getPath()+"配置的scrollstyle属性值:"+scrollstyle+"不支持");
             }else
             {
                 acbean.setScrollstyle(scrollstyle);
             }
         }
 
         if(contextmenu!=null)
         {
             contextmenu=contextmenu.toLowerCase().trim();
             if(contextmenu.equals("false"))
             {
                 acbean.setShowContextMenu(false);
             }else
             {
                 acbean.setShowContextMenu(true);
             }
         }
         XmlElementBean elePrintBean=eleComponent.getChildElementByName("print");
         if(elePrintBean!=null)
         {
             String type=elePrintBean.attributeValue("type");
             type=type==null?"":type.toLowerCase().trim();
             if(type.equals("")||type.equals("default")||type.equals("lodop"))
             {
                 AbsPrintProviderConfigBean printConfigBean=null;
                 if(type.equals("lodop"))
                 {
                     printConfigBean=new LodopPrintProviderConfigBean(acbean);
                 }else
                 {
                     printConfigBean=new DefaultPrintProviderConfigBean(acbean);
                 }
                 printConfigBean.loadConfig(elePrintBean);
                 acbean.setPrintBean(printConfigBean);
                 acbean.setPdfPrintBean(null);
             }else if(type.equals("pdf"))
             {
                 acbean.setPrintBean(null);
                 PDFExportBean pdfprintbean=new PDFExportBean(acbean,.);
                 pdfprintbean.setPrint(true);
                 pdfprintbean.loadConfig(elePrintBean);
                 acbean.setPdfPrintBean(pdfprintbean);
             }else if(type.equals("none"))
             {
                 acbean.setPrintBean(null);
                 acbean.setPdfPrintBean(null);
             }else
             {
                 throw new WabacusConfigLoadingException("加载组件"+acbean.getPath()+"的打印功能失败,为其<print/>配置的type属性"+type+"不支持");
             }
         }
         XmlElementBean eleButtonBean=eleComponent.getChildElementByName("buttons");
         if(eleButtonBean!=null)
         {
             loadButtonsInfo(acbean,eleButtonBean);
         }
         //加载组件的header/footer
         loadHeaderFooterConfig(acbean,eleComponent,"header");
         loadHeaderFooterConfig(acbean,eleComponent,"footer");
         if(onload!=null)
         {
             onload=onload.trim();
             if(onload.equals(""))
             {
                 acbean.removeOnloadMethodByType(.);
             }else
             {
                 List<StringlstOnloadMethods=Tools.parseStringToList(onload,";");
                 for(String onloadTmp:lstOnloadMethods)
                 {
                     if(onloadTmp.trim().equals("")) continue;
                     acbean.addOnloadMethod(new OnloadMethodBean(.,onloadTmp));
                 }
             }
         }
     }
 
     private static String getRealHtmlSizeValueByConfig(String htmlsize)
     {
         if(htmlsize==null||htmlsize.trim().equals("")) return "";
         htmlsize=htmlsize.trim();
         String[] htmlsizeArr=WabacusAssistant.getInstance().parseHtmlElementSizeValueAndType(htmlsize);
         if(htmlsizeArr==nullreturn "";
         if(htmlsizeArr[0].equals("0")) return "";//如果配置为0,则相当于没有配置
         return htmlsizeArr[0]+htmlsizeArr[1];
     }
 
     public static void loadApplicationCommonConfig(XmlElementBean eleApplication,IApplicationConfigBean acbean)
     {
         String refreshid=eleApplication.attributeValue("refreshid");
         if(refreshid!=null)
         {
             acbean.setRefreshid(refreshid.trim());
         }
         String printwidth=eleApplication.attributeValue("printwidth");
         if(printwidth!=null)
         {
             acbean.setPrintwidth(printwidth.trim());
         }
     }
 
     private final static List<StringLstNonChildComponentNames=new ArrayList<String>();
     static
     {
         .add("dataexports");
         .add("print");
         .add("buttons");
         .add("interceptor");
         .add("header");
         .add("footer");
     }
 
     public static void loadContainerCommonConfig(XmlElementBean eleContainer,AbsContainerConfigBean ccbean)
     {
         String border=eleContainer.attributeValue("border");
         String bordercolor=eleContainer.attributeValue("bordercolor");
         String margin=eleContainer.attributeValue("margin");
         String margin_left=eleContainer.attributeValue("margin_left");
         String margin_right=eleContainer.attributeValue("margin_right");
         String margin_top=eleContainer.attributeValue("margin_top");
         String margin_bottom=eleContainer.attributeValue("margin_bottom");
         String titleposition=eleContainer.attributeValue("titleposition");
         String scrollX=eleContainer.attributeValue("scrollX");
         String scrollY=eleContainer.attributeValue("scrollY");
 
         if(scrollX!=null&&scrollX.trim().equalsIgnoreCase("true"))
         {
             ccbean.setScrollX(true);
             if(ccbean.getWidth()==null||ccbean.getWidth().trim().equals("")||ccbean.getWidth().indexOf("%")>=0)
             {
                 throw new WabacusConfigLoadingException("容器"+ccbean.getPath()+"配置了横向滚动条,所以必须为其配置width属性,且不能配置为百分比");
             }
         }
         if(scrollY!=null&&scrollY.trim().equalsIgnoreCase("true"))
         {
             ccbean.setScrollY(true);
             if(ccbean.getHeight()==null||ccbean.getHeight().trim().equals("")||ccbean.getHeight().indexOf("%")>=0)
             {
                 throw new WabacusConfigLoadingException("容器"+ccbean.getPath()+"配置了垂直滚动条,所以必须为其配置height属性,且不能配置为百分比");
             }
         }
 
         ComponentAssistant.getInstance().doPostLoadForComponentScroll(ccbean,ccbean.isScrollX(),ccbean.isScrollY(),ccbean.getWidth(),
                 ccbean.getHeight(),ccbean.getScrollstyle());
         if(border!=null)
         {
             try
             {
                 ccbean.setBorder(Integer.parseInt(border.trim()));
             }catch(NumberFormatException e)
             {
                 .warn("页面"+ccbean.getPageBean().getId()+"中id为"+ccbean.getId()+"的子元素border属性不是合法数字",e);
             }
         }
         if(bordercolor!=null)
         {
             ccbean.setBordercolor(bordercolor.trim());
         }
         if(margin!=null)
         {//这个配置对left/right/top/bottom都有效
             ccbean.setMargin_left(margin.trim());
             ccbean.setMargin_right(margin.trim());
             ccbean.setMargin_top(margin.trim());
             ccbean.setMargin_bottom(margin.trim());
         }
         if(margin_left!=null)
         {
             ccbean.setMargin_left(margin_left.trim());
         }
         if(margin_right!=null)
         {
             ccbean.setMargin_right(margin_right.trim());
         }
         if(margin_top!=null)
         {
             ccbean.setMargin_top(margin_top.trim());
         }
         if(margin_bottom!=null)
         {
             ccbean.setMargin_bottom(margin_bottom.trim());
         }
         if(titleposition!=nullccbean.setTitleposition(titleposition.trim());
         if(ccbean.getMargin_left()!=null&&!ccbean.getMargin_left().trim().equals("")&&ccbean.getMargin_right()!=null
                 &&!ccbean.getMargin_right().trim().equals(""))
         {
             ccbean.setColspan_total(3);
         }else if((ccbean.getMargin_left()!=null&&!ccbean.getMargin_left().trim().equals(""))
                 ||(ccbean.getMargin_right()!=null&&!ccbean.getMargin_right().trim().equals("")))
         {
             ccbean.setColspan_total(2);
         }else
         {
             ccbean.setColspan_total(1);
         }
 
         Map<String,IComponentConfigBeanmChildren=new HashMap<String,IComponentConfigBean>();
         List<StringlstChildrenIDs=new ArrayList<String>();
         ccbean.setMChildren(mChildren);
         ccbean.setLstChildrenIDs(lstChildrenIDs);
         List<XmlElementBeanlstChildElements=eleContainer.getLstChildElements();
         if(lstChildElements==null||lstChildElements.size()==0)
         {
             throw new WabacusConfigLoadingException("加载页面/容器"+ccbean.getPath()+"失败,内容为空");
         }
         for(XmlElementBean eleChildTmp:lstChildElements)
         {
             if(eleChildTmp==nullcontinue;
             if(.contains(eleChildTmp.getName())) continue;
             String childid=eleChildTmp.attributeValue("id");
             if(childid==null||childid.trim().equals(""))
             {
                 throw new WabacusConfigLoadingException("容器"+ccbean.getPath()+"中子组件存在没有配置id属性的子组件");
             }
             if(..contains(childid))
             {
                 throw new WabacusConfigLoadingException("容器"+ccbean.getPath()+"中子组件的id属性"+childid+"不合法,不能出现如下字符:"
                         +.);
             }
             lstChildrenIDs.add(childid);
             String tagname=eleChildTmp.getName();
             tagname=tagname==null?"":tagname.trim();
             if(tagname.equals("report"))
             {
                 ComponentConfigLoadManager.loadReportConfig(eleChildTmp,ccbean);
             }else if(tagname.equals("html"))
             {
                 HtmlComponentBean hcbean=new HtmlComponentBean(ccbean);
                 loadComponentCommonConfig(eleChildTmp,hcbean);
                 loadApplicationCommonConfig(eleChildTmp,hcbean);
                 ccbean.getMChildren().put(hcbean.getId(),hcbean);
                 hcbean.loadExtendConfig(eleChildTmp,ccbean);
             }else if(tagname.equals("jsp"))
             {
                 JspComponentBean jspcbean=new JspComponentBean(ccbean);
                 loadComponentCommonConfig(eleChildTmp,jspcbean);
                 loadApplicationCommonConfig(eleChildTmp,jspcbean);
                 ccbean.getMChildren().put(jspcbean.getId(),jspcbean);
                 jspcbean.loadExtendConfig(eleChildTmp,ccbean);
             }else
             {
                 AbsContainerType childContainer=Config.getInstance().getContainerType(tagname);
                 if(childContainer==null)
                 {
                     throw new WabacusConfigLoadingException("容器"+ccbean.getPath()+"配置的id属性:"+childid+"的子元素对应的容器"+tagname+"不存在");
                 }
                 ccbean.getMChildren().put(childid,childContainer.loadConfig(eleChildTmp,ccbean,tagname));
             }
         }
     }
 
     public static void loadReportConfig(XmlElementBean eleReportBean,AbsContainerConfigBean parentContainerBean)
     {
         String reportid=eleReportBean.attributeValue("id");
         reportid=reportid.trim();
         String reportextends=eleReportBean.attributeValue("extends");
         ReportBean rbean=null;
         ReportBean rbeanParent=null;
         try
         {
             if(reportextends!=null&&!reportextends.trim().equals(""))
             {
                 rbeanParent=getReportBeanByPath(reportextends);
                 if(rbeanParent==null||rbeanParent.getEleReportBean()!=null)
                 {
                     rbean=new ReportBean(parentContainerBean);
                     rbean.setId(reportid);
                     rbean.setEleReportBean(eleReportBean);
                     parentContainerBean.getMChildren().put(reportid,rbean);
                     ..add(rbean);
                     return;
                 }else
                 {
                     rbean=(ReportBean)rbeanParent.clone(reportid,parentContainerBean);
                     
                     
                 }
             }else
             {
                 rbean=new ReportBean(parentContainerBean);
                 rbean.setId(reportid);
             }
             parentContainerBean.getMChildren().put(reportid,rbean);
             loadReportInfo(rbean,eleReportBean,rbeanParent);
         }catch(Exception e)
         {
             String reportid2="";
             if(rbean!=null)
             {
                 reportid2=rbean.getId();
             }
             throw new WabacusConfigLoadingException("加载报表"+parentContainerBean.getPath()+.+reportid2+"时出错",e);
         }
     }
 
     public static ReportBean getReportBeanByPath(String path)
     {
         if(path==null||path.trim().equals("")||path.trim().indexOf(.)<=0) return null;
         int idx=path.lastIndexOf(.);
         String pageid=path.substring(0,idx).trim();
         String reportid=path.substring(idx+1).trim();
         PageBean pbean=..get(pageid);
         if(pbean==nullreturn null;
         return pbean.getReportChild(reportid,true);
     }
 
     public static void loadReportInfo(ReportBean rb,XmlElementBean eleReportBean,ReportBean rbParentthrows Exception
     {
         try
         {   //$ByQXO 初始化属性Map,以便扩展类中使用
            // rb.mergeAttrs(eleReportBean.getMPropertiesClone());
             //ByQXO$
             loadComponentCommonConfig(eleReportBean,rb);
             loadApplicationCommonConfig(eleReportBean,rb);
             List<XmlElementBeanlstEleReportBeans=new ArrayList<XmlElementBean>();
             lstEleReportBeans.add(eleReportBean);
             
             String type=eleReportBean.attributeValue("type");
             if(type!=nullrb.setType(type.trim());
             LoadExtendConfigManager.loadBeforeExtendConfigForReporttype(rb,lstEleReportBeans);
             String pojoclass=eleReportBean.attributeValue("pojoclass");
             String formatclass=eleReportBean.attributeValue("formatclass");
             String border=eleReportBean.attributeValue("border");
             String bordercolor=eleReportBean.attributeValue("bordercolor");
             String datastyleproperty=eleReportBean.attributeValue("datastyleproperty");
 
             String template=eleReportBean.attributeValue("template");
             String cellresize=eleReportBean.attributeValue("cellresize");
             String celldrag=eleReportBean.attributeValue("celldrag");
             String depends=eleReportBean.attributeValue("depends");
             
             String dependstype=eleReportBean.attributeValue("dependstype");
             String dependsParams=eleReportBean.attributeValue("dependsparams");
             String scrollheight=eleReportBean.attributeValue("scrollheight");
             String scrollwidth=eleReportBean.attributeValue("scrollwidth");
             String pagesize=eleReportBean.attributeValue("pagesize");
             String navigate_reportid=eleReportBean.attributeValue("navigate_reportid");
             String navigate=eleReportBean.attributeValue("navigate");
             String personalizeclass=eleReportBean.attributeValue("personalizeclass");
             String servervalidateclass=eleReportBean.attributeValue("servervalidateclass");
             loadInterceptorInfo(eleReportBean,rb);
 
             if(pagesize!=null)
             {
                 pagesize=pagesize.trim();
                 if(pagesize.equals(""))
                 {
                     rb.setLstPagesize(null);
                 }else
                 {
                     rb.setLstPagesize(parsePagesize(rb,pagesize));
                 }
             }
             if(rb.getLstPagesize()==null||rb.getLstPagesize().size()==0)
             {
                 if(rb.isDetailReportType())
                 {
                     List<IntegerlstPageSize=new ArrayList<Integer>();
                     lstPageSize.add(0);
                     rb.setLstPagesize(lstPageSize);
                 }else if(rb.isChartReportType())
                 {
                     List<IntegerlstPagesize=new ArrayList<Integer>();
                     lstPagesize.add(-1);
                     rb.setLstPagesize(lstPagesize);
                 }else
                 {
                     if(==null)
                     {//还没加载全局默认配置
                         =parsePagesize(null,Config.getInstance().getSystemConfigValue("default-pagesize","10"));
                         if(==null||.size()==0)
                         {
                             throw new WabacusConfigLoadingException("加载报表"+rb.getPath()+"失败,没有为其配置pagesize值,且没有在wabacus.cfg.xml中指定全局默认页大小");
                         }
                     }
                     rb.setLstPagesize();
                 }
             }
             if(navigate_reportid!=nullrb.setNavigate_reportid(navigate_reportid.trim());
             if(navigate!=null)
             {
                 navigate=navigate.trim();
                 if(navigate.equals(""))
                 {
                     rb.setNavigateObj(null);
                 }else
                 {
                     Object obj=navigate;
                     if(ComponentConfigLoadAssistant.getInstance().isStaticTemplateResource(navigate))
                     {
                         if(Tools.isDefineKey("$",navigate))
                         {
                             obj=Config.getInstance().getResourceObject(null,rb.getPageBean(),navigate,true);
                         }else
                         {
                             obj=TemplateParser.parseTemplateByPath(navigate);
                         }
                     }
                     rb.setNavigateObj(obj);
                 }
             }
 
             if(personalizeclass!=null)
             {
                 personalizeclass=personalizeclass.trim();
                 if(personalizeclass.equals(""))
                 {
                     rb.setPersonalizeObj(null);
                 }else if(personalizeclass.toLowerCase().equals("default"))
                 {
                     rb.setPersonalizeObj(.);
                 }else
                 {
                     Object obj=null;
                     try
                     {
                         obj=..loadClassByCurrentLoader(personalizeclass).newInstance();
                     }catch(Exception e)
                     {
                         throw new WabacusConfigLoadingException("报表"+rb.getPath()+"配置的personalizeclass:"+personalizeclass+"类对象无例化失败",e);
                     }
                     if(!(obj instanceof IReportPersonalizePersistence))
                     {
                         throw new WabacusConfigLoadingException("报表"+rb.getPath()+"配置的personalizeclass:"+personalizeclass+"没有实现"
                                 +IReportPersonalizePersistence.class.getName()+"接口");
                     }
                     rb.setPersonalizeObj((IReportPersonalizePersistence)obj);
                 }
             }
             if(depends!=null)
             {
                 depends=depends.trim();
                 if(depends.equals(rb.getId()))
                 {
                     throw new WabacusConfigLoadingException("加载报表"+rb.getPath()+"失败,不能自己依赖自己");
                 }
                 if(rb.getRefreshid()!=null&&!rb.getRefreshid().trim().equals("")&&!rb.getRefreshid().trim().equals(rb.getId()))
                 {
                     throw new WabacusConfigLoadingException("加载报表"+rb.getPath()+"失败,此报表是从报表,不能配置refreshid,因为从报表永远只能刷新自己");
                 }
                 rb.setDependParentId(depends);
                 if(dependstype!=null)
                 {
                     dependstype=dependstype.toLowerCase().trim();
                     if(dependstype.equals(""))
                     {
                         rb.setDisplayOnParentNoData(true);
                     }else if(!dependstype.equals("hidden")&&!dependstype.equals("display"))
                     {
                         throw new WabacusConfigLoadingException("加载报表"+rb.getPath()+"失败,此报表是从报表,其dependstype属性只能配置为display或hidden");
                     }else
                     {
                         rb.setDisplayOnParentNoData(dependstype.equals("display"));
                     }
                 }
                 if(dependsParams!=null&&!dependsParams.trim().equals(""))
                 {
                     rb.setDependparams(dependsParams.trim());
                 }
                 rb.getPageBean().addRelateReports(rb);
             }
             if(servervalidateclass!=null)
             {
                 List<ClasslstClasses=ConfigLoadAssistant.getInstance().convertStringToClassList(servervalidateclass.trim());
                 rb.setLstServerValidateClasses(lstClasses);
             }
             if(border!=null)
             {
                 border=border.toLowerCase().trim();
                 if(border.equals("")) border=.;
                 if(!..contains(border))
                 {
                     .warn("报表"+rb.getPath()+"配置的border属性"+border+"无效,将采用默认边框");
                     border=.;
                 }
                 rb.setBorder(border);
             }
             if(bordercolor!=null)
             {