PL-8764 Create CustomValueCollectionDatasource, CustomValueGroupDatasource, CustomValueHierarchicalDatasource (datasourceClass XML attribute)

This commit is contained in:
Konstantin Krivopustov 2017-03-31 18:34:29 +04:00
parent 608f29f5e1
commit 6ed7ee38a4
2 changed files with 12 additions and 3 deletions

View File

@ -2324,6 +2324,7 @@
<xs:attribute name="id" type="xs:string" use="required"/>
<xs:attribute name="maxResults" type="xs:int"/>
<xs:attribute name="store" type="xs:string"/>
<xs:attribute name="datasourceClass" type="xs:string"/>
</xs:complexType>
<!-- ValueGroupDatasource -->
@ -2342,6 +2343,7 @@
<xs:attribute name="id" type="xs:string" use="required"/>
<xs:attribute name="maxResults" type="xs:int"/>
<xs:attribute name="store" type="xs:string"/>
<xs:attribute name="datasourceClass" type="xs:string"/>
</xs:complexType>
<!-- ValueHierarchicalDatasource -->
@ -2361,6 +2363,7 @@
<xs:attribute name="maxResults" type="xs:int"/>
<xs:attribute name="store" type="xs:string"/>
<xs:attribute name="hierarchyProperty" type="xs:string"/>
<xs:attribute name="datasourceClass" type="xs:string"/>
</xs:complexType>
<xs:complexType name="valueDatasourcePropertiesType">

View File

@ -464,7 +464,9 @@ public class DsContextLoader {
String id = getDatasourceId(element);
builder.reset().setMetaClass(metadata.getClassNN(KeyValueEntity.class)).setId(id);
ValueCollectionDatasourceImpl datasource = builder.buildValuesCollectionDatasource();
ValueCollectionDatasourceImpl datasource = builder
.setDsClass(getDatasourceClass(element))
.buildValuesCollectionDatasource();
String maxResults = element.attributeValue("maxResults");
if (!StringUtils.isEmpty(maxResults))
@ -485,7 +487,9 @@ public class DsContextLoader {
String id = getDatasourceId(element);
builder.reset().setMetaClass(metadata.getClassNN(KeyValueEntity.class)).setId(id);
ValueGroupDatasourceImpl datasource = builder.buildValuesGroupDatasource();
ValueGroupDatasourceImpl datasource = builder
.setDsClass(getDatasourceClass(element))
.buildValuesGroupDatasource();
String maxResults = element.attributeValue("maxResults");
if (!StringUtils.isEmpty(maxResults))
@ -506,7 +510,9 @@ public class DsContextLoader {
String id = getDatasourceId(element);
builder.reset().setMetaClass(metadata.getClassNN(KeyValueEntity.class)).setId(id);
ValueHierarchicalDatasourceImpl datasource = builder.buildValuesHierarchicalDatasource();
ValueHierarchicalDatasourceImpl datasource = builder
.setDsClass(getDatasourceClass(element))
.buildValuesHierarchicalDatasource();
String maxResults = element.attributeValue("maxResults");
if (!StringUtils.isEmpty(maxResults))