Class AbstractEntryTypeUpload

    • Constructor Detail

      • AbstractEntryTypeUpload

        public AbstractEntryTypeUpload()
    • Method Detail

      • 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 java.lang.String getUrlDownloadFile​(int nResponseId,
                                                            java.lang.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,
                                                    java.util.List<org.apache.commons.fileupload.FileItem> listUploadedFileItems,
                                                    java.util.List<org.apache.commons.fileupload.FileItem> listFileItemsToUpload,
                                                    java.util.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 java.lang.String getResponseValueForExport​(Entry entry,
                                                          javax.servlet.http.HttpServletRequest request,
                                                          Response response,
                                                          java.util.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 java.lang.String getRequestData​(Entry entry,
                                               javax.servlet.http.HttpServletRequest request,
                                               java.util.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
      • getRequestData

        public java.lang.String getRequestData​(Entry entry,
                                               javax.servlet.http.HttpServletRequest request,
                                               java.util.Locale locale,
                                               java.lang.String errorReturnUrl)
        Get the request data
        Specified by:
        getRequestData in interface IEntryTypeService
        Overrides:
        getRequestData in class EntryTypeService
        Parameters:
        entry - The entry
        request - HttpRequest
        locale - the locale
        errorReturnUrl - url to go to after displaying a message when an error occurs
        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
      • getResponseValueForRecap

        public java.lang.String getResponseValueForRecap​(Entry entry,
                                                         javax.servlet.http.HttpServletRequest request,
                                                         Response response,
                                                         java.util.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​(org.apache.commons.fileupload.FileItem fileItem,
                                                      Entry entry,
                                                      java.util.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