Class MainTreeMenuService

java.lang.Object
fr.paris.lutece.plugins.menus.service.MainTreeMenuService

@ApplicationScoped public class MainTreeMenuService extends Object
MainTreeMenuAllPagesService
  • Constructor Details

    • MainTreeMenuService

      public MainTreeMenuService()
  • Method Details

    • getInstance

      @Deprecated(since="8.0", forRemoval=true) public static MainTreeMenuService getInstance()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use @Inject to obtain the MainTreeMenuService instance. This method will be removed in future versions.
      Returns the unique instance of the MainTreeMenuService service.

      This method is deprecated and is provided for backward compatibility only. For new code, use dependency injection with @Inject to obtain the MainTreeMenuService instance instead.

      Returns:
      The unique instance of MainTreeMenuService.
    • getMainMenuItems

      public MenuItem getMainMenuItems()
      Return the root MenuItem
      Returns:
      the root MenuItem
    • getTreeMenuItems

      public MenuItem getTreeMenuItems(int nCurrentPageId, int nParentCurrentPageId)
      Return the TreeMenuItems from root MenuItem
      Parameters:
      nCurrentPageId - The current page id
      nRootParentTree - The parent page of the current page
      Returns:
      the TreeMenuItems from root MenuItem
    • generateTreeMenu

      public void generateTreeMenu(MenuItem root, int nCurrentPageId, int nParentCurrentPageId)
    • getRootParentTree

      public int getRootParentTree(int nPageId)
      Define the root tree id of a page
      Parameters:
      nPageId - The page identifier
      Returns:
      The parent page identifier or root tree
    • getCacheService

      public MainTreeMenuCacheService getCacheService()
      Get the cacheService
      Returns:
      the MainTreeMenuCacheService
    • isMainTreeCacheServiceEnable

      public Boolean isMainTreeCacheServiceEnable()
      Return if cacheService is instancied and enable
      Returns:
      true if cacheService is instancied and enable, false otherwise
    • initializedService

      public void initializedService(@Observes @Initialized(jakarta.enterprise.context.ApplicationScoped.class) jakarta.servlet.ServletContext context)
      This method observes the initialization of the ApplicationScoped context. It ensures that this CDI beans are instantiated at the application startup.

      This method is triggered automatically by CDI when the ApplicationScoped context is initialized, which typically occurs during the startup of the application server.

      Parameters:
      context - the ServletContext that is initialized. This parameter is observed and injected automatically by CDI when the ApplicationScoped context is initialized.