Class MenusService

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

@ApplicationScoped public class MenusService extends Object
This Service manages contactListt actions (create, delete, modify ...) and notify listeners.
Author:
lenaini
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use @Inject to obtain the MenusService instance.
    getSitePath(int nMode)
    Define the site path : Portal Url when mode isn't admin mode, otherwise AdminPortalUrl
    void
    Initializes the Menus service This method is called automatically after CDI instantiation
    void
    initializedService(jakarta.servlet.ServletContext context)
    This method observes the initialization of the ApplicationScoped context.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • MenusService

      public MenusService()
  • Method Details

    • init

      @PostConstruct public void init()
      Initializes the Menus service This method is called automatically after CDI instantiation
    • getInstance

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

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

      Returns:
      The unique instance of MenusService.
    • getSitePath

      public String getSitePath(int nMode)
      Define the site path : Portal Url when mode isn't admin mode, otherwise AdminPortalUrl
      Parameters:
      nMode - the mode define by the request
      Returns:
      site path depending on the mode
    • 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.