|
||||||||||
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_EQUAL
|
static int |
CONSTANT_ID_NULL
|
static int |
CONSTANT_ID_ZERO
|
static java.lang.String |
CONSTANT_INTERROGATION_MARK
|
static java.lang.String |
CONSTANT_OR
|
static java.lang.String |
CONSTANT_WHERE
|
static java.lang.String |
EMPTY_STRING
|
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.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 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 Field |
findFieldByIdInTheList(int nIdField,
java.util.List<Field> listField)
return the field which key 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.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.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.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.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.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 TEMPLATE_FORM_DIRECTORY_RECORD
public static final java.lang.String TEMPLATE_FORM_SEARCH_DIRECTORY_RECORD
public static final java.lang.String EMPTY_STRING
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.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 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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |