Class FileImagePublicService

java.lang.Object
fr.paris.lutece.portal.service.fileimage.FileImagePublicService
All Implemented Interfaces:
ImageResourceProvider

@ApplicationScoped public class FileImagePublicService extends Object implements ImageResourceProvider
  • Field Details

  • Constructor Details

    • FileImagePublicService

      public FileImagePublicService()
  • Method Details

    • init

      public static void init()
      Init
      Throws:
      LuteceInitException - if an error occurs
    • register

      public void register()
      Initializes the service
    • getInstance

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

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

      Returns:
      The unique instance of FileImagePublicService.
    • getResourceTypeId

      public String getResourceTypeId()
      Description copied from interface: ImageResourceProvider
      Return the Resource Type id
      Specified by:
      getResourceTypeId in interface ImageResourceProvider
      Returns:
      The Resource Type Id
    • getImageResource

      public ImageResource getImageResource(int nIdResource)
      Description copied from interface: ImageResourceProvider
      Return the Resource id
      Specified by:
      getImageResource in interface ImageResourceProvider
      Parameters:
      nIdResource - The resource identifier
      Returns:
      The Resource Image
    • addImageResource

      public String addImageResource(fr.paris.lutece.portal.service.upload.MultipartItem fileItem)
      Return the Resource id
      Specified by:
      addImageResource in interface ImageResourceProvider
      Parameters:
      iImageResource - The resource identifier
      Returns:
      The New Resource Id
    • getName

      public String getName()
    • 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.