Package com.portal.app.cc.comp
Class CCCompatibilityUtility
java.lang.Object
com.portal.app.cc.comp.CCCompatibilityUtility
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
confirmationMsg
(String msg) Display a confirmation dialog containing the specified message and 2 choices for the user (YES or NO).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).static void
Display an error dialog with the passed in messagestatic void
Display an error dialog with the passed in messagestatic PortalContext
Retrieves the main Portal connection used by Customer Centerstatic CustomerCenterContext
Retrieves the context for Customer Centerstatic Properties
Retrieves the global Properties object combining default properties and any customized properties (specified via the CC SDK).static String
getResource
(String base, String tag) Get a specific resource.static ResourceBundle
Retrieves the global resource bundle object combining default strings and any customized resources (specified via the CC SDK).static JFrame
Retrieves the topmost Frame used by Customer Center.static Properties
Get the user UI preferences.static void
Run a task in a thread pool managed thread.static ImageIcon
Load an ImageIcon from a supplied location stringstatic ImageIcon
Convenience API to retrieve an ImageIcon from the given URLstatic PInfranetException
Provides a wrapper around an EBufException for your view code, which is not supposed to be aware of java PCM.
-
Constructor Details
-
CCCompatibilityUtility
public CCCompatibilityUtility()
-
-
Method Details
-
getCustomerCenterContext
Retrieves the context for Customer Center- Returns:
- The Customer Center context instance
-
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
Retrieves the main Portal connection used by Customer Center- Returns:
- The PortalContext which represents the open Portal connection
-
loadImage
Convenience API to retrieve an ImageIcon from the given URL- Parameters:
u
- The URL of the image data- Returns:
- A new ImageIcon
-
loadImage
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
Retrieves the global Properties object combining default properties and any customized properties (specified via the CC SDK).- Returns:
- The global Properties object
-
getUserPreferences
Get the user UI preferences. Only valid after successful login- Returns:
- the Properties object containing the user's preferences
-
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
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 PGUIComponenttag
- 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
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 fileargs
- An argument list to format msg with
-
errorMsg
Display an error dialog with the passed in message- Parameters:
parent
- The parent component - typically getTopFrame()msg
- The error message to displayfromRes
- 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
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
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 displayint
- 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
Run a task in a thread pool managed thread.- Parameters:
run
- The task to run
-
wrapException
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
-