Package org.appng.api.support
Class CallableDataSource
- java.lang.Object
-
- org.appng.api.support.CallableDataSource
-
public class CallableDataSource extends Object
ACallableDataSource
is responsible for preparing and performing anDatasource
, based on aDatasourceRef
. ThisDatasourceRef
is provided either by aPageDefinition
'sSectionelementDef
or by anAction
.- Author:
- Matthias Müller
-
-
Constructor Summary
Constructors Constructor Description CallableDataSource(Site site, Application application, ApplicationRequest applicationRequest, ParameterSupport parameterSupport, DatasourceRef datasourceRef)
Creates a newCallableDataSource
and also determines the return value fordoInclude()
, based onPermissions
andCondition
s.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
doInclude()
Checks whether or not to include thisCallableDataSource
on the referencingPageReference
orAction
.Datasource
getDatasource()
Data
perform(String pageId)
Data
perform(String pageId, boolean setBeanNull, boolean addValidation)
Performs theCallableDataSource
.
Note that the caller needs to check if theDatasource
should be included by itself (by callingdoInclude()
), as this method doesn't check that condition.String
toString()
-
-
-
Constructor Detail
-
CallableDataSource
public CallableDataSource(Site site, Application application, ApplicationRequest applicationRequest, ParameterSupport parameterSupport, DatasourceRef datasourceRef) throws ProcessingException
Creates a newCallableDataSource
and also determines the return value fordoInclude()
, based onPermissions
andCondition
s.- Parameters:
site
- the currentSite
application
- the currentApplication
applicationRequest
- the currentApplicationRequest
parameterSupport
- theParameterSupport
holding the parameters for theDatasource
datasourceRef
- theDatasourceRef
as given in theSectionelementDef
of aPageDefinition
or by anAction
.- Throws:
ProcessingException
- if an error occurs while assembling theCallableDataSource
-
-
Method Detail
-
getDatasource
public Datasource getDatasource()
-
perform
public Data perform(String pageId) throws ProcessingException
- Throws:
ProcessingException
- See Also:
perform(String, boolean, boolean)
-
perform
public Data perform(String pageId, boolean setBeanNull, boolean addValidation) throws ProcessingException
Performs theCallableDataSource
.
Note that the caller needs to check if theDatasource
should be included by itself (by callingdoInclude()
), as this method doesn't check that condition.- Parameters:
pageId
- the ID of the current pagesetBeanNull
- whether or not to set theBean
of theDatasource
tonull
after performingaddValidation
- whether or not to add validation metadata- Returns:
- the
Data
retrieved from theDatasource
by callingDataProvider.getData(Site, Application, org.appng.api.Environment, Options, org.appng.api.Request, org.appng.api.FieldProcessor)
- Throws:
ProcessingException
- if an error occurs while retrieving theData
-
doInclude
public boolean doInclude()
Checks whether or not to include thisCallableDataSource
on the referencingPageReference
orAction
.- Returns:
true
if thisCallableDataSource
should be included,false
otherwise
-
-