Class AuthorizableUtil


  • public class AuthorizableUtil
    extends java.lang.Object
    AuthorizableUtil...
    • Constructor Detail

      • AuthorizableUtil

        public AuthorizableUtil()
    • Method Detail

      • getName

        @Deprecated
        public static java.lang.String getName​(Authorizable authorizable)
                                        throws RepositoryException
        Deprecated.
        since AEM6.4 because it is not multiple profile aware. Please use getFormattedName(ResourceResolver, Authorizable)
        Utility to retrieve the name of an authorizable that takes deprecated user properties such as present in older versions if CQ into account.
        Parameters:
        authorizable - the authorizable
        Returns:
        the name of the specified authorizable
        Throws:
        RepositoryException - in case of a failure
      • getFormattedName

        public static java.lang.String getFormattedName​(ResourceResolver resolver,
                                                        java.lang.String userId)
        Utility to retrieve the formatted name of a user. Always use the faster getFormattedName(ResourceResolver, Authorizable) if possible.
        Parameters:
        resolver - Resource resolver to use to get the UserPropertiesManager
        userId - ID of the user to get the display name from
        Returns:
        User's display name or its id if an error occurred
      • getFormattedName

        public static java.lang.String getFormattedName​(ResourceResolver resolver,
                                                        Authorizable authorizable)
        Utility to retrieve the formatted name of a user.
        Parameters:
        resolver - Resource resolver to use to get the UserPropertiesManager
        authorizable - the authorizable
        Returns:
        User's display name or its id if an error occurred
      • getFormattedName

        public static java.lang.String getFormattedName​(ResourceResolver resolver,
                                                        java.lang.String userId,
                                                        java.lang.String nameDisplayOrder)
        Utility to retrieve the formatted name of a user. Always use the faster getFormattedName(ResourceResolver, Authorizable, String) if possible.
        Parameters:
        resolver - Resource resolver to use to get the UserPropertiesManager
        userId - ID of the user to get the display name from
        nameDisplayOrder - Order of given, middle and family names. Western name order should be "givenName middleName familyName", Eastern name order should be "familyName givenName middleName".
        Returns:
        User's display name or its id if an error occurred
      • getFormattedName

        public static java.lang.String getFormattedName​(ResourceResolver resolver,
                                                        Authorizable authorizable,
                                                        java.lang.String nameDisplayOrder)
        Utility to retrieve the formatted name of a user
        Parameters:
        resolver - Resource resolver to use to get the UserPropertiesManager
        authorizable - the authorizable
        nameDisplayOrder - Order of given, middle and family names. Western name order should be "givenName middleName familyName", Eastern name order should be "familyName givenName middleName".
        Returns:
        User's display name or its id if an error occurred