Interface DataSourceService
- All Superinterfaces:
Service
public interface DataSourceService extends Service
Used to generate bindings for a tree of
DataSource
s.-
Method Summary
Modifier and Type Method Description void
addFieldsFromModelToDSD(Model model, DataSourceDef node)
Convenience method for adding fields from a model to aDataSourceDef
node.void
generateValidationContext(DataSourceDef rootDSD)
Traverse theDataSourceDef
tree, and generateValidationContexts
such that each node has: A) One primaryValidationSubContext
(named after the current node) which contains all fields of the current node and all fields of the current node's ancestors (qualified by the ancestor's name).void
generateValidationRuleBindings(DataSource rootDS)
Traverse theDataSource
tree, and generate bindings such that each node has one primary binding (which exposes field from the current node as well as the fields of parent nodes qualified with the parents name), and a binding for each descendant.java.util.List<DataSourceDef>
getAllRegisteredDSDs()
Return a list of all registeredDataSourceDef
s ordered by ascending name.DataSourceDef
getDSD(java.lang.String dataSourceDefName)
Returns theDataSourceDef
instance registered under the provided name.java.util.List<DataSourceDef>
getExposedDSDs()
Return a list of registeredDataSourceDef
s that should be exposed in the UI.void
registerDSD(DataSourceDef dataSourceDef)
RegisterDataSourceDef
instance.void
registerDSD(DataSourceDef dataSourceDef, java.lang.Boolean expose)
RegisterDataSourceDef
instance.
-
Method Details
-
generateValidationRuleBindings
Traverse theDataSource
tree, and generate bindings such that each node has one primary binding (which exposes field from the current node as well as the fields of parent nodes qualified with the parents name), and a binding for each descendant. This method assumes that the "ownBindings" property of each node is already set with the bindings for the node's fields.- Parameters:
rootDS
- the root node of aDataSource
tree
-
generateValidationContext
Traverse theDataSourceDef
tree, and generateValidationContexts
such that each node has: A) One primaryValidationSubContext
(named after the current node) which contains all fields of the current node and all fields of the current node's ancestors (qualified by the ancestor's name). B) OneValidationSubContext
per descendant (named after the descendant itself) which contains only the descendant's fields. The generated ValidationContexts are set on their respective DataSourceDef nodes.- Parameters:
rootDSD
- the root node of aDataSourceDef
tree
-
addFieldsFromModelToDSD
Convenience method for adding fields from a model to aDataSourceDef
node.- Parameters:
model
-node
-
-
registerDSD
RegisterDataSourceDef
instance.- Parameters:
dataSourceDef
-
-
registerDSD
RegisterDataSourceDef
instance. If expose is true, thisDataSourceDef
will be exposed in the UI so that it can be consumed by outbound fixed-length interfaces.- Parameters:
dataSourceDef
-expose
-
-
getDSD
Returns theDataSourceDef
instance registered under the provided name.- Parameters:
dataSourceDefName
-
-
getAllRegisteredDSDs
java.util.List<DataSourceDef> getAllRegisteredDSDs()Return a list of all registeredDataSourceDef
s ordered by ascending name. -
getExposedDSDs
java.util.List<DataSourceDef> getExposedDSDs()Return a list of registeredDataSourceDef
s that should be exposed in the UI.
-