fr.ifremer.echobase.ui.actions
Class EchoBaseActionSupport

java.lang.Object
  extended by com.opensymphony.xwork2.ActionSupport
      extended by org.nuiton.web.struts2.BaseAction
          extended by fr.ifremer.echobase.ui.actions.EchoBaseActionSupport
All Implemented Interfaces:
com.opensymphony.xwork2.Action, com.opensymphony.xwork2.LocaleProvider, com.opensymphony.xwork2.TextProvider, com.opensymphony.xwork2.Validateable, com.opensymphony.xwork2.ValidationAware, Serializable, org.nuiton.topia.framework.TopiaTransactionAware
Direct Known Subclasses:
AbstractJSONPaginedAction, ConnectToDbInformations, CreateEmbeddedApplication, DownloadEmbeddedApplication, DownloadExportSqlResult, ExportSql, ExportSqlResult, GetForeignEntities, ImportAction, LoadEntities, LoginAction, ManageExportQuery, ManageUser, SaveEntity

public class EchoBaseActionSupport
extends org.nuiton.web.struts2.BaseAction
implements org.nuiton.topia.framework.TopiaTransactionAware

EchoBase action support.

Note : All actions must implement this class to have a better i18n support, when a i18n key is not translated it has a empty translation and we do NOT want this behaviour in gui, prefer to return the marked untranslated key.

Since:
0.1
Author:
tchemit
See Also:
Serialized Form

Field Summary
static String APPLICATION_CONTEXT_PARAMETER
          Key to store the single instance of the application context
protected  EchoBaseServiceContext serviceContext
           
protected  EchoBaseServiceFactory serviceFactory
          Provides a way to get a service.
protected static String SESSION_PARAMETER
          Key to store the EchoBaseSession instance in the session's map.
protected  org.nuiton.topia.TopiaContext transaction
           
 
Fields inherited from class com.opensymphony.xwork2.ActionSupport
LOG
 
Fields inherited from interface com.opensymphony.xwork2.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
 
Constructor Summary
EchoBaseActionSupport()
           
 
Method Summary
 String decorate(Object o, String context)
           
 String formatDate(Date date)
           
 String formatMonth(Date date)
           
protected static com.opensymphony.xwork2.ActionContext getActionContext()
           
static String getApplicationVersion()
           
protected  EchoBaseConfiguration getConfiguration()
           
protected  SimpleDateFormat getDateFormat()
           
protected  DecoratorService getDecoratorService()
           
static EchoBaseApplicationContext getEchoBaseApplicationContext()
           
 EchoBaseSession getEchoBaseSession()
           
protected  SimpleDateFormat getMonthFormat()
           
protected  EchoBaseServiceContext getServiceContext()
          Fabrique pour récupérer le ServiceContext tel qu'il devrait être fourni à la fabrication d'un service.
 EchoBaseServiceFactory getServiceFactory()
           
 org.nuiton.topia.TopiaContext getTransaction()
           
<E extends EchoBaseService>
E
newService(Class<E> serviceClass)
          Sub-classes should use this method to easily get a service instance.
 void setTransaction(org.nuiton.topia.TopiaContext transaction)
           
<E extends org.nuiton.topia.persistence.TopiaEntity>
Map<String,String>
sortAndDecorate(Collection<E> beans, String context)
           
 
Methods inherited from class org.nuiton.web.struts2.BaseAction
_
 
Methods inherited from class com.opensymphony.xwork2.ActionSupport
addActionError, addActionMessage, addFieldError, clearActionErrors, clearErrors, clearErrorsAndMessages, clearFieldErrors, clearMessages, clone, doDefault, execute, getActionErrors, getActionMessages, getErrorMessages, getErrors, getFieldErrors, getLocale, getText, getText, getText, getText, getText, getText, getText, getText, getText, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, hasKey, input, pause, setActionErrors, setActionMessages, setContainer, setFieldErrors, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SESSION_PARAMETER

protected static final String SESSION_PARAMETER
Key to store the EchoBaseSession instance in the session's map.

See Also:
Constant Field Values

APPLICATION_CONTEXT_PARAMETER

public static final String APPLICATION_CONTEXT_PARAMETER
Key to store the single instance of the application context

See Also:
Constant Field Values

serviceFactory

protected transient EchoBaseServiceFactory serviceFactory
Provides a way to get a service.

Actions may not call it directly by use newService(Class) instead.


serviceContext

protected transient EchoBaseServiceContext serviceContext

transaction

protected transient org.nuiton.topia.TopiaContext transaction
Constructor Detail

EchoBaseActionSupport

public EchoBaseActionSupport()
Method Detail

getEchoBaseApplicationContext

public static EchoBaseApplicationContext getEchoBaseApplicationContext()

getConfiguration

protected EchoBaseConfiguration getConfiguration()

getEchoBaseSession

public EchoBaseSession getEchoBaseSession()

getApplicationVersion

public static String getApplicationVersion()

getServiceContext

protected EchoBaseServiceContext getServiceContext()
Fabrique pour récupérer le ServiceContext tel qu'il devrait être fourni à la fabrication d'un service.

Returns:
service context

getServiceFactory

public EchoBaseServiceFactory getServiceFactory()

newService

public <E extends EchoBaseService> E newService(Class<E> serviceClass)
Sub-classes should use this method to easily get a service instance.

Parameters:
serviceClass - The type of service to instantiate
Returns:
A newly created service of the expected type with necessary data set

getTransaction

public org.nuiton.topia.TopiaContext getTransaction()
Specified by:
getTransaction in interface org.nuiton.topia.framework.TopiaTransactionAware

setTransaction

public void setTransaction(org.nuiton.topia.TopiaContext transaction)
Specified by:
setTransaction in interface org.nuiton.topia.framework.TopiaTransactionAware

formatDate

public String formatDate(Date date)

formatMonth

public String formatMonth(Date date)

sortAndDecorate

public <E extends org.nuiton.topia.persistence.TopiaEntity> Map<String,String> sortAndDecorate(Collection<E> beans,
                                                                                               String context)

decorate

public String decorate(Object o,
                       String context)

getDateFormat

protected SimpleDateFormat getDateFormat()

getMonthFormat

protected SimpleDateFormat getMonthFormat()

getDecoratorService

protected DecoratorService getDecoratorService()

getActionContext

protected static com.opensymphony.xwork2.ActionContext getActionContext()


Copyright © 2011 Ifremer. All Rights Reserved.