Class PTelcoDevicesBase

All Implemented Interfaces:
PSaveable, PAppComponent, PClientComponent, PCollectDataListener, PComponent, PComponentAttribute, PViewDataChangeListener, ContainerListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible
Direct Known Subclasses:
NUMPanel, PDefaultDevicePanel, PTelcoNumberPanel, SIMPanel

public class PTelcoDevicesBase extends PIAExtendedDevicesBase
The base panel for extended Telco device information panels. Contains the knowledge for saving the information in these panels for account creation and maintenance.
Any extended Telco device panel you wish to add should subclass this panel.
Version:
%date_modified: Thr Feb 26 18:53:38 2003 %
Author:
tsuo
See Also:
  • Field Details

    • TELCO_DEVICES_STORABLE_CLASS_NAME_BASE

      protected static final String TELCO_DEVICES_STORABLE_CLASS_NAME_BASE
      See Also:
    • mBundle

      protected ResourceBundle mBundle
    • mSearchAction

      protected PTelcoDevicesBase.SearchAction mSearchAction
      Action to search for Telco devices. Subclasses should use this action to perform the search.
    • mHistoryAction

      protected PTelcoDevicesBase.HistoryAction mHistoryAction
      Action to display the history of devices. Subclasses should use this action to display the history panel.
    • mPrepopulateAction

      protected PTelcoDevicesBase.PrepopulateAction mPrepopulateAction
      Action to prepopulate the panel with the next available device from the database. Subclasses should use this action to perform the prepopulation of the device panel.
  • Constructor Details

    • PTelcoDevicesBase

      public PTelcoDevicesBase()
      Creates a new device details panel with the default device type, "/device".
      Throws:
      ClassNotFoundException - Exception thrown when the controller class can not be loaded.
    • PTelcoDevicesBase

      public PTelcoDevicesBase(String deviceType, String resourceBundleName)
      Creates a new device details panel with the device type, device name, and the resource buncle name. Usually called by the subclass constructor to do the initialization.
      Parameters:
      deviceType - The storable class type of the device this panel will display.
      resourceBundleName - The name of the resource bundle. Used by the subclass to read localized resource strings.
  • Method Details

    • setType

      public void setType(String deviceType) throws IllegalArgumentException
      Set the device type of the page.
      Overrides:
      setType in class PIAExtendedServicesBase
      Parameters:
      deviceType - The storable class name of the device.
      Throws:
      IllegalArgumentException - Thrown when the device type does not start with "/device".
    • getType

      public String getType()
      Retrieves the device type of the page.
    • setService

      public void setService(PModelHandle service)
      Set the owner service for this panel as the specifed service. The device could be owned by several services, but when the device panel is shown as part of the the service panel, this method is called to specify which service object is the owner. Calling this method with a non-null service object also enablees the device panel to display the history of the devices for the owner object. Override this method to implement specific handling after the owner service is set. An example would be to hide/show the history link based on whether the owner service object is set or not.
      Parameters:
      service - The service object which owns this device.
    • setParentService

      public void setParentService(PModelHandle service)
      Set the Parent modelhandle of the device.
      Parameters:
      PModelHandle -
    • setStandalone

      public void setStandalone(boolean b)
      Specify whether this device panel is displayed as a standalone panel or as part of the service panel.
      Parameters:
      b - true The device panel is a standalone panel. false The device panel is part of a service panel.
    • isStandalone

      public boolean isStandalone()
      Method to determine whether this device panel is displayed as a standalone panel or not.
      Returns:
      true The device panel is a standalone panel. false The device panel is part of a service panel.
    • setModelHandle

      public void setModelHandle(PModelHandle newDevice) throws RemoteException
      Set the model handle of this panel to be the specified object.
      Specified by:
      setModelHandle in interface PComponent
      Overrides:
      setModelHandle in class PIACustomizablePanel
      Parameters:
      newDevice - The model handle this panel is going to display.
      Throws:
      RemoteException
    • setDefault

      public void setDefault()
      Specifies that the current modelhandle is the default one.
      Specified by:
      setDefault in interface PComponentAttribute
      Overrides:
      setDefault in class PIACustomizablePanel
    • resetToDefault

      public void resetToDefault()
      Convenience method to revert the current modelhanle to the default one.
      Specified by:
      resetToDefault in interface PComponentAttribute
      Overrides:
      resetToDefault in class PIACustomizablePanel
    • isReplaced

      public boolean isReplaced()
      Is the device replaced
    • getCurDevice

      public PModelHandle getCurDevice()
      Retrieves the model handle currently being displayed by this panel.
      Returns:
      The model handle currently being displayed.
    • getDefaultDevice

      public PModelHandle getDefaultDevice()
      Retrieves the default model handle of this panel.
      Returns:
      The default model handle this panel is supposed to display.
    • formatID

      public String formatID(String input)
      Formats the telephone number. If there is an error during the formating, the original string is returned.
      Parameters:
      input - the number as a string to be formated
      Returns:
      the formated number as a string.
    • supportsLoginAndPassword

      public boolean supportsLoginAndPassword()
      Devices does not need Login/Password panel.
      Overrides:
      supportsLoginAndPassword in class PIAExtendedDevicesBase
      Returns:
      false by default for compatibility with 6.1
    • addAvailStateValue

      public final void addAvailStateValue(int value)
      Call this function to add a value that holds a device state which means the device is available for assigning
      Parameters:
      value - The numeric value of a device state that makes the device available for assingment.
    • removeAvailStateValue

      public final void removeAvailStateValue(int value)
      Call this function to remove a value that holds a device state which makes the device available for assignment.
      Parameters:
      value - The numeric value to be removed from the set of available device states.
    • save

      public com.portal.app.util.CustomerValErrorData[] save()
      Attempts to save changes to this page. When this panel is part of the service page, only the device attribute changes are saved, and the device replacement is handled by the service panel in which this device panel resides. When this panel is standalone, both the device attribute changes and the device replacement will be saved in this function.
      Specified by:
      save in interface PSaveable
      Overrides:
      save in class PIAExtendedServicesBase
      Returns:
      An array of errors, or null if the save was successful
    • isPrepopulateEnabled

      protected boolean isPrepopulateEnabled()
    • getDeviceIDColumnHeader

      protected String getDeviceIDColumnHeader()
      This method returns the device ID column header for the history page. The default implementation reads the resource file, and returns the value specified by key "device.history.results.table.column.id". Overwrite this method to return the string you want to display as the column header for the device ID column on the history page.
    • getDeviceHistoryTrailtag

      protected String getDeviceHistoryTrailtag()
      This method returns the tag for the history page. The default implementation returns string "Device History". Overwrite this method to return the string you want to display as the tag for the history page.
    • getDeviceHistoryHeader

      protected String getDeviceHistoryHeader()
      This method returns the header for the history page. The default implementation returns a string consists of the service type and the service ID. Overwrite this method to return the string you want to display as the header of the history page.
    • prepopulate

      protected PModelHandle prepopulate()
      Finds a device based on the prepopulate type (should be done by controller class), set modelhandle for this page, and return it. Override this method to implement your own device prepopulation logic.
    • searchForDevice

      protected PModelHandle searchForDevice()
      Display a search dialog and selects a device Override this method to implement your own device search logic.
    • getFirstAvailableDevice

      protected PModelHandle getFirstAvailableDevice()
      Searches the next available device in the database and returns it. This function is used in the prepopulate() function. Override to implement your own logic on how to get the available device from the database.
    • getExistingDevices

      protected PModelHandle[] getExistingDevices()
      Searches for all existing devices of the same type this panel handles, and returns them.
      Returns:
      An array of devices of the same type this panel handles.
    • getDeviceHistoryClassName

      protected String getDeviceHistoryClassName()
      Retrieves the class that handles the display of the device history. Default implementation returns PTelcoDeviceHistoryBase. This method is called by showDeviceHistory() to get the name of the device history page class. Override to return the class name of your own device history page.
      Returns:
      PTelcoDeviceHistoryBase
    • showDeviceHistory

      protected void showDeviceHistory()
      Display the device history page. In the default implmentation, the device history page is only available when the device panel belongs to a service panel. Override to implement how you want to show your device history.
    • getDeviceName

      protected String getDeviceName()
      Get the device name. Default implementation returns the name of the device storable class after "/device/". Device name should be unique. Override this method to return the name that you would like to use to identify the device with.
    • getDeviceStateConfig

      protected String getDeviceStateConfig()
      Get the name of the config object that stores the device state.
    • setIsReplaced

      public void setIsReplaced(boolean isReplace)