|
||||||||||
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 java.lang.String |
CONSTANT_EQUAL
|
static java.lang.String |
CONSTANT_GROUP_BY_DAY
|
static java.lang.String |
CONSTANT_GROUP_BY_MONTH
|
static java.lang.String |
CONSTANT_GROUP_BY_WEEK
|
static java.lang.String |
EMPTY_STRING
|
Method Summary | |
---|---|
static void |
activateMyLuteceAuthentification(Form form,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
java.util.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,
java.lang.String strFileName,
java.lang.String strFileExtension)
write the http header in the response |
static java.sql.Timestamp |
addStatisticInterval(java.sql.Timestamp timestamp,
java.lang.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 java.lang.String |
buildRequestWithFilter(java.lang.String strSelect,
java.util.List<java.lang.String> listStrFilter,
java.util.List<java.lang.String> listStrGroupBy,
java.lang.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(java.util.List<StatisticFormSubmit> listStatistic,
java.lang.String strLabelX,
java.lang.String strLableY,
java.lang.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 authentification for the form |
static Field |
findFieldByIdInTheList(int nIdField,
java.util.List<Field> listField)
return the field which key is specified in parameter |
static java.util.List<IEntry> |
getAllQuestionList(int nIdForm,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
return the questions list |
static java.util.Date |
getCurrentDate()
return current date without hours, minutes and milliseconds |
static java.sql.Timestamp |
getCurrentTimestamp()
return current Timestamp |
static java.sql.Timestamp |
getDateFirstMinute(java.util.Date date,
java.util.Locale locale)
return a timestamp Object which correspond with the string specified in parameter. |
static java.sql.Timestamp |
getDateLastMinute(java.util.Date date,
java.util.Locale locale)
return a timestamp Object which correspond with the string specified in parameter. |
static java.lang.String |
getDateString(java.sql.Timestamp date,
java.util.Locale locale)
Deprecated. |
static int |
getDay(java.sql.Timestamp timestamp)
return the day of the timestamp in parameter |
static java.util.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 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,
java.lang.StringBuffer stringBuffer,
java.util.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,
java.lang.StringBuffer stringBuffer,
java.util.Locale locale,
javax.servlet.http.HttpServletRequest request)
insert in the string buffer the content of the html code of the entry |
static java.lang.String |
getHtmlForm(Form form,
java.lang.String strUrlAction,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
java.util.Locale locale)
return the html code of the form |
static java.lang.String |
getHtmlForm(Form form,
java.lang.String strUrlAction,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
java.util.Locale locale,
javax.servlet.http.HttpServletRequest request)
return the html code of the form |
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 int |
getMonth(java.sql.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,
java.util.Locale locale)
perform in the object formSubmit the responses associates with a entry specify in parameter. |
static int |
getWeek(java.sql.Timestamp timestamp)
return the week of the timestamp in parameter |
static java.lang.String |
getXmlResponses(javax.servlet.http.HttpServletRequest request,
Form form,
java.util.List<FormSubmit> listFormSubmit,
java.util.Locale locale,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
return the xml of form's response |
static int |
getYear(java.sql.Timestamp timestamp)
return the year of the timestamp in parameter |
static java.lang.Boolean |
isFieldInTheResponseList(int nIdField,
java.util.List<Response> listResponse)
return true if the field which key is specified in parameter is in the response list |
static boolean |
sameDate(java.sql.Timestamp timestamp1,
java.sql.Timestamp timestamp2,
java.lang.String strTimesUnit)
Compare two timestamp and return true if they have the same times unit(Day,week,month) |
static void |
sendNotificationMailEndDisponibility(Form form,
java.util.Locale locale)
sendMail to the mailing list associate to the form a mail of end disponibility |
static void |
sendNotificationMailFormSubmit(Form form,
java.util.Locale locale)
sendMail to the mailing list associate to the form a mail of new form submit |
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_GROUP_BY_DAY
public static final java.lang.String CONSTANT_GROUP_BY_WEEK
public static final java.lang.String CONSTANT_GROUP_BY_MONTH
public static final java.lang.String EMPTY_STRING
public static final java.lang.String CONSTANT_EQUAL
Method Detail |
---|
public static void sendNotificationMailEndDisponibility(Form form, java.util.Locale locale)
form
- the formlocale
- the localepublic static void sendNotificationMailFormSubmit(Form form, java.util.Locale locale)
form
- the formlocale
- the localepublic static java.sql.Timestamp getDateLastMinute(java.util.Date date, java.util.Locale locale)
date
- the date who must convertlocale
- the locale
public static java.sql.Timestamp getDateFirstMinute(java.util.Date date, java.util.Locale locale)
date
- the date who must convertlocale
- the locale
public static int getDay(java.sql.Timestamp timestamp)
timestamp
- date
public static int getWeek(java.sql.Timestamp timestamp)
timestamp
- date
public static int getMonth(java.sql.Timestamp timestamp)
timestamp
- date
public static int getYear(java.sql.Timestamp timestamp)
timestamp
- date
public static java.sql.Timestamp addStatisticInterval(java.sql.Timestamp timestamp, java.lang.String strTimesUnit, int nDecal)
timestamp
- datestrTimesUnit
- (day,week,month)nDecal
- the number of timesUnit
public static boolean sameDate(java.sql.Timestamp timestamp1, java.sql.Timestamp timestamp2, java.lang.String strTimesUnit)
timestamp1
- timestamp1timestamp2
- timestamp2strTimesUnit
- (day,week,month)
public static java.lang.String getDateString(java.sql.Timestamp date, java.util.Locale locale)
date
- java.sql.Timestamp date to convertlocale
- the locale
public static java.sql.Timestamp getCurrentTimestamp()
public static java.util.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, 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.lang.String getHtmlForm(Form form, java.lang.String strUrlAction, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.util.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 java.lang.String getHtmlForm(Form form, java.lang.String strUrlAction, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.util.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, java.lang.StringBuffer stringBuffer, java.util.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
- HttpServletRequestpublic static void getHtmlEntry(int nIdEntry, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.lang.StringBuffer stringBuffer, java.util.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, java.util.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, java.util.List<Field> listField)
nIdField
- the id of the field who is searchlistField
- the list of field
public static java.lang.Boolean isFieldInTheResponseList(int nIdField, java.util.List<Response> listResponse)
nIdField
- the id of the field who is searchlistResponse
- the list of object Response
public static java.lang.String getXmlResponses(javax.servlet.http.HttpServletRequest request, Form form, java.util.List<FormSubmit> listFormSubmit, java.util.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 void addHeaderResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String strFileName, java.lang.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(java.util.List<StatisticFormSubmit> listStatistic, java.lang.String strLabelX, java.lang.String strLableY, java.lang.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)
public static java.util.List<IEntry> getAllQuestionList(int nIdForm, fr.paris.lutece.portal.service.plugin.Plugin plugin)
nIdForm
- the form idplugin
- the plugin
public static java.util.List<IEntry> getEntriesList(int nIdForm, fr.paris.lutece.portal.service.plugin.Plugin plugin)
nIdForm
- the form idplugin
- the plugin
public static java.lang.String buildRequestWithFilter(java.lang.String strSelect, java.util.List<java.lang.String> listStrFilter, java.util.List<java.lang.String> listStrGroupBy, java.lang.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, java.util.Locale locale, javax.servlet.http.HttpServletRequest request)
form
- formplugin
- Pluginlocale
- Localerequest
- HttpServletRequestpublic static void deactivateMyLuteceAuthentification(Form form, fr.paris.lutece.portal.service.plugin.Plugin plugin)
form
- Formplugin
- Plugin
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |