public abstract class AbstractSispeaAction
extends com.opensymphony.xwork2.ActionSupport
implements org.apache.struts2.interceptor.ParameterAware, org.apache.struts2.interceptor.SessionAware, org.apache.struts2.interceptor.ApplicationAware
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Object> |
application
The application context.
|
protected SispeaConfiguration |
configuration |
protected String |
formatDate |
protected String |
formatDateOnly |
protected MenuBean |
menu
Menu container
|
protected String |
nextPage
The next page.
|
protected Map<String,String[]> |
parameters
The request parameters.
|
protected ServiceMessages |
serviceMessages |
protected Map<String,Object> |
session
The session context.
|
protected SispeaSession |
sispeaSession
The business Sispea session object (contains anything in user's session)
|
protected StrutsMessages |
strutsMessages |
protected String |
submitValue
The submit button activated.
|
protected TerritoryService |
territoryService |
protected IUserService |
userService |
| Constructor and Description |
|---|
AbstractSispeaAction() |
| Modifier and Type | Method and Description |
|---|---|
void |
buildMenu()
Initializes the menu
|
Boolean |
checkIfUserCanViewDashBoard() |
protected void |
checkRight()
This method should throw an exception if the user has not got the right to access the function.
|
Boolean |
checkUserRight(Right pRight) |
boolean |
checkUserRight(Right pRight,
OrganismDto pOrganism,
ExerciseDto pExercise) |
Boolean |
checkUserRight(Right pRight,
TerritoryDto pTerritoryTest,
ExerciseDto pExercise) |
void |
createMenu(boolean pForce)
Initializes the menu if not already done.
|
protected abstract String |
doExecute()
This method is called by the execute method.
|
protected String |
doHandleException(Exception pException)
Handles all exceptions.
|
protected String |
doHandleSispeaException(SispeaException pException)
Handles exceptions of the type
SispeaException. |
String |
execute()
This method is called by the web app controller.
|
Map<String,Object> |
getApplication()
Returns the application context.
|
UserDto |
getCurrentUser() |
TerritoryDto |
getCurrentUserTerritory() |
String |
getFormatDate() |
String |
getFormatDateOnly() |
MenuBean |
getMenu() |
String |
getNextPage() |
String |
getOption(String optionKey) |
Map<String,String[]> |
getParameters()
Returns the request parameters.
|
Map<String,Object> |
getSession()
Returns the session context.
|
SispeaSession |
getSispeaSession()
Returns the SISPEA session.
|
String |
getSubmitValue() |
protected void |
initSession()
Initializes the session.
|
boolean |
isEnglish()
This method returns true if the language is english, false otherwise.
|
boolean |
isFrench()
This method returns true if the language is french, false otherwise.
|
boolean |
isSpanish()
This method returns true if the language is spanish, false otherwise.
|
protected void |
logException(Exception pException)
Logs the exception.
|
void |
openMenu(String pKey)
Open the menu corresponding to the key.
|
protected void |
removeSession()
Removes the session.
|
void |
setApplication(Map<String,Object> pMap) |
void |
setMenu(MenuBean pMenu) |
void |
setNextPage(String pNextPage) |
void |
setParameters(Map<String,String[]> pMap) |
void |
setSession(Map<String,Object> pMap) |
void |
setSubmitValue(String pSubmitValue) |
addActionError, addActionMessage, addFieldError, clearActionErrors, clearErrors, clearErrorsAndMessages, clearFieldErrors, clearMessages, clone, doDefault, getActionErrors, getActionMessages, getErrorMessages, getErrors, getFieldErrors, getFormatted, getLocale, getText, getText, getText, getText, getText, getText, getText, getText, getText, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, hasKey, input, pause, setActionErrors, setActionMessages, setContainer, setFieldErrors, validate@Autowired protected transient TerritoryService territoryService
@Autowired protected transient IUserService userService
@Autowired protected transient ServiceMessages serviceMessages
@Autowired protected transient StrutsMessages strutsMessages
@Autowired protected transient SispeaConfiguration configuration
@Value(value="${sispea.format.date}")
protected String formatDate
@Value(value="${sispea.format.date.only}")
protected String formatDateOnly
protected String submitValue
protected String nextPage
protected MenuBean menu
protected transient SispeaSession sispeaSession
protected abstract String doExecute() throws Exception
Exceptionpublic void setApplication(Map<String,Object> pMap)
setApplication in interface org.apache.struts2.interceptor.ApplicationAwarepublic void setSession(Map<String,Object> pMap)
setSession in interface org.apache.struts2.interceptor.SessionAwarepublic void setParameters(Map<String,String[]> pMap)
setParameters in interface org.apache.struts2.interceptor.ParameterAwarepublic final String execute() throws Exception
doExceute method.execute in interface com.opensymphony.xwork2.Actionexecute in class com.opensymphony.xwork2.ActionSupportExceptionprotected void checkRight()
throws SispeaException
SispeaExceptionprotected String doHandleSispeaException(SispeaException pException)
SispeaException.protected String doHandleException(Exception pException)
protected void removeSession()
protected void initSession()
protected void logException(Exception pException)
public SispeaSession getSispeaSession()
public UserDto getCurrentUser()
public TerritoryDto getCurrentUserTerritory()
public String getNextPage()
public void setNextPage(String pNextPage)
public boolean isEnglish()
public boolean isFrench()
public boolean isSpanish()
public void createMenu(boolean pForce)
throws Exception
pForce - if true, menu is rebuildExceptionpublic void buildMenu()
throws SispeaException
SispeaExceptionpublic void openMenu(String pKey)
public Boolean checkIfUserCanViewDashBoard() throws SispeaException
SispeaExceptionpublic Boolean checkUserRight(Right pRight) throws SispeaException
pRight - SispeaExceptionpublic Boolean checkUserRight(Right pRight, TerritoryDto pTerritoryTest, ExerciseDto pExercise) throws SispeaException
pRight - SispeaExceptionpublic boolean checkUserRight(Right pRight, OrganismDto pOrganism, ExerciseDto pExercise) throws SispeaException
pRight - The right to check forpOrganism - Has the user the right pRightName for the organism pOrganismpExercise - The exercise to check for.SispeaExceptionpublic MenuBean getMenu()
public void setMenu(MenuBean pMenu)
public String getSubmitValue()
public void setSubmitValue(String pSubmitValue)
public String getFormatDate()
public String getFormatDateOnly()
Copyright © 2014–2015 eaudefrance. All rights reserved.