Examples of GroupImpl


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

      return buffer.toString();
   }

   protected void setId(Group parent, Group g)
   {
      GroupImpl group = (GroupImpl)g;
      if (parent == null)
      {
         group.setId("/" + group.getGroupName());
         return;
      }
      group.setId(parent.getId() + "/" + group.getGroupName());
      group.setParentId(parent.getId());
   }
View Full Code Here

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

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

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

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

                     LOG.debug("Group " + child + ", parent  " + parent + " already exists. ");
                  }
                  throw new Exception("Group " + child + ", parent  " + parent + " already exists. ");
               }

               GroupImpl group = (GroupImpl)child;
               if (broadcast)
               {
                  preSave(group, true);
               }
View Full Code Here

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

      return buffer.toString();
   }

   protected void setId(Group parent, Group g)
   {
      GroupImpl group = (GroupImpl)g;
      if (parent == null)
      {
         group.setId("/" + group.getGroupName());
         return;
      }
      group.setId(parent.getId() + "/" + group.getGroupName());
      group.setParentId(parent.getId());
   }
View Full Code Here

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

    */
   public final Group attributesToGroup(Attributes attrs)
   {
      if (attrs == null || attrs.size() == 0)
         return null;
      Group group = new GroupImpl();
      group.setGroupName(getAttributeValueAsString(attrs, groupNameAttr));
      group.setDescription(getAttributeValueAsString(attrs, ldapDescriptionAttr));
      group.setLabel(getAttributeValueAsString(attrs, groupLabelAttr));
      return group;
   }
View Full Code Here

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

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

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

    * {@inheritDoc}
    */
   public void addChild(Group parent, Group child, boolean broadcast) throws Exception
   {
      String groupId = "/" + child.getGroupName();
      GroupImpl childImpl = (GroupImpl)child;
      if (parent != null)
      {
         Group parentGroup = findGroupById(parent.getId());
         if (parentGroup == null)
         {
            throw new InvalidNameException("Can't add node to not existed parent " + parent.getId());
         }

         groupId = parentGroup.getId() + "/" + child.getGroupName();
         childImpl.setParentId(parentGroup.getId());
      }
      else if (child.getId() != null)
      {
         groupId = child.getId();
      }

      Object o = findGroupById(groupId);
      if (o != null)
      {
         Object[] args = {child.getGroupName()};
         throw new UniqueObjectException("OrganizationService.unique-group-exception", args);
      }
      childImpl.setId(groupId);

      if (broadcast)
         preSave(child, true);

      Session session = service_.openSession();
View Full Code Here

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

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

   /**
    * {@inheritDoc}
    */
   final public Group createGroupInstance()
   {
      return new GroupImpl();
   }
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.