Class BrandUtility

java.lang.Object
com.portal.pfc.util.BrandUtility

public class BrandUtility extends Object
The Brand utility class. The APIs allow to get a list of accessible brands, the current active brand scope and to set to a new brand scope.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.portal.permission.ScopeEntryPoint
    Returns the active brand as a ScopeEntryPoint Object
    Returns the Brand hierarchy in a swing TreeModel.
    boolean
    Check if branding is enabled.
    boolean
    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.
    com.portal.permission.ScopeEntryPoint
    Used to lookup the brand that is associated with the given brand poid.
    void
    Reloads the Brand hierarchy from the database.
    boolean
    setActiveBrand(com.portal.permission.ScopeEntryPoint newScope)
    Sets the given brand as the new active brand in the infranet system.

    Methods inherited from class java.lang.Object

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

  • Method Details

    • getBrands

      public TreeModel getBrands()
      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
    • reloadBrands

      public void reloadBrands()
      Reloads 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.
    • isDummyRoot

      public boolean isDummyRoot()
      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)
    • getActiveBrand

      public com.portal.permission.ScopeEntryPoint getActiveBrand() throws IllegalStateException
      Returns the active brand as a ScopeEntryPoint Object
      Returns:
      ScopeEntryPoint
      Throws:
      IllegalStateException
    • lookupBrandFromPoid

      public com.portal.permission.ScopeEntryPoint lookupBrandFromPoid(Poid brandPoid)
      Used to lookup the brand that is associated with the given brand poid. The brand poid should be available as a ScopeEntryPoint in the Context.
      Parameters:
      brandPoid - The Brand poid object.
      Returns:
      PScopeEntryPoint representing brand.
    • setActiveBrand

      public boolean setActiveBrand(com.portal.permission.ScopeEntryPoint newScope)
      Sets the given brand as the new active brand in the infranet system.
      Parameters:
      ScopeEntryPoint - 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.
    • isBrandingEnabled

      public boolean isBrandingEnabled()
      Check if branding is enabled.
      Returns:
      true if Branding is enabled, false otherwise.