Class PCustomerCenterInternals

All Implemented Interfaces:
CustomerCenterContext, PAppComponent, PAppContext, PClientComponent, PCollectDataListener, PComponent, PComponentAttribute, PContextChangedListener, PViewDataChangeListener, ContainerListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class PCustomerCenterInternals extends PIACustomizablePanel implements CustomerCenterContext, PContextChangedListener
The customer center application shell and framework implementation
Version:
%version: 16 % %date_modified: Tue Mar 19 17:05:17 2002 %
Author:
kapono
See Also:
  • Constructor Details

    • PCustomerCenterInternals

      public PCustomerCenterInternals()
      Creates CustomerCenter
  • Method Details

    • getInstance

      public static PCustomerCenterInternals getInstance(String username, String password, String db, String port, String propFileName) throws InstantiationException
      Returns an instance of this panel that is connected to Portal with the given connection parameters. Infranet.properties is not required and will be ignored when this factory method is used.
      This is the method to use if you wish to embed Customer Center in a separate stand-alone application.
      Parameters:
      username - The id/login to use when connecting to Portal
      password - The password to use when connecting to Portal
      db - The name of the CM you are connecting to
      port - The port # of the CM you are connecting to
      propFileName - The name of the main property file for the app you are instantiating. For Customer Center, that is "CustomerCenter.properties"
      Returns:
      An instance of Customer Center that is connected to Portal
      Throws:
      InstantiationException - when the connection attempt fails
    • getAccount

      public PModelHandle getAccount(String accountNum)
      Performs a GLOBAL search to locate the given account, using the given account number.
      Parameters:
      accountNum - the Portal account number to search for
      Returns:
      the PModelHandle for the account; null if not found
    • getCurrencyManager

      public PCurrencyManager getCurrencyManager()
      Specified by:
      getCurrencyManager in interface CustomerCenterContext
      Returns:
      Retrieves the client's currency manager instance
    • getSaveManager

      public PSaveManager getSaveManager()
      Specified by:
      getSaveManager in interface CustomerCenterContext
      Returns:
      Retrieves the client's save manager instance
    • getBrandManager

      public PBrandManager getBrandManager()
      Specified by:
      getBrandManager in interface CustomerCenterContext
      Returns:
      Retrieves the client's brand manager instance
    • getPrintManager

      public PrintManager getPrintManager()
      Specified by:
      getPrintManager in interface CustomerCenterContext
      Returns:
      Retrieves the client's print manager instance
    • getCSRNameModelHandle

      public PModelHandle getCSRNameModelHandle()
      Description copied from interface: CustomerCenterContext
      Return the CSR Account object model handle. This is mostly used in the Notes object to retrieve th CSR name while inserting text into notes. CSR name/model handle is to be retrieved from here since the CSR name/model handle cannot be accessed from sub-brands.
      Specified by:
      getCSRNameModelHandle in interface CustomerCenterContext
      Returns:
      ModelHandle containing the CSR name
    • showDefault

      public void showDefault()
      Description copied from interface: CustomerCenterContext
      Mechanism to force the display of the main application interface. setOverlay() allows the main application interface to be taken over, so there needs to be a hook to get back to the original default.
      Specified by:
      showDefault in interface CustomerCenterContext
    • setWizardContext

      public void setWizardContext(PAppContext ctx)
      Used to establish the context for the current wizard.
      Specified by:
      setWizardContext in interface CustomerCenterContext
      Parameters:
      ctx - The wizard context
    • getWizardContext

      public PAppContext getWizardContext()
      We currently provide the ability to display one wizard at a time. This method allows you to access that wizard.
      Specified by:
      getWizardContext in interface CustomerCenterContext
      Returns:
      The wizard context if the wizard is active; null otherwise
    • setCurrentAccount

      public void setCurrentAccount(PModelHandle pm) throws PropertyVetoException
      Establishes the current account for the client. A vetoable property change event will be issued giving listeners the opportunity to disallow the change in current account. If there are no objections, the current account is changed and an update is sent via a property change event.
      Specified by:
      setCurrentAccount in interface CustomerCenterContext
      Parameters:
      pm - The model handle for the new account
      The - model handle for the new account
      Throws:
      PropertyVetoException
    • getCurrentAccountInfo

      public PAccountInfo getCurrentAccountInfo()
      Retrieves the information class for the current account
      Specified by:
      getCurrentAccountInfo in interface CustomerCenterContext
      Returns:
      The current account's data wrapper
    • getLastActiveOpenAccount

      public PAccountInfo getLastActiveOpenAccount()
      Used to track the last active open account. If you go to the home page (or something like it that may be added to the client) the current account will be set to null. However, it is often useful to know which account you were previously looking at.
      Note this will be set to null if all accounts are closed, and it will usually be the same as the current account (i.e. when you select an account this value does not track the previous one - its only really useful when current account is null).
      Specified by:
      getLastActiveOpenAccount in interface CustomerCenterContext
      Returns:
      The last active open account, if any open accounts exist.
    • addCurrentAccountListener

      public void addCurrentAccountListener(PropertyChangeListener p)
      Registers the given listener so that it receives a PropertyChangeEvent when the current account changes
      Specified by:
      addCurrentAccountListener in interface CustomerCenterContext
      Parameters:
      p - The listener
    • removeCurrentAccountListener

      public void removeCurrentAccountListener(PropertyChangeListener p)
      Removes the PropertyChangeListener for the CustomerCenterContext.CURRENT_ACCOUNT property
      Specified by:
      removeCurrentAccountListener in interface CustomerCenterContext
      Parameters:
      p - The listener
    • addCurrentAccountVetoableListener

      public void addCurrentAccountVetoableListener(VetoableChangeListener v)
      Registers the given listener so that it receives a VetoableChangeEvent before the current account changes
      Specified by:
      addCurrentAccountVetoableListener in interface CustomerCenterContext
      Parameters:
      v - The VetoableChangeListener
    • removeCurrentAccountVetoableListener

      public void removeCurrentAccountVetoableListener(VetoableChangeListener v)
      Removes the VetoableChangeListener for the CustomerCenterContext.CURRENT_ACCOUNT property
      Specified by:
      removeCurrentAccountVetoableListener in interface CustomerCenterContext
      Parameters:
      v - The listener
    • serviceSelectionChanged

      public void serviceSelectionChanged(PModelHandle pm) throws PropertyVetoException
      Used to notify Context regarding the Service Selection Change occured in the PServicePage with the PModelHandle of the newly selected Service. This will allow PropertyListeners for that change to act accordingly. client.
      Specified by:
      serviceSelectionChanged in interface CustomerCenterContext
      Parameters:
      pm - The Service that currently selected
      Throws:
      PropertyVetoException
    • addServiceSelectionListener

      public void addServiceSelectionListener(PropertyChangeListener p)
      Registers the given listener so that it receives a PropertyChangeEvent event when Service Selection change Occured in PServicePage.
      Specified by:
      addServiceSelectionListener in interface CustomerCenterContext
      Parameters:
      p - The listener
    • removeServiceSelectionListener

      public void removeServiceSelectionListener(PropertyChangeListener p)
      Removes the given listener for SERVICE_SELECTION property
      Specified by:
      removeServiceSelectionListener in interface CustomerCenterContext
      Parameters:
      p - The listener
    • billInfoSelectionChanged

      public void billInfoSelectionChanged(BillInfoChangeEvent bie)
      Used to notify Context regarding the BillInfo Selection Change occured in the BillGroup ComboBox with the PModelHandle of the newly selected BillInfo and previously Selected BillGroup. This will allow PropertyListeners for that change to act accordingly. client.
      Specified by:
      billInfoSelectionChanged in interface CustomerCenterContext
      Parameters:
      previousBillInfo - The BillInfo that was previously selected
      currentBillInfo - The BillInfo that is the new Selection
    • addBillInfoSelectionListener

      public void addBillInfoSelectionListener(PropertyChangeListener p)
      Registers the given listener so that it receives a PropertyChangeEvent event when BillInfo Selection change Occured in BillGroup ComboBox.
      Specified by:
      addBillInfoSelectionListener in interface CustomerCenterContext
      Parameters:
      p - The listener
    • removeBillInfoSelectionListener

      public void removeBillInfoSelectionListener(PropertyChangeListener p)
      Removes the given listener for BILL_INFO_SELECTION property
      Specified by:
      removeBillInfoSelectionListener in interface CustomerCenterContext
      Parameters:
      p - The listener
    • closeAccount

      public void closeAccount(PModelHandle pm) throws PropertyVetoException
      Used to close the account represented by the given PModelHandle. Closing an account essentially means removing it from display in the client. A vetoable property change event will be issued giving listeners the opportunity to disallow the close. If there are no objections, the current account is closed and an update is sent via a property change event.
      Specified by:
      closeAccount in interface CustomerCenterContext
      Parameters:
      pm - The account to close
      Throws:
      PropertyVetoException
    • addAccountClosedListener

      public void addAccountClosedListener(PropertyChangeListener p)
      Registers the given listener so that it receives a PropertyChangeEvent event when an account closes.
      Specified by:
      addAccountClosedListener in interface CustomerCenterContext
      Parameters:
      p - The listener
    • removeAccountClosedListener

      public void removeAccountClosedListener(PropertyChangeListener p)
      Removes the PropertyChangeListener for the CLOSE_ACCOUNT property
      Specified by:
      removeAccountClosedListener in interface CustomerCenterContext
      Parameters:
      p - The listener
    • addAccountClosedVetoableListener

      public void addAccountClosedVetoableListener(VetoableChangeListener v)
      Registers the given listener so that it receives a VetoableChangeEvent before an account closes.
      Specified by:
      addAccountClosedVetoableListener in interface CustomerCenterContext
      Parameters:
      v - The VetoableChangeListener
    • removeAccountClosedVetoableListener

      public void removeAccountClosedVetoableListener(VetoableChangeListener v)
      Removes the VetoableChangeListener for the CLOSE_ACCOUNT property
      Specified by:
      removeAccountClosedVetoableListener in interface CustomerCenterContext
      Parameters:
      v - The listener
    • getAccountViewContext

      public PAccountViewContext getAccountViewContext()
      Retrieves the context associated with the current account. This context provides a mechanism for navigating in the account view component.
      Specified by:
      getAccountViewContext in interface CustomerCenterContext
      Returns:
      the account context for the current account
    • setOverlay

      public void setOverlay(Component comp)
      no-op
      Specified by:
      setOverlay in interface PAppContext
      Parameters:
      comp - the component to add to the application
    • changeSize

      public void changeSize(Component comp, int spaceNeeded)
      no-op
      Specified by:
      changeSize in interface PAppContext
      Parameters:
      comp - the component to change
      spaceNeeded - a constant that describes how to change the component's size
    • setStatus

      public void setStatus(String status)
      Description copied from interface: PAppContext
      Sets the string, if any, to display in the status bar.
      Specified by:
      setStatus in interface PAppContext
      Parameters:
      status - the new status text
    • addActions

      public void addActions(Vector tools)
      Description copied from interface: PAppContext
      Adds a vector of PBASAction from the application menu, toolbar, or both.
      Specified by:
      addActions in interface PAppContext
      Parameters:
      tools - a Vector of PBASAction objects
    • addActions

      public void addActions(Vector tools, JToolBar tb)
    • removeActions

      public void removeActions(Vector tools)
      Description copied from interface: PAppContext
      Removes a vector of PBASAction from the application menu, toolbar, or both.
      Specified by:
      removeActions in interface PAppContext
      Parameters:
      tools - a Vector of PBASAction objects
    • removeActions

      public void removeActions(Vector tools, JToolBar tb)
    • getAppName

      public String getAppName()
      Retrieves the name of the client
      Specified by:
      getAppName in interface PAppContext
      Returns:
      the client name - "Customer Center"
    • focusOn

      public void focusOn(Component comp)
      Description copied from interface: PAppContext
      Ensures that a panel is shown, then gives it focus.
      Specified by:
      focusOn in interface PAppContext
      Parameters:
      comp - the component that gets focus
    • addContextChangedListener

      public void addContextChangedListener(PContextChangedListener l)
      Description copied from interface: PAppContext
      Specified by:
      addContextChangedListener in interface PAppContext
      Parameters:
      l - a PContextChangedListener
    • removeContextChangedListener

      public void removeContextChangedListener(PContextChangedListener l)
      Description copied from interface: PAppContext
      Specified by:
      removeContextChangedListener in interface PAppContext
      Parameters:
      l - a PContextChangedListener
    • fireContextChangedEvent

      public boolean fireContextChangedEvent(PContextChangedEvent event)
      Description copied from interface: PAppContext
      Specified by:
      fireContextChangedEvent in interface PAppContext
      Parameters:
      event - a PContextChangedEvent event
      Returns:
      False for an okToExit event, true otherwise.
    • addNotify

      public void addNotify()
      Overridden to perform server side initialization of BAS tables (BEID, Locale, etc.)
      Overrides:
      addNotify in class JComponent
    • getAccountManager

      public PActiveAccountManager getAccountManager()
      Returns the active account manager instance
    • getNavigatorComponent

      public PAccountNavigator getNavigatorComponent()
      Returns the account navigator component
    • getControllerClassName

      public String getControllerClassName() throws RemoteException
      Gets the class name for this class's controller
      Specified by:
      getControllerClassName in interface PComponent
      Overrides:
      getControllerClassName in class PIACustomizablePanel
      Returns:
      a String with the component's controller's classname
      Throws:
      RemoteException - thrown for errors
    • toTop

      public void toTop(PContextChangedEvent event)
      Description copied from interface: PContextChangedListener
      Handles a PContextChangedEvent associated with a change in panel position to the top.
      Specified by:
      toTop in interface PContextChangedListener
      Parameters:
      event - the event to handle
    • wasOnTop

      public void wasOnTop(PContextChangedEvent event)
      Description copied from interface: PContextChangedListener
      Handles a PContextChangedEvent associated with a change in panel position from the top.
      Specified by:
      wasOnTop in interface PContextChangedListener
      Parameters:
      event - the event to handle
    • appletStart

      public void appletStart(PContextChangedEvent event)
      Description copied from interface: PContextChangedListener
      Handles a PContextChangedEvent associated with an applet's start.
      Specified by:
      appletStart in interface PContextChangedListener
      Parameters:
      event - the event to handle
    • appletStop

      public void appletStop(PContextChangedEvent event)
      Description copied from interface: PContextChangedListener
      Handles a PContextChangedEvent associated with an applet's stop.
      Specified by:
      appletStop in interface PContextChangedListener
      Parameters:
      event - the event to handle
    • sizeChanged

      public void sizeChanged(PContextChangedEvent event)
      Description copied from interface: PContextChangedListener
      Handles a PContextChangedEvent associated with a change in panel size.
      Specified by:
      sizeChanged in interface PContextChangedListener
      Parameters:
      event - the event to handle
    • okToExit

      public boolean okToExit(PContextChangedEvent event)
      Description copied from interface: PContextChangedListener
      Handles a PContextChangedEvent associated with an exit.
      Specified by:
      okToExit in interface PContextChangedListener
      Parameters:
      event - the event to handle