OrganizationsUtil (Custom Portal Handler 1.8.0-3.10.0 API)
Date: 2016-02-09

org.gcube.portal.custom.communitymanager

## Class OrganizationsUtil

- java.lang.Object
- - org.gcube.portal.custom.communitymanager.OrganizationsUtil

- Direct Known Subclasses:
    CommunityManagerImpl, OrganizationManagerImpl

      public class OrganizationsUtil
      extends Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEFAULT_COMPANY_WEB_ID`
    `static String` | `ROOT_ORG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OrganizationsUtil()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static com.liferay.portal.model.Role` | `addManagerRole(String vreName, String username)` Create a Regular Manager Role for the community/Organization
    `static com.liferay.portal.model.Role` | `addManagerRole(String roleName, String vreName, long userid)` Create a Regular Manager Role for the community/Organization
    `boolean` | `addUserToGroup(long groupid, String username)`
    `protected static long` | `createLayout(com.liferay.portal.model.Group group, com.liferay.portal.model.User user, GCUBESiteLayout siteLayout)` Use this method to associate a layout to a Group (whether organization or community)
    `protected static com.liferay.portal.model.Role` | `createRole(String roleName, String vreName, long userid)` Create a Regular Manager Role for the community
    `static com.liferay.portal.model.Company` | `getCompany()` return the companyId
    `static String` | `getDefaultCompanyWebId()`
    `List<GCUBEPortlet>` | `getDefaultPortlets()`
    `static String` | `getgCubeThemeId(String themeid)` get the themes id for from the property file
    `static String` | `getRootOrganizationName()` read the root VO name from a property file and retuns it
    `static String` | `getTomcatFolder()`
    `protected List<GCUBEPortlet>` | `getVREBelongingPortlets(List<String> belongingPorltets)`
    `static com.liferay.portal.model.User` | `validateUser(String username)` check if the user exists in the database and has AuthZ to perform the operation

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_COMPANY_WEB_ID

          public static final String DEFAULT_COMPANY_WEB_ID

      See Also:
        Constant Field Values

    - #### ROOT_ORG

          public static final String ROOT_ORG

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### OrganizationsUtil

          public OrganizationsUtil()

  - ### Method Detail

    - #### getCompany

          public static com.liferay.portal.model.Company getCompany()
                                                             throws com.liferay.portal.kernel.exception.PortalException,
                                                                    com.liferay.portal.kernel.exception.SystemException

      return the companyId
      Parameters:
        `webId` - .
      Returns:
        the company bean
      Throws:
        `com.liferay.portal.kernel.exception.PortalException` - .
        `com.liferay.portal.kernel.exception.SystemException` - .

    - #### getDefaultCompanyWebId

          public static String getDefaultCompanyWebId()

      Returns:
        the default company web-id (e.g. iMarine.eu)

    - #### getTomcatFolder

          public static String getTomcatFolder()

      Returns:
        $CATALINA_HOME

    - #### getgCubeThemeId

          public static String getgCubeThemeId(String themeid)

      get the themes id for from the property file
      Parameters:
        `themeid` - see org.gcube.portal.custom.communitymanager.ThemesIdManager
      Returns:
        the themeid for LR

    - #### getVREBelongingPortlets

          protected List<GCUBEPortlet> getVREBelongingPortlets(List<String> belongingPorltets)

      Returns:
        -

    - #### getDefaultPortlets

          public List<GCUBEPortlet> getDefaultPortlets()

      Returns:
        the default template for a community (just one Tab)

    - #### addManagerRole

          public static com.liferay.portal.model.Role addManagerRole(String vreName,
                                                     String username)
                                                              throws com.liferay.portal.kernel.exception.PortalException,
                                                                     com.liferay.portal.kernel.exception.SystemException

      Create a Regular Manager Role for the community/Organization
      Parameters:
        `vreName` -
      Returns:
      Throws:
        `com.liferay.portal.kernel.exception.SystemException`
        `com.liferay.portal.kernel.exception.PortalException`

    - #### addManagerRole

          public static com.liferay.portal.model.Role addManagerRole(String roleName,
                                                     String vreName,
                                                     long userid)
                                                              throws com.liferay.portal.kernel.exception.PortalException,
                                                                     com.liferay.portal.kernel.exception.SystemException

      Create a Regular Manager Role for the community/Organization
      Parameters:
        `vreName` -
      Returns:
      Throws:
        `com.liferay.portal.kernel.exception.SystemException`
        `com.liferay.portal.kernel.exception.PortalException`

    - #### validateUser

          public static com.liferay.portal.model.User validateUser(String username)
                                                            throws com.liferay.portal.kernel.exception.PortalException,
                                                                   com.liferay.portal.kernel.exception.SystemException

      check if the user exists in the database and has AuthZ to perform the operation
      Returns:
      Throws:
        `com.liferay.portal.kernel.exception.SystemException`
        `com.liferay.portal.kernel.exception.PortalException`

    - #### createLayout

          protected static long createLayout(com.liferay.portal.model.Group group,
                          com.liferay.portal.model.User user,
                          GCUBESiteLayout siteLayout)
                                      throws com.liferay.portal.kernel.exception.PortalException,
                                             com.liferay.portal.kernel.exception.SystemException

      Use this method to associate a layout to a Group (whether organization or community)
      Parameters:
        `group` - .
        `user` - .
        `siteLayout` - .
      Returns:
        the layoutid of the yet created layout
      Throws:
        `com.liferay.portal.kernel.exception.PortalException` - .
        `com.liferay.portal.kernel.exception.SystemException` - .

    - #### addUserToGroup

          public boolean addUserToGroup(long groupid,
                               String username)

      Parameters:
        `groupid` - the groupid of the organization
        `username` -
      Returns:

    - #### createRole

          protected static com.liferay.portal.model.Role createRole(String roleName,
                                                 String vreName,
                                                 long userid)

      Create a Regular Manager Role for the community
      Parameters:
        `vreName` -
      Returns:
      Throws:
        `com.liferay.portal.kernel.exception.PortalException`
        `com.liferay.portal.kernel.exception.SystemException`

    - #### getRootOrganizationName

          public static String getRootOrganizationName()

      read the root VO name from a property file and retuns it

Copyright © 2016. All Rights Reserved.