Class PBrandTree

All Implemented Interfaces:
PAppComponent, PClientComponent, PComponent, PViewDataChangeListener, ActionListener, ItemListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, ListDataListener

public class PBrandTree extends JComboTree implements PAppComponent, ItemListener, Serializable
Portal aware Brand component. This displays the whole brand hierarchy as a tree with-in a combo box. Users can navigate through the brand tree and/or switch scope to a new brand. When the user selects a new brand, this component fires a vetoable event for the property "brand", before actually switching to a new brand scope. The APIs allows the developers to get the current active brand scope and to set to a new brand scope.
Version:
%version: 9 % %date_modified: Mon Feb 04 08:53:20 2002 %
Author:
raghuv
See Also:
  • Constructor Details

    • PBrandTree

      public PBrandTree()
      Default constructor that creates a Brand component
  • Method Details

    • unregister

      public void unregister() throws RemoteException
      Causes this component to be disassociated from its controller (GC'd)
      Specified by:
      unregister in interface PClientComponent
      Throws:
      RemoteException
    • getBrands

      public TreeModel getBrands() throws RemoteException
      Returns the Brand hierarchy in a swing TreeModel. The root node may be dummy only serving the purpose of parenting the loose brands. Use isDummy() on the root node to determine if it is just a dummy root node.
      Returns:
      TreeModel
      Throws:
      RemoteException
      RemoteException - invalid input: '<'>
    • retrieveBrands

      public void retrieveBrands() throws RemoteException
      Retrieves the Brand hierarchy from the database. This causes an opcode call be made to infranet to retrieve the brand hierarchy and update the component data. Unlike getBrands(), this forces a call to back end to get the updated brand hierarchy instead of returning one from the cache.
      Throws:
      RemoteException
      RemoteException - invalid input: '<'>
    • getActiveBrand

      public PScopeEntryPoint getActiveBrand() throws RemoteException
      Returns the active brand through the PScopeEntryPoint Object. Use different methods available on PScopeEntryPoint to obtain brand name, ACL poid, etc.
      Returns:
      PScopeEntryPoint
      Throws:
      RemoteException
      RemoteException - invalid input: '<'>
    • lookupBrandFromPoid

      public PScopeEntryPoint lookupBrandFromPoid(PModelHandle brandPoid) throws RemoteException
      Used to lookup the brand that is associated with the given brand poid. The brand poid should be available as a PScopeEntryPoint in the Context.
      Parameters:
      brandPoid - A PModelHandle object representing a Brand poid object.
      Returns:
      PScopeEntryPoint representing brand name.
      Throws:
      RemoteException
    • setActiveBrand

      public boolean setActiveBrand(PScopeEntryPoint newActiveBrand) throws RemoteException
      Sets the given brand as the new active brand in the infranet system.
      Parameters:
      PScopeEntryPoint - A Brand info object containing the brand to which the credentials/scope should be set to
      Returns:
      Returns true if active brand was set successfully, else returns false.
      Throws:
      RemoteException
      RemoteException - invalid input: '<'>
    • isDummyRoot

      public boolean isDummyRoot() throws RemoteException
      Returns true if the root node of the tree model is a dummy root node only serving the purpose of parenting loose brands and account groups. (In such a case root node is invisible in the tree displayed)
      Throws:
      RemoteException
    • isBrandingEnabled

      public boolean isBrandingEnabled() throws RemoteException
      Check if branding is enabled.
      Returns:
      true if Branding is enabled, false otherwise.
      Throws:
      RemoteException
      RemoteException - invalid input: '<'>
    • addNotify

      public void addNotify()
      Baseclass (JComponent) override that sets a model for the View
      Overrides:
      addNotify in class JComponent
    • setModelHandle

      public void setModelHandle(PModelHandle data) throws RemoteException
      Establishes the PModelHandle for this component
      Specified by:
      setModelHandle in interface PComponent
      Parameters:
      data - The new PModelHandle from which information will be extracted.
      Throws:
      RemoteException
    • viewDataChange

      public void viewDataChange(PViewDataChangeEvent event) throws RemoteException
      Called when the view data changes. The component should use this to update the display
      Specified by:
      viewDataChange in interface PViewDataChangeListener
      Parameters:
      event - Data change event
      Throws:
      RemoteException - Thrown for errors
    • getModelHandle

      public PModelHandle getModelHandle() throws RemoteException
      Retrieves the PModelHandle for this component
      Specified by:
      getModelHandle in interface PComponent
      Returns:
      The PModelHandle associated with this component
      Throws:
      RemoteException
    • isLight

      public boolean isLight() throws RemoteException
      Determines if this is component defers PModelHandle knowledge to its parent container. If so, the parent container will pass the PModelHandle to this component on the server side (via the controller) saving a client/server roundtrip for data exchange. If you need to do specific processing of some kind when PModelHandle is called you'll need to subclass this component and override this method. Otherwise setModelHandle() will not be called.
      Specified by:
      isLight in interface PComponent
      Returns:
      true
      Throws:
      RemoteException
    • getControllerClassName

      public String getControllerClassName() throws RemoteException
      Retrieves the class name of this component's controller
      Specified by:
      getControllerClassName in interface PComponent
      Returns:
      "com.portal.bas.comp.PBrandBeanImpl", the default controller for this component.
      Throws:
      RemoteException
    • getTools

      public Vector getTools()
      Get a list of Actions supported by this component. When subclassed, the overriding class should call its super class version, then add its actions to the retuned list. This preserves actions supplied by base classes. The default, supplied here, include Help for this component.
      Specified by:
      getTools in interface PClientComponent
      Returns:
      a Vector containing Action objects
    • setResourceName

      public void setResourceName(String name)
      Set the base resource name used in resource lookup. Basically, the resource name will be this base, followed by a dot, flowwed by the local name (label).
      Specified by:
      setResourceName in interface PClientComponent
      Parameters:
      name - The new base resource name.
    • getResourceName

      public String getResourceName()
      Get the base resource name used in resource lookup.
      Specified by:
      getResourceName in interface PClientComponent
      Returns:
      The base resource name
      Throws:
      RemoteException
    • getRemoteComponent

      public Remote getRemoteComponent()
      Get a reference to the remote component for this object. The remote component is used when interfacing with this component's controller.
      Specified by:
      getRemoteComponent in interface PAppComponent
      Returns:
      a RemoteComponent
    • itemStateChanged

      public void itemStateChanged(ItemEvent e)
      Specified by:
      itemStateChanged in interface ItemListener