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

public class CatalogTreeModelPopulator extends Object implements com.hybris.cockpitng.model.ComponentModelPopulator<org.zkoss.zul.TreeModel<org.zkoss.zul.TreeNode<ItemModel>>>, com.hybris.cockpitng.tree.node.SearchableDynamicNodePopulator
  • Field Details

    • MULTI_SELECT

      public static final String MULTI_SELECT
    • SHOW_ALL_CATALOGS_NODE

      public static final String SHOW_ALL_CATALOGS_NODE
    • SHOW_UNCATEGORIZED_ROOT_NODE

      public static final String SHOW_UNCATEGORIZED_ROOT_NODE
    • SHOW_UNCATEGORIZED_CATALOG_NODE

      public static final String SHOW_UNCATEGORIZED_CATALOG_NODE
    • SHOW_UNCATEGORIZED_CATALOG_VERSION_NODE

      public static final String SHOW_UNCATEGORIZED_CATALOG_VERSION_NODE
    • SHOW_UNCATEGORIZED_CLASSIFICATION_CATALOG_VERSION_NODE

      public static final String SHOW_UNCATEGORIZED_CLASSIFICATION_CATALOG_VERSION_NODE
    • ALL_CATALOGS_NODE_ID

      public static final String ALL_CATALOGS_NODE_ID
      See Also:
    • UNCATEGORIZED_PRODUCTS_NODE_ID

      public static final String UNCATEGORIZED_PRODUCTS_NODE_ID
      See Also:
    • I18N_CATALOGTREEMODELPOPULATOR_ALLCATALOGS

      public static final String I18N_CATALOGTREEMODELPOPULATOR_ALLCATALOGS
      See Also:
    • I18N_CATALOGTREEMODELPOPULATOR_UNCATEGORIZED

      public static final String I18N_CATALOGTREEMODELPOPULATOR_UNCATEGORIZED
      See Also:
    • SIMPLE_LABELS_CTX_PARAMETERS

      public static final String SIMPLE_LABELS_CTX_PARAMETERS
      See Also:
    • BACKOFFICE_CONFIGURATION_CATALOG_ID

      public static final String BACKOFFICE_CONFIGURATION_CATALOG_ID
      See Also:
    • I18N_EXPLORER_TREE_FILTERED_TOO_MANY_RESULT

      public static final String 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

      public static final String CONFIG_BACKOFFICE_CATALOG_TREE_POPULATOR_SEARCH_BASED_ACTIVE
      See Also:
    • CTX_TREE_LOOKUP_FS_ENABLED

      public static final String CTX_TREE_LOOKUP_FS_ENABLED
      See Also:
    • CTX_TREE_LOOKUP_ATTRIBUTES

      public static final String CTX_TREE_LOOKUP_ATTRIBUTES
      See Also:
    • CTX_TREE_LOOKUP_ALLOW_FOR_FLAT_LIST

      public static final String CTX_TREE_LOOKUP_ALLOW_FOR_FLAT_LIST
      See Also:
    • CTX_TREE_LOOKUP_FLAT_LIST_THRESHOLD

      public static final String CTX_TREE_LOOKUP_FLAT_LIST_THRESHOLD
      See Also:
    • CTX_TREE_LOOKUP_OVERFLOW_THRESHOLD

      public static final String 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:
      createModel in interface com.hybris.cockpitng.model.ComponentModelPopulator<org.zkoss.zul.TreeModel<org.zkoss.zul.TreeNode<ItemModel>>>
    • getChildren

      public List<com.hybris.backoffice.navigation.NavigationNode> getChildren(com.hybris.backoffice.navigation.NavigationNode node)
      Specified by:
      getChildren in interface com.hybris.cockpitng.tree.node.DynamicNodePopulator
    • 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:
      getChildren in interface com.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 - parent DynamicNode
      categories - Categories to be included in the tree
      cv - 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

      protected boolean isRootCategory(CategoryModel category, CatalogVersionModel cv)
    • findChildrenNavigationNodes

      protected List<com.hybris.backoffice.navigation.NavigationNode> findChildrenNavigationNodes(com.hybris.backoffice.navigation.NavigationNode node)
    • prepareCatalogNodes

      protected List<com.hybris.backoffice.navigation.NavigationNode> prepareCatalogNodes(com.hybris.backoffice.navigation.NavigationNode node)
    • prepareCatalogVersionNodes

      protected List<com.hybris.backoffice.navigation.NavigationNode> prepareCatalogVersionNodes(com.hybris.backoffice.navigation.NavigationNode node, CatalogModel nodeData)
    • prepareRootCategoryNodes

      protected List<com.hybris.backoffice.navigation.NavigationNode> prepareRootCategoryNodes(com.hybris.backoffice.navigation.NavigationNode node, CatalogVersionModel nodeData)
    • showUncategorizedNodeForCatalogVersion

      protected boolean showUncategorizedNodeForCatalogVersion(com.hybris.backoffice.navigation.NavigationNode node, CatalogVersionModel nodeData)
    • prepareSubcategoryNodes

      protected List<com.hybris.backoffice.navigation.NavigationNode> prepareSubcategoryNodes(com.hybris.backoffice.navigation.NavigationNode node, CategoryModel nodeData)
    • getRegularNodeCreatorFunction

      protected Function<org.zkoss.zul.TreeNode,com.hybris.cockpitng.tree.node.DynamicNode> getRegularNodeCreatorFunction(com.hybris.backoffice.navigation.NavigationNode node)
    • getCategoryDynamicNodeCreatorFunction

      protected Function<org.zkoss.zul.TreeNode,com.hybris.cockpitng.tree.node.DynamicNode> getCategoryDynamicNodeCreatorFunction(com.hybris.backoffice.navigation.NavigationNode node)
    • prepareNodeLabel

      protected String prepareNodeLabel(org.zkoss.zul.TreeNode treeNode, com.hybris.backoffice.navigation.NavigationNode parentNode, Function<Object,String> labelServiceFn)
    • prepareNodeLabel

      protected String prepareNodeLabel(Object data, com.hybris.backoffice.navigation.NavigationNode parentNode, Function<Object,String> labelServiceFn)
    • createDynamicNode

      protected com.hybris.cockpitng.tree.node.DynamicNode createDynamicNode(com.hybris.backoffice.navigation.NavigationNode node, org.zkoss.zul.TreeNode<?> treeNode, String label)
    • createDynamicNode

      protected com.hybris.cockpitng.tree.node.DynamicNode createDynamicNode(com.hybris.backoffice.navigation.NavigationNode parent, Object data, String label, com.hybris.cockpitng.tree.node.DynamicNodePopulator populator, boolean expanded)
    • simpleLabelsEnabled

      protected boolean simpleLabelsEnabled(com.hybris.backoffice.navigation.NavigationNode node)
    • prepareAllCatalogsNode

      protected com.hybris.cockpitng.tree.node.DynamicNode prepareAllCatalogsNode(com.hybris.backoffice.navigation.NavigationNode rootNode)
    • prepareUncategorizedProductsNode

      protected com.hybris.cockpitng.tree.node.DynamicNode prepareUncategorizedProductsNode(com.hybris.backoffice.navigation.NavigationNode rootNode, ItemModel parentObject)
    • createDynamicNodeId

      protected String createDynamicNodeId(com.hybris.backoffice.navigation.NavigationNode node, String postFix)
    • createParentNodesIdPrefix

      protected String createParentNodesIdPrefix(com.hybris.backoffice.navigation.NavigationNode node)
    • isParentIdAppended

      protected boolean isParentIdAppended(String parentId, StringBuilder childId)
    • filterAvailableCategories

      protected List<com.hybris.backoffice.navigation.NavigationNode> filterAvailableCategories(Function<org.zkoss.zul.TreeNode,com.hybris.cockpitng.tree.node.DynamicNode> nodeCreator, Collection<CategoryModel> categories)
    • partitionNodes

      protected List<com.hybris.backoffice.navigation.NavigationNode> partitionNodes(com.hybris.backoffice.navigation.NavigationNode parent, List<com.hybris.backoffice.navigation.NavigationNode> nodes)
    • getIndexingDepth

      protected int getIndexingDepth(com.hybris.backoffice.navigation.NavigationNode node)
    • createCockpitContext

      protected com.hybris.cockpitng.core.context.CockpitContext createCockpitContext(com.hybris.backoffice.navigation.NavigationNode node)
    • 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

      public CatalogService getCatalogService()
    • setCatalogService

      public void setCatalogService(CatalogService catalogService)
    • getPermissionFacade

      public com.hybris.cockpitng.dataaccess.facades.permissions.PermissionFacade getPermissionFacade()
    • setPermissionFacade

      public void setPermissionFacade(com.hybris.cockpitng.dataaccess.facades.permissions.PermissionFacade permissionFacade)
    • getCatalogVersionService

      public CatalogVersionService getCatalogVersionService()
    • setCatalogVersionService

      public void setCatalogVersionService(CatalogVersionService catalogVersionService)
    • 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, see getAllReadableCatalogVersionsForCurrentUser()
    • 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, see getAllReadableCatalogVersionsForCurrentUser()
    • getUserService

      public UserService getUserService()
    • setUserService

      public void setUserService(UserService userService)
    • getAllReadableCatalogVersions

      protected List<CatalogVersionModel> getAllReadableCatalogVersions(CatalogModel data)
    • getAllReadableCatalogVersionsForCurrentUser

      protected Collection<CatalogVersionModel> getAllReadableCatalogVersionsForCurrentUser()
    • getAllCatalogVersions

      protected Collection<CatalogVersionModel> getAllCatalogVersions()
    • isSupportedType

      protected boolean isSupportedType(String typeCode)
    • 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

      public TypeService getTypeService()
    • setTypeService

      public void setTypeService(TypeService typeService)
    • getPartitionThreshold

      public int getPartitionThreshold()
    • setPartitionThreshold

      public void setPartitionThreshold(int partitionThreshold)
    • getCatalogTreeSimpleLabelProvider

      public CatalogTreeSimpleLabelProvider getCatalogTreeSimpleLabelProvider()
    • setCatalogTreeSimpleLabelProvider

      public void setCatalogTreeSimpleLabelProvider(CatalogTreeSimpleLabelProvider catalogTreeSimpleLabelProvider)
    • getExcludedTypes

      public Set<String> getExcludedTypes()
    • setExcludedTypes

      public void setExcludedTypes(Set<String> excludedTypes)
    • getLabelService

      public com.hybris.cockpitng.labels.LabelService getLabelService()
    • setLabelService

      public void setLabelService(com.hybris.cockpitng.labels.LabelService labelService)
    • getSessionService

      protected SessionService getSessionService()
    • setSessionService

      public void setSessionService(SessionService sessionService)
    • 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

      public Set<String> getLookupQueryAttributes()
    • setLookupQueryAttributes

      public void setLookupQueryAttributes(Set<String> lookupQueryAttributes)
    • getLookupQueryAttributes

      public Set<String> getLookupQueryAttributes(com.hybris.cockpitng.tree.node.DynamicNode parent)
    • filterConfiguredCategoryAttributes

      protected Set<String> filterConfiguredCategoryAttributes(Set<String> validAttributes, Collection<String> configuredAttributes)