|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.paris.lutece.plugins.directory.utils.DirectoryUtils
public final class DirectoryUtils
class DirectoryUtils
Field Summary | |
---|---|
static java.lang.String |
CONSTANT_AMPERSAND
|
static java.lang.String |
CONSTANT_AND
|
static java.lang.String |
CONSTANT_COMA
|
static java.lang.String |
CONSTANT_DOT
|
static java.lang.String |
CONSTANT_EQUAL
|
static java.lang.String |
CONSTANT_ID
|
static int |
CONSTANT_ID_NULL
|
static int |
CONSTANT_ID_ZERO
|
static java.lang.String |
CONSTANT_INTERROGATION_MARK
|
static java.lang.String |
CONSTANT_NAME
|
static java.lang.String |
CONSTANT_OR
|
static java.lang.String |
CONSTANT_TRUE
|
static java.lang.String |
CONSTANT_UNDERSCORE
|
static java.lang.String |
CONSTANT_WHERE
|
static java.lang.String |
EMPTY_STRING
|
static java.lang.String |
JSP_MANAGE_DIRECTORY_RECORD
|
static java.lang.String |
MESSAGE_DIRECTORY_ERROR
|
static java.lang.String |
MESSAGE_DIRECTORY_ERROR_MANDATORY_FIELD
|
static java.lang.String |
MESSAGE_DIRECTORY_ERROR_MIME_TYPE
|
static java.lang.String |
MESSAGE_RECORD_INVALID_STATE
|
static java.lang.String |
MESSAGE_SELECT_RECORDS
|
static java.lang.String |
PARAMETER_DATECREATION
|
static java.lang.String |
PARAMETER_DATEMODIFICATION
|
static java.lang.String |
PARAMETER_DELETE_PREFIX
|
static java.lang.String |
PARAMETER_ID_ACTION
|
static java.lang.String |
PARAMETER_ID_DIRECTORY
|
static java.lang.String |
PARAMETER_ID_DIRECTORY_RECORD
|
static java.lang.String |
PARAMETER_ID_ENTRY
|
static java.lang.String |
PARAMETER_ID_FILE
|
static java.lang.String |
PARAMETER_SESSION
|
static java.lang.String |
PARAMETER_SHOW_ACTION_RESULT
|
static java.lang.String |
PARAMETER_UPLOAD_SUBMIT
|
static java.lang.String |
PROPERTY_LUTECE_BASE_URL
|
static java.lang.String |
PROPERTY_LUTECE_PROD_URL
|
static java.lang.String |
SESSION_DIRECTORY_LIST_SUBMITTED_RECORD_FIELDS
|
static java.lang.String |
SESSION_DIRECTORY_TASKS_SUBMITTED_RECORD_FIELDS
|
static java.lang.String |
TEMPLATE_FORM_DIRECTORY_RECORD
|
static java.lang.String |
TEMPLATE_FORM_SEARCH_DIRECTORY_RECORD
|
Method Summary | |
---|---|
static void |
addHeaderResponse(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String strFileName)
write the http header in the response |
static java.util.Map<java.lang.String,java.util.List<RecordField>> |
buildMapIdEntryListRecordField(Record record)
Build the map of |
static java.lang.String |
buildQueryWithFilter(java.lang.StringBuilder sbSQL,
java.util.List<java.lang.String> listFilter,
java.lang.String strOrder)
Builds a query with filters placed in parameters |
static java.lang.String |
buildRequetteWithFilter(java.lang.String strSelect,
java.util.List<java.lang.String> listStrFilter,
java.lang.String strOrder)
Builds a query with filters placed in parameters. |
static fr.paris.lutece.util.ReferenceList |
convertMapToReferenceList(java.util.Map<java.lang.String,java.lang.String> map)
Convert a map of ( String, String ) into a ReferenceList |
static int |
convertStringToInt(java.lang.String strParameter)
convert a string to int |
static IEntry |
createEntryByType(javax.servlet.http.HttpServletRequest request,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
return an instance of IEntry function of type entry |
static IEntry |
createEntryByType(int nIdType,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
return an instance of IEntry function of type entry |
static java.util.Map<java.lang.String,java.lang.Object> |
depopulate(Directory directory)
Depopulate the directory into a map of key - value |
static File |
doDownloadFile(java.lang.String strUrl)
Do download a file |
static void |
doDownloadFile(java.lang.String strUrl,
java.lang.String strFilePath)
Do download a file |
static Field |
findFieldByIdInTheList(int nIdField,
java.util.List<Field> listField)
return the field which key is specified in parameter |
static Field |
findFieldByTitleInTheList(java.lang.String strTitle,
java.util.List<Field> listFields)
Return the field which title is specified in parameter |
static Field |
findFieldByValueInTheList(java.lang.String strFieldValue,
java.util.List<Field> listField)
return the field which value is specified in parameter |
static java.util.List<Field> |
getAuthorizedFieldsByRole(javax.servlet.http.HttpServletRequest request,
java.util.List<Field> listField)
Filter a list of field for a given user |
static java.util.List<Field> |
getAuthorizedFieldsByWorkgroup(java.util.List<Field> listField,
fr.paris.lutece.portal.business.user.AdminUser user)
Filter a list of field for a given user |
static java.lang.String |
getBaseUrl(javax.servlet.http.HttpServletRequest request)
Get the base url |
static java.sql.Timestamp |
getCurrentTimestamp()
return current Timestamp |
static void |
getDirectoryRecordData(javax.servlet.http.HttpServletRequest request,
Record record,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
java.util.Locale locale)
Get the request data and if there is no error insert the data in the record specified in parameter. return null if there is no error or else return a DirectoryError object |
static void |
getDirectoryRecordFieldData(Record record,
javax.servlet.http.HttpServletRequest request,
int nIdEntry,
boolean bTestDirectoryError,
java.util.List<RecordField> listRecordFieldResult,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
java.util.Locale locale)
perform in the record field list the record field associates with a entry specify in parameter. return null if there is no error in the response else return a DirectoryError Object |
static File |
getFileData(java.lang.String strFileInputName,
javax.servlet.http.HttpServletRequest request)
Get the file contains in the request from the name of the input file |
static java.lang.String |
getFileName(java.lang.String strUrl)
Get the file name of a file from the url |
static java.util.List<IEntry> |
getFormEntries(int nIdDirectory,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
fr.paris.lutece.portal.business.user.AdminUser user)
return all entry associate to the directory |
static java.util.List<IEntry> |
getFormEntriesByFilter(EntryFilter filter,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
return all entry associate to the directory |
static int |
getIndexEntryInTheEntryList(int nIdEntry,
java.util.List<IEntry> listEntry)
return the index in the list of the entry whose key is specified in parameter |
static int |
getIndexFieldInTheFieldList(int nIdField,
java.util.List<Field> listField)
return the index in the list of the field whose key is specified in parameter |
static java.lang.String |
getJspManageDirectoryRecord(javax.servlet.http.HttpServletRequest request,
int nIdDirectory)
return url of the jsp manage directory record |
static java.util.List<RecordField> |
getListRecordField(IEntry entry,
int nIdRecord,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Gets all RecordField for the entry |
static java.util.List<java.lang.Integer> |
getListResults(javax.servlet.http.HttpServletRequest request,
Directory directory,
boolean bWorkflowServiceEnable,
boolean bUseFilterDirectory,
IDirectorySearchFields searchFields,
fr.paris.lutece.portal.business.user.AdminUser adminUser,
java.util.Locale locale)
Get the result list according to queries |
static java.util.List<java.lang.Integer> |
getListResults(javax.servlet.http.HttpServletRequest request,
Directory directory,
boolean bWorkflowServiceEnable,
boolean bUseFilterDirectory,
IEntry sortEntry,
int nSortOrder,
IDirectorySearchFields searchFields,
fr.paris.lutece.portal.business.user.AdminUser adminUser,
java.util.Locale locale)
Get the result list according to queries |
static java.util.Map<java.lang.String,java.util.List<RecordField>> |
getMapIdEntryListRecordField(java.util.List<IEntry> lisEntry,
int nIdRecord,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
get a Map which contains for each entry the list of recordField object associated |
static java.util.Map<java.lang.String,java.util.List<RecordField>> |
getMapIdEntryListRecordField(java.util.List<IEntry> lisEntry,
int nIdRecord,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
boolean bGetFileName)
get a Map which contains for each entry the list of recordField object associated |
static fr.paris.lutece.portal.service.plugin.Plugin |
getPlugin()
Gets the plugin |
static java.util.HashMap<java.lang.String,java.util.List<RecordField>> |
getSearchRecordData(javax.servlet.http.HttpServletRequest request,
int nIdDirectory,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
java.util.Locale locale)
Get the request data and return a Map which contains for each entry the list of recordField object associated |
static java.util.Date |
getSearchRecordDateCreationFromRequest(javax.servlet.http.HttpServletRequest request,
java.lang.String dateTypeParameter,
java.util.Locale locale)
|
static java.util.Map<java.lang.String,java.util.List<RecordField>> |
getSpecificMapIdEntryListRecordField(java.util.List<IEntry> lisEntry,
int nIdRecord,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
get a Map which contains for each entry the list of recordField object associated |
static java.lang.Boolean |
isFieldInTheRecordFieldList(int nIdField,
java.util.List<RecordField> listRecordField)
return true if the field which key is specified in parameter is in the response list |
static java.util.List<java.lang.Integer> |
retainAll(java.util.List<java.lang.Integer> list1,
java.util.List<java.lang.Integer> list2)
Removes from list all the elements that are not contained in the other list Faster than classic "List.retainAll" because each id is unique |
static java.util.List<java.lang.Integer> |
retainAllIdsKeepingFirstOrder(java.util.List<java.lang.Integer> list1,
java.util.List<java.lang.Integer> list2)
Like List.retainAll(java.util.Collection) , keeping first list
order. |
static java.lang.String |
substituteSpecialCaractersForExport(java.lang.String strSource)
replace special characters in the string passed as a parameter |
static java.lang.String |
trim(java.lang.String strParameter)
Returns a copy of the string , with leading and trailing whitespace omitted. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CONSTANT_WHERE
public static final java.lang.String CONSTANT_AND
public static final java.lang.String CONSTANT_OR
public static final java.lang.String CONSTANT_EQUAL
public static final java.lang.String CONSTANT_COMA
public static final java.lang.String CONSTANT_INTERROGATION_MARK
public static final java.lang.String CONSTANT_AMPERSAND
public static final int CONSTANT_ID_NULL
public static final int CONSTANT_ID_ZERO
public static final java.lang.String EMPTY_STRING
public static final java.lang.String CONSTANT_ID
public static final java.lang.String CONSTANT_NAME
public static final java.lang.String CONSTANT_TRUE
public static final java.lang.String CONSTANT_DOT
public static final java.lang.String CONSTANT_UNDERSCORE
public static final java.lang.String TEMPLATE_FORM_DIRECTORY_RECORD
public static final java.lang.String TEMPLATE_FORM_SEARCH_DIRECTORY_RECORD
public static final java.lang.String MESSAGE_DIRECTORY_ERROR_MANDATORY_FIELD
public static final java.lang.String MESSAGE_DIRECTORY_ERROR
public static final java.lang.String MESSAGE_DIRECTORY_ERROR_MIME_TYPE
public static final java.lang.String MESSAGE_SELECT_RECORDS
public static final java.lang.String MESSAGE_RECORD_INVALID_STATE
public static final java.lang.String PARAMETER_ID_DIRECTORY
public static final java.lang.String PARAMETER_ID_DIRECTORY_RECORD
public static final java.lang.String PARAMETER_ID_ENTRY
public static final java.lang.String PARAMETER_SESSION
public static final java.lang.String PARAMETER_DELETE_PREFIX
public static final java.lang.String PARAMETER_UPLOAD_SUBMIT
public static final java.lang.String PARAMETER_ID_FILE
public static final java.lang.String PARAMETER_ID_ACTION
public static final java.lang.String PARAMETER_SHOW_ACTION_RESULT
public static final java.lang.String PARAMETER_DATECREATION
public static final java.lang.String PARAMETER_DATEMODIFICATION
public static final java.lang.String JSP_MANAGE_DIRECTORY_RECORD
public static final java.lang.String SESSION_DIRECTORY_LIST_SUBMITTED_RECORD_FIELDS
public static final java.lang.String SESSION_DIRECTORY_TASKS_SUBMITTED_RECORD_FIELDS
public static final java.lang.String PROPERTY_LUTECE_BASE_URL
public static final java.lang.String PROPERTY_LUTECE_PROD_URL
Method Detail |
---|
public static java.sql.Timestamp getCurrentTimestamp()
public static IEntry createEntryByType(javax.servlet.http.HttpServletRequest request, fr.paris.lutece.portal.service.plugin.Plugin plugin)
request
- the requestplugin
- the plugin
public static IEntry createEntryByType(int nIdType, fr.paris.lutece.portal.service.plugin.Plugin plugin)
nIdType
- the type idplugin
- the plugin
public static int getIndexEntryInTheEntryList(int nIdEntry, java.util.List<IEntry> listEntry)
nIdEntry
- the key of the entrylistEntry
- the list of the entry
public static int getIndexFieldInTheFieldList(int nIdField, java.util.List<Field> listField)
nIdField
- the key of the fieldlistField
- the list of field
public static java.util.List<IEntry> getFormEntries(int nIdDirectory, fr.paris.lutece.portal.service.plugin.Plugin plugin, fr.paris.lutece.portal.business.user.AdminUser user)
nIdDirectory
- the id of the directoryplugin
- the pluginuser
- the AdminUser
public static java.util.List<IEntry> getFormEntriesByFilter(EntryFilter filter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
filter
- entry filterplugin
- the pluginuser
- the AdminUser
public static java.util.Map<java.lang.String,java.util.List<RecordField>> getMapIdEntryListRecordField(java.util.List<IEntry> lisEntry, int nIdRecord, fr.paris.lutece.portal.service.plugin.Plugin plugin)
lisEntry
- the list of entry associate to the recordnIdRecord
- the id of the recordplugin
- plugin
public static java.util.Map<java.lang.String,java.util.List<RecordField>> getMapIdEntryListRecordField(java.util.List<IEntry> lisEntry, int nIdRecord, fr.paris.lutece.portal.service.plugin.Plugin plugin, boolean bGetFileName)
lisEntry
- the list of entry associate to the recordnIdRecord
- the id of the recordplugin
- pluginbGetFileName
- true if it must get the file name, false otherwise public static java.util.Map<java.lang.String,java.util.List<RecordField>> buildMapIdEntryListRecordField(Record record)
record
- the record
public static java.util.List<RecordField> getListRecordField(IEntry entry, int nIdRecord, fr.paris.lutece.portal.service.plugin.Plugin plugin)
RecordField
for the entry
entry
- the entrynIdRecord
- the record idplugin
- the plugin
public static java.util.Map<java.lang.String,java.util.List<RecordField>> getSpecificMapIdEntryListRecordField(java.util.List<IEntry> lisEntry, int nIdRecord, fr.paris.lutece.portal.service.plugin.Plugin plugin)
lisEntry
- the list of entry associate to the recordnIdRecord
- the id of the recordplugin
- plugin
public static void getDirectoryRecordData(javax.servlet.http.HttpServletRequest request, Record record, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.util.Locale locale) throws DirectoryErrorException
request
- the requestnIdDirectory
- the id of the directory associate to the recordrecord
- the recordplugin
- the pluginlocale
- the locale
DirectoryErrorException
public static java.util.HashMap<java.lang.String,java.util.List<RecordField>> getSearchRecordData(javax.servlet.http.HttpServletRequest request, int nIdDirectory, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.util.Locale locale) throws DirectoryErrorException
request
- the requestnIdDirectory
- the id of the directoryplugin
- the pluginlocale
- the locale
DirectoryErrorException
public static void getDirectoryRecordFieldData(Record record, javax.servlet.http.HttpServletRequest request, int nIdEntry, boolean bTestDirectoryError, java.util.List<RecordField> listRecordFieldResult, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.util.Locale locale) throws DirectoryErrorException
request
- the requestnIdEntry
- the key of the entrybTestDirectoryError
- true if we must test the validity of user inputlistRecordFieldResult
- the list of record field resultplugin
- the pluginlocale
- the locale
DirectoryErrorException
public static Field findFieldByIdInTheList(int nIdField, java.util.List<Field> listField)
nIdField
- the id of the field who is searchlistField
- the list of field
public static Field findFieldByValueInTheList(java.lang.String strFieldValue, java.util.List<Field> listField)
strFieldValue
- the value of the field who is searchlistField
- the list of field
public static Field findFieldByTitleInTheList(java.lang.String strTitle, java.util.List<Field> listFields)
strTitle
- the titlelistFields
- the list of fields
public static java.lang.Boolean isFieldInTheRecordFieldList(int nIdField, java.util.List<RecordField> listRecordField)
nIdField
- the id of the field who is searchlistRecordField
- the list of object Response
public static void addHeaderResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String strFileName)
request
- the httpServletRequestresponse
- the http responsestrFileName
- the name of the file who must insert in the responsepublic static int convertStringToInt(java.lang.String strParameter)
strParameter
- the string parameter to convert
public static java.lang.String trim(java.lang.String strParameter)
strParameter
- the string parameter to convert
public static File getFileData(java.lang.String strFileInputName, javax.servlet.http.HttpServletRequest request)
strFileInputName
- le name of the input file filerequest
- the request
public static java.lang.String buildRequetteWithFilter(java.lang.String strSelect, java.util.List<java.lang.String> listStrFilter, java.lang.String strOrder)
buildQueryWithFilter(StringBuilder, List, String)
instead.
strSelect
- the select of the querylistStrFilter
- the list of filter to add in the querystrOrder
- the order by of the query
public static java.lang.String buildQueryWithFilter(java.lang.StringBuilder sbSQL, java.util.List<java.lang.String> listFilter, java.lang.String strOrder)
sbSQL
- the beginning of the querylistFilter
- the list of filter to add in the querystrOrder
- the order by of the query
public static java.lang.String substituteSpecialCaractersForExport(java.lang.String strSource)
strSource
- the string
public static java.util.List<Field> getAuthorizedFieldsByWorkgroup(java.util.List<Field> listField, fr.paris.lutece.portal.business.user.AdminUser user)
listField
- a list of fielduser
- an adminUser
public static java.util.List<Field> getAuthorizedFieldsByRole(javax.servlet.http.HttpServletRequest request, java.util.List<Field> listField)
listField
- a list of fielduser
- a luteceUser
public static java.util.List<java.lang.Integer> retainAll(java.util.List<java.lang.Integer> list1, java.util.List<java.lang.Integer> list2)
list1
- input list 1list2
- input list 2
public static java.util.List<java.lang.Integer> retainAllIdsKeepingFirstOrder(java.util.List<java.lang.Integer> list1, java.util.List<java.lang.Integer> list2)
List.retainAll(java.util.Collection)
, keeping first list
order. This method is based on the fact that list1 and list2 have unique
elements.
list1
- the first listlist2
- the other list
public static java.util.Date getSearchRecordDateCreationFromRequest(javax.servlet.http.HttpServletRequest request, java.lang.String dateTypeParameter, java.util.Locale locale)
public static java.util.List<java.lang.Integer> getListResults(javax.servlet.http.HttpServletRequest request, Directory directory, boolean bWorkflowServiceEnable, boolean bUseFilterDirectory, IDirectorySearchFields searchFields, fr.paris.lutece.portal.business.user.AdminUser adminUser, java.util.Locale locale)
request
- The HttpServletRequest
directory
- The Directory
bWorkflowServiceEnable
- true if the WorkflowService is enabled
public static java.util.List<java.lang.Integer> getListResults(javax.servlet.http.HttpServletRequest request, Directory directory, boolean bWorkflowServiceEnable, boolean bUseFilterDirectory, IEntry sortEntry, int nSortOrder, IDirectorySearchFields searchFields, fr.paris.lutece.portal.business.user.AdminUser adminUser, java.util.Locale locale)
request
- The HttpServletRequest
directory
- The Directory
bWorkflowServiceEnable
- true if the WorkflowService is enabled
public static fr.paris.lutece.portal.service.plugin.Plugin getPlugin()
public static java.lang.String getJspManageDirectoryRecord(javax.servlet.http.HttpServletRequest request, int nIdDirectory)
request
- The HTTP requestnIdDirectory
- the directory id
public static fr.paris.lutece.util.ReferenceList convertMapToReferenceList(java.util.Map<java.lang.String,java.lang.String> map)
ReferenceList
map
- the map to convert
ReferenceList
public static java.lang.String getFileName(java.lang.String strUrl)
strUrl
- the url of the file
public static void doDownloadFile(java.lang.String strUrl, java.lang.String strFilePath)
strUrl
- the url of the file to downloadstrFilePath
- the file path to download the filepublic static File doDownloadFile(java.lang.String strUrl)
strUrl
- the url of the file to download
FileItem
public static java.lang.String getBaseUrl(javax.servlet.http.HttpServletRequest request)
request
- the HTTP request
public static java.util.Map<java.lang.String,java.lang.Object> depopulate(Directory directory)
directory
- the directory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |