Interface MenuItemService<P extends MenuItem>

  • All Superinterfaces:
    com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
    All Known Implementing Classes:
    DefaultMenuItemService

    public interface MenuItemService<P extends MenuItem>
    extends com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
    Service API for MenuItems. Supported by MenuItemRepository.
    Author:
    Samarth Dhruva (samarthd)
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      String getRepositoryDomain()  
      org.springframework.data.domain.Page<P> readAllByLabelAndParentMenuId​(String labelQuery, String parentMenuId, boolean rootsOnly, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Read all menu items for a menu, optionally filtered by label (ignoring case).
      List<P> readAllByParentMenuId​(String parentMenuId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Read all menu items that are children (both direct and indirect) of the specified Menu.
      List<P> readAllByParentMenuItemId​(String parentMenuItemId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Read all menu items that are direct children of the specified MenuItem.
      MenuItemAncestorList readAncestors​(String menuItemId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Accepts a menu item ID and returns a payload object containing the requested menu item and a list of its ancestors.
      • Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService

        create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort
      • Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService

        readAll, readAll, readAll, readAll
    • Method Detail

      • readAllByLabelAndParentMenuId

        org.springframework.data.domain.Page<P> readAllByLabelAndParentMenuId​(@Nullable
                                                                              String labelQuery,
                                                                              @NonNull
                                                                              String parentMenuId,
                                                                              boolean rootsOnly,
                                                                              @Nullable
                                                                              cz.jirutka.rsql.parser.ast.Node filters,
                                                                              @Nullable
                                                                              org.springframework.data.domain.Pageable page,
                                                                              @Nullable
                                                                              com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Read all menu items for a menu, optionally filtered by label (ignoring case).
        Parameters:
        labelQuery - (optional) the menu item label to filter by (ignoring case)
        parentMenuId - the context ID of the menu whose items should be returned
        rootsOnly - if true, restricts results to only the top-level menu items for the menu. Otherwise, returns all menu items for the menu.
        page - the requested page of results from the database
        filters - additional filters to apply in the query, can be null
        contextInfo - context information surrounding sandboxing and multitenant state
        Returns:
        all menu items, optionally filtered by name
      • readAllByParentMenuItemId

        List<P> readAllByParentMenuItemId​(@NonNull
                                          String parentMenuItemId,
                                          @Nullable
                                          com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Read all menu items that are direct children of the specified MenuItem. In other words, find all menu items who have the given parentMenuItemId set as their MenuItem.getParentMenuItemId().
        Parameters:
        parentMenuItemId - the context ID of the MenuItem whose direct children should be returned
        contextInfo - context information surrounding sandboxing and multitenant state
        Returns:
        all the menu items which are direct children of the specified menu item
      • readAllByParentMenuId

        List<P> readAllByParentMenuId​(@NonNull
                                      String parentMenuId,
                                      @Nullable
                                      com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Read all menu items that are children (both direct and indirect) of the specified Menu. In other words, find all menu items who have the given parentMenuId set as their MenuItem.getParentMenuId(). This effectively returns the entire set of MenuItems that are in a menu's tree.
        Parameters:
        parentMenuId - the context ID of the Menu whose children should be returned
        contextInfo - context information surrounding sandboxing and multitenant state
        Returns:
        all the menu items which are children of the specified menu
      • readAncestors

        @NonNull
        MenuItemAncestorList readAncestors​(@NonNull
                                           String menuItemId,
                                           @Nullable
                                           com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Accepts a menu item ID and returns a payload object containing the requested menu item and a list of its ancestors.
        Parameters:
        menuItemId - the context ID of the menu item whose ancestors should be found
        contextInfo - context information surrounding sandboxing and multitenant state
        Returns:
        a payload object containing the requested menu item and a list of its ancestors, sorted with the immediate parent at the beginning and the top-level parent at the end
      • getRepositoryDomain

        @NonNull
        String getRepositoryDomain()