Class PIACAProfilePanel

All Implemented Interfaces:
PAccountViewPage, PCCPage, PWizardPage, PAppComponent, PClientComponent, PCollectDataListener, PComponent, PComponentAttribute, PViewDataChangeListener, ContainerListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible
Direct Known Subclasses:
PCAEmptyProfilePanel

public class PIACAProfilePanel extends PMaintenancePage implements PWizardPage
A skeletal profile panel that can be extended and used in an account creation wizard to gather profile information, and also during account maintenance to display the profile information.

The default controller associated with this panel takes care of all FList manipulations that need to occur during account creation and modification.
NOTE: If you plan on using more than one profile panel/object per account during account creation, you'll need to specify an index for each (see the setProfileIndex() method).
See Also:
  • Constructor Details

    • PIACAProfilePanel

      public PIACAProfilePanel()
      Creates a profile panel with a default index of zero
  • Method Details

    • setModelHandle

      public void setModelHandle(PModelHandle data) throws RemoteException
      Overridden to deal with those accounts that do not have a profile object of the desired type. Currently this method simply clears the contents of the UI. You could modify this to disable the panel or set the panel invisible.
      Specified by:
      setModelHandle in interface PComponent
      Overrides:
      setModelHandle in class PIACustomizablePanel
      Parameters:
      data - The new model handle representing an account
      Throws:
      RemoteException - thrown for errors
    • save

      public void save() throws PSaveException
      Used to save changes to already existing profile objects or create new profile objects (this is not used for account creation, just for existing accounts)
      Specified by:
      save in interface PAccountViewPage
      Overrides:
      save in class PMaintenancePage
      Throws:
      PSaveException
    • collectData

      public void collectData(PCollectDataEvent event)
      During the account creation process, data will be collected from this panel for storing in a new profile object. The input flist for this OP_COMMIT_CUSTOMER needs to look like (assuming a "bank" profile object):
      0 PIN_FLD_PROFILES ARRAY [0] allocated 2, used 2
      1 PIN_FLD_PROFILE_OBJ POID [0] 0.0.0.1 /profile/bank -1 0
      1 PIN_FLD_INHERITED_INFO SUBSTRUCT [0] allocated 1, used 1
      2 data from your fields here...


      This code assumes all fields contained in this panel will have modelFieldDescription properties that start with "FldInheritedInfo.". The FList that is generated while gathering the data from these fields is automatically inserted in a PIN_FLD_PROFILES array for you by this collectData() method so you don't need to do any work.
      This also allows you to retain the same modelFieldDescription properties for the account maintenance process and reuse the same panel for both situations. This also creates the correct input flist to work with OP_UPDATE_CUSTOMER, OP_MODIFY_PROFILE and OP_CREATE_PROFILE The input flist for OP_UPDATE_CUSTOMER:
      0 PIN_FLD_POID POID[0] 0.0.0.1 /account 1234 111
      0 PIN_FLD_PROFILES ARRAY [0] allocated 2, used 2
      1 PIN_FLD_PROFILE_OBJ POID [0] 0.0.0.1 /profile/bank 5678 222
      1 PIN_FLD_INHERITED_INFO SUBSTRUCT [0] allocated 1, used 1
      2 data from your fields here...


      The input flist for OP_MODIFY_PROFILE:
      0 PIN_FLD_POID POID[0] 0.0.0.1 /profile/bank 5678 222
      0 PIN_FLD_INHERITED_INFO SUBSTRUCT [0] allocated 1, used 1
      1 data from your fields here...


      The input flist for OP_CREATE_PROFILE:
      0 PIN_FLD_POID POID[0] 0.0.0.1 /profile/bank -1 0
      0 PIN_FLD_ACCOUNT_OBJ POID[0] 0.0.0.1 /account 1234 111
      0 PIN_FLD_INHERITED_INFO SUBSTRUCT [0] allocated 1, used 1
      1 data from your fields here...


      Specified by:
      collectData in interface PCollectDataListener
      Specified by:
      collectData in interface PWizardPage
      Overrides:
      collectData in class PIACustomizablePanel
      Parameters:
      event - The marshal data event
      See Also:
    • setProfileType

      public void setProfileType(String s)
      Sets up the profile string to be used in commiting profile data.
      Parameters:
      s - the profile string
    • getProfileType

      public String getProfileType()
      Returns the profile string used in commiting profile data.
      Returns:
      profile type
    • setProfileIndex

      public void setProfileIndex(int i)
      Sets up the profile index to be used in commiting profile data. This needs to be set if you have more than one profile panel/object during the account creation process. By default, this is zero.
      Parameters:
      s - the profile index
    • getProfileIndex

      public int getProfileIndex()
      Returns the profile index used in commiting profile data.
      Returns:
      profile index
    • 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 classname
      Throws:
      RemoteException - thrown for errors
    • hasProfile

      public boolean hasProfile()
      Checks whether the account does have a profile object of the desired type.
      Returns:
      true if the account has the profile object; false otherwise
    • getWizardHelpID

      public String getWizardHelpID()
      Help ID for this wizard page.
      Specified by:
      getWizardHelpID in interface PWizardPage
    • validateWizardPage

      public void validateWizardPage() throws PValidationException
      Validates this page. (This base class implementation does no validation. A subclass of this class could do its own validation and/or use wizard a framework convenience method to do validation.)
      Specified by:
      validateWizardPage in interface PWizardPage
      Throws:
      PValidationException
      See Also:
    • handleWizardCommitError

      public boolean handleWizardCommitError(com.portal.app.util.CustomerError error)
      Handles commit-time errors. Uses the wizard framework convience method to do default commit-time error handling.
      Specified by:
      handleWizardCommitError in interface PWizardPage
      Parameters:
      error - The error.
      Returns:
      true if the page will handle the error; otherwise false.
      See Also:
    • leavingPage

      public void leavingPage() throws PropertyVetoException
      Called before the wizard actually leaves the current page. If for some reason the implementing page does not want the wizard to leave the page, it should throw a PropertyVetoException.
      Specified by:
      leavingPage in interface PWizardPage
    • localCollectData

      protected void localCollectData(PCollectDataEvent event)
      Subclasses should override this instead of collectData() if they need to mangle the data that gets sent to Portal. They should
      Parameters:
      The - collect data event
    • containsProfileObject

      protected void containsProfileObject(boolean hasProfile)
      Subclasses can override this if they want to change the appearance of their profile panel if/when the account does not have a profile object of the desired type.
      Parameters:
      hasProfile - true if the account has the requested profile object; false otherwise
    • handleSaveError

      protected void handleSaveError(com.portal.app.util.CustomerValErrorData[] err)
      Subclasses can override this if they want to handle any save error in their profile panel if/when the account does not have a profile object of the desired type.
      Parameters:
      an - array describing any errors encountered while saving