Class LocalizedStringTable

java.lang.Object
com.portal.pcm.LocalizedStringTable

public class LocalizedStringTable extends Object
The LocalizedStringTable class is used to access server side localized message strings. This class will maintain a cache of read data, so the database is not hit repeatedly for multiple requests.
  • Constructor Details

    • LocalizedStringTable

      public LocalizedStringTable()
      Create an instance of the LocalizedStringTable class
  • Method Details

    • getInstance

      public static LocalizedStringTable getInstance()
      Get a shared instance of the LocalizedStringTable. This maximizes the sharing of cached data.
      Returns:
      An instance of the LocalizedStringTable
    • lookupEntry

      public LocalizedStringTable.Entry lookupEntry(PortalContext ctx, String domain, String locale, int id, int version)
      Gen an individual StringTabe Entry for a specified Domain and Locale This method uses the chache.
      Parameters:
      ctx - A PortalContext. This is needed to get data from the database, if the cache doesn't have it.
      domain - The Domain of strings to look in. Examples are: 'Errors' or 'ReasonCodes'
      locale - The Locale to get message for. This should follow the Un*x / Java standard
      id - The actual message ID to get string info for
      version - the version of the entry to get.
      Returns:
      A LocalizedStringTable.Entry containing the message, help text (if any), and other information
    • lookupLatestEntryByID

      public LocalizedStringTable.Entry lookupLatestEntryByID(PortalContext ctx, String domain, String locale, int id)
      Gen an individual StringTabe Entry for a specified Domain and Locale This method uses the chache. Returns the latest version of the string.
      Parameters:
      ctx - A PortalContext. This is needed to get data from the database, if the cache doesn't have it.
      domain - The Domain of strings to look in. Examples are: 'Errors' or 'ReasonCodes'
      locale - The Locale to get message for. This should follow the Un*x / Java standard
      id - The actual message ID to get string info for
      Returns:
      A LocalizedStringTable.Entry containing the message, help text (if any), and other information. Returns null if not found.
    • lookupLatestEntryByMessage

      public LocalizedStringTable.Entry lookupLatestEntryByMessage(PortalContext ctx, String domain, String locale, String message)
      Gen an individual StringTabe Entry for a specified Domain and Locale This method uses the chache. Returns the latest version of the string.
      Parameters:
      ctx - A PortalContext. This is needed to get data from the database, if the cache doesn't have it.
      domain - The Domain of strings to look in. Examples are: 'Errors' or 'ReasonCodes'
      locale - The Locale to get message for. This should follow the Un*x / Java standard
      message - The message string to find.
      Returns:
      A LocalizedStringTable.Entry containing the message, help text (if any), and other information. Returns null if not found.
    • lookupEntriesFor

      public LocalizedStringTable.Entry[] lookupEntriesFor(PortalContext ctx, String domain, String locale)
      Gen an array of StringTabe Entries for a specified Domain and Locale This method looks in the cache before going to the database, and caches the results.
      Parameters:
      ctx - A PortalContext. This is needed to get data from the database, if the cache doesn't have it.
      domain - The Domain of strings to look in. Examples are: 'Errors' or 'ReasonCodes'
      locale - The Locale to get message for. This should follow the Un*x / Java standard
      Returns:
      An array of LocalizedStringTable.Entry containing the message, help text (if any), and other information
    • getEntriesFor

      public LocalizedStringTable.Entry[] getEntriesFor(PortalContext ctx, String domain, String locale, Integer version, Integer id)
      Do a database search for Stringtable Entries matching the specified criteria. This method does not look in the cache. If null is specified for a parameter, that parameter is not used in the search.
      Parameters:
      ctx - A PortalContext. This is needed to get data from the database, if the cache doesn't have it.
      domain - The Domain of strings to look in. Examples are: 'Errors' or 'ReasonCodes'. Can contain SQL wildcard
      locale - The Locale to get message for. This should follow the Un*x / Java standard Can contain SQL wildcard
      version - The message version to look for.
      id - A specific ID to look for.
      Returns:
      An array of LocalizedStringTable.Entry containing the message, help text (if any), and other information