Esempio n. 1
0
 public void doPostLoad() {
   DisplayBean dbean = (DisplayBean) this.getOwner();
   String[] strs =
       ListReportAssistant.getInstance().calColPosition(null, this, dbean.getLstCols(), null);
   this.defaultFirstColid = strs[0];
   this.defaultLastColId = strs[1];
   this.setDefaultColumnCount(Integer.parseInt(strs[2]));
   AbsListReportColBean alrcbean;
   AbsListReportBean alrbean =
       (AbsListReportBean)
           dbean.getReportBean().getExtendConfigDataForReportType(AbsListReportType.KEY);
   boolean isFirstCol = true;
   for (ColBean cbean : dbean.getLstCols()) {
     if (cbean.getDisplaytype().equals(Consts.COL_DISPLAYTYPE_HIDDEN)) continue;
     String borderstyle = cbean.getBorderStylePropertyOnColBean();
     if (borderstyle != null && !borderstyle.trim().equals("")) {
       cbean.setValuestyleproperty(
           Tools.mergeHtmlTagPropertyString(
               cbean.getValuestyleproperty(null, true), "style=\"" + borderstyle + "\"", 1),
           true);
     }
     if (!isFirstCol
         && this.getRowGroupColsNum() > 0
         && this.getRowgrouptype() == 2
         && alrbean.getScrollType() == AbsListReportBean.SCROLLTYPE_VERTICAL) {
       if (Tools.getPropertyValueByName("width", cbean.getValuestyleproperty(null, true), true)
               != null
           || Tools.getPropertyValueByName("width", cbean.getLabelstyleproperty(null, true), true)
               != null) {
         throw new WabacusConfigLoadingException(
             "加载报表"
                 + cbean.getReportBean().getPath()
                 + "失败,此报表是配置了scrollheight的树形报表,因此除第一列之外,其它列均不能配置width属性");
       }
     }
     isFirstCol = false;
     alrcbean =
         (AbsListReportColBean) cbean.getExtendConfigDataForReportType(AbsListReportType.KEY);
     if (alrcbean == null) continue;
     if (alrcbean.isRequireClickOrderby()) {
       if (cbean.getDatasetValueId() != null && !cbean.getDatasetValueId().trim().equals("")) {
         if (dbean.getReportBean().getSbean().isExistDependentDataset(cbean.getDatasetValueId())) {
           throw new WabacusConfigLoadingException(
               "加载报表"
                   + cbean.getReportBean().getPath()
                   + "的列"
                   + cbean.getLabel(null)
                   + "失败,当前列是从子数据集中取数据,不能为它配置列排序功能");
         }
       }
     }
     if (alrcbean.getFilterBean() != null) {
       alrcbean.getFilterBean().doPostLoad();
     }
   }
 }
Esempio n. 2
0
  public AbsExtendConfigBean clone(AbsConfigBean owner) {
    AbsListReportBean mynewrbean = (AbsListReportBean) super.clone(owner);
    if (lstRowSelectCallBackFuncs != null) {
      mynewrbean.setLstRowSelectCallBackFuncs(
          (List<String>) ((ArrayList<String>) lstRowSelectCallBackFuncs).clone());
    }
    if (this.subdisplaybean != null) {
      mynewrbean.setSubdisplaybean((AbsListReportSubDisplayBean) subdisplaybean.clone(owner));
    }

    return mynewrbean;
  }
Esempio n. 3
0
  public void storeRoworder(ReportRequest rrequest, ReportBean rbean) {
    String rowordertype = rrequest.getStringAttribute(rbean.getId() + "_ROWORDERTYPE", "");
    if (rowordertype.equals("") || !Consts.lstAllRoworderTypes.contains(rowordertype)) return;

    String roworderparams = rrequest.getStringAttribute(rbean.getId() + "_ROWORDERPARAMS", "");
    if (roworderparams.equals("")) return;
    AbsListReportBean alrbean =
        (AbsListReportBean) rbean.getExtendConfigDataForReportType(AbsListReportType.KEY);
    IListReportRoworderPersistence lsObj = alrbean.getLoadStoreRoworderObject(); // 获取到读写行排序顺序值的类对象
    if (lsObj == null) lsObj = Config.default_roworder_object;
    List<Map<String, String>> lstColValusInAllRows =
        EditableReportAssistant.getInstance().parseSaveDataStringToList(roworderparams);
    if (lstColValusInAllRows.size() == 0) return;
    Map<String, String> mColValuesInRow = lstColValusInAllRows.get(0);
    log.debug("被排序记录行参数:" + mColValuesInRow);
    if (rowordertype.equals(Consts.ROWORDER_INPUTBOX)) {
      String newrowordervalue = rrequest.getStringAttribute(rbean.getId() + "_ROWORDERVALUE", "");
      lsObj.storeRoworderByInputbox(rrequest, rbean, mColValuesInRow, newrowordervalue);
    } else if (rowordertype.equals(Consts.ROWORDER_TOP)) {
      lsObj.storeRoworderByTop(rrequest, rbean, mColValuesInRow);
    } else {
      String direct = rrequest.getStringAttribute(rbean.getId() + "_ROWORDERDIRECT", "");
      String destrowParams = rrequest.getStringAttribute(rbean.getId() + "_DESTROWPARAMS", "");
      Map<String, String> mColValuesInDestRow = null;
      if (!destrowParams.trim().equals("")) {
        mColValuesInDestRow =
            EditableReportAssistant.getInstance().parseSaveDataStringToList(destrowParams).get(0);
        log.debug("目标位置记录行参数:" + mColValuesInDestRow);
      }
      if (rowordertype.equals(Consts.ROWORDER_DRAG)) {
        lsObj.storeRoworderByDrag(
            rrequest,
            rbean,
            mColValuesInRow,
            mColValuesInDestRow,
            direct.toLowerCase().trim().equals("true"));
      } else {
        lsObj.storeRoworderByArrow(
            rrequest,
            rbean,
            mColValuesInRow,
            mColValuesInDestRow,
            direct.toLowerCase().trim().equals("true"));
      }
    }
  }
