示例#1
0
  public boolean setSon(ITreeNode father, int curLevel) {
    String treeID = father.getId();

    try {
      java.util.Map selectedOrgs = (Map) request.getAttribute("selectedOrgs");

      List orglist = OrgCacheManager.getInstance().getSubOrganizations(treeID);
      if (orglist != null) {
        Iterator iterator = orglist.iterator();
        while (iterator.hasNext()) {
          Organization sonorg = (Organization) iterator.next();
          Map map = new HashMap();
          String orgId = sonorg.getOrgId();
          map.put("orgId", orgId);
          map.put("resId", orgId);
          map.put("orgName", sonorg.getRemark5());
          String temp = (String) orgId + " " + sonorg.getRemark5();
          if (selectedOrgs != null && selectedOrgs.containsKey(temp)) {
            map.put("node_checkboxchecked", true);
          }

          if (accessControl.isOrganizationManager(orgId) || accessControl.isAdmin()) {
            addNode(
                father,
                orgId,
                orgId + "-" + sonorg.getRemark5(),
                "org",
                true,
                curLevel,
                (String) null,
                temp,
                temp,
                map);
          } else {
            if (super.accessControl.isSubOrgManager(orgId)) {
              addNode(
                  father,
                  orgId,
                  orgId + "-" + sonorg.getRemark5(),
                  "org",
                  false,
                  curLevel,
                  temp,
                  orgId + "' disabled='true",
                  temp,
                  map);
            }
          }
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
    }

    return true;
  }
示例#2
0
  public boolean hasSon(ITreeNode father) {
    String treeID = father.getId();

    try {
      return OrgCacheManager.getInstance().hasSubOrg(treeID);
    } catch (Exception e) {
      e.printStackTrace();
    }

    return false;
  }