eXo Platform 4.0 Documentation > Developer Guide > Managing Your Organization

7.2. Working with organization API

Prerequisites

To use the OrganizationService API, you need to:

eXo Platform manages identification and authorization with the entities packaged in org.exoplatform.services.organization, including user, user profile, group, membership type (also known as "role"), and membership. See more about these entities in the Organization API.

You can take handlers corresponding to the entities by using OrganizationService as follows:

/** .*/

  private UserHandler userHandler;
  /** .*/
  private UserProfileHandler profileHandler;
  /** .*/
  private GroupHandler groupHandler;
  /** .*/
  private MembershipHandler membershipHandler;
  /** .*/
  private MembershipTypeHandler membershipTypeHandler;
  @Override
  public void init(PortletConfig config) throws PortletException{
    super.init(config);
    PortalContainer container = PortalContainer.getInstance();
    OrganizationService orgService = (OrganizationService)container.getComponentInstanceOfType(OrganizationService.class);
    userHandler = orgService.getUserHandler();
    profileHandler = orgService.getUserProfileHandler();
    groupHandler = orgService.getGroupHandler();
    membershipHandler = orgService.getMembershipHandler();
    membershipTypeHandler = orgService.getMembershipTypeHandler();
  }
Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus