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 java.lang.Object

Abstract class for jsp bean

Author:
abataille

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  java.lang.String getHtmlError(fr.paris.lutece.plugins.stock.commons.exception.FunctionnalException e, javax.servlet.http.HttpServletRequest request)
          Return html code for error message.
protected  java.lang.String getMessage(java.lang.String key, javax.servlet.http.HttpServletRequest request)
          Return localized message.
protected  java.lang.String getMessage(java.lang.String key, javax.servlet.http.HttpServletRequest request, java.lang.String... args)
          Return localized message with args.
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  java.lang.String manageFunctionnalException(javax.servlet.http.HttpServletRequest request, fr.paris.lutece.plugins.stock.commons.exception.FunctionnalException e, java.lang.String targetUrl)
          Manage functionnal exception.
protected static void populate(java.lang.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
 

Constructor Detail

AbstractXPageApp

public AbstractXPageApp()
Method Detail

populate

protected static void populate(java.lang.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 java.lang.String getMessage(java.lang.String key,
                                      javax.servlet.http.HttpServletRequest request)
Return localized message.

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

getMessage

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

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

getHtmlError

protected java.lang.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 java.lang.String manageFunctionnalException(javax.servlet.http.HttpServletRequest request,
                                                      fr.paris.lutece.plugins.stock.commons.exception.FunctionnalException e,
                                                      java.lang.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


Copyright © 2012 Mairie de Paris. All Rights Reserved.