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

java.lang.Object
  extended by fr.paris.lutece.portal.web.admin.AdminFeaturesPageJspBean
      extended by fr.paris.lutece.portal.web.admin.PluginAdminPageJspBean
          extended by fr.paris.lutece.plugins.stock.modules.billetterie.web.AbstractJspBean
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CategoryJspBean, NotificationJspBean, OfferJspBean, PartnerJspBean, PurchaseJspBean, ShowJspBean, StatisticJspBean, SubscriptionProductJspBean

public class AbstractJspBean
extends fr.paris.lutece.portal.web.admin.PluginAdminPageJspBean

Abstract class for jsp bean

Author:
abataille
See Also:
Serialized Form

Field Summary
protected  int _nItemsPerPage
           
protected static String ERROR_MESSAGE_KEY
           
protected static String ERROR_TEMPLATE
           
protected static String FIELD_MESSAGE_PREFIX
           
protected static String MARK_DATA_TABLE_MANAGER
           
protected static String MARK_FILTER
           
protected static String MARK_MESSAGE_LIST
           
protected static String MARK_NB_ITEMS_PER_PAGE
           
protected static String MARK_PAGINATOR
           
protected static String MARK_PLUGIN_NAME
           
static int N_DEFAULT_ITEMS_PER_PAGE
           
protected static String PARAMETER_FIND_BY_FILTER_NAME_METHOD
           
 
Constructor Summary
AbstractJspBean()
           
 
Method Summary
protected
<T> fr.paris.lutece.util.datatable.DataTableManager<T>
getAbstractDataTableManager(javax.servlet.http.HttpServletRequest request, Object filter, String keyDataTable, String jspManage, Object service, Method findByFilter)
           
protected
<T> fr.paris.lutece.util.datatable.DataTableManager<T>
getDataTableToUse(javax.servlet.http.HttpServletRequest request, String markFilter, String jspManage)
          Get the correct data table manager
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
<T> T
getFilterToUse(javax.servlet.http.HttpServletRequest request, T filter, String markFilter, fr.paris.lutece.util.datatable.DataTableManager<?> dataTable)
          Get the correct filter to use with data table manager
protected  String getHtmlError(fr.paris.lutece.plugins.stock.commons.exception.FunctionnalException e)
          Return html code for error message
protected  String getMessage(String key)
          Return localized message
protected  String getMessage(String key, String... args)
          Return localized message with args
protected
<T> fr.paris.lutece.util.datatable.DataTableManager<T>
loadDataTableFromSession(javax.servlet.http.HttpServletRequest request, String key)
          Get the datatable save in the session
protected  String manageFunctionnalException(javax.servlet.http.HttpServletRequest request, fr.paris.lutece.plugins.stock.commons.exception.FunctionnalException e, String targetUrl)
          Manage functionnal exception.
protected
<T> void
saveDataTableInSession(javax.servlet.http.HttpServletRequest request, fr.paris.lutece.util.datatable.DataTableManager<T> dataTable, String key)
          Save a Data table manager into the http session with key.
protected
<T> void
validateBilletterie(T bean)
          Validate a bean using jsr 303 specs.
 
Methods inherited from class fr.paris.lutece.portal.web.admin.PluginAdminPageJspBean
getPlugin, init
 
Methods inherited from class fr.paris.lutece.portal.web.admin.AdminFeaturesPageJspBean
getAdminPage, getFeatureIcon, getHomeUrl, getLocale, getPageTitle, getUser, populate, setFeatureIcon, setPageTitleProperty, validate, validate, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

N_DEFAULT_ITEMS_PER_PAGE

public static final int N_DEFAULT_ITEMS_PER_PAGE

ERROR_MESSAGE_KEY

protected static final String ERROR_MESSAGE_KEY
See Also:
Constant Field Values

ERROR_TEMPLATE

protected static final String ERROR_TEMPLATE
See Also:
Constant Field Values

