public final class FormUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CONSTANT_GROUP_BY_DAY |
static String |
CONSTANT_GROUP_BY_MONTH |
static String |
CONSTANT_GROUP_BY_WEEK |
static String |
EMPTY_STRING |
Modifier and Type | Method and Description |
---|---|
static void |
addHeaderResponse(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String strFileName,
String strFileExtension)
write the http header in the response
|
static Timestamp |
addStatisticInterval(Timestamp timestamp,
String strTimesUnit,
int nDecal)
return a timestamp Object which correspond to the timestamp
in parameter add with a number of times unit (day,week,month)specify in strTimesUnit .
|
static String |
buildRequestWithFilter(String strSelect,
List<String> listStrFilter,
List<String> listStrGroupBy,
String strOrder)
Builds a query with filters placed in parameters
|
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 org.jfree.chart.JFreeChart |
createXYGraph(List<StatisticFormSubmit> listStatistic,
String strLabelX,
String strLableY,
String strTimesUnit)
create a JFreeChart Graph function of the statistic form submit
|
static Field |
findFieldByIdInTheList(int nIdField,
List<Field> listField)
return the field which key is specified in parameter
|
static List<IEntry> |
getAllQuestionList(int nIdForm,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
return the questions list
|
static Date |
getCurrentDate()
return current date without hours, minutes and milliseconds
|
static Timestamp |
getCurrentTimestamp()
return current Timestamp
|
static Timestamp |
getDateFirstMinute(Date date,
Locale locale)
return a timestamp Object which correspond with the string specified in parameter.
|
static Timestamp |
getDateLastMinute(Date date,
Locale locale)
return a timestamp Object which correspond with the string specified in parameter.
|
static String |
getDateString(Timestamp date,
Locale locale)
Deprecated.
|
static int |
getDay(Timestamp timestamp)
return the day of the timestamp
in parameter
|
static List<IEntry> |
getEntriesList(int nIdForm,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
return all entries of form
|
static fr.paris.lutece.util.ReferenceList |
getFormList(fr.paris.lutece.portal.service.plugin.Plugin plugin,
fr.paris.lutece.portal.business.user.AdminUser user)
Load the data of all form that the user is authorized to see depends workgroups user
|
static void |
getHtmlEntry(int nIdEntry,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
StringBuffer stringBuffer,
Locale locale)
insert in the string buffer the content of the html code of the entry
|
static String |
getHtmlForm(Form form,
String strUrlAction,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
Locale locale)
return the html code of the form
|
static int |
getIndexEntryInTheEntryList(int nIdEntry,
List<IEntry> listEntry)
return the index in the list of the entry whose key is specified in parameter
|
static int |
getIndexFieldInTheFieldList(int nIdField,
List<Field> listField)
return the index in the list of the field whose key is specified in parameter
|
static int |
getMonth(Timestamp timestamp)
return the month of the timestamp
in parameter
|
static fr.paris.lutece.util.ReferenceList |
getRefListAllQuestions(int nIdForm,
fr.paris.lutece.portal.service.plugin.Plugin plugin) |
static FormError |
getResponseEntry(javax.servlet.http.HttpServletRequest request,
int nIdEntry,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
FormSubmit formSubmit,
boolean bResponseNull,
Locale locale)
perform in the object formSubmit the responses associates with a entry specify in parameter.
|
static int |
getWeek(Timestamp timestamp)
return the week of the timestamp
in parameter
|
static String |
getXmlResponses(javax.servlet.http.HttpServletRequest request,
Form form,
List<FormSubmit> listFormSubmit,
Locale locale,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
return the xml of form's response
|
static int |
getYear(Timestamp timestamp)
return the year of the timestamp
in parameter
|
static Boolean |
isFieldInTheResponseList(int nIdField,
List<Response> listResponse)
return true if the field which key is specified in parameter is in the response list
|
static boolean |
sameDate(Timestamp timestamp1,
Timestamp timestamp2,
String strTimesUnit)
Compare two timestamp and return true if they have the same times unit(Day,week,month)
|
static void |
sendNotificationMailEndDisponibility(Form form,
Locale locale)
sendMail to the mailing list associate to the form a mail of end disponibility
|
static void |
sendNotificationMailFormSubmit(Form form,
Locale locale)
sendMail to the mailing list associate to the form a mail of new form submit
|
public static final String CONSTANT_GROUP_BY_DAY
public static final String CONSTANT_GROUP_BY_WEEK
public static final String CONSTANT_GROUP_BY_MONTH
public static final String EMPTY_STRING
public static void sendNotificationMailEndDisponibility(Form form, Locale locale)
form
- the formlocale
- the localepublic static void sendNotificationMailFormSubmit(Form form, Locale locale)
form
- the formlocale
- the localepublic static Timestamp getDateLastMinute(Date date, Locale locale)
date
- the date who must convertlocale
- the localepublic static Timestamp getDateFirstMinute(Date date, Locale locale)
date
- the date who must convertlocale
- the localepublic static int getDay(Timestamp timestamp)
timestamp
- datepublic static int getWeek(Timestamp timestamp)
timestamp
- datepublic static int getMonth(Timestamp timestamp)
timestamp
- datepublic static int getYear(Timestamp timestamp)
timestamp
- datepublic static Timestamp addStatisticInterval(Timestamp timestamp, String strTimesUnit, int nDecal)
timestamp
- datestrTimesUnit
- (day,week,month)nDecal
- the number of timesUnitpublic static boolean sameDate(Timestamp timestamp1, Timestamp timestamp2, String strTimesUnit)
timestamp1
- timestamp1timestamp2
- timestamp2strTimesUnit
- (day,week,month)public static String getDateString(Timestamp date, Locale locale)
date
- java.sql.Timestamp date to convertlocale
- the localepublic static Timestamp getCurrentTimestamp()
public static Date getCurrentDate()
public static IEntry createEntryByType(javax.servlet.http.HttpServletRequest request, fr.paris.lutece.portal.service.plugin.Plugin plugin)
request
- the requestplugin
- the pluginpublic static int getIndexEntryInTheEntryList(int nIdEntry, List<IEntry> listEntry)
nIdEntry
- the key of the entrylistEntry
- the list of the entrypublic static int getIndexFieldInTheFieldList(int nIdField, List<Field> listField)
nIdField
- the key of the fieldlistField
- the list of fieldpublic static String getHtmlForm(Form form, String strUrlAction, fr.paris.lutece.portal.service.plugin.Plugin plugin, Locale locale)
form
- the form which html code must be returnstrUrlAction
- the url who must be call after the form submitplugin
- the pluginlocale
- the localepublic static void getHtmlEntry(int nIdEntry, fr.paris.lutece.portal.service.plugin.Plugin plugin, StringBuffer stringBuffer, Locale locale)
nIdEntry
- the key of the entry which html code must be insert in the stringBufferplugin
- the pluginstringBuffer
- the buffer which contains the html codelocale
- the localepublic static FormError getResponseEntry(javax.servlet.http.HttpServletRequest request, int nIdEntry, fr.paris.lutece.portal.service.plugin.Plugin plugin, FormSubmit formSubmit, boolean bResponseNull, Locale locale)
request
- the requestnIdEntry
- the key of the entryplugin
- the pluginformSubmit
- Form Submit ObjectbResponseNull
- true if the response create must be nulllocale
- the localepublic static Field findFieldByIdInTheList(int nIdField, List<Field> listField)
nIdField
- the id of the field who is searchlistField
- the list of fieldpublic static Boolean isFieldInTheResponseList(int nIdField, List<Response> listResponse)
nIdField
- the id of the field who is searchlistResponse
- the list of object Responsepublic static String getXmlResponses(javax.servlet.http.HttpServletRequest request, Form form, List<FormSubmit> listFormSubmit, Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin)
request
- the requestform
- the formlistFormSubmit
- the form submit listlocale
- the localeplugin
- the pluginpublic static void addHeaderResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String strFileName, String strFileExtension)
request
- the httpServletRequestresponse
- the http responsestrFileName
- the name of the file who must insert in the responsestrFileExtension
- the file extensionpublic static org.jfree.chart.JFreeChart createXYGraph(List<StatisticFormSubmit> listStatistic, String strLabelX, String strLableY, String strTimesUnit)
listStatistic
- the list of statistic of form submitstrLabelX
- the label of axis xstrLableY
- the label of axis xstrTimesUnit
- the times unit of axis x(Day,Week,Month)public static fr.paris.lutece.util.ReferenceList getFormList(fr.paris.lutece.portal.service.plugin.Plugin plugin, fr.paris.lutece.portal.business.user.AdminUser user)
plugin
- the pluginuser
- the current userpublic static fr.paris.lutece.util.ReferenceList getRefListAllQuestions(int nIdForm, fr.paris.lutece.portal.service.plugin.Plugin plugin)
public static List<IEntry> getAllQuestionList(int nIdForm, fr.paris.lutece.portal.service.plugin.Plugin plugin)
nIdForm
- the form idplugin
- the pluginpublic static List<IEntry> getEntriesList(int nIdForm, fr.paris.lutece.portal.service.plugin.Plugin plugin)
nIdForm
- the form idplugin
- the pluginpublic static String buildRequestWithFilter(String strSelect, List<String> listStrFilter, List<String> listStrGroupBy, String strOrder)
strSelect
- the select of the querylistStrFilter
- the list of filter to add in the querylistStrGroupBy
- the list of group by to add in the querystrOrder
- the order by of the queryCopyright © 2015 City of Paris. All rights reserved.