|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.paris.lutece.plugins.form.utils.FormUtils
public final class FormUtils
class FormUtils
| Field Summary | |
|---|---|
static String |
BEAN_ENTRY_TYPE_SERVICE
|
static String |
BEAN_EXPORT_DAEMON_TYPE_FACTORY
|
static String |
BEAN_FORM_RESPONSE_SERVICE
|
static String |
CONSTANT_EQUAL
|
static String |
CONSTANT_GROUP_BY_DAY
|
static String |
CONSTANT_GROUP_BY_MONTH
|
static String |
CONSTANT_GROUP_BY_WEEK
|
static int |
CONSTANT_ID_NULL
|
static String |
CONSTANT_RESPONSE_VALUE_ANONYMIZED
|
static String |
CONSTANT_UNDERSCORE
|
static String |
EMPTY_STRING
|
static String |
PARAMETER_DELETE_PREFIX
|
static String |
PARAMETER_ID_ENTRY
|
static String |
PARAMETER_KEY
|
static String |
PROPERTY_CLEAN_FORM_ANSWERS_KEY
|
static String |
PROPERTY_CLEAN_FORM_ANSWERS_RETURN_CODE_KO
|
static String |
PROPERTY_CLEAN_FORM_ANSWERS_RETURN_CODE_OK
|
static String |
PROPERTY_CLEAN_FORM_ANSWERS_RETURN_CODE_UNAUTHORIZED
|
static String |
SESSION_FORM_ERRORS
|
static String |
SESSION_FORM_LIST_SUBMITTED_RESPONSES
|
static String |
SESSION_VALIDATE_REQUIREMENT
|
| Method Summary | |
|---|---|
static void |
activateMyLuteceAuthentification(Form form,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
Locale locale,
javax.servlet.http.HttpServletRequest request)
Activate mylutece authentification for the form |
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 int |
convertStringToInt(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 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 void |
deactivateMyLuteceAuthentification(Form form,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Deactivate mylutece authentication for the form |
static Field |
findFieldByIdInTheList(int nIdField,
List<Field> listField)
return the field which key is specified in parameter |
static Field |
findFieldByTitleInTheList(String strTitle,
List<Field> listFields)
Return the field which title is specified in parameter |
static String |
getAdminBaseUrl(javax.servlet.http.HttpServletRequest request)
Get the base url |
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 EntryType |
getEntryTypeMyLuteceUser(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get entry type mylutece user |
static List<FormError> |
getFormErrors(javax.servlet.http.HttpSession session)
Gets the form errors bound to the session |
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 void |
getHtmlEntry(int nIdEntry,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
StringBuffer stringBuffer,
Locale locale,
javax.servlet.http.HttpServletRequest request)
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 String |
getHtmlForm(Form form,
String strUrlAction,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
Locale locale,
javax.servlet.http.HttpServletRequest request)
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.portal.service.plugin.Plugin |
getPlugin()
Gets the form plugin |
static fr.paris.lutece.util.ReferenceList |
getRefListAllQuestions(int nIdForm,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the ReferenceList associated to all questions |
static fr.paris.lutece.util.ReferenceList |
getRefListCategory(List<Category> listCategories)
Init reference list with the different categories |
static List<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 Map<Integer,List<Response>> |
getResponses(javax.servlet.http.HttpSession session)
Gets the responses bound to the session |
static int |
getWeek(Timestamp timestamp)
return the week of the timestamp in parameter |
static String |
getXmlResponses(javax.servlet.http.HttpServletRequest request,
Form form,
FormSubmit formSubmit,
Locale locale,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the XML responses for a single form submit |
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 void |
removeFormErrors(javax.servlet.http.HttpSession session)
Removes submitted responses |
static void |
removeResponses(javax.servlet.http.HttpSession session)
Removes submitted responses |
static void |
restoreFormErrors(javax.servlet.http.HttpSession session,
List<FormError> listFormErrors)
Restores form errors |
static void |
restoreResponses(javax.servlet.http.HttpSession session,
Map<Integer,List<Response>> mapResponses)
Restores submitted responses |
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 |
static void |
sendNotificationMailFormSubmit(FormSubmit formSubmit,
Locale locale)
SendMail to the mailing list associate to the form a mail of new form submit. |
static String |
trim(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 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 final String CONSTANT_EQUAL
public static final String PARAMETER_DELETE_PREFIX
public static final String BEAN_ENTRY_TYPE_SERVICE
public static final String BEAN_FORM_RESPONSE_SERVICE
public static final String BEAN_EXPORT_DAEMON_TYPE_FACTORY
public static final int CONSTANT_ID_NULL
public static final String CONSTANT_UNDERSCORE
public static final String SESSION_FORM_LIST_SUBMITTED_RESPONSES
public static final String SESSION_VALIDATE_REQUIREMENT
public static final String SESSION_FORM_ERRORS
public static final String PARAMETER_ID_ENTRY
public static final String PARAMETER_KEY
public static final String PROPERTY_CLEAN_FORM_ANSWERS_KEY
public static final String PROPERTY_CLEAN_FORM_ANSWERS_RETURN_CODE_UNAUTHORIZED
public static final String PROPERTY_CLEAN_FORM_ANSWERS_RETURN_CODE_OK
public static final String PROPERTY_CLEAN_FORM_ANSWERS_RETURN_CODE_KO
public static final String CONSTANT_RESPONSE_VALUE_ANONYMIZED
| Method Detail |
|---|
public static void sendNotificationMailEndDisponibility(Form form,
Locale locale)
form - the formlocale - the locale
public static void sendNotificationMailFormSubmit(Form form,
Locale locale)
form - the formlocale - the locale
public static void sendNotificationMailFormSubmit(FormSubmit formSubmit,
Locale locale)
formSubmit - the submit formlocale - Locale
public static Timestamp getDateLastMinute(Date date,
Locale locale)
date - the date who must convertlocale - the locale
public static Timestamp getDateFirstMinute(Date date,
Locale locale)
date - the date who must convertlocale - the locale
public static int getDay(Timestamp timestamp)
timestamp - date
public static int getWeek(Timestamp timestamp)
timestamp - date
public static int getMonth(Timestamp timestamp)
timestamp - date
public static int getYear(Timestamp timestamp)
timestamp - date
public static Timestamp addStatisticInterval(Timestamp timestamp,
String strTimesUnit,
int nDecal)
timestamp - datestrTimesUnit - (day,week,month)nDecal - the number of timesUnit
public 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 locale
public 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 plugin
public static int getIndexEntryInTheEntryList(int nIdEntry,
List<IEntry> listEntry)
nIdEntry - the key of the entrylistEntry - the list of the entry
public static int getIndexFieldInTheFieldList(int nIdField,
List<Field> listField)
nIdField - the key of the fieldlistField - the list of field
public static String getHtmlForm(Form form,
String strUrlAction,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
Locale locale,
javax.servlet.http.HttpServletRequest request)
form - the form which html code must be returnstrUrlAction - the url who must be call after the form submitplugin - the pluginlocale - the localerequest - HttpServletRequest
public static fr.paris.lutece.util.ReferenceList getRefListCategory(List<Category> listCategories)
listCategories - the list of categories
public 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 locale
public static void getHtmlEntry(int nIdEntry,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
StringBuffer stringBuffer,
Locale locale,
javax.servlet.http.HttpServletRequest request)
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 localerequest - HttpServletRequest
public 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 locale
public static List<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 locale
public static Field findFieldByIdInTheList(int nIdField,
List<Field> listField)
nIdField - the id of the field who is searchlistField - the list of field
public static Boolean isFieldInTheResponseList(int nIdField,
List<Response> listResponse)
nIdField - the id of the field who is searchlistResponse - the list of object Response
public 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 plugin
public static String getXmlResponses(javax.servlet.http.HttpServletRequest request,
Form form,
FormSubmit formSubmit,
Locale locale,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
request - the HTTP requestform - the formformSubmit - the form submitlocale - the localeplugin - the plugin
public 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 extension
public 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 user
public static fr.paris.lutece.util.ReferenceList getRefListAllQuestions(int nIdForm,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
nIdForm - the id formplugin - the Plugin
ReferenceList
public static List<IEntry> getAllQuestionList(int nIdForm,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
nIdForm - the form idplugin - the plugin
public static List<IEntry> getEntriesList(int nIdForm,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
nIdForm - the form idplugin - the plugin
public 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 query
public static EntryType getEntryTypeMyLuteceUser(fr.paris.lutece.portal.service.plugin.Plugin plugin)
plugin - Plugin
public static void activateMyLuteceAuthentification(Form form,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
Locale locale,
javax.servlet.http.HttpServletRequest request)
form - formplugin - Pluginlocale - Localerequest - HttpServletRequest
public static void deactivateMyLuteceAuthentification(Form form,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
form - Formplugin - Plugin
public static void restoreResponses(javax.servlet.http.HttpSession session,
Map<Integer,List<Response>> mapResponses)
session - the sessionmapResponses - response list, key is entry idpublic static void removeResponses(javax.servlet.http.HttpSession session)
session - the sessionpublic static Map<Integer,List<Response>> getResponses(javax.servlet.http.HttpSession session)
session - the session
null otherwise.
public static void restoreFormErrors(javax.servlet.http.HttpSession session,
List<FormError> listFormErrors)
session - the sessionlistFormErrors - the form errosrpublic static void removeFormErrors(javax.servlet.http.HttpSession session)
session - the sessionpublic static List<FormError> getFormErrors(javax.servlet.http.HttpSession session)
session - the session
public static int convertStringToInt(String strParameter)
strParameter - the string parameter to convert
public static fr.paris.lutece.portal.service.plugin.Plugin getPlugin()
public static String trim(String strParameter)
strParameter - the string parameter to convert
public static Field findFieldByTitleInTheList(String strTitle,
List<Field> listFields)
strTitle - the titlelistFields - the list of fields
public static String getAdminBaseUrl(javax.servlet.http.HttpServletRequest request)
request - the HTTP request
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||