Package org.exoplatform.services.organization

Examples of org.exoplatform.services.organization.Group


      for (org.picketlink.idm.api.Group group : plGroups)
      {
         if (!group.equals(root))
         {
            Group g = convertGroup(group);

            // If membership of mapped types is forced then we need to exclude those that are not direct child
            if (orgService.getConfiguration().isForceMembershipOfMappedTypes())
            {
               String id = g.getParentId();
               if ((parent == null && id == null)
                   || (id != null && id.equals(parent.getId())))
               {
                  exoGroups.add(g);
                  continue;
View Full Code Here


      if (!(o instanceof Group))
      {
         return 0;
      }

      Group group = (Group)o;

      return groupName.compareTo(group.getGroupName());

   }
View Full Code Here

      HashSet<MembershipImpl> memberships = new HashSet<MembershipImpl>();

      for (Role role : roles)
      {
         MembershipImpl m = new MembershipImpl();
         Group g = ((GroupDAOImpl)orgService.getGroupHandler()).convertGroup(role.getGroup());
         m.setGroupId(g.getId());
         m.setUserName(role.getUser().getId());
         m.setMembershipType(role.getRoleType().getName());
         memberships.add(m);

         if (broadcast)
View Full Code Here

      for (Role role : roles)
      {
         if (isCreateMembership(role.getRoleType().getName()))
         {
            MembershipImpl m = new MembershipImpl();
            Group g = ((GroupDAOImpl)orgService.getGroupHandler()).convertGroup(role.getGroup());
            m.setGroupId(g.getId());
            m.setUserName(role.getUser().getId());
            m.setMembershipType(role.getRoleType().getName());
            memberships.add(m);
         }
      }
     
      if (isAssociationMapped())
      {

         Collection<org.picketlink.idm.api.Group> groups = new HashSet();

         try
         {
            groups = getIdentitySession().getRelationshipManager().findAssociatedGroups(userName, null);
         }
         catch (Exception e)
         {
            //TODO:
            log.info("Identity operation error: ", e);

         }

         for (org.picketlink.idm.api.Group group : groups)
         {
            MembershipImpl m = new MembershipImpl();
            Group g = ((GroupDAOImpl)orgService.getGroupHandler()).convertGroup(group);
            m.setGroupId(g.getId());
            m.setUserName(userName);
            m.setMembershipType(getAssociationMapping());
            memberships.add(m);
         }
                
View Full Code Here

      for (Role role : roles)
      {
         if (isCreateMembership(role.getRoleType().getName()))
         {
            MembershipImpl m = new MembershipImpl();
            Group g = ((GroupDAOImpl)orgService.getGroupHandler()).convertGroup(role.getGroup());
            m.setGroupId(g.getId());
            m.setUserName(role.getUser().getId());
            m.setMembershipType(role.getRoleType().getName());
            memberships.add(m);
         }
      }
View Full Code Here

            String groupName = "groupTest";
            assertNull(storage_.getPortalConfig(PortalConfig.GROUP_TYPE, groupName));

            //
            GroupHandler groupHandler = orgService_.getGroupHandler();
            Group group = groupHandler.createGroupInstance();
            group.setGroupName(groupName);
            group.setDescription("this is a group for test");
            groupHandler.addChild(null, group, true);

            //
            PortalConfig cfg = storage_.getPortalConfig(PortalConfig.GROUP_TYPE, "/" + groupName);
            assertNotNull(cfg);
View Full Code Here

   }

   public void testGroupLayout() throws Exception
   {
      GroupHandler groupHandler = org.getGroupHandler();
      Group group = groupHandler.findGroupById("groupTest");
      assertNull(group);

      group = groupHandler.createGroupInstance();
      group.setGroupName("groupTest");
      group.setLabel("group label");

      groupHandler.addChild(null, group, true);

      group = groupHandler.findGroupById("/groupTest");
      assertNotNull(group);
View Full Code Here

      {
         confirm = context.getApplicationResourceBundle().getString(confirm);
         MembershipUser membershipUser = uiGrid.searchMembershipUser(beanId);
         if (membershipUser == null)
            return confirm;
         Group selectGroup = getSelectedGroup();
         if (selectGroup == null)
            return confirm;
         confirm = confirm.replaceAll("\\{0\\}", membershipUser.getUserName());
         confirm = confirm.replaceAll("\\{1\\}", selectGroup.getId().substring(1));
      }
      catch (Exception e)
      {

      }
View Full Code Here

         UIApplication uiApp = context.getUIApplication();

         UIGroupDetail uiGroupDetail = uiGroupManagement.getChild(UIGroupDetail.class);
         UIGroupExplorer uiGroupExplorer = uiGroupManagement.getChild(UIGroupExplorer.class);

         Group currentGroup = uiGroupExplorer.getCurrentGroup();
         if (currentGroup == null)
         {
            uiApp.addMessage(new ApplicationMessage("UIGroupManagement.msg.Edit", null));
            return;
         }
View Full Code Here

      {
         UIGroupManagement uiGroupManagement = event.getSource();
         WebuiRequestContext context = event.getRequestContext();
         UIApplication uiApp = context.getUIApplication();
         UIGroupExplorer uiGroupExplorer = uiGroupManagement.getChild(UIGroupExplorer.class);
         Group currentGroup = uiGroupExplorer.getCurrentGroup();
         if (currentGroup == null)
         {
            uiApp.addMessage(new ApplicationMessage("UIGroupManagement.msg.Edit", null));
            return;
         }
         UIGroupForm groupForm = uiGroupManagement.findFirstComponentOfType(UIGroupForm.class);
         if (groupForm.getGroupId() != null)
         {
            uiApp.addMessage(new ApplicationMessage("UIGroupManagement.msg.Delete", null));
            return;
         }
         OrganizationService service = uiGroupManagement.getApplicationComponent(OrganizationService.class);
         UserACL acl = uiGroupManagement.getApplicationComponent(UserACL.class);
         List<String> mandatories = acl.getMandatoryGroups();
         if (!mandatories.isEmpty() && isMandatory(service.getGroupHandler(), currentGroup, mandatories))
         {
            uiApp.addMessage(new ApplicationMessage("UIGroupManagement.msg.DeleteMandatory", null));
            return;
         }
         String parentId = currentGroup.getParentId();
         service.getGroupHandler().removeGroup(currentGroup, true);
         uiGroupExplorer.changeGroup(parentId);
      }
View Full Code Here

TOP

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

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.