Class CCCompatibilityUtility

java.lang.Object
com.portal.app.cc.comp.CCCompatibilityUtility

public class CCCompatibilityUtility extends Object
A wrapper class around existing API used in Customer Center. By going through this API instead of through the standard BAS API you minimize any chance of breakage between this release and any future major releases. As we continue to evolve our Java framework, there is a remote chance that packages may change and API may move around. If you use the API available here, we will be able to change the implementation without breaking you.
Version:
%version: 2 % %date_modified: Tue Jan 22 16:31:59 2002 %
Author:
kapono
  • Constructor Details

    • CCCompatibilityUtility

      public CCCompatibilityUtility()
  • Method Details

    • getCustomerCenterContext

      public static CustomerCenterContext getCustomerCenterContext()
      Retrieves the context for Customer Center
      Returns:
      The Customer Center context instance
    • getTopFrame

      public static JFrame getTopFrame()
      Retrieves the topmost Frame used by Customer Center. Users should always retrieve this - do not cache it.
      Returns:
      The JFrame wrapping Customer Center.
    • getConnection

      public static PortalContext getConnection()
      Retrieves the main Portal connection used by Customer Center
      Returns:
      The PortalContext which represents the open Portal connection
    • loadImage

      public static ImageIcon loadImage(URL u)
      Convenience API to retrieve an ImageIcon from the given URL
      Parameters:
      u - The URL of the image data
      Returns:
      A new ImageIcon
    • loadImage

      public static ImageIcon loadImage(String name)
      Load an ImageIcon from a supplied location string
      Parameters:
      name - The file name of the image data. An assumption is made that this file is located with other Java resources so the name should be package reletive. I.E> "foo.gif" or "com/portal/myapp/foo.gif"
      Returns:
      A new ImageIcon
    • getProperties

      public static Properties getProperties()
      Retrieves the global Properties object combining default properties and any customized properties (specified via the CC SDK).
      Returns:
      The global Properties object
    • getUserPreferences

      public static Properties getUserPreferences()
      Get the user UI preferences. Only valid after successful login
      Returns:
      the Properties object containing the user's preferences
    • getResources

      public static ResourceBundle getResources()
      Retrieves the global resource bundle object combining default strings and any customized resources (specified via the CC SDK).
      Returns:
      The global Properties object
    • getResource

      public static String getResource(String base, String tag)
      Get a specific resource. If not present, the resource tag is returned. This lets users specify string that are shown directly then replaced by real resources without changing code.
      Parameters:
      base - The resource base string. Usually specified as a property of a PGUIComponent
      tag - The resource name tag. This is appended to the base resource name (seperated by a '.') and used to find a a resource. If not found, it is looked for alone (not appended to the base name), and if still not found, it is returned itself.
      Returns:
      The resource string or tag.
    • errorMsg

      public static void errorMsg(Component parent, String msg, Object[] args)
      Display an error dialog with the passed in message
      Parameters:
      parent - The parent component - typically getTopFrame()
      msg - The error message tag. Loads message from resource file
      args - An argument list to format msg with
    • errorMsg

      public static void errorMsg(Component parent, String msg, boolean fromRes)
      Display an error dialog with the passed in message
      Parameters:
      parent - The parent component - typically getTopFrame()
      msg - The error message to display
      fromRes - If true, the error message is assumed to be a tag that will be read in from the global resource bundle. If false, the passed in message is displayed.
    • confirmationMsg

      public static int confirmationMsg(String msg)
      Display a confirmation dialog containing the specified message and 2 choices for the user (YES or NO). The Yes button is selected by default.
      Parameters:
      msg - The confirmation message to display
      Returns:
      One of JOptionPane.YES_OPTION, JOptionPane.NO_OPTION, or JOptionPane.CLOSED_OPTION if the user cancel's the dialog
    • confirmationMsg

      public static int confirmationMsg(String msg, String title)
      Display a confirmation dialog containing the specified message, title and 2 choices for the user (YES or NO). The Yes button is selected by default.
      Parameters:
      msg - The confirmation message to display
      int - The default button. Use JOptionPane.YES_OPTION or JOptionPane.NO_OPTION
      Returns:
      One of JOptionPane.YES_OPTION, JOptionPane.NO_OPTION, or JOptionPane.CLOSED_OPTION if the user cancel's the dialog
    • invokeInThreadPool

      public static void invokeInThreadPool(Runnable run)
      Run a task in a thread pool managed thread.
      Parameters:
      run - The task to run
    • wrapException

      public static PInfranetException wrapException(EBufException ex)
      Provides a wrapper around an EBufException for your view code, which is not supposed to be aware of java PCM. This is not really an issue anymore, but to be pure you should use this.
      Returns:
      a PInfranetException wrapper