← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20760: minor fixes, adds jackson xml root element to enums

 

------------------------------------------------------------
revno: 20760
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-10-19 17:28:05 +0700
message:
  minor fixes, adds jackson xml root element to enums
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/analytics/AnalyticsFavoriteType.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/analytics/EventDataType.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/analytics/EventOutputType.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/ValueType.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementDomain.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/event/EventStatus.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/legend/LegendSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/FeatureType.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/MathUtils.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/analytics/AnalyticsFavoriteType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/analytics/AnalyticsFavoriteType.java	2015-10-13 10:18:02 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/analytics/AnalyticsFavoriteType.java	2015-10-19 10:28:05 +0000
@@ -28,10 +28,14 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import org.hisp.dhis.common.DxfNamespaces;
+
 /**
  * @author Lars Helge Overland
  */
+@JacksonXmlRootElement( localName = "analyticsFavoriteType", namespace = DxfNamespaces.DXF_2_0 )
 public enum AnalyticsFavoriteType
 {
-    CHART, EVENT_CHART, REPORT_TABLE, EVENT_REPORT, MAP, DATASET_REPORT;
+    CHART, EVENT_CHART, REPORT_TABLE, EVENT_REPORT, MAP, DATASET_REPORT
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/analytics/EventDataType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/analytics/EventDataType.java	2015-09-15 11:21:39 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/analytics/EventDataType.java	2015-10-19 10:28:05 +0000
@@ -28,9 +28,13 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import org.hisp.dhis.common.DxfNamespaces;
+
 /**
  * @author Lars Helge Overland
  */
+@JacksonXmlRootElement( localName = "eventDataType", namespace = DxfNamespaces.DXF_2_0 )
 public enum EventDataType
 {
     AGGREGATED_VALUES, EVENTS

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/analytics/EventOutputType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/analytics/EventOutputType.java	2015-08-28 10:23:48 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/analytics/EventOutputType.java	2015-10-19 10:28:05 +0000
@@ -28,10 +28,14 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import org.hisp.dhis.common.DxfNamespaces;
+
 /**
  * @author Lars Helge Overland
  */
+@JacksonXmlRootElement( localName = "eventOutputType", namespace = DxfNamespaces.DXF_2_0 )
 public enum EventOutputType
 {
-    EVENT, ENROLLMENT, TRACKED_ENTITY_INSTANCE;
+    EVENT, ENROLLMENT, TRACKED_ENTITY_INSTANCE
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/ValueType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/ValueType.java	2015-09-24 14:35:08 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/ValueType.java	2015-10-19 10:28:05 +0000
@@ -31,6 +31,7 @@
 import java.util.Date;
 import java.util.List;
 
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
 import org.hisp.dhis.trackedentity.TrackedEntityInstance;
 
 import com.google.common.collect.Lists;
@@ -38,6 +39,7 @@
 /**
  * @author Lars Helge Overland
  */
+@JacksonXmlRootElement( localName = "valueType", namespace = DxfNamespaces.DXF_2_0 )
 public enum ValueType
 {
     TEXT( String.class ),

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementDomain.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementDomain.java	2015-08-18 22:46:02 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementDomain.java	2015-10-19 10:28:05 +0000
@@ -28,11 +28,13 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import org.hisp.dhis.common.DxfNamespaces;
+
 /**
  * @author Chau Thu Tran
- * 
- * @version $ DataElementDomain.java Jun 14, 2014 12:12:23 PM $
  */
+@JacksonXmlRootElement( localName = "dataElementDomain", namespace = DxfNamespaces.DXF_2_0 )
 public enum DataElementDomain
 {
     AGGREGATE( "aggregate" ), TRACKER( "tracker" );

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/event/EventStatus.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/event/EventStatus.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/event/EventStatus.java	2015-10-19 10:28:05 +0000
@@ -41,7 +41,7 @@
 
     private final int value;
 
-    private EventStatus( int value )
+    EventStatus( int value )
     {
         this.value = value;
     }
@@ -63,15 +63,10 @@
 
         throw new IllegalArgumentException();
     }
-    
+
     public static boolean isExistingEvent( EventStatus status )
     {
-        if ( status == null )
-        {
-            return false;
-        }
-        
-        return COMPLETED.equals( status ) || VISITED.equals( status );
+        return status != null && (COMPLETED.equals( status ) || VISITED.equals( status ));
     }
 }
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/legend/LegendSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/legend/LegendSet.java	2015-08-31 14:41:00 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/legend/LegendSet.java	2015-10-19 10:28:05 +0000
@@ -40,8 +40,6 @@
 import org.hisp.dhis.common.annotation.Scanned;
 import org.hisp.dhis.common.view.DetailedView;
 import org.hisp.dhis.common.view.ExportView;
-import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.indicator.Indicator;
 
 import java.util.HashSet;
 import java.util.Set;
@@ -62,8 +60,7 @@
     {
     }
 
-    public LegendSet( String name, String type, String symbolizer, Set<Legend> legends,
-        Set<Indicator> indicators, Set<DataElement> dataElements )
+    public LegendSet( String name, String symbolizer, Set<Legend> legends )
     {
         this.name = name;
         this.symbolizer = symbolizer;
@@ -78,7 +75,7 @@
     {
         legends.clear();
     }
-    
+
     public Legend getLegendByUid( String uid )
     {
         for ( Legend legend : legends )
@@ -88,7 +85,7 @@
                 return legend;
             }
         }
-        
+
         return null;
     }
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/FeatureType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/FeatureType.java	2015-09-17 04:29:29 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/FeatureType.java	2015-10-19 10:28:05 +0000
@@ -28,9 +28,13 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import org.hisp.dhis.common.DxfNamespaces;
+
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
+@JacksonXmlRootElement( localName = "featureType", namespace = DxfNamespaces.DXF_2_0 )
 public enum FeatureType
 {
     NONE,

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/MathUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/MathUtils.java	2015-10-15 08:57:07 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/MathUtils.java	2015-10-19 10:28:05 +0000
@@ -564,7 +564,7 @@
     {
         return new Random().nextInt( 999 );
     }
-    
+
     /**
      * Returns the minimum value from the given array.
      *