Exemplo n.º 1
0
 /**
  * @param portalsiteview
  * @param monitorgroup
  * @param array
  * @param i
  */
 void findSubgroups(PortalSiteView portalsiteview, MonitorGroup monitorgroup, Array array, int i) {
   Enumeration enumeration = monitorgroup.getMonitors();
   while (enumeration.hasMoreElements()) {
     Monitor monitor = (Monitor) enumeration.nextElement();
     if (monitor instanceof SubGroup) {
       String s = monitor.getProperty(SubGroup.pGroup);
       MonitorGroup monitorgroup1 = (MonitorGroup) portalsiteview.getElement(s);
       if (monitorgroup1 != null) {
         array.add(monitorgroup1.getProperty(Monitor.pID));
         monitorgroup1.setProperty("groupLevel", "" + i);
         findSubgroups(portalsiteview, monitorgroup1, array, i + 1);
       }
     }
   }
 }
Exemplo n.º 2
0
  public Array getSortedGroupIDs(PortalSiteView portalsiteview) {
    Array array = new Array();
    int i = 0;
    Array array1 = portalsiteview.getGroups();
    for (int j = 0; j < array1.size(); j++) {
      MonitorGroup monitorgroup = (MonitorGroup) array1.at(j);
      if (monitorgroup.getProperty(MonitorGroup.pParent).length() == 0) {
        array.add(monitorgroup.getProperty(Monitor.pID));
        monitorgroup.setProperty("groupLevel", "0");
        findSubgroups(portalsiteview, monitorgroup, array, i + 1);
      }
    }

    return array;
  }