fr.paris.lutece.plugins.mvc
Class MVCApplication

java.lang.Object
  extended by fr.paris.lutece.plugins.mvc.MVCApplication
All Implemented Interfaces:
fr.paris.lutece.portal.web.xpages.XPageApplication

public abstract class MVCApplication
extends Object
implements fr.paris.lutece.portal.web.xpages.XPageApplication

MVC XPage Application


Constructor Summary
MVCApplication()
           
 
Method Summary
protected  void fillCommons(Map<String,Object> model)
          Fill the model with commons objects used in templates
protected  String getAction(javax.servlet.http.HttpServletRequest request)
          Get the action parameter
protected  String getDefaultPagePath()
          Returns the default page path
protected  String getDefaultPageTitle()
          Returns the default page title
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  List<fr.paris.lutece.util.ErrorMessage> getValidationErrors()
          Gets validation errors
protected  String getView(javax.servlet.http.HttpServletRequest request)
          Get the view parameter
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 redirectView(javax.servlet.http.HttpServletRequest request, String strView)
          Redirect to requested view
protected
<T> boolean
validateBean(T bean)
          Validate a bean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MVCApplication

public MVCApplication()
Method Detail

getPage

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
Returns the content of the page

Specified by:
getPage in interface fr.paris.lutece.portal.web.xpages.XPageApplication
Parameters:
request - The http request
nMode - The current mode
plugin - The plugin object
Returns:
The XPage
Throws:
fr.paris.lutece.portal.service.message.SiteMessageException - Message displayed if an exception occurs

getView

protected String getView(javax.servlet.http.HttpServletRequest request)
Get the view parameter

Parameters:
request - The HTTP request
Returns:
The view parameter or null if not found

getAction

protected String getAction(javax.servlet.http.HttpServletRequest request)
Get the action parameter

Parameters:
request - The HTTP request
Returns:
The action parameter or null if not found

getXPageName

protected String getXPageName()
Returns the XPage name

Returns:
The XPage name

getDefaultPageTitle

protected String getDefaultPageTitle()
Returns the default page title

Returns:
The default page title

getDefaultPagePath

protected String getDefaultPagePath()
Returns the default page path

Returns:
The default pagepath

getXPage

protected fr.paris.lutece.portal.web.xpages.XPage getXPage()
Returns a new XPage object with default values

Returns:
An XPage Object

getXPage

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

Parameters:
strTemplate - The template
Returns:
An XPage Object

getXPage

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

Parameters:
strTemplate - The template
locale - The locale
Returns:
An XPage Object

getXPage

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

Parameters:
strTemplate - The template
locale - The locale
model - The model
Returns:
An XPage Object

getModel

protected Map<String,Object> getModel()
Get a model Object filled with default values

Returns:
The model

populate

protected void populate(Object bean,
                        javax.servlet.http.HttpServletRequest request)
Populate a bean using parameters in http request

Parameters:
bean - bean to populate
request - http request

validateBean

protected <T> boolean validateBean(T bean)
Validate a bean

Type Parameters:
T - The bean class
Parameters:
bean - The bean
Returns:
true if validated otherwise false

getValidationErrors

protected List<fr.paris.lutece.util.ErrorMessage> getValidationErrors()
Gets validation errors

Returns:
The errors list

fillCommons

protected void fillCommons(Map<String,Object> model)
Fill the model with commons objects used in templates

Parameters:
model - The model

redirect

protected fr.paris.lutece.portal.web.xpages.XPage redirect(javax.servlet.http.HttpServletRequest request,
                                                           String strTarget)
Redirect to requested page

Parameters:
request - the http request
strTarget - the targeted page
Returns:
the page requested

redirectView

protected fr.paris.lutece.portal.web.xpages.XPage redirectView(javax.servlet.http.HttpServletRequest request,
                                                               String strView)
Redirect to requested view

Parameters:
request - the http request
strView - the targeted view
Returns:
the page requested


Copyright © 2013 Mairie de Paris. All Rights Reserved.