Esempio n. 4
0
  private void processRelateReports() {
    if (this.lstRelateReports == null || this.lstRelateReports.size() == 0) return;
    this.mRelateReports = new HashMap<ReportBean, ReportBean>();
    for (ReportBean rbeanSlave : lstRelateReports) {
      ReportBean rbeanMaster = this.getReportChild(rbeanSlave.getDependParentId(), true);
      if (rbeanMaster == null) {
        throw new WabacusConfigLoadingException(
            "加载页面"
                + this.getPath()
                + "失败,其下的报表"
                + rbeanSlave.getId()
                + "依赖的报表"
                + rbeanSlave.getDependParentId()
                + "不存在");
      }
      if (rbeanMaster
          .isListReportType()) { // 如果主报表是列表报表,则子报表不能配置refreshid为其它容器,因为它们是在客户端单独加载的,不能和其它报表绑定加载
        if (rbeanSlave.getRefreshid() != null
            && !rbeanSlave.getRefreshid().trim().equals("")
            && !rbeanSlave.getRefreshid().trim().equals(rbeanSlave.getId())) {
          throw new WabacusConfigLoadingException(
              "报表" + rbeanSlave.getPath() + "失败,它是依赖其它报表的从报表,因此不能为它配置refreshid属性");
        }
      }
      processDependParams(rbeanSlave, rbeanMaster);
      if (rbeanMaster.isListReportType()) {
        AbsListReportBean alrbean =
            (AbsListReportBean) rbeanMaster.getExtendConfigDataForReportType(AbsListReportType.KEY);
        if (alrbean.getRowSelectType() == null
            || alrbean.getRowSelectType().trim().equals("")
            || alrbean.getRowSelectType().trim().equals(Consts.ROWSELECT_NONE)) {
          alrbean.setRowSelectType(Consts.ROWSELECT_SINGLE);
        }
      }
      this.mRelateReports.put(rbeanSlave, rbeanMaster);
    }
    validRelateReports();
    ReportBean rbeanTempMaster;
    AbsListReportBean alrbean;
    List<ReportBean> lstCreatedListReportBeans = new ArrayList<ReportBean>();
    for (Entry<ReportBean, ReportBean> rbeanEntries : this.mRelateReports.entrySet()) {
      rbeanTempMaster = rbeanEntries.getValue();
      if (rbeanTempMaster.isListReportType()) {
        if (lstCreatedListReportBeans.contains(rbeanTempMaster)) continue; // 已经为此报表生成过js
        lstCreatedListReportBeans.add(rbeanTempMaster);
        alrbean =
            (AbsListReportBean)
                rbeanTempMaster.getExtendConfigDataForReportType(AbsListReportType.KEY);
        if (alrbean == null) {
          alrbean = new AbsListReportBean(rbeanTempMaster);
          rbeanTempMaster.setExtendConfigDataForReportType(AbsListReportType.KEY, alrbean);
        }

        alrbean.addRowSelectCallBackFunc(
            rbeanTempMaster.getRefreshSlaveReportsCallBackMethodName());
        rbeanTempMaster.addOnloadMethod(
            new OnloadMethodBean(
                Consts_Private.ONLOAD_REFRESHSLAVE,
                rbeanTempMaster.getRefreshSlaveReportsCallBackMethodName()));
      } else {
        String masterReportRefreshId = rbeanTempMaster.getRefreshid();
        if (masterReportRefreshId == null || masterReportRefreshId.trim().equals("")) {
          masterReportRefreshId = rbeanTempMaster.getId();
        }
        rbeanTempMaster.setRefreshid(
            getParentContainerObjOfComponents(masterReportRefreshId, rbeanEntries.getKey().getId())
                .getId());
      }
    }
    for (ReportBean rbTmp : lstCreatedListReportBeans) {
      JavaScriptAssistant.getInstance().createRefreshSlaveReportsDataScript(rbTmp);
    }
    this.lstRelateReports = null;
  }