Package com.exedosoft.plat.ui

Examples of com.exedosoft.plat.ui.DOTreeModel


    String result = null;
//    HbmDAO dao = new HbmDAO();
//    dao.setAutoClose(false);
    try {

      DOTreeModel treeModel =  DAOUtil.INSTANCE().getByObjUid(
          DOTreeModel.class, treeModelUid);
      if (dropDownID != null) {
        treeModel.setDropDownID(dropDownID);
      }

      // //////////////初始化当前上下文环境1
      if (instanceUid != null) {
        if (treeModel.getParent() != null) {
          DOService parentService = null;
          if (treeModel.getParent().getService() != null) {
            parentService = treeModel.getParent().getService();
          } else {
            parentService = this.getIfParentService(treeModel
                .getParent());
          }
          if (parentService != null) {
            parentService.getBo().refreshContext(instanceUid);
          }

        }
      }
      if (initOnly != null) {
        log.info("instanceUid::" + instanceUid);
        log.info("treeModelUid::" + treeModelUid);
        /**
         * 如果是初始化上下文环境,执行到这儿就返回。
         */
        return;
      }

      DOPaneModel containerPaneModel = null;
      if (containerPaneUid != null) {
        containerPaneModel = DOPaneModel
            .getPaneModelByID(containerPaneUid);
        treeModel.setContainerPane(containerPaneModel);

      }
     
     
      log.info("treeModel.getStatus()::::" + treeModel.getStatus());


      switch (treeModel.getStatus()) {
     
   
      case DOTreeModel.STATUS_SELFLINK_ONLY:
        result = dealSelfLinkOnly(treeModel, instanceUid);
        break;
View Full Code Here


    // ///////////判断如果有两个child,并且有一个child是子连接,并且这个child对应的查询没有值,
    // 那么可以作为STATUS_CHILD_ONE处理
    List children = treeModel.getChildren();
    if (children.size() == 2) {

      DOTreeModel commModel = null;
      DOTreeModel selfModel = null;
      DOTreeModel childModel0 = (DOTreeModel) children.toArray()[0];
      DOTreeModel childModel1 = (DOTreeModel) children.toArray()[1];

      if (childModel0.isSelf()) {
        selfModel = childModel0;
        commModel = childModel1;
      }
      if (childModel1.isSelf()) {
        selfModel = childModel1;
        commModel = childModel0;
      }
      if (commModel != null && selfModel != null) {
        List listChilds = selfModel.getService().invokeSelect(
View Full Code Here

  private void dealMultChildHelper(DOTreeModel treeModel,
      StringBuffer buffer, String instanceUid) {

    for (Iterator itChild = treeModel.getChildren().iterator(); itChild
        .hasNext();) {
      DOTreeModel childModel = (DOTreeModel) itChild.next();
      childModel.setDropDownID(treeModel.getDropDownID());
      if (childModel.isSelf()) {
        log.info("Enter is Self::::" + childModel.getL10n());
        setTempPara(instanceUid, treeModel, childModel);
        List list = childModel.getService().invokeSelect();
        childModel.setContainerPane(treeModel.getContainerPane());
        dealSelfLinkOnlyHelper(childModel, list, buffer, instanceUid);
      } else {
        buffer.append("\n<tree text=\"").append(childModel.getL10n());
        this.appendIconXML(treeModel, buffer);

        if (childModel.getService() == null) {
          appendSrc(childModel.getObjUid(), treeModel, instanceUid,
              buffer);

        } else {

          List listChilds = childModel.getService().invokeSelect(
              instanceUid);
          if (listChilds != null && listChilds.size() > 0) {

            appendSrc(childModel.getObjUid(), treeModel,
                instanceUid, buffer);
          }
        }
        buffer.append("\"/>\n"); // / xml 关闭符号
      }
View Full Code Here

    List list = treeModel.getService().invokeSelect();
    addListforNew(list, treeModel);
    StringBuffer buffer = new StringBuffer();
    buffer.append("<tree>\n");

    DOTreeModel childModel = (DOTreeModel) treeModel.getChildren()
        .toArray()[0];
    dealChildOneHelper(treeModel, instanceUid, list, buffer, childModel);
    buffer.append("</tree>\n");
    return buffer.toString();
  }
View Full Code Here

  public String getHtmlCode(DOIModel doimodel) {

    String s = "";
    try {
      DOTreeModel tm = (DOTreeModel) doimodel;

      Map<String, Object> data = this.putData(doimodel);

      s = HtmlTemplateGenerator.getContentFromDBTemplate(tm
          .getController().getObjUid(), data);
    } catch (Exception e) {
      e.printStackTrace();
    }
    return s;
View Full Code Here

    this.templateFile = "tree/SimpleTree.ftl";
  }

  public Map<String, Object> putData(DOIModel doimodel) {

    DOTreeModel treeModel = (DOTreeModel) doimodel;
    Map<String, Object> data = new HashMap<String, Object>();
    String treeModelUrl = "/" + DOGlobals.URL
        + "/loadtreesvl?treeModelUid=" + treeModel.getObjUid();
    data.put("model", treeModel);
    data.put("treeModelUrl", treeModelUrl);
    // /

    if (treeModel.getTemplate() != null) {
      StringBuffer buffer = new StringBuffer();
      buffer.append("javascript:")
          .append(treeModel.getTemplate());
     
      data.put("actionUrl", buffer.toString());
    }

    return data;
View Full Code Here

          if (pm.getLinkUID() != null
              && !"".equals(pm.getLinkUID().trim())) {

            try {
              DOTreeModel tm = pm.getTreeModel();
              tm.setContainerPane(pm);
              if (pm.getDropDownID() != null) {
                tm.setDropDownID(pm.getDropDownID());
              }
              buffer.append(tm.getHtmlCode());
            } catch (Exception e) {
              e.printStackTrace();
            }
          }
          break;
View Full Code Here

    String result = null;
    // HbmDAO dao = new HbmDAO();
    // dao.setAutoClose(false);
    try {

      DOTreeModel treeModel = DAOUtil.INSTANCE().getByObjUid(
          DOTreeModel.class, treeModelUid);
      if (dropDownID != null) {
        treeModel.setDropDownID(dropDownID);
      }

      // //////////////初始化当前上下文环境1
      if (instanceUid != null) {
        if (treeModel.getParent() != null) {
          DOService parentService = null;
          if (treeModel.getParent().getService() != null) {
            parentService = treeModel.getParent().getService();
          } else {
            parentService = this.getIfParentService(treeModel
                .getParent());
          }
          if (parentService != null) {
            parentService.getBo().refreshContext(instanceUid);
          }

        }
      }
      if (initOnly != null) {
        log.info("instanceUid::" + instanceUid);
        log.info("treeModelUid::" + treeModelUid);
        /**
         * 如果是初始化上下文环境,执行到这儿就返回。
         */
        return;
      }

      DOPaneModel containerPaneModel = null;
      if (containerPaneUid != null) {
        containerPaneModel = DOPaneModel
            .getPaneModelByID(containerPaneUid);
        treeModel.setContainerPane(containerPaneModel);

      }

      log.info("treeModel.getStatus()::::" + treeModel.getStatus());

      switch (treeModel.getStatus()) {

      case DOTreeModel.STATUS_SELFLINK_ONLY:
        result = dealSelfLinkOnly(treeModel, instanceUid);
        break;
      case DOTreeModel.STATUS_SELFLINK_CHILD:
View Full Code Here

    // ///////////判断如果有两个child,并且有一个child是子连接,并且这个child对应的查询没有值,
    // 那么可以作为STATUS_CHILD_ONE处理
    List children = treeModel.getChildren();
    if (children.size() == 2) {

      DOTreeModel commModel = null;
      DOTreeModel selfModel = null;
      DOTreeModel childModel0 = (DOTreeModel) children.toArray()[0];
      DOTreeModel childModel1 = (DOTreeModel) children.toArray()[1];

      if (childModel0.isSelf()) {
        selfModel = childModel0;
        commModel = childModel1;
      }
      if (childModel1.isSelf()) {
        selfModel = childModel1;
        commModel = childModel0;
      }
      if (commModel != null && selfModel != null) {
        List listChilds = selfModel.getService().invokeSelect(
View Full Code Here

  private void dealMultChildHelper(DOTreeModel treeModel,
      StringBuffer buffer, String instanceUid) {

    for (Iterator itChild = treeModel.getChildren().iterator(); itChild
        .hasNext();) {
      DOTreeModel childModel = (DOTreeModel) itChild.next();
      childModel.setDropDownID(treeModel.getDropDownID());
      if (childModel.isSelf()) {
        log.info("Enter is Self::::" + childModel.getL10n());
        setTempPara(instanceUid, treeModel, childModel);
        List list = childModel.getService().invokeSelect();
        childModel.setContainerPane(treeModel.getContainerPane());
        dealSelfLinkOnlyHelper(childModel, list, buffer, instanceUid);
      } else {

        if (childModel.getService() == null) {
          buffer.append("\n<tree text=\"").append(
              childModel.getL10n());
          this.appendIconXML(treeModel, buffer);

          appendSrc(childModel.getObjUid(), treeModel, instanceUid,
              buffer);
          buffer.append("\"/>\n"); // / xml 关闭符号

        } else {

          List listChilds = childModel.getService().invokeSelect(
              instanceUid);

          if (listChilds != null && listChilds.size() > 0) {

            buffer.append("\n<tree text=\"").append(
                childModel.getL10n());
            this.appendIconXML(treeModel, buffer);

            appendSrc(childModel.getObjUid(), treeModel,
                instanceUid, buffer);
            buffer.append("\"/>\n"); // / xml 关闭符号
          }

        }
View Full Code Here

TOP

Related Classes of com.exedosoft.plat.ui.DOTreeModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.