org.chorem.pollen.ui.actions
Class PollenActionSupport

java.lang.Object
  extended by com.opensymphony.xwork2.ActionSupport
      extended by org.nuiton.web.struts2.BaseAction
          extended by org.chorem.pollen.ui.actions.PollenActionSupport
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:
AbstractDisplayChoice, AbstractJSONPaginedAction, AbstractPollForm, AbstractPollUriIdAction, Confirm, Confirm, CreatedList, DeleteFavoriteList, DeletePollAccount, DeleteUser, DisplayPersonToList, DisplayVotingList, Edit, GenerateChart, GetFavoriteList, GetFavoriteListPollAccount, GetPollFeed, GetPollImageChoice, GetUser, ImportPersonListToVotingList, InvitedList, Login, Logout, LostPassword, ManageFavoriteList, ManageFavoriteLists, ManagePolls, ManageUsers, ParticipatedList, Register, SelectPersonListToVotingList, Show

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

Pollen 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:
1.3
Author:
tchemit
See Also:
Serialized Form

Field Summary
static List<String> SAFE_LANGUAGES
           
protected  org.chorem.pollen.services.PollenServiceContext serviceContext
           
protected  org.chorem.pollen.services.PollenServiceFactory serviceFactory
          Provides a way to get a service.
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
PollenActionSupport()
           
 
Method Summary
 void addFlashError(String message)
           
 void addFlashMessage(String message)
           
 void clearFlashErrors()
           
 void clearFlashMessages()
           
protected static com.opensymphony.xwork2.ActionContext getActionContext()
           
 URL getApplicationUrl()
           
static String getApplicationVersion()
           
 org.chorem.pollen.PollenConfiguration getConfiguration()
           
static Date getCurrentDateTime()
           
 String getCurrentUrl()
           
 Collection<String> getFlashErrors()
           
 Collection<String> getFlashMessages()
           
 String getJqueryTheme()
           
 String getPageLogo()
           
static PollenApplicationContext getPollenApplicationContext()
           
 PollenSession getPollenSession()
           
 org.chorem.pollen.business.persistence.UserAccount getPollenUserAccount()
           
 String getSafeLanguage()
           
protected  org.chorem.pollen.services.PollenServiceContext getServiceContext()
          Fabrique pour récupérer le ServiceContext tel qu'il devrait être fourni à la fabrication d'un service.
 org.chorem.pollen.services.PollenServiceFactory getServiceFactory()
           
 PageSkin getSkin()
           
 org.nuiton.topia.TopiaContext getTransaction()
           
 String getVoteCountingTypeHelp(org.chorem.pollen.common.VoteCountingType voteCountingType)
           
 boolean hasAnyErrors()
           
 boolean hasFlashErrors()
           
 boolean hasFlashMessages()
           
 boolean isUserAdmin()
           
 boolean isUserLoggued()
           
<E extends org.chorem.pollen.services.PollenService>
E
newService(Class<E> serviceClass)
          Sub-classes should use this method to easily get a service instance.
 void setTransaction(org.nuiton.topia.TopiaContext transaction)
           
 
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

serviceFactory

protected transient org.chorem.pollen.services.PollenServiceFactory serviceFactory
Provides a way to get a service.

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


serviceContext

protected transient org.chorem.pollen.services.PollenServiceContext serviceContext

transaction

protected transient org.nuiton.topia.TopiaContext transaction

SAFE_LANGUAGES

public static final List<String> SAFE_LANGUAGES
Constructor Detail

PollenActionSupport

public PollenActionSupport()
Method Detail

getPollenApplicationContext

public static PollenApplicationContext getPollenApplicationContext()

getConfiguration

public org.chorem.pollen.PollenConfiguration getConfiguration()

getSkin

public PageSkin getSkin()

getPageLogo

public String getPageLogo()

getJqueryTheme

public String getJqueryTheme()

getPollenSession

public PollenSession getPollenSession()

getPollenUserAccount

public org.chorem.pollen.business.persistence.UserAccount getPollenUserAccount()

isUserLoggued

public boolean isUserLoggued()

isUserAdmin

public boolean isUserAdmin()

getApplicationVersion

public static String getApplicationVersion()

getApplicationUrl

public URL getApplicationUrl()

getServiceContext

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

Returns:
service context

getServiceFactory

public org.chorem.pollen.services.PollenServiceFactory getServiceFactory()

newService

public <E extends org.chorem.pollen.services.PollenService> 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

getSafeLanguage

public String getSafeLanguage()

getActionContext

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

getCurrentDateTime

public static Date getCurrentDateTime()

getVoteCountingTypeHelp

public String getVoteCountingTypeHelp(org.chorem.pollen.common.VoteCountingType voteCountingType)

getCurrentUrl

public String getCurrentUrl()

addFlashMessage

public void addFlashMessage(String message)

addFlashError

public void addFlashError(String message)

getFlashMessages

public Collection<String> getFlashMessages()

getFlashErrors

public Collection<String> getFlashErrors()

hasFlashMessages

public boolean hasFlashMessages()

hasFlashErrors

public boolean hasFlashErrors()

clearFlashMessages

public void clearFlashMessages()

clearFlashErrors

public void clearFlashErrors()

hasAnyErrors

public boolean hasAnyErrors()


Copyright © 2009-2012 CodeLutin. All Rights Reserved.