Package com.portal.pfc.util
Class BrandUtility
java.lang.Object
com.portal.pfc.util.BrandUtility
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 -
Method Summary
Modifier and TypeMethodDescriptioncom.portal.permission.ScopeEntryPoint
Returns the active brand as a ScopeEntryPoint ObjectReturns 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
lookupBrandFromPoid
(Poid brandPoid) 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.
-
Constructor Details
-
BrandUtility
-
-
Method Details
-
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
Returns the active brand as a ScopeEntryPoint Object- Returns:
- ScopeEntryPoint
- Throws:
IllegalStateException
-
lookupBrandFromPoid
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.
-