Class AMFormatUtils

    • Constructor Detail

      • AMFormatUtils

        public AMFormatUtils()
    • Method Detail

      • sortItems

        public static List sortItems​(Collection collection,
                                     Locale locale)
        Sorts items in a set.
        Parameters:
        collection - to sort.
        locale - of user.
        Returns:
        list of sorted items.
      • reverseStringMap

        public static Map reverseStringMap​(Map map)
        Reverses key to value String-String map i.e. key of map becomes the value; and value becomes key for each entry.
        Parameters:
        map - Map to reverse.
        Returns:
        reversed map.
      • sortKeyInMap

        public static List sortKeyInMap​(Map map,
                                        Locale locale)
        Sorts keys in a map.
        Parameters:
        map - to sort.
        locale - of user.
        Returns:
        a list of sorted keys.
      • getSortedOptionList

        public static com.iplanet.jato.view.html.OptionList getSortedOptionList​(Map map,
                                                                                Locale locale)
        Returns an option list of sorted label.
        Parameters:
        map - Map of value to its label.
        locale - Locale of user.
        Returns:
        an option list of sorted label.
      • DNToName

        public static String DNToName​(AMModel model,
                                      String dn)
        Gets relative distinguished name
        Parameters:
        model - the model used to resolve localized strings
        dn - - distinguished name
        Returns:
        name of relative distinguished name
      • sortMapByValue

        public static List sortMapByValue​(Map map,
                                          Locale locale)
        Sorts keys in a map ordered by its value (String).
        Parameters:
        map - to sort
        locale - of user
        Returns:
        a list of sorted keys
      • replaceString

        public static String replaceString​(String originalString,
                                           String token,
                                           String newString)
        Replaces a string with another string in a String object.
        Parameters:
        originalString - original String.
        token - string to be replaced.
        newString - new string to replace token.
        Returns:
        a String object after replacement.
      • toCommaSeparatedFormat

        public static String toCommaSeparatedFormat​(Set set)
        Returns a string of comma separated strings that are contained in a set.
        Parameters:
        set - Set of strings.
      • getIdentityDisplayName

        public static String getIdentityDisplayName​(AMModel model,
                                                    String universalId)
        Returns the display name of an AMIdentity. a dispalyable format. For example: cn=Static-1_ou=Groups_dc=sun_dc=com would be dispalyed as Static-1 Administrator This will be used by the Privileges tab and Entity Subject tab views.
        Parameters:
        model - handle to AMModel interface.
        universalId - Universal Id of Entity object.
        Returns:
        the display name of an AMIdentity.
      • getIdentityDisplayName

        public static String getIdentityDisplayName​(AMModel model,
                                                    AMIdentity entity)
        Returns the display name of an AMIdentity. a dispalyable format. For example: cn=Static-1_ou=Groups_dc=sun_dc=com would be dispalyed as Static-1 Administrator This will be used by the Privileges tab and Entity Subject tab views.
        Parameters:
        model - handle to AMModel interface.
        entity - Entity object.
        Returns:
        the display name of an AMIdentity.