Class AbstractEntryTypeUpload

java.lang.Object
fr.paris.lutece.plugins.genericattributes.service.entrytype.EntryTypeService
fr.paris.lutece.plugins.genericattributes.service.entrytype.AbstractEntryTypeUpload
All Implemented Interfaces:
IEntryTypeService
Direct Known Subclasses:
AbstractEntryTypeFile, AbstractEntryTypeImage

public abstract class AbstractEntryTypeUpload extends EntryTypeService
Abstract entry type for uploads
  • Constructor Details

    • AbstractEntryTypeUpload

      public AbstractEntryTypeUpload()
  • Method Details

    • getAsynchronousUploadHandler

      public abstract fr.paris.lutece.plugins.asynchronousupload.service.IAsyncUploadHandler getAsynchronousUploadHandler()
      Get the asynchronous upload handler to use for entries of this type
      Returns:
      The asynchronous upload handler to use for entries of this type
    • getUrlDownloadFile

      public abstract String getUrlDownloadFile(int nResponseId, String strBaseUrl)
      Get the URL to download the file of a response
      Parameters:
      nResponseId - The id of the response to download the file of
      strBaseUrl - The base URL
      Returns:
      The URL to redirect the user to download the file
    • canUploadFiles

      public GenericAttributeError canUploadFiles(Entry entry, List<fr.paris.lutece.portal.service.upload.MultipartItem> listUploadedFileItems, List<fr.paris.lutece.portal.service.upload.MultipartItem> listFileItemsToUpload, Locale locale)
      Check if the file can be uploaded or not. This method will check the size of each file and the number max of files that can be uploaded.
      Specified by:
      canUploadFiles in interface IEntryTypeService
      Overrides:
      canUploadFiles in class EntryTypeService
      Parameters:
      entry - The entry
      listUploadedFileItems - the list of uploaded files
      listFileItemsToUpload - the list of files to upload
      locale - the locale
      Returns:
      The error if there is any
    • getResponseValueForExport

      public String getResponseValueForExport(Entry entry, jakarta.servlet.http.HttpServletRequest request, Response response, Locale locale)
      Get the response value associate to the entry to export in the file export
      Specified by:
      getResponseValueForExport in interface IEntryTypeService
      Overrides:
      getResponseValueForExport in class EntryTypeService
      Parameters:
      entry - The entry
      request - the request
      response - the response associate to the entry
      locale - the locale
      Returns:
      the response value associate to the entry to export in the file export
    • getRequestData

      public String getRequestData(Entry entry, jakarta.servlet.http.HttpServletRequest request, Locale locale)
      Get the request data
      Specified by:
      getRequestData in interface IEntryTypeService
      Overrides:
      getRequestData in class EntryTypeService
      Parameters:
      entry - The entry
      request - HttpRequest
      locale - the locale
      Returns:
      null if all data required are in the request else the url of jsp error
    • getReferenceListRegularExpression

      public fr.paris.lutece.util.ReferenceList getReferenceListRegularExpression(Entry entry, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Get the list of regular expression who is use in the template modify of the entry
      Specified by:
      getReferenceListRegularExpression in interface IEntryTypeService
      Overrides:
      getReferenceListRegularExpression in class EntryTypeService
      Parameters:
      entry - the entry
      plugin - the plugin
      Returns:
      the regular expression list who is use in the template modify of the entry
    • setResponseToStringValue

      public void setResponseToStringValue(Entry entry, Response response, Locale locale)
      toStringValue should stay null.
      Specified by:
      setResponseToStringValue in interface IEntryTypeService
      Overrides:
      setResponseToStringValue in class EntryTypeService
      Parameters:
      entry - The entry
      response - The response
      locale - the locale - will use a default one if not specified
    • getResponseValueForRecap

      public String getResponseValueForRecap(Entry entry, jakarta.servlet.http.HttpServletRequest request, Response response, Locale locale)
      Get the response value associate to the entry to write in the recap
      Specified by:
      getResponseValueForRecap in interface IEntryTypeService
      Overrides:
      getResponseValueForRecap in class EntryTypeService
      Parameters:
      entry - The entry
      request - the request
      response - the response associate to the entry
      locale - the locale
      Returns:
      the response value associate to the entry to write in the recap
    • doCheckforImages

      public GenericAttributeError doCheckforImages(fr.paris.lutece.portal.service.upload.MultipartItem fileItem, Entry entry, Locale locale)
      Do check that an uploaded file is an image
      Parameters:
      fileItem - The file item
      entry - the entry
      locale - The locale
      Returns:
      The error if any, or null if the file is a valid image