public class CatalogAutoNav extends HierarchyTypeAutoNav<ProductReference>
Modifier and Type | Class and Description |
---|---|
static class |
CatalogAutoNav.CatalogMenuItem |
filterNodesWithNames, filterPredicate
Constructor and Description |
---|
CatalogAutoNav() |
Modifier and Type | Method and Description |
---|---|
protected MenuItem |
addNode(MenuItem parent,
ProductReference node,
List<MenuItem> children)
Add Leaf nodes
|
MenuItem |
getGeneratedMenuItem(Object... params)
Generate a Menu based on context, logic and some optional/additional params
|
org.apache.commons.collections.Transformer |
getProductPagePathLookup()
Allows for an algorithm to determine the path of the product page
The Transformer is expected to take in ProductReference as input and give the path as String |
Map<String,String[]> |
getReferenceToPathMapping(Object... params)
A
MenuItem.getRefId() points to the raw resource that the menu points to (like classpath name). |
protected String |
getRefId(ProductReference prodReference)
Override this method and customize it to App Page specific path
Default it will only return the product name suffixed to productPagePathLookup |
protected boolean |
isNodeNavigable(ProductReference prodReference) |
void |
setProductPagePathLookup(org.apache.commons.collections.Transformer productPagePathLookup)
Allows for an algorithm to determine the path of the product page
The Transformer is expected to take in ProductReference as input and give the path as String |
add, assignRootLevel, getFilterNodesWithNames, getGeneratedPageMenuMap, getId, setFilterNodesWithNames, setId, toString, transform
protected MenuItem addNode(MenuItem parent, ProductReference node, List<MenuItem> children)
HierarchyTypeAutoNav
addNode
in class HierarchyTypeAutoNav<ProductReference>
parent
- as MenuItem
as the node to add children undernode
- as type IHierarchialReference
children
- as List of MenuItem
protected String getRefId(ProductReference prodReference)
productPagePathLookup
getRefId
in class HierarchyTypeAutoNav<ProductReference>
String
protected boolean isNodeNavigable(ProductReference prodReference)
isNodeNavigable
in class HierarchyTypeAutoNav<ProductReference>
MenuItem.isNavigable()
public MenuItem getGeneratedMenuItem(Object... params)
IMenuGenerator
getGeneratedMenuItem
in interface IMenuGenerator
getGeneratedMenuItem
in class HierarchyTypeAutoNav<ProductReference>
params
- optionalMenuItem
public Map<String,String[]> getReferenceToPathMapping(Object... params)
IMenuPathMapper
MenuItem.getRefId()
points to the raw resource that the menu points to (like classpath name).
To generate the Page Menu Map when the refId is not same as app path we require the additional mapping(s).
Note, a reference can have multiple path aliases.Map
of String to String arraypublic org.apache.commons.collections.Transformer getProductPagePathLookup()
Transformer
is expected to take in ProductReference as input and give the path as StringProductPagePathTransformer
public void setProductPagePathLookup(org.apache.commons.collections.Transformer productPagePathLookup)
Transformer
is expected to take in ProductReference as input and give the path as StringProductPagePathTransformer
Copyright © 2018. All rights reserved.