Class DefaultMenuService<P extends Menu>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
com.broadleafcommerce.menu.service.DefaultMenuService<P>
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>
,com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
,MenuService<P>
public class DefaultMenuService<P extends Menu>
extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
implements MenuService<P>
- Author:
- Samarth Dhruva (samarthd)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultMenuService
(MenuRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, MenuItemService<MenuItem> menuItemService, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> parser) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.common.extension.cache.CacheStateManager
protected com.broadleafcommerce.common.extension.cache.key.ContextKeyGen
protected MenuItemService<? extends MenuItem>
getMenuWithNavigationTree
(String menuName, int depthLimit, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Accepts a menu name and returns the menu with itssubmenu
fully populated.protected Optional<NavigableMenu>
getMenuWithNavigationTreeInternal
(String menuName, int depthLimit, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected MenuRepository<com.broadleafcommerce.data.tracking.core.Trackable>
getTenantOwnedMenu
(List<P> list) protected com.broadleafcommerce.common.extension.TypeFactory
org.springframework.data.domain.Page<P>
readAllByName
(String nameQuery, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Read all menus, optionally filtered by name.readByName
(String menuName, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds the menu with the given name (should only be one result, as menu names are unique).void
setCacheStateManager
(com.broadleafcommerce.common.extension.cache.CacheStateManager cacheStateManager) void
setMenuCacheByNameKeyGen
(com.broadleafcommerce.common.extension.cache.key.ContextKeyGen menuCacheByNameKeyGen) Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService
getRsqlHelper, readAll, readAll, readAll, readAll
Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService
convertFromPersistentDomain, convertToPersistentDomain, create, createAll, createAllAllowingPartialSuccess, delete, getHelper, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSort
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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
-
Field Details
-
CACHE_BY_MENU
- See Also:
-
-
Constructor Details
-
Method Details
-
readAllByName
public org.springframework.data.domain.Page<P> readAllByName(@Nullable String nameQuery, @NonNull cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:MenuService
Read all menus, optionally filtered by name.- Specified by:
readAllByName
in interfaceMenuService<P extends Menu>
- Parameters:
nameQuery
- (optional) the menu name to filter byfilters
- additional filters to apply in the query, can be nullpage
- the requested page of results from the databasecontext
- context information surrounding sandboxing and multitenant state- Returns:
- all menus, optionally filtered by name
-
readByName
public Optional<P> readByName(@NonNull String menuName, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:MenuService
Finds the menu with the given name (should only be one result, as menu names are unique).- Specified by:
readByName
in interfaceMenuService<P extends Menu>
- Parameters:
menuName
- the menu name of the menu that should be retrievedcontextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- an
Optional
containing the menu with the given name, empty if not found
-
getTenantOwnedMenu
-
getRepositoryDomain
- Specified by:
getRepositoryDomain
in interfaceMenuService<P extends Menu>
-
getRepository
@NonNull protected MenuRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository() -
getMenuItemService
-
getTypeFactory
@NonNull protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getCacheStateManager
@Nullable protected com.broadleafcommerce.common.extension.cache.CacheStateManager getCacheStateManager() -
setCacheStateManager
@Autowired(required=false) public void setCacheStateManager(@Nullable com.broadleafcommerce.common.extension.cache.CacheStateManager cacheStateManager) -
setMenuCacheByNameKeyGen
@Autowired(required=false) @Qualifier("menuCacheByMenu") public void setMenuCacheByNameKeyGen(@Nullable com.broadleafcommerce.common.extension.cache.key.ContextKeyGen menuCacheByNameKeyGen) -
getMenuCacheByNameKeyGen
@Nullable protected com.broadleafcommerce.common.extension.cache.key.ContextKeyGen getMenuCacheByNameKeyGen()
-