LoginServiceUtil (gCube Bundle Login Portlet 2.0.0-SNAPSHOT API)
Date: 2014-05-10

org.gcube.portlets.user.gcubelogin.server

## Class LoginServiceUtil

- java.lang.Object
- - org.gcube.portlets.user.gcubelogin.server.LoginServiceUtil

-     public class LoginServiceUtil
      extends Object

  Version:
    2.0 Jan 10th 2012
  Author:
    Massimiliano Assante ISTI-CNR

- - ### Field Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LoginServiceUtil()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addMembershipRequest(String username, VO rootVO, String scope, String optionalMessage, String portalbasicurl, String gatewayName)`
    `protected static void` | `addPropertyDefaultLandingPageAndTheme(boolean automaticRedirect, SelectedTheme theme)` add a property to gcube-data.properties for root vo
    `protected static void` | `appendRootOrganizationName(String rootVoName)` add a property to gcube-data.properties for root vo, it make the login portlet understand the installation was setup already
    `protected static boolean` | `checkPending(String screenName, long organizationId)`
    `protected static ArrayList<CheckResult>` | `checkScope(String scopename)`
    `protected static Boolean` | `checkVresPresence(String scopename)`
    `static Boolean` | `createAdministratorAccountAndAssignRoles(long creatorUserId, String email, String password, String firstname, String lastname)` this method create a user and assigns the role Administrator to this user, also assigns the VO-ADMIN role or VRE-Manager for each VO/VRE present in the infrastructure
    `protected static ArrayList<String>` | `getAdministratorsEmails(String scope)`
    `protected static ArrayList<VO>` | `getFakeVOs()` simply returns fake VOS for debugging purpose
    `protected static String` | `getRootOrganizationName()` read the root VO name from a property file and retuns it
    `protected static ArrayList<VRE>` | `getVREsFromInfrastructure(String scopename)`
    `protected static boolean` | `setupGuestCommunity(SelectedTheme theme)`

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

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

- - ### Field Detail

    - #### ROOT_ORG

          public static final String ROOT_ORG

      See Also:
        Constant Field Values

    - #### PUBLIC_LAYOUT_NAME

          public static final String PUBLIC_LAYOUT_NAME

      See Also:
        Constant Field Values

    - #### GUEST_COMMUNITY_NAME

          public static final String GUEST_COMMUNITY_NAME

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### LoginServiceUtil

          public LoginServiceUtil()

  - ### Method Detail

    - #### setupGuestCommunity

          protected static boolean setupGuestCommunity(SelectedTheme theme)
                                                throws com.liferay.portal.kernel.exception.PortalException,
                                                       com.liferay.portal.kernel.exception.SystemException

      Returns:
        true if the setup is performed correctly
      Throws:
        `com.liferay.portal.kernel.exception.PortalException` - .
        `com.liferay.portal.kernel.exception.SystemException` - .

    - #### checkPending

          protected static boolean checkPending(String screenName,
                             long organizationId)

      Parameters:
        `screenName` -
        `organizatioId` -
      Returns:

    - #### addPropertyDefaultLandingPageAndTheme

          protected static void addPropertyDefaultLandingPageAndTheme(boolean automaticRedirect,
                                                   SelectedTheme theme)

      add a property to gcube-data.properties for root vo

    - #### appendRootOrganizationName

          protected static void appendRootOrganizationName(String rootVoName)

      add a property to gcube-data.properties for root vo, it make the login portlet understand the installation was setup already
      Parameters:
        `rootVoName` - .

    - #### getRootOrganizationName

          protected static String getRootOrganizationName()

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

    - #### getFakeVOs

          protected static ArrayList<VO> getFakeVOs()

      simply returns fake VOS for debugging purpose
      Returns:

    - #### getAdministratorsEmails

          protected static ArrayList<String> getAdministratorsEmails(String scope)

    - #### addMembershipRequest

          public static void addMembershipRequest(String username,
                                  VO rootVO,
                                  String scope,
                                  String optionalMessage,
                                  String portalbasicurl,
                                  String gatewayName)

      Parameters:
        `scope` - .
        `optionalMessage` - .

    - #### checkScope

          protected static ArrayList<CheckResult> checkScope(String scopename)

      Parameters:
        `scope` - pass a scope without "/"
      Returns:
        ArrayList containing the result for the test done

    - #### checkVresPresence

          protected static Boolean checkVresPresence(String scopename)

      Parameters:
        `scopename` - a string
      Returns:
        true if any VRE Exists

    - #### getVREsFromInfrastructure

          protected static ArrayList<VRE> getVREsFromInfrastructure(String scopename)

      Parameters:
        `scopename` - a string
      Returns:
        an arraylist of VRE with just name and description filled

    - #### createAdministratorAccountAndAssignRoles

          public static Boolean createAdministratorAccountAndAssignRoles(long creatorUserId,
                                                         String email,
                                                         String password,
                                                         String firstname,
                                                         String lastname)
                                                                  throws Exception

      this method create a user and assigns the role Administrator to this user, also assigns the VO-ADMIN role or VRE-Manager for each VO/VRE present in the infrastructure
      Throws:
        `com.liferay.portal.kernel.exception.SystemException`
        `com.liferay.portal.kernel.exception.PortalException`
        `Exception`

Copyright © 2014. All Rights Reserved.