Class PSaveManager

java.lang.Object
com.portal.app.cc.comp.PSaveManager
All Implemented Interfaces:
PropertyChangeListener, EventListener

public class PSaveManager extends Object implements PropertyChangeListener
This class controls the data saving process for Customer Center. It is primarily here to implement the implicit/explicit save mechanism that occurs as a user modifies and then attempts to leave a page.
Depending on a system setting (processed by this class) the user may be prompted and given the option of saving changes before moving to the desired page. However, the setting may specify that the user should not be prompted in which case the save will happen automatically.
Version:
%version: 14 % %date_modified: Thu Jan 24 17:44:08 2002 %
Author:
kapono
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates the save manager instance
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Displays an error message indicating that there was a failure during saving.
    boolean
    displayErrorMessage(String sCustErrorMsg)
    Displays an error message indicating that there was a failure during saving.
    static Component
    findErrorComponent(Component base, com.portal.app.util.CustomerValErrorData[] err, boolean checkAllComponents)
    For a passed-in array of model field descriptions, seeks those components with matching model field descriptions and marks them as being in error.
    void
    Internal listener for changes to the property that determines if the user is queried before saving changes (when switching tabs).
    boolean
    Attempt to save the currently visible page in the given PPageTemplate.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PSaveManager

      public PSaveManager()
      Creates the save manager instance
  • Method Details

    • save

      public boolean save(PPageTemplate temp)
      Attempt to save the currently visible page in the given PPageTemplate. The page is responsible for doing any error handling (for example, putting up an error message, marking a field associated with the error, etc.).
      Parameters:
      The - template to save.
      Returns:
      true if the save was successful or there was nothing to save. A return value of false means the CSR has requested to remain on the current page. (false will be returned if the page on which the save attempt is being made throws a PSaveException.)
      See Also:
    • displayErrorMessage

      public boolean displayErrorMessage()
      Displays an error message indicating that there was a failure during saving. The two options they can choose from are: "Discard Changes" and "Fix Errors".
      Returns:
      true if the user selects the "Fix Errors" option; false otherwise
    • displayErrorMessage

      public boolean displayErrorMessage(String sCustErrorMsg)
      Displays an error message indicating that there was a failure during saving. The two options they can choose from are: "Discard Changes" and "Fix Errors". The callers pass in a string of customer error message, which will be added to the front of the generic message. Pass in null or "" to display generic message only.
      Parameters:
      the - customer error message
      Returns:
      true if the user selects the "Fix Errors" option; false otherwise
    • propertyChange

      public void propertyChange(PropertyChangeEvent e)
      Internal listener for changes to the property that determines if the user is queried before saving changes (when switching tabs).
      Specified by:
      propertyChange in interface PropertyChangeListener
      Parameters:
      e - The property change event
    • findErrorComponent

      public static Component findErrorComponent(Component base, com.portal.app.util.CustomerValErrorData[] err, boolean checkAllComponents)
      For a passed-in array of model field descriptions, seeks those components with matching model field descriptions and marks them as being in error. If at least one matching component is found, the last component found is returned; otherwise null is returned.
      Parameters:
      base - Top-level component in which to start the search
      err - Array of model field descriptions
      checkAllComponents - True to examine all components; false to check only dirty components
      Returns:
      The last matching component, or null if no matching component is found