FIELD_MESSAGE_PREFIX

protected static final String FIELD_MESSAGE_PREFIX
See Also:
Constant Field Values

MARK_FILTER

protected static final String MARK_FILTER
See Also:
Constant Field Values

MARK_DATA_TABLE_MANAGER

protected static final String MARK_DATA_TABLE_MANAGER
See Also:
Constant Field Values

MARK_MESSAGE_LIST

protected static final String MARK_MESSAGE_LIST
See Also:
Constant Field Values

MARK_NB_ITEMS_PER_PAGE

protected static final String MARK_NB_ITEMS_PER_PAGE
See Also:
Constant Field Values

MARK_PAGINATOR

protected static final String MARK_PAGINATOR
See Also:
Constant Field Values

MARK_PLUGIN_NAME

protected static final String MARK_PLUGIN_NAME
See Also:
Constant Field Values

PARAMETER_FIND_BY_FILTER_NAME_METHOD

protected static final String PARAMETER_FIND_BY_FILTER_NAME_METHOD
See Also:
Constant Field Values

_nItemsPerPage

protected int _nItemsPerPage
Constructor Detail

AbstractJspBean

public AbstractJspBean()
Method Detail

loadDataTableFromSession

protected <T> fr.paris.lutece.util.datatable.DataTableManager<T> loadDataTableFromSession(javax.servlet.http.HttpServletRequest request,
                                                                                          String key)
Get the datatable save in the session

Parameters:
request - the http request
key - the key for the data table
Returns:
the DataTableManager keep in session

saveDataTableInSession

protected <T> void saveDataTableInSession(javax.servlet.http.HttpServletRequest request,
                                          fr.paris.lutece.util.datatable.DataTableManager<T> dataTable,
                                          String key)
Save a Data table manager into the http session with key. Can save various data table.

Type Parameters:
T - Type of data
Parameters:
request - the http request with the user session
dataTable - the datatable
key - the datatable key

validateBilletterie

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

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

getMessage

protected String getMessage(String key)
Return localized message

Parameters:
key - i18n key
Returns:
localized message

getMessage

protected String getMessage(String key,
                            String... args)
Return localized message with args

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

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

getHtmlError

protected String getHtmlError(fr.paris.lutece.plugins.stock.commons.exception.FunctionnalException e)
Return html code for error message

Parameters:
e - functionnal exception
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. Save it into session

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

getFilterToUse

protected <T> T getFilterToUse(javax.servlet.http.HttpServletRequest request,
                               T filter,
                               String markFilter,
                               fr.paris.lutece.util.datatable.DataTableManager<?> dataTable)
Get the correct filter to use with data table manager

Type Parameters:
T - the bean filter type
Parameters:
request - the http request
filter - the bean filter get with request
markFilter - the key of the filter
dataTable - the datatable to use
Returns:
the filter to use

getDataTableToUse

protected <T> fr.paris.lutece.util.datatable.DataTableManager<T> getDataTableToUse(javax.servlet.http.HttpServletRequest request,
                                                                                   String markFilter,
                                                                                   String jspManage)
Get the correct data table manager

Type Parameters:
T - the bean filter type
Parameters:
request - the http request
markFilter - the key of the filter
jspManage - the jsp file to manage the beans
Returns:
the DataTableManager

getAbstractDataTableManager

protected <T> fr.paris.lutece.util.datatable.DataTableManager<T> getAbstractDataTableManager(javax.servlet.http.HttpServletRequest request,
                                                                                             Object filter,
                                                                                             String keyDataTable,
                                                                                             String jspManage,
                                                                                             Object service,
                                                                                             Method findByFilter)
Parameters:
request - the http request
filter - the filter
keyDataTable - the key to store data table manager
jspManage - the url to the manage page
service - the bean service
findByFilter - the method which give the method to find beans
Returns:
the data table to use


Copyright © 2013 Mairie de Paris. All Rights Reserved.