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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddImageResource(fr.paris.lutece.portal.service.upload.MultipartItem fileItem) Return the Resource idgetImageResource(int nIdResource) Return the Resource idstatic FileImagePublicServiceDeprecated, for removal: This API element is subject to removal in a future version.getName()Return the Resource Type idstatic voidinit()InitvoidinitializedService(jakarta.servlet.ServletContext context) This method observes the initialization of theApplicationScopedcontext.voidregister()Initializes the service
-
Field Details
-
IMAGE_RESOURCE_TYPE_ID
- See Also:
-
-
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, for removal: This API element is subject to removal in a future version.Use@Injectto obtain theFileImagePublicServiceinstance. This method will be removed in future versions.Returns the unique instance of theFileImagePublicServiceservice.This method is deprecated and is provided for backward compatibility only. For new code, use dependency injection with
@Injectto obtain theFileImagePublicServiceinstance instead.- Returns:
- The unique instance of
FileImagePublicService.
-
getResourceTypeId
Description copied from interface:ImageResourceProviderReturn the Resource Type id- Specified by:
getResourceTypeIdin interfaceImageResourceProvider- Returns:
- The Resource Type Id
-
getImageResource
Description copied from interface:ImageResourceProviderReturn the Resource id- Specified by:
getImageResourcein interfaceImageResourceProvider- Parameters:
nIdResource- The resource identifier- Returns:
- The Resource Image
-
addImageResource
Return the Resource id- Specified by:
addImageResourcein interfaceImageResourceProvider- Parameters:
iImageResource- The resource identifier- Returns:
- The New Resource Id
-
getName
-
initializedService
public void initializedService(@Observes @Initialized(jakarta.enterprise.context.ApplicationScoped.class) jakarta.servlet.ServletContext context) This method observes the initialization of theApplicationScopedcontext. It ensures that this CDI beans are instantiated at the application startup.This method is triggered automatically by CDI when the
ApplicationScopedcontext is initialized, which typically occurs during the startup of the application server.- Parameters:
context- theServletContextthat is initialized. This parameter is observed and injected automatically by CDI when theApplicationScopedcontext is initialized.
-
@Injectto obtain theFileImagePublicServiceinstance.