Package org.exoplatform.services.organization

Examples of org.exoplatform.services.organization.GroupHandler


   {
      if (LOG.isDebugEnabled())
         LOG.debug("+++++++++++FIND USER BY GROUP_ID " + groupId);

      MembershipHandler membershipHandler = orgService.getMembershipHandler();
      GroupHandler groupHandler = orgService.getGroupHandler();
      Group group = groupHandler.findGroupById(groupId);
      if (group == null)
      {
         return new LazyListImpl();
      }
View Full Code Here


   public void onEvent(Event<UserDAOImpl, User> event) throws Exception
   {
      LOG.info("Create User Profile: " + event.getData().getUserName());
      UserProfile profile = service_.getUserProfileHandler().createUserProfileInstance(event.getData().getUserName());
      service_.getUserProfileHandler().saveUserProfile(profile, true);
      GroupHandler groupHandler = service_.getGroupHandler();
      Group g = groupHandler.findGroupById("/user");
      MembershipTypeHandler membershipTypeHandler = service_.getMembershipTypeHandler();
      MembershipType memberType = membershipTypeHandler.findMembershipType("member");

      if (g == null)
      {
         g = groupHandler.createGroupInstance();
         g.setGroupName("user");
         groupHandler.addChild(null, g, true);
      }
      if (memberType == null)
      {
         memberType = membershipTypeHandler.createMembershipTypeInstance();
         memberType.setName("member");
View Full Code Here

    public void setUIInputValue(Object input) {
        user_ = (String) input;
    }

    public void save(OrganizationService service, boolean broadcast) throws Exception {
        GroupHandler groupHandler = service.getGroupHandler();
        MembershipTypeHandler mtHandler = service.getMembershipTypeHandler();
        User user = service.getUserHandler().findUserByName(user_);
        for (Membership membership : membership_) {
            if (user == null)
                user = service.getUserHandler().findUserByName(membership.getUserName());
            Group group = groupHandler.findGroupById(membership.getGroupId());
            MembershipType mt = mtHandler.findMembershipType(membership.getMembershipType());
            if (service.getMembershipHandler() != null) {
                service.getMembershipHandler().linkMembership(user, group, mt, broadcast);
            }
        }
View Full Code Here

      if (LOG.isDebugEnabled())
      {
         LOG.debug("Remove all Child of Group: " + event.getData().getId());
      }

      GroupHandler membershipHanler = service_.getGroupHandler();
      List<Group> children = (List<Group>)membershipHanler.findGroups(event.getData());
      for (Group child : children)
      {
         membershipHanler.removeGroup(child, true);
      }
   }
View Full Code Here

   {
      if (LOG.isDebugEnabled())
         LOG.debug("+++++++++++FIND USER BY GROUP_ID " + groupId);

      MembershipHandler membershipHandler = orgService.getMembershipHandler();
      GroupHandler groupHandler = orgService.getGroupHandler();
      Group group = groupHandler.findGroupById(groupId);
      if (group == null)
      {
         return new LazyListImpl();
      }
View Full Code Here

      }
   }

   private void removeGroupNavigation(Group group) throws Exception
   {
      GroupHandler groupHandler = orgService.getGroupHandler();
      Collection<String> descendantGroups = getDescendantGroups(group, groupHandler);
      Collection<String> deletedNavigationGroups = new ArrayList<String>();
      deletedNavigationGroups.addAll(descendantGroups);
      deletedNavigationGroups.add(group.getId());
      for (String childGroup : deletedNavigationGroups)
View Full Code Here

      OrganizationService service = (OrganizationService) container
        .getComponentInstanceOfType(OrganizationService.class);

      // load user roles
      Collection tmpRoles = service.getGroupHandler().findGroupsOfUser(userId);
      GroupHandler groupHandler = service.getGroupHandler();
      SecurityProviderUtilities.debug(this.getClass(), "init", "Group Handler retrived " + groupHandler);
      MembershipHandler memberHandler = service.getMembershipHandler();
      SecurityProviderUtilities.debug(this.getClass(), "init", "Membership Handler retrived " + memberHandler);
      Group group = null;
      Matcher matcher = null;
View Full Code Here

      if (log.isDebugEnabled())
         log.debug("+++++++++++FIND USER BY GROUP_ID " + groupId);
      PortalContainer manager = PortalContainer.getInstance();
      OrganizationService service = (OrganizationService)manager.getComponentInstanceOfType(OrganizationService.class);
      MembershipHandler membershipHandler = service.getMembershipHandler();
      GroupHandler groupHandler = service.getGroupHandler();
      Group group = groupHandler.findGroupById(groupId);
      @SuppressWarnings("unchecked")
      List<Membership> members = (List<Membership>)membershipHandler.findMembershipsByGroup(group);

      DBObjectQuery dbQuery = new DBObjectQuery<UserImpl>(UserImpl.class);
      for (Membership member : members)
View Full Code Here

   public void onEvent(Event<UserDAOImpl, User> event) throws Exception
   {
      log.info("Create User Profile: " + event.getData().getUserName());
      UserProfile profile = service_.getUserProfileHandler().createUserProfileInstance(event.getData().getUserName());
      service_.getUserProfileHandler().saveUserProfile(profile, true);
      GroupHandler groupHandler = service_.getGroupHandler();
      Group g = groupHandler.findGroupById("/user");
      MembershipTypeHandler membershipTypeHandler = service_.getMembershipTypeHandler();
      MembershipType memberType = membershipTypeHandler.findMembershipType("member");

      if (g == null)
      {
         g = groupHandler.createGroupInstance();
         g.setGroupName("user");
         groupHandler.addChild(null, g, true);
      }
      if (memberType == null)
      {
         memberType = membershipTypeHandler.createMembershipTypeInstance();
         memberType.setName("member");
View Full Code Here

   @SuppressWarnings("unchecked")
   public void onEvent(Event<GroupDAOImpl, Group> event) throws Exception
   {
      log.info("Remove all Child of Group: " + event.getData().getId());
      GroupHandler membershipHanler = service_.getGroupHandler();
      List<Group> children = (List<Group>)membershipHanler.findGroups(event.getData());
      for (Group child : children)
      {
         membershipHanler.removeGroup(child, true);
      }
   }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.organization.GroupHandler

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.