fr.paris.lutece.plugins.directory.business
Class AbstractEntryTypeUpload

java.lang.Object
  extended by fr.paris.lutece.plugins.directory.business.Entry
      extended by fr.paris.lutece.plugins.directory.business.AbstractEntryTypeUpload
All Implemented Interfaces:
IEntry
Direct Known Subclasses:
EntryTypeDownloadUrl, EntryTypeFile, EntryTypeImg

public abstract class AbstractEntryTypeUpload
extends Entry

AbstractEntryTypeUpload


Field Summary
protected static String ALL
           
protected static String COMMA
           
protected static String CONSTANT_FILE_MAX_SIZE
           
protected static String CONSTANT_MAX_FILES
           
protected static String PARAMETER_FILE_MAX_SIZE
           
protected static String PARAMETER_MAX_FILES
           
 
Fields inherited from class fr.paris.lutece.plugins.directory.business.Entry
ATTRIBUTE_ENTRY_ID, ATTRIBUTE_ENTRY_ID_TYPE, ATTRIBUTE_IS_SORTABLE, ATTRIBUTE_SHOWXY, ATTRIBUTE_TITLE, FIELD_COMMENT, FIELD_ENTRY_ASSOCIATE, FIELD_HEIGHT, FIELD_HEIGHT_DISPLAY, FIELD_HELP_MESSAGE, FIELD_HELP_MESSAGE_SEARCH, FIELD_INSERT_GROUP, FIELD_LABEL_ALL_SEARCH, FIELD_MANDATORY, FIELD_MAX_SIZE_ENTER, FIELD_PRESENTATION, FIELD_REQUEST_SQL, FIELD_TITLE, FIELD_VALUE, FIELD_WIDTH, FIELD_WIDTH_DISPLAY, JSP_DOWNLOAD_FILE, MARK_DEFAULT_VALUES, MARK_ENTRY, MARK_LOCALE, MARK_MYLUTECE_USER_INFOS_LIST, MARK_MYLUTECE_USER_LOGIN, MARK_RECORD_FIELD, MARK_SHOW_ALL_INFO, MESSAGE_BLOBSTORE_CLIENT_SERVICE_UNAVAILABLE, MESSAGE_MANDATORY_FIELD, MESSAGE_NUMERIC_FIELD, PARAMETER_AUTOCOMPLETE, PARAMETER_COMMENT, PARAMETER_DATE_BEGIN, PARAMETER_DATE_END, PARAMETER_DIRECTORY_ASSOCIATE, PARAMETER_DISPLAY_HEIGHT, PARAMETER_DISPLAY_WIDTH, PARAMETER_ENTRY_ASSOCIATE, PARAMETER_FIELD_IN_LINE, PARAMETER_HEIGHT, PARAMETER_HELP_MESSAGE, PARAMETER_HELP_MESSAGE_SEARCH, PARAMETER_ID_DIRECTORY_RECORD, PARAMETER_INDEXED, PARAMETER_INDEXED_AS_SUMMARY, PARAMETER_INDEXED_AS_TITLE, PARAMETER_IS_ADD_VALUE_SEARCH_ALL, PARAMETER_LABEL_VALUE_SEARCH_ALL, PARAMETER_MANDATORY, PARAMETER_MAX_SIZE_ENTER, PARAMETER_MULTIPLE_SEARCH_FIELDS, PARAMETER_REQUEST_SQL, PARAMETER_ROLE_ASSOCIATED, PARAMETER_SEARCH_ACTION, PARAMETER_SHOW_ALL_INFO, PARAMETER_SHOWN_IN_ADVANCED_SEARCH, PARAMETER_SHOWN_IN_COMPLETENESS, PARAMETER_SHOWN_IN_EXPORT, PARAMETER_SHOWN_IN_HISTORY, PARAMETER_SHOWN_IN_RESULT_LIST, PARAMETER_SHOWN_IN_RESULT_RECORD, PARAMETER_TITLE, PARAMETER_UPDATE_ENTRY, PARAMETER_VALUE, PARAMETER_WIDTH, PARAMETER_WORKGROUP_ASSOCIATED, PROPERTY_IMPORT_MULTIPLE_VALUE_DELIMITER, TAG_ENTRY, TAG_LIST_ENTRY, TAG_TITLE
 
Constructor Summary
AbstractEntryTypeUpload()
           
 
Method Summary
 void canUploadFiles(List<org.apache.commons.fileupload.FileItem> listUploadedFileItems, List<org.apache.commons.fileupload.FileItem> listFileItemsToUpload, Locale locale)
          Check if the file can be uploaded or not.
protected  String checkEntryData(javax.servlet.http.HttpServletRequest request, Locale locale)
          Check the entry data
protected abstract  void checkRecordFieldData(org.apache.commons.fileupload.FileItem fileItem, Locale locale)
          Check the record field data for a single file item
protected  void checkRecordFieldData(List<org.apache.commons.fileupload.FileItem> listFilesSource, Locale locale)
          Check the record field data
protected  List<org.apache.commons.fileupload.FileItem> getFileSources(javax.servlet.http.HttpServletRequest request)
          Get the file source from the session
protected  void setFields(javax.servlet.http.HttpServletRequest request)
          Set the list of fields
