Package org.appng.api.support
Class CallableAction
- java.lang.Object
-
- org.appng.api.support.CallableAction
-
public class CallableAction extends Object
ACallableAction
is responsible for preparing and performing anAction
, based on a givenActionRef
which is part of aPageDefinition
'sSectionelementDef
.- Author:
- Matthias Müller
-
-
Constructor Summary
Constructors Modifier Constructor Description CallableAction(Site site, Application application, ApplicationRequest applicationRequest, ActionRef actionRef)
Creates a newCallableAction
and also determines the return values fordoInclude()
doExecute()
getOnSuccess()
, based onPermissions
andCondition
s.protected
CallableAction(Site site, ApplicationRequest applicationRequest, ElementHelper elementHelper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
doExecute()
Checks whether or not thisCallableAction
should execute theActionProvider
provided by the referencedAction
.boolean
doForward()
Checks whether thisCallableAction
causes a page-forward, which is the case whenhasErrors()
returnsfalse
andgetOnSuccess()
a non-null
valueboolean
doInclude()
Checks whether or not to include thisCallableAction
on thePageReference
.Action
getAction()
protected Object
getBindObject(FieldProcessor fieldProcessor)
Creates, fills and returns a new bindobject.String
getOnSuccess()
Returns the forward-path that was defined by theActionRef
thisCallableAction
was build from.boolean
hasErrors()
Checks whether some errors occurred while performing theAction
.FieldProcessor
perform()
Performs thisCallableAction
.
If theAction
is actually included and/or executed depends on the returns values ofdoInclude()
anddoExecute()
.FieldProcessor
perform(boolean isSectionHidden)
Performs thisCallableAction
.
If theAction
is actually included and/or executed depends on the returns values ofdoInclude()
anddoExecute()
.protected boolean
retrieveData(boolean setBeanNull)
String
toString()
-
-
-
Constructor Detail
-
CallableAction
public CallableAction(Site site, Application application, ApplicationRequest applicationRequest, ActionRef actionRef) throws ProcessingException
Creates a newCallableAction
and also determines the return values for , based onPermissions
andCondition
s.- Parameters:
site
- the currentSite
application
- the currentApplication
applicationRequest
- the currentApplicationRequest
actionRef
- theActionRef
as given in theSectionelementDef
of aPageDefinition
.- Throws:
ProcessingException
- if an error occurs while assembling theCallableAction
-
CallableAction
protected CallableAction(Site site, ApplicationRequest applicationRequest, ElementHelper elementHelper)
-
-
Method Detail
-
getAction
public Action getAction()
-
retrieveData
protected boolean retrieveData(boolean setBeanNull) throws ProcessingException
- Throws:
ProcessingException
-
perform
public FieldProcessor perform() throws ProcessingException
Performs thisCallableAction
.
If theAction
is actually included and/or executed depends on the returns values ofdoInclude()
anddoExecute()
. If theAction
is executed and a forward-path exists, a redirect is send viaSite.sendRedirect(Environment, String)
.- Returns:
- a
FieldProcessor
, only non-null
if theAction
has been executed successfully - Throws:
ProcessingException
- if an error occurred while performing- See Also:
doInclude()
,doExecute()
,doForward()
,getOnSuccess()
-
perform
public FieldProcessor perform(boolean isSectionHidden) throws ProcessingException
Performs thisCallableAction
.
If theAction
is actually included and/or executed depends on the returns values ofdoInclude()
anddoExecute()
. If theAction
is executed and a forward-path exists, a redirect is send viaSite.sendRedirect(Environment, String)
.- Parameters:
isSectionHidden
- whether this action is part of a hiddenSection
, meaning noMessages
should be set for the action.- Returns:
- a
FieldProcessor
, only non-null
if theAction
has been executed successfully - Throws:
ProcessingException
- if an error occurred while performing- See Also:
doInclude()
,doExecute()
,doForward()
,getOnSuccess()
-
getBindObject
protected Object getBindObject(FieldProcessor fieldProcessor) throws BusinessException
Creates, fills and returns a new bindobject.- Parameters:
fieldProcessor
- theFieldProcessor
to use- Returns:
- a new bindobject
- Throws:
BusinessException
- ifApplicationRequest.getBindObject(FieldProcessor, org.appng.forms.RequestContainer, ClassLoader)
throws such an exception- See Also:
ApplicationRequest.getBindObject(FieldProcessor, org.appng.forms.RequestContainer, ClassLoader)
-
doInclude
public boolean doInclude()
Checks whether or not to include thisCallableAction
on thePageReference
.- Returns:
true
if thisCallableAction
should be included,false
otherwise
-
doExecute
public boolean doExecute()
Checks whether or not thisCallableAction
should execute theActionProvider
provided by the referencedAction
.- Returns:
true
if thisCallableAction
should be executed,false
otherwise
-
hasErrors
public boolean hasErrors()
Checks whether some errors occurred while performing theAction
.- Returns:
true
if some errors occurred,false
otherwise
-
getOnSuccess
public String getOnSuccess()
Returns the forward-path that was defined by theActionRef
thisCallableAction
was build from.- Returns:
- the forward-path, may be
null
-
doForward
public boolean doForward()
Checks whether thisCallableAction
causes a page-forward, which is the case whenhasErrors()
returnsfalse
andgetOnSuccess()
a non-null
value- Returns:
true
if a page-forward is caused,false
otherwise
-
-