com.ibm.tivoli.maximo.miniapps.treegrid

Class TreeGridUtil

  • java.lang.Object
    • com.ibm.tivoli.maximo.miniapps.treegrid.TreeGridUtil


  • public class TreeGridUtil
    extends java.lang.Object
    Static Methods that are useful for any TreeGrid implementation
    • Method Detail

      • toSerializedValue

        public static java.lang.Object toSerializedValue(java.lang.Object o,
                                                         TreeGridUtil.ITGSerializationHelper helper)
                                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • toTreeGridDate

        public static long toTreeGridDate(java.util.Date d,
                                          java.util.TimeZone tz)
        Used to convert from "Maximo" time to "TreeGrid" time where TreeGrid time does not use seconds, and it uses GMT-0
        Parameters:
        d - Date using TimeZone specified
        tz - User's TimeZone
        Returns:
      • toTreeGridUTCDate

        public static long toTreeGridUTCDate(java.util.Date d)
        Converts the date to UTC without accounting for TZ
        Parameters:
        d - Date
        Returns:
      • toMaximoDate

        public static java.util.Date toMaximoDate(long utcMillis)
        Converts the long to a UTC date without accounting for TZ. A Maximo Date is a Date that is in the TZ of the server. So this takes a UTC date created by toTreeGridUTCDate() and then converts it back to a Maximo date so that it's a UTC value but accounts for the TZ of maximo. It's complicated :(
        Parameters:
        d - Date
        Returns:
      • fromTreeGridDate

        public static java.util.Date fromTreeGridDate(long ms,
                                                      java.util.TimeZone tz)
        Convert a GMT-0 TreeGrid time into a Maximo Time
        Parameters:
        ms - TreeGrid's Time in MS
        tz - User's TimeZone
        Returns:
        Date in the User's TimeZone
      • loadLocaleResource

        public static com.ibm.json.java.JSONObject loadLocaleResource(java.util.Locale loc,
                                                                      MiniAppControl miniapp)
                                                               throws java.io.IOException,
                                                                      MXException
        Throws:
        java.io.IOException
        MXException
      • loadLocaleResource

        public static java.lang.String loadLocaleResource(java.lang.String loc,
                                                          boolean failonerror,
                                                          MiniAppControl miniapp)
                                                   throws java.io.IOException,
                                                          MXException
        Throws:
        java.io.IOException
        MXException
      • addCommonLangCFG

        public static void addCommonLangCFG(com.ibm.json.java.JSONObject root,
                                            UserInfo userInfo)
        Adds the default Formats based on the user's SKD locale object. It also forces the grid to use GMT0, since, TreeGrid can only use GMTO or the Browser's timezone... you cannot set a TimeZone.
        Parameters:
        root -
        userInfo -
        skdUIInfo -
      • updateTreeGridLangFormatForLocale

        public static void updateTreeGridLangFormatForLocale(com.ibm.json.java.JSONObject format,
                                                             UserInfo userInfo)
        Parameters:
        format -
        locale -
      • toStringArray

        public static java.lang.Object toStringArray(java.lang.String[] items)