public abstract class MVCApplication extends Object implements fr.paris.lutece.portal.web.xpages.XPageApplication
Constructor and Description |
---|
MVCApplication() |
Modifier and Type | Method and Description |
---|---|
protected void |
addError(String strMessage)
Add an error message.
|
protected void |
addError(String strMessageKey,
Locale locale)
Add an error message.
|
protected void |
addInfo(String strMessage)
Add an info message.
|
protected void |
addInfo(String strMessageKey,
Locale locale)
Add an info message.
|
protected fr.paris.lutece.portal.web.xpages.XPage |
download(byte[] data,
String strFilename,
String strContentType)
Initiates a download of a byte array
|
protected fr.paris.lutece.portal.web.xpages.XPage |
download(String strData,
String strFilename,
String strContentType)
Initiates a file download
|
protected void |
fillCommons(Map<String,Object> model)
Fill the model with commons objects used in templates
|
protected String |
getActionFullUrl(String strAction)
Get Action URL
|
protected String |
getActionUrl(String strAction)
Get Action URL
|
protected String |
getDefaultPagePath(Locale locale)
Returns the default page path
|
protected String |
getDefaultPageTitle(Locale locale)
Returns the default page title
|
protected Locale |
getLocale(javax.servlet.http.HttpServletRequest request)
Default getLocale() implementation.
|
protected Map<String,Object> |
getModel()
Get a model Object filled with default values
|
fr.paris.lutece.portal.web.xpages.XPage |
getPage(javax.servlet.http.HttpServletRequest request,
int nMode,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns the content of the page
|
protected String |
getViewFullUrl(String strView)
Gets the view URL with the JSP path
|
protected String |
getViewUrl(String strView)
Get a View URL
|
protected fr.paris.lutece.portal.web.xpages.XPage |
getXPage()
Returns a new XPage object with default values
|
protected fr.paris.lutece.portal.web.xpages.XPage |
getXPage(String strTemplate)
Returns a new XPage object with default values and the content filled
by a template
|
protected fr.paris.lutece.portal.web.xpages.XPage |
getXPage(String strTemplate,
Locale locale)
Returns a new XPage object with default values and the content filled
by a template using a default model and for a given locale
|
protected fr.paris.lutece.portal.web.xpages.XPage |
getXPage(String strTemplate,
Locale locale,
Map<String,Object> model)
Returns a new XPage object with default values and the content filled
by a template using a given model and for a given locale
|
protected String |
getXPageName()
Returns the XPage name
|
protected void |
populate(Object bean,
javax.servlet.http.HttpServletRequest request)
Populate a bean using parameters in http request
|
protected fr.paris.lutece.portal.web.xpages.XPage |
redirect(javax.servlet.http.HttpServletRequest request,
String strTarget)
Redirect to requested page
|
protected fr.paris.lutece.portal.web.xpages.XPage |
redirect(javax.servlet.http.HttpServletRequest request,
String strView,
Map<String,String> additionalParameters)
Redirect to an url defined by given parameters
|
protected fr.paris.lutece.portal.web.xpages.XPage |
redirect(javax.servlet.http.HttpServletRequest request,
String strView,
String strParameter,
int nValue)
Redirect to an url defined by given parameters
|
protected fr.paris.lutece.portal.web.xpages.XPage |
redirect(javax.servlet.http.HttpServletRequest request,
String strView,
String strParameter1,
int nValue1,
String strParameter2,
int nValue2)
Redirect to an url defined by given parameters
|
protected fr.paris.lutece.portal.web.xpages.XPage |
redirectMessageBox(javax.servlet.http.HttpServletRequest request,
MVCMessageBox messageBox)
Redirect to a Message Box page
|
protected fr.paris.lutece.portal.web.xpages.XPage |
redirectView(javax.servlet.http.HttpServletRequest request,
String strView)
Redirect to requested view
|
protected <T> boolean |
validateBean(T bean)
Validate a bean.
|
protected <T> boolean |
validateBean(T bean,
Locale locale)
Validate a bean.
|
public fr.paris.lutece.portal.web.xpages.XPage getPage(javax.servlet.http.HttpServletRequest request, int nMode, fr.paris.lutece.portal.service.plugin.Plugin plugin) throws fr.paris.lutece.portal.service.message.SiteMessageException, fr.paris.lutece.portal.service.security.UserNotSignedException
getPage
in interface fr.paris.lutece.portal.web.xpages.XPageApplication
request
- The http requestnMode
- The current modeplugin
- The plugin objectfr.paris.lutece.portal.service.message.SiteMessageException
- Message displayed if an exception occursfr.paris.lutece.portal.service.security.UserNotSignedException
- if an authentication is required by a viewprotected String getXPageName()
protected String getDefaultPageTitle(Locale locale)
locale
- The localeprotected String getDefaultPagePath(Locale locale)
locale
- The localeprotected fr.paris.lutece.portal.web.xpages.XPage getXPage()
protected fr.paris.lutece.portal.web.xpages.XPage getXPage(String strTemplate)
strTemplate
- The templateprotected fr.paris.lutece.portal.web.xpages.XPage getXPage(String strTemplate, Locale locale)
strTemplate
- The templatelocale
- The localeprotected fr.paris.lutece.portal.web.xpages.XPage getXPage(String strTemplate, Locale locale, Map<String,Object> model)
strTemplate
- The templatelocale
- The localemodel
- The modelprotected Map<String,Object> getModel()
protected void populate(Object bean, javax.servlet.http.HttpServletRequest request)
bean
- bean to populaterequest
- http requestprotected <T> boolean validateBean(T bean)
validateBean(Object, Locale)
should be used instead.T
- The bean classbean
- The beanprotected <T> boolean validateBean(T bean, Locale locale)
validateBean(Object)
should be used instead.T
- The bean classbean
- The beanlocale
- The localeprotected void addError(String strMessage)
strMessage
- The messageprotected void addError(String strMessageKey, Locale locale)
strMessageKey
- The messagelocale
- The locale to display the message inprotected void addInfo(String strMessage)
strMessage
- The messageprotected void addInfo(String strMessageKey, Locale locale)
strMessageKey
- The message keylocale
- The locale to display the message inprotected void fillCommons(Map<String,Object> model)
model
- The modelprotected fr.paris.lutece.portal.web.xpages.XPage redirect(javax.servlet.http.HttpServletRequest request, String strTarget)
request
- the http requeststrTarget
- the targeted pageprotected fr.paris.lutece.portal.web.xpages.XPage redirect(javax.servlet.http.HttpServletRequest request, String strView, String strParameter, int nValue)
request
- The HTTP requeststrView
- The View namestrParameter
- The additional parameternValue
- The additional parameter's valueprotected fr.paris.lutece.portal.web.xpages.XPage redirect(javax.servlet.http.HttpServletRequest request, String strView, String strParameter1, int nValue1, String strParameter2, int nValue2)
request
- The HTTP requeststrView
- The View namestrParameter1
- The first additional parameternValue1
- The first additional parameter's valuestrParameter2
- The second additionnal parameternValue2
- The second additionnal parameter's valueprotected fr.paris.lutece.portal.web.xpages.XPage redirect(javax.servlet.http.HttpServletRequest request, String strView, Map<String,String> additionalParameters)
request
- The HTTP requeststrView
- The View nameadditionalParameters
- A map containing parameters to add to the
URL. Keys of the map are parameters name, and values are
parameters valuesprotected fr.paris.lutece.portal.web.xpages.XPage redirectView(javax.servlet.http.HttpServletRequest request, String strView)
request
- the http requeststrView
- the targeted viewprotected String getViewUrl(String strView)
strView
- The view nameprotected String getViewFullUrl(String strView)
strView
- The viewprotected String getActionUrl(String strAction)
strAction
- The view nameprotected String getActionFullUrl(String strAction)
strAction
- The view nameprotected fr.paris.lutece.portal.web.xpages.XPage download(String strData, String strFilename, String strContentType)
strData
- Data of the file to downloadstrFilename
- Name of filestrContentType
- content type to set to the responseprotected fr.paris.lutece.portal.web.xpages.XPage download(byte[] data, String strFilename, String strContentType)
data
- Data to downloadstrFilename
- Name of the downloaded filestrContentType
- Content type to set to the responseprotected fr.paris.lutece.portal.web.xpages.XPage redirectMessageBox(javax.servlet.http.HttpServletRequest request, MVCMessageBox messageBox)
request
- The HTTP requestmessageBox
- The MessageBox infosprotected Locale getLocale(javax.servlet.http.HttpServletRequest request)
request
- The HTTP requestCopyright © 2016 Mairie de Paris. All Rights Reserved.