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.system.component.application.report.abstractreport;
 
 import java.util.List;
 import java.util.Map;
 
 
 public abstract class AbsChartReportType extends AbsReportType
 {
     public final static String KEY=AbsChartReportType.class.getName();
 
     protected AbsChartReportBean acrbean;
     
     protected AbsChartReportDisplayBean acrdbean;
     
     public AbsChartReportType(AbsContainerType parentContainerType,IComponentConfigBean comCfgBean,ReportRequest rrequest)
     {
         super(parentContainerType,comCfgBean,rrequest);
         if(comCfgBean!=null)
         {
         }
     }
 
     public AbsChartReportBean getAcrbean()
     {
         return ;
     }
 
     {
         return ;
     }
 
     public abstract String loadStringChartData(boolean invokeInterceptor);
     
     protected boolean isHiddenCol(ColBean cbean)
     {
         if(..equals(cbean.getDisplaytype())) return true;
         return !cbean.checkDisplayPermission();
     }
 
     public String getColSelectedMetadata()
     {
         return null;
     }
 
     protected String getDefaultNavigateKey()
     {
         return null;
     }
 
     protected int getTotalColCount()
     {
         return 0;
     }
 
     public int afterDisplayLoading(DisplayBean disbean,List<XmlElementBeanlstEleDisplayBeans)
     {
         super.afterDisplayLoading(disbean,lstEleDisplayBeans);
         if(acrdbean==null)
         {
             acrdbean=new AbsChartReportDisplayBean(disbean);
             disbean.setExtendConfigDataForReportType(,acrdbean);
         }
        Map<String,StringmDisplayProperties=ConfigLoadAssistant.getInstance().assembleAllAttributes(lstEleDisplayBeans,
                new String[] { "labelcolumn" });
        String labelcolumn=mDisplayProperties.get("labelcolumn");
        if(labelcolumn!=null)
        {
            acrdbean.setLabelcolumn(labelcolumn.trim());
        }
        return 1;
    }
    public int afterReportLoading(ReportBean reportbean,List<XmlElementBeanlstEleReportBeans)
    {
        super.afterReportLoading(reportbean,lstEleReportBeans);
        if(acrbean==null)
        {
            acrbean=new AbsChartReportBean(reportbean);
            reportbean.setExtendConfigDataForReportType(,acrbean);
        }
        XmlElementBean eleReportBean=lstEleReportBeans.get(0);
        String chartype=eleReportBean.attributeValue("chartype");
        if(chartype!=nullacrbean.setChartype(chartype.trim());
        if(acrbean.getChartype()==null||acrbean.getChartype().trim().equals(""))
        {
            throw new WabacusConfigLoadingException("报表"+reportbean.getPath()+"必须指定图表类型");
        }
        String datatype=eleReportBean.attributeValue("datatype");
        if(datatype!=nullacrbean.setDatatype(datatype.trim());
        String chartstyleproperty=eleReportBean.attributeValue("chartstyleproperty");
        if(chartstyleproperty!=null)
        {
            acrbean.setChartstyleproperty(chartstyleproperty.trim(),false);
        }
        return 1;
    }
    public int doPostLoad(ReportBean reportbean)
    {
        super.doPostLoad(reportbean);
        List<ReportDataSetBeanlstDatasetBeans=reportbean.getSbean().getLstDatasetBeans();
        if(lstDatasetBeans!=null&&lstDatasetBeans.size()>0)
        {
            List<StringlstGroupids=new ArrayList<String>();
            Map<String,List<ReportDataSetBean>> mReportDatasetGroupBeans=new HashMap<String,List<ReportDataSetBean>>();
            for(ReportDataSetBean dsbeanTmp:lstDatasetBeans)
            {
                List<ReportDataSetBeanlstDatasetGroupBeans=mReportDatasetGroupBeans.get(dsbeanTmp.getGroupid());
                if(lstDatasetGroupBeans==null)
                {
                    lstDatasetGroupBeans=new ArrayList<ReportDataSetBean>();
                    mReportDatasetGroupBeans.put(dsbeanTmp.getGroupid(),lstDatasetGroupBeans);
                    lstGroupids.add(dsbeanTmp.getGroupid());
                }
                lstDatasetGroupBeans.add(dsbeanTmp);
            }
            List<List<ReportDataSetBean>> lstDatasetGroupBeans=new ArrayList<List<ReportDataSetBean>>();
            for(String groupidTmp:lstGroupids)
            {
                lstDatasetGroupBeans.add(mReportDatasetGroupBeans.get(groupidTmp));
            }
            crbean.setLstDatasetGroupBeans(lstDatasetGroupBeans);
        }
        if(acrdbean!=null&&acrdbean.getLabelcolumn()!=null&&!acrdbean.getLabelcolumn().trim().equals(""))
        {
            for(ColBean cbTmp:reportbean.getDbean().getLstCols())
            {
                if(acrdbean.getLabelcolumn().equals(cbTmp.getColumn()))
                {
                    if(cbTmp.isControlCol()||cbTmp.isNonFromDbCol()||..equals(cbTmp.getDisplaytype()))
                    {
                        throw new WabacusConfigLoadingException("加载报表"+reportbean.getPath()+"失败,column为"+acrdbean.getLabelcolumn()
                                +"的列为隐藏列或控制列或不为从数据库取数据的列,不能做配置为<display/>的labelcolumn");
                    }
                    if(acrdbean.getCbeanLabel()!=null)
                    {
                        throw new WabacusConfigLoadingException("加载报表"+reportbean.getPath()+"失败,column为"+acrdbean.getLabelcolumn()
                                +"为<display/>的labelcolumn,因此不能配置多个column为"+acrdbean.getLabelcolumn()+"的<col/>");
                    }
                    acrdbean.setCbeanLabel(cbTmp);
                }else if(cbTmp.isNonFromDbCol())
                {
                    throw new WabacusConfigLoadingException("加载报表"+reportbean.getPath()
                            +"失败,此报表在<display/>中配置有labelcolumn,因此不能配置column为{non-fromdb}的<col/>");
                }
            }
            if(acrdbean.getCbeanLabel()==null)
            {
                throw new WabacusConfigLoadingException("加载报表"+reportbean.getPath()+"失败,此报表在<display/>中配置的labelcolumn属性:"+acrdbean.getLabelcolumn()
                        +"没有对应的<col/>");
            }
            if(lstDatasetBeans!=null)
            {
                for(ReportDataSetBean dsbeanTmp:lstDatasetBeans)
                {
                    if(dsbeanTmp.getDatasetValueBeanById(acrdbean.getCbeanLabel().getDatasetValueId())!=null)
                    {
                        acrdbean.setLabelDatasetid(dsbeanTmp.getId());
                        break;
                    }
                }
            }
        }
        return 1;
    }
New to GrepCode? Check out our FAQ X