Package org.exoplatform.services.organization.impl

Examples of org.exoplatform.services.organization.impl.GroupImpl


      }
   }

   protected Group buildGroup(String groupDN, Attributes attrs) throws NamingException
   {
      GroupImpl group = new GroupImpl();

      // extract group's id, group's name and parent's group from DN
      StringBuffer idBuffer = new StringBuffer();
      String parentId = null;
      String[] baseParts = explodeDN(ldapAttrMapping.groupsURL, true);
      String[] membershipParts = explodeDN(groupDN, true);
      for (int x = (membershipParts.length - baseParts.length - 1); x > -1; x--)
      {
         idBuffer.append("/" + membershipParts[x]);
         if (x == 1)
            parentId = idBuffer.toString();
      }
      group.setGroupName(membershipParts[0]);
      group.setId(idBuffer.toString());
      if (attrs != null)
      {
         group.setDescription(ldapAttrMapping.getAttributeValueAsString(attrs, ldapAttrMapping.ldapDescriptionAttr));
         group.setLabel(ldapAttrMapping.getAttributeValueAsString(attrs, ldapAttrMapping.groupLabelAttr));
      }
      group.setParentId(parentId);

      return group;
   }
View Full Code Here


      listeners_.add(listener);
   }

   final public Group createGroupInstance()
   {
      return new GroupImpl();
   }
View Full Code Here

   public void addChild(Group parent, Group child, boolean broadcast) throws Exception
   {
      Session session = service_.openSession();
      String groupId = "/" + child.getGroupName();
      GroupImpl childImpl = (GroupImpl)child;
      if (parent != null)
      {
         Group parentGroup = (Group)session.get(GroupImpl.class, parent.getId());
         groupId = parentGroup.getId() + "/" + child.getGroupName();
         childImpl.setParentId(parentGroup.getId());
      }
      else if (child.getId() != null)
      {
         groupId = child.getId();
      }
      Object o = session.get(GroupImpl.class, groupId);
      if (o != null)
      {
         Object[] args = {child.getGroupName()};
         throw new UniqueObjectException("OrganizationService.unique-group-exception", args);
      }
      if (broadcast)
         preSave(child, true);
      childImpl.setId(groupId);
      session.save(childImpl);
      if (broadcast)
         postSave(child, true);
      session.flush();
   }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.organization.impl.GroupImpl

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.