fr.paris.lutece.plugins.stock.modules.billetterie.web
Class AbstractXPageApp

java.lang.Object
  extended by fr.paris.lutece.plugins.stock.modules.billetterie.web.AbstractXPageApp
Direct Known Subclasses:
StockBilletterieApp, StockBilletterieReservationApp

public abstract class AbstractXPageApp
extends Object

Abstract class for jsp bean

Author:
abataille

Field Summary
static String DEFAULT_PAGE_INDEX
           
static String DEFAULT_RESULTS_PER_PAGE
           
static String PARAMETER_NB_ITEMS_PER_PAGE
           
static String PROPERTY_RESULTS_PER_PAGE
           
 
Constructor Summary
AbstractXPageApp()
           
 
Method Summary
protected  fr.paris.lutece.plugins.stock.commons.exception.FunctionnalException getErrorOnce(javax.servlet.http.HttpServletRequest request)
          Get validation error from session and remove from it
protected  String getHtmlError(fr.paris.lutece.plugins.stock.commons.exception.FunctionnalException e, javax.servlet.http.HttpServletRequest request)
          Return html code for error message.
protected  String getMessage(String key, javax.servlet.http.HttpServletRequest request)
          Return localized message.
protected  String getMessage(String key, javax.servlet.http.HttpServletRequest request, String... args)
          Return localized message with args.
protected  fr.paris.lutece.plugins.stock.commons.dao.PaginationProperties getPaginationProperties(javax.servlet.http.HttpServletRequest request)
          Return a bean for pagination in service/dao using parameter in http request
protected  fr.paris.lutece.portal.service.security.LuteceUser getUser(javax.servlet.http.HttpServletRequest request)
          Return authified user and throw technical exception if no user auth found.
protected  String manageFunctionnalException(javax.servlet.http.HttpServletRequest request, fr.paris.lutece.plugins.stock.commons.exception.FunctionnalException e, String targetUrl)
          Manage functionnal exception.
protected static void populate(Object bean, javax.servlet.http.HttpServletRequest request)
          Populate a bean using parameters in http request
protected
<T> void
validate(T bean)
          Validate a bean using jsr 303 specs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAMETER_NB_ITEMS_PER_PAGE

public static final String PARAMETER_NB_ITEMS_PER_PAGE
See Also:
Constant Field Values

DEFAULT_RESULTS_PER_PAGE

public static final String DEFAULT_RESULTS_PER_PAGE
See Also:
Constant Field Values

DEFAULT_PAGE_INDEX

public static final String DEFAULT_PAGE_INDEX
See Also:
Constant Field Values

PROPERTY_RESULTS_PER_PAGE

public static final String PROPERTY_RESULTS_PER_PAGE
See Also:
Constant Field Values
Constructor Detail

AbstractXPageApp

public AbstractXPageApp()
Method Detail

populate

protected static 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

validate

protected <T> void validate(T bean)
                 throws fr.paris.lutece.plugins.stock.commons.exception.ValidationException
Validate a bean using jsr 303 specs.

Type Parameters:
T - the generic type
Parameters:
bean - to validate
Throws:
fr.paris.lutece.plugins.stock.commons.exception.ValidationException - exception containing informations about errors and the bean

getUser

protected fr.paris.lutece.portal.service.security.LuteceUser getUser(javax.servlet.http.HttpServletRequest request)
                                                              throws fr.paris.lutece.plugins.stock.commons.exception.TechnicalException
Return authified user and throw technical exception if no user auth found.

Parameters:
request - http request
Returns:
user lutece
Throws:
fr.paris.lutece.plugins.stock.commons.exception.TechnicalException - the technical exception

getMessage

protected String getMessage(String key,
                            javax.servlet.http.HttpServletRequest request)
Return localized message.

Parameters:
key - i18n key
request - the request
Returns:
localized message

getMessage

protected String getMessage(String key,
                            javax.servlet.http.HttpServletRequest request,
                            String... args)
Return localized message with args.

Parameters:
key - i18n key
request - the request
args - args
Returns:
localized message

getHtmlError

protected String getHtmlError(fr.paris.lutece.plugins.stock.commons.exception.FunctionnalException e,
                              javax.servlet.http.HttpServletRequest request)
Return html code for error message.

Parameters:
e - the e
request - the request
Returns:
html

manageFunctionnalException

protected String manageFunctionnalException(javax.servlet.http.HttpServletRequest request,
                                            fr.paris.lutece.plugins.stock.commons.exception.FunctionnalException e,
                                            String targetUrl)
Manage functionnal exception.

Parameters:
request - the request
e - the e
targetUrl - the target url
Returns:
the string

getErrorOnce

protected fr.paris.lutece.plugins.stock.commons.exception.FunctionnalException getErrorOnce(javax.servlet.http.HttpServletRequest request)
Get validation error from session and remove from it

Parameters:
request - http request
Returns:
validation exception

getPaginationProperties

protected fr.paris.lutece.plugins.stock.commons.dao.PaginationProperties getPaginationProperties(javax.servlet.http.HttpServletRequest request)
Return a bean for pagination in service/dao using parameter in http request

Parameters:
request - http request
Returns:
paginator the populate paginator


Copyright © 2013 Mairie de Paris. All Rights Reserved.