Examples of OrganizationService


Examples of org.exoplatform.services.organization.OrganizationService

      {
         // Invalidate the captcha image
         PortalRequestContext prContext = Util.getPortalRequestContext();
         UIRegisterForm registerForm = event.getSource();
         OrganizationService orgService = registerForm.getApplicationComponent(OrganizationService.class);
         UserHandler userHandler = orgService.getUserHandler();
         WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
         UIRegisterInputSet registerInput = registerForm.getChild(UIRegisterInputSet.class);

         if (registerInput.save(userHandler, context))
         {
View Full Code Here

Examples of org.exoplatform.services.organization.OrganizationService

      @Override
      public void execute(Event<UIRegisterForm> event) throws Exception
      {
         UIRegisterForm registerForm = event.getSource();
         OrganizationService orgService = registerForm.getApplicationComponent(OrganizationService.class);
         UIRegisterInputSet registerInput = registerForm.getChild(UIRegisterInputSet.class);
         UIFormStringInput userNameInput = registerInput.getUIStringInput(UIRegisterInputSet.USER_NAME);
         MandatoryValidator validator = new MandatoryValidator();
         try
         {
View Full Code Here

Examples of org.exoplatform.services.organization.OrganizationService

   {
      public void execute(Event<UIListUsers> event) throws Exception
      {
         String username = event.getRequestContext().getRequestParameter(OBJECTID);
         UIListUsers uiListUsers = event.getSource();
         OrganizationService service = uiListUsers.getApplicationComponent(OrganizationService.class);
         if (service.getUserHandler().findUserByName(username) == null)
         {
            uiListUsers.search(new Query());
            return;
         }
         uiListUsers.setRendered(false);
View Full Code Here

Examples of org.exoplatform.services.organization.OrganizationService

   {
      public void execute(Event<UIListUsers> event) throws Exception
      {
         UIListUsers uiListUser = event.getSource();
         String userName = event.getRequestContext().getRequestParameter(OBJECTID);
         OrganizationService service = uiListUser.getApplicationComponent(OrganizationService.class);
         UserACL userACL = uiListUser.getApplicationComponent(UserACL.class);
         if (userACL.getSuperUser().equals(userName))
         {
            UIApplication uiApp = event.getRequestContext().getUIApplication();
            uiApp.addMessage(new ApplicationMessage("UIListUsers.msg.DeleteSuperUser", new String[]{userName},
               ApplicationMessage.WARNING));
            return;
         }
         UIPageIterator pageIterator = uiListUser.getChild(UIGrid.class).getUIPageIterator();
         int currentPage = pageIterator.getCurrentPage();
         service.getUserHandler().removeUser(userName, true);
         uiListUser.search(uiListUser.lastQuery_);
         while (currentPage > pageIterator.getAvailablePage())
            currentPage--;
         pageIterator.setCurrentPage(currentPage);
         UIComponent uiToUpdateAjax = uiListUser.getAncestorOfType(UIUserManagement.class);
View Full Code Here

Examples of org.exoplatform.services.organization.OrganizationService

         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

Examples of org.exoplatform.services.organization.OrganizationService

      public void execute(Event<UIListMembershipType> event) throws Exception
      {
         UIListMembershipType uiMembership = event.getSource();
         String name = event.getRequestContext().getRequestParameter(OBJECTID);

         OrganizationService service = uiMembership.getApplicationComponent(OrganizationService.class);
         MembershipType mt = service.getMembershipTypeHandler().findMembershipType(name);
         if(mt.getDescription()==null)
         {
            mt.setDescription("");
         }
         UIMembershipManagement uiMembershipManager = uiMembership.getParent();
View Full Code Here

Examples of org.exoplatform.services.organization.OrganizationService

            UIApplication uiApp = event.getRequestContext().getUIApplication();
            uiApp.addMessage(new ApplicationMessage("UIMembershipList.msg.DeleteMandatory", null));
            return;
         }

         OrganizationService service = uiMembership.getApplicationComponent(OrganizationService.class);
         MembershipType membershipType = service.getMembershipTypeHandler().findMembershipType(name);
         UIPageIterator pageIterator = uiMembership.getChild(UIGrid.class).getUIPageIterator();
         int currentPage = -1;
         if (membershipType != null)
         {
            currentPage = pageIterator.getCurrentPage();
            service.getMembershipTypeHandler().removeMembershipType(name, true);
            membership.deleteOptions(membershipType);
         }
         uiMembership.loadData();
         if (currentPage >= 0)
         {
View Full Code Here

Examples of org.exoplatform.services.organization.OrganizationService

   @Override
   protected ListAccess<Membership> create(String state) throws Exception
   {
      ExoContainer container = PortalContainer.getInstance();
      OrganizationService service = (OrganizationService)container.getComponentInstance(OrganizationService.class);
      MembershipHandler handler = service.getMembershipHandler();
      Group group = service.getGroupHandler().findGroupById(state);
      List<Membership> memberships = (List<Membership>)handler.findMembershipsByGroup(group);
      return new ListAccessImpl<Membership>(Membership.class, memberships);
   }
View Full Code Here

Examples of org.exoplatform.services.organization.OrganizationService

   @SuppressWarnings("unchecked")
   public UIGroupExplorer() throws Exception
   {
      UITree tree = addChild(UITree.class, null, "TreeGroupExplorer");
      OrganizationService service = getApplicationComponent(OrganizationService.class);
      sibblingsGroup_ = service.getGroupHandler().findGroups(null);

      //  if not administrator
      if (!GroupManagement.isAdministrator(null))
         sibblingsGroup_ = GroupManagement.getRelatedGroups(null, sibblingsGroup_);
View Full Code Here

Examples of org.exoplatform.services.organization.OrganizationService

   }

   @SuppressWarnings("unchecked")
   public void changeGroup(String groupId) throws Exception
   {
      OrganizationService service = getApplicationComponent(OrganizationService.class);

      UIGroupManagement uiGroupManagement = this.getParent();
      UIBreadcumbs uiBreadcumb = uiGroupManagement.getChild(UIBreadcumbs.class);
      uiBreadcumb.setPath(getPath(null, groupId));

      UITree uiTree = getChild(UITree.class);
      UIGroupDetail uiGroupDetail = uiGroupManagement.getChild(UIGroupDetail.class);
      UIGroupInfo uiGroupInfo = uiGroupDetail.getChild(UIGroupInfo.class);

      if (groupId == null)
      {
         sibblingsGroup_ = service.getGroupHandler().findGroups(null);
         //    if not administrator
         if (!GroupManagement.isAdministrator(null))
            sibblingsGroup_ = GroupManagement.getRelatedGroups(null, sibblingsGroup_);
         uiTree.setSibbling((List)convertGroups(sibblingsGroup_));
         uiTree.setSelected(null);
         uiTree.setChildren(null);
         uiTree.setParentSelected(null);
         selectedGroup_ = null;
         uiGroupInfo.setGroup(null);
         return;
      }

      if (groupId != null)
      {
         selectedGroup_ = service.getGroupHandler().findGroupById(groupId);
      }
      else
      {
         selectedGroup_ = null;
      }

      String parentGroupId = null;
      if (selectedGroup_ != null)
         parentGroupId = selectedGroup_.getParentId();
      Group parentGroup = null;
      if (parentGroupId != null)
         parentGroup = service.getGroupHandler().findGroupById(parentGroupId);
      childrenGroup_ = service.getGroupHandler().findGroups(selectedGroup_);
      sibblingsGroup_ = service.getGroupHandler().findGroups(parentGroup);

      // if not administrator
      if (!GroupManagement.isAdministrator(null))
      {
         childrenGroup_ = GroupManagement.getRelatedGroups(null, childrenGroup_);
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.