Package com.hybris.backoffice.tree.model
Class CatalogTreeModelPopulator
java.lang.Object
com.hybris.backoffice.tree.model.CatalogTreeModelPopulator
- All Implemented Interfaces:
com.hybris.cockpitng.model.ComponentModelPopulator<org.zkoss.zul.TreeModel<org.zkoss.zul.TreeNode<ItemModel>>>,com.hybris.cockpitng.tree.node.DynamicNodePopulator,com.hybris.cockpitng.tree.node.SearchableDynamicNodePopulator
- Direct Known Subclasses:
BundleTemplatesModelPopulator
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCategoriesFromTheTail(Map<CategoryModel, org.apache.commons.math3.util.Pair<com.hybris.cockpitng.tree.node.DynamicNode, List<com.hybris.backoffice.navigation.NavigationNode>>> treeNodes, com.hybris.cockpitng.tree.node.SearchableDynamicNodePopulator treeNodesToTreePopulator, List<CategoryModel> tail, org.apache.commons.math3.util.Pair<com.hybris.cockpitng.tree.node.DynamicNode, List<com.hybris.backoffice.navigation.NavigationNode>> categoryNode) protected List<com.hybris.backoffice.navigation.NavigationNode>buildFlatListNodes(com.hybris.cockpitng.tree.node.DynamicNode parent, CatalogVersionModel cv, com.hybris.cockpitng.search.data.pageable.Pageable<CategoryModel> result, int totalCount) protected List<com.hybris.backoffice.navigation.NavigationNode>buildOverflowNode(int total, int max, CatalogVersionModel cv) protected List<com.hybris.backoffice.navigation.NavigationNode>buildSpanningTree(com.hybris.cockpitng.tree.node.DynamicNode root, String filterString, CatalogVersionModel cv, com.hybris.cockpitng.search.data.pageable.Pageable<CategoryModel> data) protected List<com.hybris.backoffice.navigation.NavigationNode>buildSpanningTree(com.hybris.cockpitng.tree.node.DynamicNode root, List<CategoryModel> categories, CatalogVersionModel cv) This method builds spanning tree for given categories as described in the documentation of the Explorer Tree Catalog Tree Model Populator.protected com.hybris.cockpitng.core.context.CockpitContextcreateCockpitContext(com.hybris.backoffice.navigation.NavigationNode node) protected com.hybris.cockpitng.tree.node.DynamicNodecreateDynamicNode(com.hybris.backoffice.navigation.NavigationNode parent, Object data, String label, com.hybris.cockpitng.tree.node.DynamicNodePopulator populator, boolean expanded) protected com.hybris.cockpitng.tree.node.DynamicNodecreateDynamicNode(com.hybris.backoffice.navigation.NavigationNode node, org.zkoss.zul.TreeNode<?> treeNode, String label) protected StringcreateDynamicNodeId(com.hybris.backoffice.navigation.NavigationNode node, String postFix) org.zkoss.zul.TreeModel<org.zkoss.zul.TreeNode<ItemModel>>createModel(com.hybris.cockpitng.core.context.CockpitContext context) protected StringcreateParentNodesIdPrefix(com.hybris.backoffice.navigation.NavigationNode node) protected List<com.hybris.backoffice.navigation.NavigationNode>filterAvailableCategories(Function<org.zkoss.zul.TreeNode, com.hybris.cockpitng.tree.node.DynamicNode> nodeCreator, Collection<CategoryModel> categories) filterConfiguredCategoryAttributes(Set<String> validAttributes, Collection<String> configuredAttributes) protected List<com.hybris.backoffice.navigation.NavigationNode>findChildrenNavigationNodes(com.hybris.backoffice.navigation.NavigationNode node) protected Collection<CatalogVersionModel>getAllReadableCatalogs(com.hybris.cockpitng.core.context.CockpitContext context) protected List<CatalogVersionModel>protected Collection<CatalogVersionModel>protected Function<org.zkoss.zul.TreeNode,com.hybris.cockpitng.tree.node.DynamicNode> getCategoryDynamicNodeCreatorFunction(com.hybris.backoffice.navigation.NavigationNode node) List<com.hybris.backoffice.navigation.NavigationNode>getChildren(com.hybris.backoffice.navigation.NavigationNode node) List<com.hybris.backoffice.navigation.NavigationNode>getChildren(com.hybris.cockpitng.tree.node.DynamicNode parent, String filterString, boolean camelCase, com.hybris.cockpitng.tree.util.TreeUtils.MatchMode matchMode) com.hybris.cockpitng.core.user.CockpitUserServiceDeprecated, for removal: This API element is subject to removal in a future version.com.hybris.cockpitng.dataaccess.facades.search.FieldSearchFacadeintintgetFlatListThreshold(com.hybris.cockpitng.tree.node.DynamicNode parent) protected intgetIndexingDepth(com.hybris.backoffice.navigation.NavigationNode node) com.hybris.cockpitng.labels.LabelServicegetLookupQueryAttributes(com.hybris.cockpitng.tree.node.DynamicNode parent) intintgetOverflowThreshold(com.hybris.cockpitng.tree.node.DynamicNode parent) intcom.hybris.cockpitng.dataaccess.facades.permissions.PermissionFacadeprotected Function<org.zkoss.zul.TreeNode,com.hybris.cockpitng.tree.node.DynamicNode> getRegularNodeCreatorFunction(com.hybris.backoffice.navigation.NavigationNode node) org.zkoss.zul.TreeNode<ItemModel>getRoot(com.hybris.cockpitng.core.context.CockpitContext context) protected SessionServicecom.hybris.cockpitng.dataaccess.facades.type.TypeFacadebooleanbooleanisAllowForFlatList(com.hybris.cockpitng.tree.node.DynamicNode parent) protected booleanisCatalogAvailableInContext(CatalogModel catalogModel, com.hybris.cockpitng.core.context.CockpitContext context) protected booleanisCatalogVersionAvailableInContext(CatalogVersionModel catalogVersionModel, com.hybris.cockpitng.core.context.CockpitContext context) protected booleanisParentIdAppended(String parentId, StringBuilder childId) protected booleanisRootCategory(CategoryModel category, CatalogVersionModel cv) protected booleanisSearchBasedPopulatorActive(com.hybris.cockpitng.tree.node.DynamicNode parent) protected booleanisSupportedType(String typeCode) protected List<com.hybris.backoffice.navigation.NavigationNode>partitionNodes(com.hybris.backoffice.navigation.NavigationNode parent, List<com.hybris.backoffice.navigation.NavigationNode> nodes) voidprotected com.hybris.cockpitng.tree.node.DynamicNodeprepareAllCatalogsNode(com.hybris.backoffice.navigation.NavigationNode rootNode) protected List<com.hybris.backoffice.navigation.NavigationNode>prepareCatalogNodes(com.hybris.backoffice.navigation.NavigationNode node) protected List<com.hybris.backoffice.navigation.NavigationNode>prepareCatalogVersionNodes(com.hybris.backoffice.navigation.NavigationNode node, CatalogModel nodeData) protected StringprepareNodeLabel(Object data, com.hybris.backoffice.navigation.NavigationNode parentNode, Function<Object, String> labelServiceFn) protected StringprepareNodeLabel(org.zkoss.zul.TreeNode treeNode, com.hybris.backoffice.navigation.NavigationNode parentNode, Function<Object, String> labelServiceFn) protected com.hybris.backoffice.widgets.advancedsearch.engine.AdvancedSearchQueryDatapreparePopulatingQuery(com.hybris.cockpitng.tree.node.DynamicNode parent, CatalogVersionModel cv, String filterString, boolean caseSensitive, com.hybris.cockpitng.tree.util.TreeUtils.MatchMode matchMode) protected List<com.hybris.backoffice.navigation.NavigationNode>prepareRootCategoryNodes(com.hybris.backoffice.navigation.NavigationNode node, CatalogVersionModel nodeData) protected List<com.hybris.backoffice.navigation.NavigationNode>prepareSubcategoryNodes(com.hybris.backoffice.navigation.NavigationNode node, CategoryModel nodeData) protected com.hybris.cockpitng.tree.node.DynamicNodeprepareUncategorizedProductsNode(com.hybris.backoffice.navigation.NavigationNode rootNode, ItemModel parentObject) protected com.hybris.cockpitng.search.data.ValueComparisonOperatorresolvedMatchOperator(com.hybris.cockpitng.tree.util.TreeUtils.MatchMode matchMode) voidsetAllowForFlatList(boolean allowForFlatList) voidsetCatalogService(CatalogService catalogService) voidsetCatalogTreeSimpleLabelProvider(CatalogTreeSimpleLabelProvider catalogTreeSimpleLabelProvider) voidsetCatalogVersionService(CatalogVersionService catalogVersionService) voidsetCockpitUserService(com.hybris.cockpitng.core.user.CockpitUserService cockpitUserService) Deprecated, for removal: This API element is subject to removal in a future version.since 19.05 - implementation not use it any more, seegetAllReadableCatalogVersionsForCurrentUser()voidsetExcludedTypes(Set<String> excludedTypes) voidsetFieldSearchFacade(com.hybris.cockpitng.dataaccess.facades.search.FieldSearchFacade fieldSearchFacade) voidsetFlatListThreshold(int flatListThreshold) voidsetLabelService(com.hybris.cockpitng.labels.LabelService labelService) voidsetLookupQueryAttributes(Set<String> lookupQueryAttributes) voidsetOverflowThreshold(int overflowThreshold) voidsetPartitionThreshold(int partitionThreshold) voidsetPermissionFacade(com.hybris.cockpitng.dataaccess.facades.permissions.PermissionFacade permissionFacade) voidsetSessionService(SessionService sessionService) voidsetTypeFacade(com.hybris.cockpitng.dataaccess.facades.type.TypeFacade typeFacade) voidsetTypeService(TypeService typeService) voidsetUserService(UserService userService) protected booleanshowUncategorizedNodeForCatalogVersion(com.hybris.backoffice.navigation.NavigationNode node, CatalogVersionModel nodeData) protected booleansimpleLabelsEnabled(com.hybris.backoffice.navigation.NavigationNode node) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hybris.cockpitng.tree.node.SearchableDynamicNodePopulator
getChildren
-
Field Details
-
MULTI_SELECT
-
SHOW_ALL_CATALOGS_NODE
-
SHOW_UNCATEGORIZED_ROOT_NODE
-
SHOW_UNCATEGORIZED_CATALOG_NODE
-
SHOW_UNCATEGORIZED_CATALOG_VERSION_NODE
-
SHOW_UNCATEGORIZED_CLASSIFICATION_CATALOG_VERSION_NODE
-
ALL_CATALOGS_NODE_ID
- See Also:
-
UNCATEGORIZED_PRODUCTS_NODE_ID
- See Also:
-
I18N_CATALOGTREEMODELPOPULATOR_ALLCATALOGS
- See Also:
-
I18N_CATALOGTREEMODELPOPULATOR_UNCATEGORIZED
- See Also:
-
SIMPLE_LABELS_CTX_PARAMETERS
- See Also:
-
BACKOFFICE_CONFIGURATION_CATALOG_ID
- See Also:
-
I18N_EXPLORER_TREE_FILTERED_TOO_MANY_RESULT
- See Also:
-
FALLBACK_OVERFLOW_THRESHOLD_VALUE
public static final int FALLBACK_OVERFLOW_THRESHOLD_VALUE- See Also:
-
CONFIG_BACKOFFICE_CATALOG_TREE_POPULATOR_SEARCH_BASED_ACTIVE
- See Also:
-
CTX_TREE_LOOKUP_FS_ENABLED
- See Also:
-
CTX_TREE_LOOKUP_ATTRIBUTES
- See Also:
-
CTX_TREE_LOOKUP_ALLOW_FOR_FLAT_LIST
- See Also:
-
CTX_TREE_LOOKUP_FLAT_LIST_THRESHOLD
- See Also:
-
CTX_TREE_LOOKUP_OVERFLOW_THRESHOLD
- See Also:
-
-
Constructor Details
-
CatalogTreeModelPopulator
public CatalogTreeModelPopulator()
-
-
Method Details
-
postConstruct
@PostConstruct public void postConstruct() -
createModel
public org.zkoss.zul.TreeModel<org.zkoss.zul.TreeNode<ItemModel>> createModel(com.hybris.cockpitng.core.context.CockpitContext context) - Specified by:
createModelin interfacecom.hybris.cockpitng.model.ComponentModelPopulator<org.zkoss.zul.TreeModel<org.zkoss.zul.TreeNode<ItemModel>>>
-
getChildren
public List<com.hybris.backoffice.navigation.NavigationNode> getChildren(com.hybris.cockpitng.tree.node.DynamicNode parent, String filterString, boolean camelCase, com.hybris.cockpitng.tree.util.TreeUtils.MatchMode matchMode) - Specified by:
getChildrenin interfacecom.hybris.cockpitng.tree.node.SearchableDynamicNodePopulator
-
isSearchBasedPopulatorActive
protected boolean isSearchBasedPopulatorActive(com.hybris.cockpitng.tree.node.DynamicNode parent) - Parameters:
parent-- Returns:
- true in case the search-based tre population should be used, false otherwise
-
buildFlatListNodes
protected List<com.hybris.backoffice.navigation.NavigationNode> buildFlatListNodes(com.hybris.cockpitng.tree.node.DynamicNode parent, CatalogVersionModel cv, com.hybris.cockpitng.search.data.pageable.Pageable<CategoryModel> result, int totalCount) -
buildOverflowNode
protected List<com.hybris.backoffice.navigation.NavigationNode> buildOverflowNode(int total, int max, CatalogVersionModel cv) -
preparePopulatingQuery
protected com.hybris.backoffice.widgets.advancedsearch.engine.AdvancedSearchQueryData preparePopulatingQuery(com.hybris.cockpitng.tree.node.DynamicNode parent, CatalogVersionModel cv, String filterString, boolean caseSensitive, com.hybris.cockpitng.tree.util.TreeUtils.MatchMode matchMode) -
resolvedMatchOperator
protected com.hybris.cockpitng.search.data.ValueComparisonOperator resolvedMatchOperator(com.hybris.cockpitng.tree.util.TreeUtils.MatchMode matchMode) -
buildSpanningTree
protected List<com.hybris.backoffice.navigation.NavigationNode> buildSpanningTree(com.hybris.cockpitng.tree.node.DynamicNode root, String filterString, CatalogVersionModel cv, com.hybris.cockpitng.search.data.pageable.Pageable<CategoryModel> data) -
buildSpanningTree
protected List<com.hybris.backoffice.navigation.NavigationNode> buildSpanningTree(com.hybris.cockpitng.tree.node.DynamicNode root, List<CategoryModel> categories, CatalogVersionModel cv) This method builds spanning tree for given categories as described in the documentation of the Explorer Tree Catalog Tree Model Populator.- Parameters:
root- parentDynamicNodecategories- Categories to be included in the treecv- catalog version to which the nodes should belong- Returns:
- list of direct children of the given root node
-
addCategoriesFromTheTail
protected void addCategoriesFromTheTail(Map<CategoryModel, org.apache.commons.math3.util.Pair<com.hybris.cockpitng.tree.node.DynamicNode, List<com.hybris.backoffice.navigation.NavigationNode>>> treeNodes, com.hybris.cockpitng.tree.node.SearchableDynamicNodePopulator treeNodesToTreePopulator, List<CategoryModel> tail, org.apache.commons.math3.util.Pair<com.hybris.cockpitng.tree.node.DynamicNode, List<com.hybris.backoffice.navigation.NavigationNode>> categoryNode) -
isRootCategory
-
isParentIdAppended
-
filterAvailableCategories
protected List<com.hybris.backoffice.navigation.NavigationNode> filterAvailableCategories(Function<org.zkoss.zul.TreeNode, com.hybris.cockpitng.tree.node.DynamicNode> nodeCreator, Collection<CategoryModel> categories) -
getAllReadableCatalogs
public Collection<CatalogModel> getAllReadableCatalogs(com.hybris.cockpitng.core.context.CockpitContext context) -
isCatalogAvailableInContext
protected boolean isCatalogAvailableInContext(CatalogModel catalogModel, com.hybris.cockpitng.core.context.CockpitContext context) -
isCatalogVersionAvailableInContext
protected boolean isCatalogVersionAvailableInContext(CatalogVersionModel catalogVersionModel, com.hybris.cockpitng.core.context.CockpitContext context) -
getRoot
public org.zkoss.zul.TreeNode<ItemModel> getRoot(com.hybris.cockpitng.core.context.CockpitContext context) -
getCatalogService
-
setCatalogService
-
getPermissionFacade
public com.hybris.cockpitng.dataaccess.facades.permissions.PermissionFacade getPermissionFacade() -
setPermissionFacade
public void setPermissionFacade(com.hybris.cockpitng.dataaccess.facades.permissions.PermissionFacade permissionFacade) -
getCatalogVersionService
-
setCatalogVersionService
-
getCockpitUserService
@Deprecated(since="19.05", forRemoval=true) public com.hybris.cockpitng.core.user.CockpitUserService getCockpitUserService()Deprecated, for removal: This API element is subject to removal in a future version.since 19.05 - implementation not use it any more, seegetAllReadableCatalogVersionsForCurrentUser() -
setCockpitUserService
@Deprecated(since="19.05", forRemoval=true) public void setCockpitUserService(com.hybris.cockpitng.core.user.CockpitUserService cockpitUserService) Deprecated, for removal: This API element is subject to removal in a future version.since 19.05 - implementation not use it any more, seegetAllReadableCatalogVersionsForCurrentUser() -
getUserService
-
setUserService
-
getAllReadableCatalogVersions
-
getAllReadableCatalogVersionsForCurrentUser
-
getAllCatalogVersions
-
isSupportedType
-
getTypeFacade
public com.hybris.cockpitng.dataaccess.facades.type.TypeFacade getTypeFacade() -
setTypeFacade
public void setTypeFacade(com.hybris.cockpitng.dataaccess.facades.type.TypeFacade typeFacade) -
getFieldSearchFacade
public com.hybris.cockpitng.dataaccess.facades.search.FieldSearchFacade getFieldSearchFacade() -
setFieldSearchFacade
public void setFieldSearchFacade(com.hybris.cockpitng.dataaccess.facades.search.FieldSearchFacade fieldSearchFacade) -
getTypeService
-
setTypeService
-
getPartitionThreshold
public int getPartitionThreshold() -
setPartitionThreshold
public void setPartitionThreshold(int partitionThreshold) -
getCatalogTreeSimpleLabelProvider
-
setCatalogTreeSimpleLabelProvider
public void setCatalogTreeSimpleLabelProvider(CatalogTreeSimpleLabelProvider catalogTreeSimpleLabelProvider) -
getExcludedTypes
-
setExcludedTypes
-
getLabelService
public com.hybris.cockpitng.labels.LabelService getLabelService() -
setLabelService
public void setLabelService(com.hybris.cockpitng.labels.LabelService labelService) -
getSessionService
-
setSessionService
-
getOverflowThreshold
public int getOverflowThreshold() -
setOverflowThreshold
public void setOverflowThreshold(int overflowThreshold) -
getOverflowThreshold
public int getOverflowThreshold(com.hybris.cockpitng.tree.node.DynamicNode parent) -
getFlatListThreshold
public int getFlatListThreshold() -
setFlatListThreshold
public void setFlatListThreshold(int flatListThreshold) -
getFlatListThreshold
public int getFlatListThreshold(com.hybris.cockpitng.tree.node.DynamicNode parent) -
isAllowForFlatList
public boolean isAllowForFlatList() -
setAllowForFlatList
public void setAllowForFlatList(boolean allowForFlatList) -
isAllowForFlatList
public boolean isAllowForFlatList(com.hybris.cockpitng.tree.node.DynamicNode parent) -
getLookupQueryAttributes
-
setLookupQueryAttributes
-
getLookupQueryAttributes
-
filterConfiguredCategoryAttributes
-
getAllReadableCatalogVersionsForCurrentUser()