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
-
-
Field Summary
-
Fields inherited from interface fr.paris.lutece.plugins.genericattributes.service.entrytype.IEntryTypeService
ATTRIBUTE_RESPONSE_ITERATION_NUMBER, ERROR_FIELD_FILE_MAX_SIZE, ERROR_FIELD_FILE_TYPE, ERROR_FIELD_HEIGHT, ERROR_FIELD_MAX_FILES, ERROR_FIELD_REF_LIST, ERROR_FIELD_TITLE, ERROR_FIELD_WIDTH, FIELD_ADDITIONAL_ADDRESS, FIELD_ADDRESS, FIELD_ANONYMIZABLE, FIELD_ANSWER_CHOICE, FIELD_ARRAY_CELL, FIELD_ARRAY_COLUMN, FIELD_ARRAY_ROW, FIELD_ATTRIBUTE_NAME, FIELD_AUTOCOMPLETE, FIELD_COMMENT, FIELD_CONFIRM, FIELD_CONFIRM_FIELD_TITLE, FIELD_DATE_VALUE, FIELD_DISABLED, FIELD_DISPLAY_BO, FIELD_DOWNLOADABLE_FILE, FIELD_EDIT_MODE, FIELD_EXPORTABLE, FIELD_EXPORTABLE_PDF, FIELD_FILE_BINARY, FIELD_FILE_CONFIG, FIELD_FILE_MAX_SIZE, FIELD_FILE_TYPE, FIELD_GEOJSON, FIELD_GEOMETRY, FIELD_HEIGHT, FIELD_ID_ADDRESS, FIELD_ID_LAYER, FIELD_ILLUSTRATION_IMAGE, FIELD_IMAGE_TYPE, FIELD_INSERT_GROUP, FIELD_IS_UPDATABLE, FIELD_MAX, FIELD_MAX_FILES, FIELD_MAX_SIZE, FIELD_MAX_SIZE_ENTER, FIELD_MIN, FIELD_MYLUTECE_ATTRIBUTE_NAME_CODE, FIELD_NUMBER_COLUMNS, FIELD_NUMBER_ROWS, FIELD_PLACEHOLDER, FIELD_PREFIX, FIELD_PROVIDER, FIELD_PUBLISHED, FIELD_RICHTEXT, FIELD_SORTABLE_LIST_TYPE, FIELD_SUFFIX, FIELD_TEXT_CONF, FIELD_USE_REF_LIST, FIELD_VIEW_NUMBER, FIELD_WIDTH, FIELD_X, FIELD_Y, MESSAGE_CONFIRM_FIELD, MESSAGE_ERROR_IMPOSSIBLE_SLOT, MESSAGE_ERROR_SLOT, MESSAGE_INVALID_SQL_QUERY, MESSAGE_MANDATORY_FIELD, MESSAGE_MAXLENGTH, MESSAGE_MYLUTECE_AUTHENTIFICATION_REQUIRED, MESSAGE_NUMERIC_FIELD, MESSAGE_NUMERIC_MAX, MESSAGE_NUMERIC_MIN, MESSAGE_UNIQUE_FIELD, MESSAGE_XSS_FIELD, PARAMETER_ANONYMIZABLE, PARAMETER_ANONYMIZE_PATTERN, PARAMETER_AUTOCOMPLETE, PARAMETER_COMMENT, PARAMETER_CONFIRM_FIELD, PARAMETER_CONFIRM_FIELD_TITLE, PARAMETER_CSS_CLASS, PARAMETER_DISABLED, PARAMETER_DISPLAY_BO, PARAMETER_ENTRY_CODE, PARAMETER_ERROR_MESSAGE, PARAMETER_EXPORTABLE, PARAMETER_EXPORTABLE_PDF, PARAMETER_FIELD_IN_LINE, PARAMETER_FILE, PARAMETER_HEIGHT, PARAMETER_HELP_MESSAGE, PARAMETER_ILLUSTRATION_IMAGE, PARAMETER_IMAGE_TYPE, PARAMETER_INDEXED, PARAMETER_MANDATORY, PARAMETER_MAX, PARAMETER_MAX_IMAGE_SIZE, PARAMETER_MAX_SIZE_ENTER, PARAMETER_MIN, PARAMETER_NUMBER_COLUMNS, PARAMETER_NUMBER_ROWS, PARAMETER_ONLY_DISPLAY_IN_BACK, PARAMETER_PLACEHOLDER, PARAMETER_PUBLISHED, PARAMETER_REF_LIST_SELECT, PARAMETER_SORTABLE_LIST_TYPE, PARAMETER_TITLE, PARAMETER_TODAY_DATE, PARAMETER_UNIQUE, PARAMETER_USE_REF_LIST, PARAMETER_VALUE, PARAMETER_WIDTH, PREFIX_ATTRIBUTE, PREFIX_ITERATION_ATTRIBUTE, SUFFIX_CONFIRM_FIELD
-
-
Constructor Summary
Constructors Constructor Description AbstractEntryTypeUpload()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description GenericAttributeErrorcanUploadFiles(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.GenericAttributeErrordoCheckforImages(org.apache.commons.fileupload.FileItem fileItem, Entry entry, java.util.Locale locale)Do check that an uploaded file is an imageabstract fr.paris.lutece.plugins.asynchronousupload.service.IAsyncUploadHandlergetAsynchronousUploadHandler()Get the asynchronous upload handler to use for entries of this typefr.paris.lutece.util.ReferenceListgetReferenceListRegularExpression(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 entryjava.lang.StringgetRequestData(Entry entry, javax.servlet.http.HttpServletRequest request, java.util.Locale locale)Get the request datajava.lang.StringgetRequestData(Entry entry, javax.servlet.http.HttpServletRequest request, java.util.Locale locale, java.lang.String errorReturnUrl)Get the request datajava.lang.StringgetResponseValueForExport(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 exportjava.lang.StringgetResponseValueForRecap(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 recapabstract java.lang.StringgetUrlDownloadFile(int nResponseId, java.lang.String strBaseUrl)Get the URL to download the file of a responsevoidsetResponseToStringValue(Entry entry, Response response, java.util.Locale locale)toStringValue should staynull.-
Methods inherited from class fr.paris.lutece.plugins.genericattributes.service.entrytype.EntryTypeService
getAnonymizationHelpMessage, getResponseData, getResponseIterationValue, getTemplateEntryReadOnly, getTemplateEntryReadOnly, getValidWildcards, setAnonymizationTypes
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface fr.paris.lutece.plugins.genericattributes.service.entrytype.IEntryTypeService
getTemplateCreate, getTemplateHtmlForm, getTemplateModify
-
-
-
-
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 ofstrBaseUrl- 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:
canUploadFilesin interfaceIEntryTypeService- Overrides:
canUploadFilesin classEntryTypeService- Parameters:
entry- The entrylistUploadedFileItems- the list of uploaded fileslistFileItemsToUpload- the list of files to uploadlocale- 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:
getResponseValueForExportin interfaceIEntryTypeService- Overrides:
getResponseValueForExportin classEntryTypeService- Parameters:
entry- The entryrequest- the requestresponse- the response associate to the entrylocale- 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:
getRequestDatain interfaceIEntryTypeService- Overrides:
getRequestDatain classEntryTypeService- Parameters:
entry- The entryrequest- HttpRequestlocale- 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:
getRequestDatain interfaceIEntryTypeService- Overrides:
getRequestDatain classEntryTypeService- Parameters:
entry- The entryrequest- HttpRequestlocale- the localeerrorReturnUrl- 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:
getReferenceListRegularExpressionin interfaceIEntryTypeService- Overrides:
getReferenceListRegularExpressionin classEntryTypeService- Parameters:
entry- the entryplugin- 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, java.util.Locale locale)
toStringValue should staynull.- Specified by:
setResponseToStringValuein interfaceIEntryTypeService- Overrides:
setResponseToStringValuein classEntryTypeService- Parameters:
entry- The entryresponse- The responselocale- the locale - will use a default one if not specified
-
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:
getResponseValueForRecapin interfaceIEntryTypeService- Overrides:
getResponseValueForRecapin classEntryTypeService- Parameters:
entry- The entryrequest- the requestresponse- the response associate to the entrylocale- 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 itementry- the entrylocale- The locale- Returns:
- The error if any, or null if the file is a valid image
-
-