public class PanelContent extends Object
This object contains all panel attributes for the panel, as defined in eSales Manager.
For zone panels, this object contains all sub panels returned by the eSales service.
For function panels, this object contains the Result
of evaluating the function in the eSales service.
An object of this class will never make new requests to the eSales service; it just holds the result of a request.
Modifier and Type | Method | Description |
---|---|---|
Map<String,String> |
attributes() |
Returns a map of panel attributes and their values.
|
boolean |
hasResult() |
Returns true if this panel content contains a function result.
|
boolean |
hasSubpanel(String relativePath) |
Returns true if this zone contains a sub panel with the specified relative path.
|
boolean |
isZone() |
Returns true if this panel is a container, that is, contains sub panels.
|
Path |
path() |
Returns the complete path of this panel.
|
Result |
result() |
Returns the result of this panel.
|
Result.Ads |
resultAsAds() |
Fetches the result as Ads
|
List<Result.CategoryData> |
resultAsCategoryList() |
Fetches the result as a list of
Result.CategoryData objects. |
Result.CategoryNode |
resultAsCategoryTree() |
Fetches the result as a
Result.CategoryNode object, representing the root of a (possibly partial) category tree. |
Result.Completions |
resultAsCompletions() |
Fetches the result as Completions
|
Result.Corrections |
resultAsCorrections() |
Fetches the result as Corrections
|
Result.Count |
resultAsCount() |
Fetches the result as Count
|
Result.FacetList |
resultAsFacetList() |
Fetches the result as a FacetList.
|
Result.FacetRange |
resultAsFacetRange() |
Fetches the result as FacetRange
|
Result.Phrases |
resultAsPhrases() |
Fetches the result as Phrases
|
Result.Products |
resultAsProducts() |
Fetches the result as Products
|
Result.Values |
resultAsValues() |
Fetches the result as Values
|
PanelContent |
subpanel(String relativePath) |
Returns a sub panel given its relative path.
|
List<PanelContent> |
subpanels() |
Returns a list of all sub panels in this panel.
|
String |
ticket() |
Returns the ticket of the panel
|
String |
toString() |
public Map<String,String> attributes()
public boolean hasResult()
public Result result() throws PanelException
PanelException
- if there was an error evaluating the function in the eSales servicepublic boolean isZone()
public boolean hasSubpanel(String relativePath)
relativePath
- The simple name of the sub panelpublic PanelContent subpanel(String relativePath)
relativePath
- The relative path of the sub panelpublic List<PanelContent> subpanels()
public Path path()
public String ticket()
public Result.Corrections resultAsCorrections() throws ResultTypeException, PanelException
ResultTypeException
- if the result is not of type Corrections.PanelException
- if there was an error evaluating the function in the eSales servicepublic Result.Completions resultAsCompletions() throws ResultTypeException, PanelException
ResultTypeException
- if the result is not of type Completions.PanelException
- if there was an error evaluating the function in the eSales servicepublic Result.Count resultAsCount() throws ResultTypeException, PanelException
ResultTypeException
- if the result is not of type Count.PanelException
- if there was an error evaluating the function in the eSales servicepublic Result.Products resultAsProducts() throws ResultTypeException, PanelException
ResultTypeException
- if the result is not of type Products.PanelException
- if there was an error evaluating the function in the eSales servicepublic Result.Values resultAsValues() throws ResultTypeException, PanelException
ResultTypeException
- if the result is not of type Values.PanelException
- if there was an error evaluating the function in the eSales servicepublic Result.Phrases resultAsPhrases() throws ResultTypeException, PanelException
ResultTypeException
- if the result is not of type Phrases.PanelException
- if there was an error evaluating the function in the eSales servicepublic Result.Ads resultAsAds() throws ResultTypeException, PanelException
ResultTypeException
- if the result is not of type Ads.PanelException
- if there was an error evaluating the function in the eSales servicepublic Result.CategoryNode resultAsCategoryTree() throws ResultTypeException, PanelException
Result.CategoryNode
object, representing the root of a (possibly partial) category tree.
The tree can be traversed using for example Result.CategoryNode.getSubcategories()
, or utility methods such as
Result.CategoryNode.getSelectedSubcategory()
and Result.CategoryNode.findDescendant(String)
.ResultTypeException
- if the result is not of category_tree formatPanelException
- if there was an error evaluating the function in the eSales servicepublic List<Result.CategoryData> resultAsCategoryList() throws PanelException, ResultTypeException
Result.CategoryData
objects. These objects only hold information and do not
have links to subcategories or parent.ResultTypeException
- if the result is not a list of categoriesPanelException
- if there was an error evaluating the function in the eSales servicepublic Result.FacetRange resultAsFacetRange() throws PanelException, ResultTypeException
ResultTypeException
- if the result is not of type FacetRangePanelException
- if there was an error evaluating the function in the eSales servicepublic Result.FacetList resultAsFacetList() throws PanelException, ResultTypeException
Result.Values
or Result.FacetRange
.ResultTypeException
- if the result is not of type FacetListPanelException
- if there was an error evaluating the function in the eSales serviceCopyright © 2021 Apptus Technologies AB. All rights reserved.