dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #34110
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17517: bugfix for :persisted filter, also adds :owner filter which will only give the properties that th...
------------------------------------------------------------
revno: 17517
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-11-18 12:20:53 +0700
message:
bugfix for :persisted filter, also adds :owner filter which will only give the properties that the instance owns (i.e. that can be changed through web-api crud)
modified:
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/fieldfilter/DefaultFieldFilterService.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/fieldfilter/DefaultFieldFilterService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/fieldfilter/DefaultFieldFilterService.java 2014-10-01 11:50:02 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/fieldfilter/DefaultFieldFilterService.java 2014-11-18 05:20:53 +0000
@@ -67,13 +67,13 @@
@Autowired
private SchemaService schemaService;
- @Autowired(required = false)
+ @Autowired( required = false )
private Set<PresetProvider> presetProviders = Sets.newHashSet();
- @Autowired(required = false)
+ @Autowired( required = false )
private Set<NodePropertyConverter> nodePropertyConverters = Sets.newHashSet();
- @Autowired(required = false)
+ @Autowired( required = false )
private Set<NodeTransformer> nodeTransformers = Sets.newHashSet();
private ImmutableMap<String, PresetProvider> presets = ImmutableMap.of();
@@ -333,7 +333,21 @@
for ( Property property : properties )
{
- if ( property.isPersisted() )
+ if ( !fieldMap.containsKey( property.key() ) && property.isPersisted() )
+ {
+ fieldMap.put( property.key(), new FieldMap() );
+ }
+ }
+
+ cleanupFields.add( fieldKey );
+ }
+ else if ( ":owner".equals( fieldKey ) )
+ {
+ List<Property> properties = schema.getProperties();
+
+ for ( Property property : properties )
+ {
+ if ( !fieldMap.containsKey( property.key() ) && property.isPersisted() && property.isOwner() )
{
fieldMap.put( property.key(), new FieldMap() );
}