Uploaded image for project: 'Grouper'
  1. Grouper
  2. GRP-187

add stem delete function (gsh?)

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      add a method in gsh which deletes a stem and all subgroups etc... I think it should print out what it will do, and have a dry run mode... here is some GSH that might be a workaround...

      addRootStem("a", "a");
      addGroup("a", "groupA", "groupA");
      addStem("a", "b", "b");
      addGroup("a:b", "groupB", "groupB");
      addStem("a", "c", "c");
      addGroup("a:b", "groupB1", "groupB1");
      addGroup("a:c", "groupC1", "groupC1");
      addGroup("a:c", "groupC2", "groupC2");

      grouperSession = GrouperSession.startRootSession();

      stem = StemFinder.findByName(grouperSession, "a");
      for(child : stem.getChildGroups(Stem.Scope.SUB))

      { System.out.println("deleting: " + child.getName()); child.delete(); }

      stemList = new ArrayList(stem.getChildStems(Stem.Scope.SUB));
      Collections.sort(stemList);
      Collections.reverse(stemList);
      for(childStem : stemList)

      { System.out.println("deleting: " + childStem.getName()); childStem.delete(); }

      stem.delete();

      StemFinder.findByName(grouperSession, "a");

        Attachments

          Activity

            People

            Assignee:
            chris.hyzer@at.internet2.edu Chris Hyzer (upenn.edu)
            Reporter:
            chris.hyzer@at.internet2.edu Chris Hyzer (upenn.edu)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Smart Checklist