protected abstract  void setFields(javax.servlet.http.HttpServletRequest request, List<Field> listFields)
          Set the fields
 
Methods inherited from class fr.paris.lutece.plugins.directory.business.Entry
addSearchCriteria, convertRecordFieldTitleToString, convertRecordFieldValueToString, getAnonymize, getChildren, getComment, getDirectory, getDisplayHeight, getDisplayWidth, getEntryAssociate, getEntryData, getEntryType, getFields, getHelpMessage, getHelpMessageSearch, getHtmlFormEntry, getHtmlFormEntry, getHtmlFormSearchEntry, getHtmlFormSearchEntry, getHtmlRecordFieldValue, getIdEntry, getImportRecordFieldData, getImportRecordFieldData, getLabelValueAllSearch, getMapProvider, getPaginator, getPaginator, getParent, getPosition, getRecordFieldData, getRecordFieldData, getReferenceListRegularExpression, getRequestSQL, getSQLJoin, getSQLOrderBy, getSQLParametersValues, getTemplateCreate, getTemplateHtmlFormEntry, getTemplateHtmlFormSearchEntry, getTemplateHtmlRecordFieldValue, getTemplateModify, getTitle, getXml, isAddValueAllSearch, isAnonymizable, isAutocompleteEntry, isFieldInLine, isFirstInTheList, isIndexed, isIndexedAsSummary, isIndexedAsTitle, isLastInTheList, isMandatory, isMultipleSearchFields, isRoleAssociated, isShownInAdvancedSearch, isShownInCompleteness, isShownInExport, isShownInHistory, isShownInResultList, isShownInResultRecord, isSortable, isWorkgroupAssociated, setAddValueAllSearch, setAnonymize, setAutocompleteEntry, setChildren, setComment, setDirectory, setDisplayHeight, setDisplayWidth, setEntryAssociate, setEntryType, setFieldInLine, setFields, setFirstInTheList, setHelpMessage, setHelpMessageSearch, setIdEntry, setIndexed, setIndexedAsSummary, setIndexedAsTitle, setLabelValueAllSearch, setLastInTheList, setMandatory, setMapProvider, setMultipleSearchFields, setParent, setPosition, setRequestSQL, setRoleAssociated, setShownInAdvancedSearch, setShownInCompleteness, setShownInExport, setShownInHistory, setShownInResultList, setShownInResultRecord, setTitle, setWorkgroupAssociated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAMETER_MAX_FILES

protected static final String PARAMETER_MAX_FILES
See Also:
Constant Field Values

PARAMETER_FILE_MAX_SIZE

protected static final String PARAMETER_FILE_MAX_SIZE
See Also:
Constant Field Values

CONSTANT_MAX_FILES

protected static final String CONSTANT_MAX_FILES
See Also:
Constant Field Values

CONSTANT_FILE_MAX_SIZE

protected static final String CONSTANT_FILE_MAX_SIZE
See Also:
Constant Field Values

ALL

protected static final String ALL
See Also:
Constant Field Values

COMMA

protected static final String COMMA
See Also:
Constant Field Values
Constructor Detail

AbstractEntryTypeUpload

public AbstractEntryTypeUpload()
Method Detail

setFields

protected abstract void setFields(javax.servlet.http.HttpServletRequest request,
                                  List<Field> listFields)
Set the fields

Parameters:
request - the HTTP request
listFields - the list of fields to set

checkRecordFieldData

protected abstract void checkRecordFieldData(org.apache.commons.fileupload.FileItem fileItem,
                                             Locale locale)
                                      throws DirectoryErrorException
Check the record field data for a single file item

Parameters:
fileItem - the file item
locale - the locale
Throws:
DirectoryErrorException - exception if there is an error

canUploadFiles

public void canUploadFiles(List<org.apache.commons.fileupload.FileItem> listUploadedFileItems,
                           List<org.apache.commons.fileupload.FileItem> listFileItemsToUpload,
                           Locale locale)
                    throws DirectoryErrorException
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 IEntry
Overrides:
canUploadFiles in class Entry
Parameters:
listUploadedFileItems - the list of uploaded files
listFileItemsToUpload - the list of files to upload
locale - the locale
Throws:
DirectoryErrorException - exception if there is an error

checkEntryData

protected String checkEntryData(javax.servlet.http.HttpServletRequest request,
                                Locale locale)
Check the entry data

Parameters:
request - the HTTP request
locale - the locale
Returns:
the error message url if there is an error, an empty string otherwise

checkRecordFieldData

protected void checkRecordFieldData(List<org.apache.commons.fileupload.FileItem> listFilesSource,
                                    Locale locale)
                             throws DirectoryErrorException
Check the record field data

Parameters:
fileSource - the file source to upload
locale - the locale
Throws:
DirectoryErrorException - exception if there is an error

getFileSources

protected List<org.apache.commons.fileupload.FileItem> getFileSources(javax.servlet.http.HttpServletRequest request)
Get the file source from the session

Parameters:
request - the HttpServletRequest
session - the HttpSession
Returns:
the file item

setFields

protected void setFields(javax.servlet.http.HttpServletRequest request)
Set the list of fields

Parameters:
request - the HTTP request


Copyright © 2013 Mairie de Paris. All Rights Reserved.