Examples of IEntityGroup


Examples of org.jasig.portal.groups.IEntityGroup

    }
    return context;
  }

  protected IEntityGroup makeGroup(GroupShadow shadow) throws GroupsException{
    IEntityGroup group = null;
    if ( shadow != null )
    {
        group = new EntityGroupImpl(shadow.key,iperson);
        group.setDescription(shadow.description);
        group.setName(shadow.name);
    }
    return group;
  }
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

  public String[] findMemberGroupKeys(IEntityGroup group) throws GroupsException
  {
    List keys = new ArrayList();
    for ( Iterator itr=findMemberGroups(group); itr.hasNext(); )
    {
        IEntityGroup eg = (IEntityGroup) itr.next();
        keys.add(eg.getKey());
    }
    return (String[]) keys.toArray(new String[keys.size()]);
  }
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

     * @param sD
     */
    public void setStaticData (org.jasig.portal.ChannelStaticData sD) throws PortalException{
        this.session = new PermissionsSessionData();
        session.staticData = sD;
        IEntityGroup admin = GroupService.getDistinguishedGroup(GroupService.PORTAL_ADMINISTRATORS);
        IGroupMember me = AuthorizationService.instance().getGroupMember(session.staticData.getAuthorizationPrincipal());
        if (admin.deepContains(me)) {
            session.isAuthorized = true;
        }
        session.isFinished=false;

    }
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

    * @return Element
    */
   public Element getXml (IGroupMember gm, Element anElem, CGroupsManagerUnrestrictedSessionData sessionData) {
      Document aDoc = sessionData.model;
      String nextID;
      IEntityGroup entGrp = (IEntityGroup)gm;
      Element rootElem = (anElem != null ? anElem : GroupsManagerXML.createElement(ELEMENT_TAGNAME, aDoc, false));
      Utility.logMessage("DEBUG", "GroupWrapper::getXml(): START, Element Expanded: " + rootElem.getAttribute("expanded"));
      try {
         String uid = rootElem.getAttribute("id");
         if (Utility.areEqual(uid, "")) {
            nextID = GroupsManagerXML.getNextUid();
            rootElem.setAttribute("id", nextID);
         }
         rootElem.setAttribute("key", gm.getKey());
         rootElem.setAttribute("entityType",gm.getLeafType().getName());
         rootElem.setAttribute("type", gm.getType().getName());
         rootElem.setAttribute("editable", String.valueOf(entGrp.isEditable()));
         boolean hasMems = gm.hasMembers();
         if (!hasMems) {
            rootElem.setAttribute("expanded", "false");
         }
         boolean isGroupExpanded = (Boolean.valueOf(rootElem.getAttribute("expanded")).booleanValue());
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

         String userName = (String)AnIndividual.getAttribute( Constants.UNFIELD );
         IGroupMember gm =
          GroupService.getGroupMember( userName, IPerson.class );

         for (Iterator itr = gm.getContainingGroups(); itr.hasNext(); ) {
             IEntityGroup group = (IEntityGroup) itr.next();

             if ( group.isEditable() ) {
               IEntityGroup lg =
                 GroupService.findLockableGroup( group.getKey(), this.getClass().getName() );

               lg.removeMember( gm );
               lg.update();

               LOG.info("Removed " + userName + " from " + group.getKey());
             }// if
          }// for
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

       
        // Do a first loop to build the main catalog (new_groups)...
        for (LdapRecord r : set) {
           
            // new_groups (me)...
            IEntityGroup g = r.getGroup();
            new_groups.put(g.getLocalKey(), g);

        }
       
        // Do a second loop to build local indeces...
        for (LdapRecord r : set) {

            IEntityGroup g = r.getGroup();

            // new_parents (I am a parent for all my children)...
            for (String childKey : r.getKeysOfChildren()) {
               
                // NB:  We're only interested in relationships between
                // objects in the main catalog (i.e. new_groups); 
                // discard everything else...
                if (!new_groups.containsKey(childKey)) {
                    break;
                }

                List<String> parentsList = new_parents.get(childKey);
                if (parentsList == null) {
                    // first parent for this child...
                    parentsList = Collections.synchronizedList(new LinkedList<String>());
                    new_parents.put(childKey, parentsList);
                }
                parentsList.add(g.getLocalKey());

            }
           
            // new_children...
            List<String> childrenList = Collections.synchronizedList(new LinkedList<String>());
            for (String childKey : r.getKeysOfChildren()) {
                // NB:  We're only interested in relationships between
                // objects in the main catalog (i.e. new_groups); 
                // discard everything else...
                if (new_groups.containsKey(childKey)) {
                    childrenList.add(childKey);
                }
            }
            new_children.put(g.getLocalKey(), childrenList);
           
            // new_keysByUpperCaseName...
            List<String> groupsWithMyName = new_keysByUpperCaseName.get(g.getName().toUpperCase());
            if (groupsWithMyName == null) {
                // I am the first group with my name (pretty likely)...
                groupsWithMyName = Collections.synchronizedList(new LinkedList<String>());
                new_keysByUpperCaseName.put(g.getName().toUpperCase(), groupsWithMyName);
            }
            groupsWithMyName.add(g.getLocalKey());
           
        }      
       
        /*
         * Now load the ROOT_GROUP into the collections...
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

      //parentEntityType = (Class) GroupsManagerXML.getEntityTypes().get("Person");
      Utility.logMessage("DEBUG", "CreateGroup::execute(): About to create new group: "
            + newGrpName + " Type: " + parentEntityType.getName());
      String userID = sessionData.user.getEntityIdentifier().getKey();
      Utility.logMessage("DEBUG", "CreateGroup::execute(): userID = " + userID);
      IEntityGroup childEntGrp = GroupService.newGroup(parentEntityType);
      childEntGrp.setName(newGrpName);
      childEntGrp.setCreatorID(userID);
      childEntGrp.update();
      Utility.logMessage("DEBUG", "CreateGroup::execute(): About to add new group: "
         + newGrpName);
      parentGroup.addMember((IGroupMember)childEntGrp);
      parentGroup.updateMembersAndRenewLock();
      parentNodes = GroupsManagerXML.getNodesByTagNameAndKey(model, GROUP_TAGNAME, parentKey);
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

         CGroupsManagerUnrestrictedSessionData unrsd = sessionData.getUnrestrictedData();
         Iterator entTypeKeys = entTypes.keySet().iterator();
         while (entTypeKeys.hasNext()) {
            Object key = entTypeKeys.next();
            Class entType = (Class)entTypes.get(key);
            IEntityGroup rootGrp = GroupService.getRootGroup(entType);
            rootGroupElement = getGroupMemberXml(rootGrp, true, null, unrsd);
            rootGroupElement.setAttribute("editable", String.valueOf(rootGrp.isEditable()));
            rootGroupsElem.appendChild(rootGroupElement);
         }
      } catch (Exception e) {
         Utility.logMessage("ERROR", "GroupsManagerXML::getGroupsManagerXML(): ERROR"
               + e, e);
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

      // A search element holds search results and should not be refreshed
      // because it is not persistent.
      if (!isPersistentGroup(updElem)) {
         return;
      }
      IEntityGroup updEntGrp = (entGrp != null ? entGrp : retrieveGroup (updElem.getAttribute("key")));
      //Utility.logMessage("DEBUG", "GroupsManagerXML::refreshElement(): About to update xml for element id: " + updElem.getAttribute("id") + " Key: " + updElem.getAttribute("key"));
      Utility.printElement(updElem, "Element before update------");
      NodeList nList = updElem.getElementsByTagName("dc:title");
      if (nList.getLength() > 0) {
         Node titleNode = nList.item(0);
         titleNode.getFirstChild().setNodeValue(entGrp.getName());
      }

      nList = updElem.getElementsByTagName("dc:description");
      if (nList.getLength() > 0) {
         Node descNode = nList.item(0);
         descNode.getFirstChild().setNodeValue(entGrp.getDescription());
      }

      nList = updElem.getElementsByTagName("dc:creator");
      if (nList.getLength() > 0) {
         Node descNode = nList.item(0);
         String crtName = GroupsManagerXML.getEntityName(updEntGrp.getLeafType(), updEntGrp.getCreatorID());
         descNode.getFirstChild().setNodeValue(crtName);
      }
      Utility.printElement(updElem, "Element after update++++++");
      return;
   }
View Full Code Here

Examples of org.jasig.portal.groups.IEntityGroup

      // A search element holds search results and should not be refreshed
      // because it is not persistent.
      if (!isPersistentGroup(chkElem)) {
         return false;
      }
      IEntityGroup chkEntGrp = (entGrp != null ? entGrp : retrieveGroup (chkElem.getAttribute("key")));
      Utility.logMessage("DEBUG", "GroupsManagerXML::refreshRequired(): About to check if element needs to be refreshed for Element ID: "
            + chkElem.getAttribute("id") + " Key: " + chkElem.getAttribute("key"));
      String elemValue = getElementValueForTagName(chkElem, "dc:title");
      if (!Utility.areEqual(elemValue, chkEntGrp.getName())){
         Utility.logMessage("DEBUG", "GroupsManagerXML::refreshRequired(): Name has changed!!");
         return true;
      }
      elemValue = getElementValueForTagName(chkElem, "dc:description");
      if (!Utility.areEqual(elemValue, chkEntGrp.getDescription())){
         Utility.logMessage("DEBUG", "GroupsManagerXML::refreshRequired(): Description has changed!!");
         return true;
      }

      return false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.