← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18523: Moved dataDimension property up to BaseDimensionalObject class

 

------------------------------------------------------------
revno: 18523
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2015-03-08 11:23:09 +0100
message:
  Moved dataDimension property up to BaseDimensionalObject class
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseDimensionalObject.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionalObject.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroupSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroupSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.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-api/src/main/java/org/hisp/dhis/common/BaseDimensionalObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseDimensionalObject.java	2015-02-26 15:21:29 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseDimensionalObject.java	2015-03-08 10:23:09 +0000
@@ -79,6 +79,15 @@
     private String filter;
 
     //--------------------------------------------------------------------------
+    // Persistent properties
+    //--------------------------------------------------------------------------
+
+    /**
+     * Indicates whether this object should be handled as a data dimension.
+     */
+    protected boolean dataDimension = true;
+
+    //--------------------------------------------------------------------------
     // Constructors
     //--------------------------------------------------------------------------
 
@@ -252,6 +261,19 @@
         this.filter = filter;
     }
 
+    @JsonProperty
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    public boolean isDataDimension()
+    {
+        return dataDimension;
+    }
+
+    public void setDataDimension( boolean dataDimension )
+    {
+        this.dataDimension = dataDimension;
+    }
+
     //--------------------------------------------------------------------------
     // Supportive methods
     //--------------------------------------------------------------------------
@@ -265,6 +287,8 @@
         {
             DimensionalObject dimensionalObject = (DimensionalObject) other;
 
+            dataDimension = dimensionalObject.isDataDimension();
+            
             if ( strategy.isReplace() )
             {
                 dimensionType = dimensionalObject.getDimensionType();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionalObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionalObject.java	2015-02-25 20:40:28 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionalObject.java	2015-03-08 10:23:09 +0000
@@ -137,4 +137,10 @@
      * Indicates the analytics type of this dimensional object.
      */
     AnalyticsType getAnalyticsType();
+    
+    /**
+     * Indicates whether this object should be handled as a data dimension. 
+     * Persistent property.
+     */
+    boolean isDataDimension();
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroupSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroupSet.java	2015-02-05 06:53:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/CategoryOptionGroupSet.java	2015-03-08 10:23:09 +0000
@@ -60,8 +60,6 @@
     @Scanned
     private List<CategoryOptionGroup> members = new ArrayList<>();
 
-    private boolean dataDimension = true;
-
     // -------------------------------------------------------------------------
     // Constructors
     // -------------------------------------------------------------------------
@@ -133,19 +131,6 @@
         this.members = members;
     }
 
-    @JsonProperty
-    @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
-    public boolean isDataDimension()
-    {
-        return dataDimension;
-    }
-
-    public void setDataDimension( boolean dataDimension )
-    {
-        this.dataDimension = dataDimension;
-    }
-
     // -------------------------------------------------------------------------
     // Logic
     // -------------------------------------------------------------------------
@@ -170,7 +155,6 @@
         if ( other.getClass().isInstance( this ) )
         {
             CategoryOptionGroupSet categoryOptionGroupSet = (CategoryOptionGroupSet) other;
-            dataDimension = categoryOptionGroupSet.isDataDimension();
 
             members.clear();
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java	2015-02-26 15:21:29 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategory.java	2015-03-08 10:23:09 +0000
@@ -72,8 +72,6 @@
     @Scanned
     private List<DataElementCategoryOption> categoryOptions = new ArrayList<>();
 
-    private boolean dataDimension;
-
     // -------------------------------------------------------------------------
     // Constructors
     // -------------------------------------------------------------------------
@@ -209,19 +207,6 @@
         this.categoryOptions = categoryOptions;
     }
 
-    @JsonProperty
-    @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
-    public boolean isDataDimension()
-    {
-        return dataDimension;
-    }
-
-    public void setDataDimension( boolean dataDimension )
-    {
-        this.dataDimension = dataDimension;
-    }
-
     @Override
     public void mergeWith( IdentifiableObject other, MergeStrategy strategy )
     {

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroupSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroupSet.java	2015-02-26 15:21:29 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementGroupSet.java	2015-03-08 10:23:09 +0000
@@ -72,8 +72,6 @@
     @Scanned
     private List<DataElementGroup> members = new ArrayList<>();
 
-    private boolean dataDimension = true;
-
     // -------------------------------------------------------------------------
     // Constructors
     // -------------------------------------------------------------------------
@@ -255,19 +253,6 @@
         this.members = members;
     }
 
-    @JsonProperty
-    @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
-    public boolean isDataDimension()
-    {
-        return dataDimension;
-    }
-
-    public void setDataDimension( boolean dataDimension )
-    {
-        this.dataDimension = dataDimension;
-    }
-
     @Override
     public void mergeWith( IdentifiableObject other, MergeStrategy strategy )
     {
@@ -277,8 +262,6 @@
         {
             DataElementGroupSet dataElementGroupSet = (DataElementGroupSet) other;
 
-            dataDimension = dataElementGroupSet.isDataDimension();
-
             if ( strategy.isReplace() )
             {
                 description = dataElementGroupSet.getDescription();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java	2015-02-26 15:21:29 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java	2015-03-08 10:23:09 +0000
@@ -72,8 +72,6 @@
     @Scanned
     private Set<OrganisationUnitGroup> organisationUnitGroups = new HashSet<>();
 
-    private boolean dataDimension = true;
-
     /**
      * Set of the dynamic attributes values that belong to this data element.
      */
@@ -247,19 +245,6 @@
         this.organisationUnitGroups = organisationUnitGroups;
     }
 
-    @JsonProperty
-    @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
-    public boolean isDataDimension()
-    {
-        return dataDimension;
-    }
-
-    public void setDataDimension( boolean dataDimension )
-    {
-        this.dataDimension = dataDimension;
-    }
-
     @JsonProperty( "attributeValues" )
     @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
@@ -284,7 +269,6 @@
             OrganisationUnitGroupSet organisationUnitGroupSet = (OrganisationUnitGroupSet) other;
 
             compulsory = organisationUnitGroupSet.isCompulsory();
-            dataDimension = organisationUnitGroupSet.isDataDimension();
 
             if ( strategy.isReplace() )
             {