← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17751: Minor fixes

 

------------------------------------------------------------
revno: 17751
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-12-19 17:13:54 +0100
message:
  Minor fixes
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroup.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroupSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/interpretation/Interpretation.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/interpretation/InterpretationComment.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/Map.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapLayer.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/message/MessageConversation.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/option/OptionSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroup.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/Report.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlView.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstance.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserAuthorityGroup.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserGroup.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRule.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRuleGroup.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/indicator/Indicator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java	2014-12-19 15:36:44 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java	2014-12-19 16:13:54 +0000
@@ -307,7 +307,7 @@
         this.url = url;
     }
 
-    @JsonProperty( value = "indicatorGroups" )
+    @JsonProperty( "indicatorGroups" )
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
     @JsonView( { DetailedView.class } )
     @JacksonXmlElementWrapper( localName = "indicatorGroups", namespace = DxfNamespaces.DXF_2_0 )
@@ -337,7 +337,7 @@
         this.dataSets = dataSets;
     }
 
-    @JsonProperty( value = "attributeValues" )
+    @JsonProperty( "attributeValues" )
     @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
     @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroup.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroup.java	2014-12-19 16:13:54 +0000
@@ -48,7 +48,7 @@
 /**
  * @author Lars Helge Overland
  */
-@JacksonXmlRootElement( localName = "indicatorGroup", namespace = DxfNamespaces.DXF_2_0)
+@JacksonXmlRootElement( localName = "indicatorGroup", namespace = DxfNamespaces.DXF_2_0 )
 public class IndicatorGroup
     extends BaseIdentifiableObject
 {
@@ -134,11 +134,11 @@
         return false;
     }
 
-    @JsonProperty( value = "indicators" )
+    @JsonProperty( "indicators" )
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlElementWrapper( localName = "indicators", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "indicator", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlElementWrapper( localName = "indicators", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "indicator", namespace = DxfNamespaces.DXF_2_0 )
     public Set<Indicator> getMembers()
     {
         return members;
@@ -149,10 +149,10 @@
         this.members = members;
     }
 
-    @JsonProperty( value = "indicatorGroupSet" )
+    @JsonProperty( "indicatorGroupSet" )
     @JsonSerialize( as = BaseIdentifiableObject.class )
     @JsonView( { DetailedView.class } )
-    @JacksonXmlProperty( localName = "indicatorGroupSet", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( localName = "indicatorGroupSet", namespace = DxfNamespaces.DXF_2_0 )
     public IndicatorGroupSet getGroupSet()
     {
         return groupSet;
@@ -163,10 +163,10 @@
         this.groupSet = groupSet;
     }
 
-    @JsonProperty( value = "attributeValues" )
+    @JsonProperty( "attributeValues" )
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
     public Set<AttributeValue> getAttributeValues()
     {
         return attributeValues;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroupSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroupSet.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/IndicatorGroupSet.java	2014-12-19 16:13:54 +0000
@@ -41,6 +41,7 @@
 import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.common.view.DetailedView;
 import org.hisp.dhis.common.view.ExportView;
+import org.hisp.dhis.schema.annotation.PropertyRange;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -54,7 +55,7 @@
  *
  * @author Lars Helge Overland
  */
-@JacksonXmlRootElement(localName = "indicatorGroupSet", namespace = DxfNamespaces.DXF_2_0)
+@JacksonXmlRootElement( localName = "indicatorGroupSet", namespace = DxfNamespaces.DXF_2_0 )
 public class IndicatorGroupSet
     extends BaseIdentifiableObject
 {
@@ -186,8 +187,9 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class })
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    @PropertyRange( min = 2 )
     public String getDescription()
     {
         return description;
@@ -199,8 +201,8 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class })
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Boolean isCompulsory()
     {
         if ( compulsory == null )
@@ -216,11 +218,11 @@
         this.compulsory = compulsory;
     }
 
-    @JsonProperty(value = "indicatorGroups")
-    @JsonSerialize(contentAs = BaseIdentifiableObject.class)
-    @JsonView({ DetailedView.class, ExportView.class })
-    @JacksonXmlElementWrapper(localName = "indicatorGroups", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty(localName = "indicatorGroup", namespace = DxfNamespaces.DXF_2_0)
+    @JsonProperty( "indicatorGroups" )
+    @JsonSerialize( contentAs = BaseIdentifiableObject.class )
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlElementWrapper( localName = "indicatorGroups", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "indicatorGroup", namespace = DxfNamespaces.DXF_2_0 )
     public List<IndicatorGroup> getMembers()
     {
         return members;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/interpretation/Interpretation.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/interpretation/Interpretation.java	2014-08-12 05:22:04 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/interpretation/Interpretation.java	2014-12-19 16:13:54 +0000
@@ -34,8 +34,8 @@
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import org.hisp.dhis.acl.AccessStringHelper;
 import org.hisp.dhis.chart.Chart;
-import org.hisp.dhis.acl.AccessStringHelper;
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.DxfNamespaces;
 import org.hisp.dhis.common.IdentifiableObject;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/interpretation/InterpretationComment.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/interpretation/InterpretationComment.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/interpretation/InterpretationComment.java	2014-12-19 16:13:54 +0000
@@ -43,7 +43,7 @@
 /**
  * @author Lars Helge Overland
  */
-@JacksonXmlRootElement(localName = "interpretationComment", namespace = DxfNamespaces.DXF_2_0 )
+@JacksonXmlRootElement( localName = "interpretationComment", namespace = DxfNamespaces.DXF_2_0 )
 public class InterpretationComment
     extends BaseIdentifiableObject
 {
@@ -68,8 +68,8 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class })
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0 )
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getText()
     {
         return text;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/Map.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/Map.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/Map.java	2014-12-19 16:13:54 +0000
@@ -28,9 +28,11 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
-import java.util.List;
-
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonView;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.DxfNamespaces;
 import org.hisp.dhis.common.IdentifiableObject;
@@ -38,13 +40,11 @@
 import org.hisp.dhis.common.view.DetailedView;
 import org.hisp.dhis.common.view.DimensionalView;
 import org.hisp.dhis.common.view.ExportView;
+import org.hisp.dhis.schema.annotation.PropertyRange;
 import org.hisp.dhis.user.User;
 
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonView;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @author Lars Helge Overland
@@ -69,7 +69,7 @@
     public Map()
     {
     }
-    
+
     public Map( String name, User user, Double longitude, Double latitude, Integer zoom )
     {
         this.name = name;
@@ -84,8 +84,9 @@
     // -------------------------------------------------------------------------
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    @PropertyRange( min = -180, max = 180 )
     public Double getLongitude()
     {
         return longitude;
@@ -97,8 +98,9 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    @PropertyRange( min = -90, max = 90 )
     public Double getLatitude()
     {
         return latitude;
@@ -110,7 +112,7 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Integer getZoom()
     {
@@ -123,7 +125,7 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
     @JacksonXmlElementWrapper( localName = "mapViews", namespace = DxfNamespaces.DXF_2_0 )
     @JacksonXmlProperty( localName = "mapView", namespace = DxfNamespaces.DXF_2_0 )
     public List<MapView> getMapViews()
@@ -140,18 +142,18 @@
     public void mergeWith( IdentifiableObject other )
     {
         super.mergeWith( other );
-        
+
         if ( other.getClass().isInstance( this ) )
         {
             Map map = (Map) other;
-            
+
             user = map.getUser();
             longitude = map.getLongitude();
             latitude = map.getLatitude();
             zoom = map.getZoom();
-            
+
             mapViews.clear();
             mapViews.addAll( map.getMapViews() );
-        }            
+        }
     }
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapLayer.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapLayer.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapLayer.java	2014-12-19 16:13:54 +0000
@@ -37,6 +37,8 @@
 import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.common.view.DetailedView;
 import org.hisp.dhis.common.view.ExportView;
+import org.hisp.dhis.schema.PropertyType;
+import org.hisp.dhis.schema.annotation.Property;
 
 /**
  * @author Jan Henrik Overland
@@ -66,7 +68,7 @@
     }
 
     public MapLayer( String name, String type, String url, String layers, String time, String fillColor,
-                     double fillOpacity, String strokeColor, int strokeWidth )
+        double fillOpacity, String strokeColor, int strokeWidth )
     {
         this.name = name;
         this.type = type;
@@ -84,7 +86,7 @@
     // -------------------------------------------------------------------------
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
+    @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getType()
     {
@@ -97,8 +99,9 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
+    @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    @Property( PropertyType.URL )
     public String getUrl()
     {
         return url;
@@ -110,7 +113,7 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
+    @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getLayers()
     {
@@ -123,7 +126,7 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
+    @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getTime()
     {
@@ -136,8 +139,9 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
+    @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    @Property( PropertyType.COLOR )
     public String getFillColor()
     {
         return fillColor;
@@ -149,7 +153,7 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
+    @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public double getFillOpacity()
     {
@@ -162,8 +166,9 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
+    @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    @Property( PropertyType.COLOR )
     public String getStrokeColor()
     {
         return strokeColor;
@@ -175,7 +180,7 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
+    @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public int getStrokeWidth()
     {

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.java	2014-12-19 16:13:54 +0000
@@ -47,6 +47,8 @@
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
+import org.hisp.dhis.schema.PropertyType;
+import org.hisp.dhis.schema.annotation.Property;
 import org.hisp.dhis.user.User;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
@@ -251,6 +253,7 @@
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @Property( PropertyType.COLOR )
     public String getColorLow()
     {
         return colorLow;
@@ -264,6 +267,7 @@
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @Property( PropertyType.COLOR )
     public String getColorHigh()
     {
         return colorHigh;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/message/MessageConversation.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/message/MessageConversation.java	2014-11-25 20:22:50 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/message/MessageConversation.java	2014-12-19 16:13:54 +0000
@@ -40,19 +40,27 @@
 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.schema.PropertyType;
+import org.hisp.dhis.schema.annotation.Property;
+import org.hisp.dhis.schema.annotation.PropertyRange;
 import org.hisp.dhis.user.User;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
 
 /**
  * @author Lars Helge Overland
  */
-@JacksonXmlRootElement( localName = "messageConversation", namespace = DxfNamespaces.DXF_2_0)
+@JacksonXmlRootElement( localName = "messageConversation", namespace = DxfNamespaces.DXF_2_0 )
 public class MessageConversation
     extends BaseIdentifiableObject
 {
     private static final int RECIPIENTS_MAX_DISPLAY = 25;
-    
+
     // --------------------------------------------------------------------------
     // Persistent fields
     // --------------------------------------------------------------------------
@@ -80,7 +88,7 @@
     private transient String lastSenderSurname;
 
     private transient String lastSenderFirstname;
-    
+
     private transient int messageCount;
 
     // --------------------------------------------------------------------------
@@ -149,7 +157,7 @@
 
         return false;
     }
-    
+
     public boolean isFollowUp( User user )
     {
         for ( UserMessage userMessage : userMessages )
@@ -165,9 +173,9 @@
 
     public boolean isRead( User user )
     {
-        for( UserMessage userMessage : userMessages )
+        for ( UserMessage userMessage : userMessages )
         {
-            if( userMessage.getUser() != null && userMessage.getUser().equals( user ) )
+            if ( userMessage.getUser() != null && userMessage.getUser().equals( user ) )
             {
                 return userMessage.isRead();
             }
@@ -265,31 +273,31 @@
     {
         userMessages.clear();
     }
-    
+
     public String getLastSenderName()
     {
         boolean hasName = lastSenderFirstname != null || lastSenderSurname != null;
-                
-        return hasName ? ( lastSenderFirstname + " " + lastSenderSurname ) : null;
+
+        return hasName ? (lastSenderFirstname + " " + lastSenderSurname) : null;
     }
-    
+
     public Set<User> getTopRecipients()
     {
         Set<User> recipients = new HashSet<>();
-        
+
         for ( UserMessage userMessage : userMessages )
         {
             recipients.add( userMessage.getUser() );
-            
+
             if ( recipients.size() > RECIPIENTS_MAX_DISPLAY )
             {
                 break;
             }
         }
-        
+
         return recipients;
     }
-    
+
     public int getBottomRecipients()
     {
         return userMessages.size() - RECIPIENTS_MAX_DISPLAY;
@@ -307,7 +315,8 @@
 
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    @PropertyRange( min = 2 )
     public String getSubject()
     {
         return subject;
@@ -321,7 +330,7 @@
     @JsonProperty
     @JsonSerialize( as = BaseIdentifiableObject.class )
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public User getLastSender()
     {
         return lastSender;
@@ -334,7 +343,7 @@
 
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public Date getLastMessage()
     {
         return lastMessage;
@@ -347,8 +356,8 @@
 
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlElementWrapper( localName = "userMessages", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "userMessage", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlElementWrapper( localName = "userMessages", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "userMessage", namespace = DxfNamespaces.DXF_2_0 )
     public Set<UserMessage> getUserMessages()
     {
         return userMessages;
@@ -361,8 +370,8 @@
 
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlElementWrapper( localName = "messages", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "message", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlElementWrapper( localName = "messages", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "message", namespace = DxfNamespaces.DXF_2_0 )
     public List<Message> getMessages()
     {
         return messages;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/option/OptionSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/option/OptionSet.java	2014-09-12 08:50:22 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/option/OptionSet.java	2014-12-19 16:13:54 +0000
@@ -34,7 +34,6 @@
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.DxfNamespaces;
 import org.hisp.dhis.common.IdentifiableObject;
@@ -129,12 +128,12 @@
             options.addAll( optionSet.getOptions() );
         }
     }
-    
+
     public List<String> getOptionValues()
     {
         List<String> result = new ArrayList<>();
 
-        for( Option option : options )
+        for ( Option option : options )
         {
             result.add( option.getName() );
         }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2014-12-19 12:31:55 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2014-12-19 16:13:54 +0000
@@ -50,6 +50,7 @@
 import org.hisp.dhis.period.PeriodType;
 import org.hisp.dhis.schema.PropertyType;
 import org.hisp.dhis.schema.annotation.Property;
+import org.hisp.dhis.schema.annotation.PropertyRange;
 import org.hisp.dhis.user.User;
 
 import java.util.ArrayList;
@@ -797,6 +798,7 @@
     @JsonProperty
     @JsonView( UuidView.class )
     @JacksonXmlProperty( isAttribute = true )
+    @PropertyRange( min = 36, max = 36 )
     public String getUuid()
     {
         return uuid;
@@ -887,6 +889,7 @@
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    @PropertyRange( min = 2 )
     public String getComment()
     {
         return comment;
@@ -1005,7 +1008,7 @@
         this.type = type;
     }
 
-    @JsonProperty( value = "organisationUnitGroups" )
+    @JsonProperty( "organisationUnitGroups" )
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
     @JsonView( { DetailedView.class } )
     @JacksonXmlElementWrapper( localName = "organisationUnitGroups", namespace = DxfNamespaces.DXF_2_0 )
@@ -1050,7 +1053,7 @@
         this.users = users;
     }
 
-    @JsonProperty( value = "attributeValues" )
+    @JsonProperty( "attributeValues" )
     @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
     @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroup.java	2014-09-29 18:29:02 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroup.java	2014-12-19 16:13:54 +0000
@@ -28,9 +28,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.HashSet;
-import java.util.Set;
-
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonView;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
 import org.hisp.dhis.attribute.AttributeValue;
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.BaseNameableObject;
@@ -40,12 +43,8 @@
 import org.hisp.dhis.common.view.DetailedView;
 import org.hisp.dhis.common.view.ExportView;
 
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonView;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import java.util.HashSet;
+import java.util.Set;
 
 /**
  * @author Kristian Nordal
@@ -128,7 +127,7 @@
             addOrganisationUnit( unit );
         }
     }
-    
+
     public boolean hasSymbol()
     {
         return symbol != null && !symbol.trim().isEmpty();
@@ -151,7 +150,7 @@
         this.symbol = symbol;
     }
 
-    @JsonProperty( value = "organisationUnits" )
+    @JsonProperty( "organisationUnits" )
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
     @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlElementWrapper( localName = "organisationUnits", namespace = DxfNamespaces.DXF_2_0 )
@@ -166,7 +165,7 @@
         this.members = members;
     }
 
-    @JsonProperty( value = "organisationUnitGroupSet" )
+    @JsonProperty( "organisationUnitGroupSet" )
     @JsonSerialize( as = BaseIdentifiableObject.class )
     @JsonView( { DetailedView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
@@ -180,10 +179,10 @@
         this.groupSet = groupSet;
     }
 
-    @JsonProperty( value = "attributeValues" )
+    @JsonProperty( "attributeValues" )
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
     public Set<AttributeValue> getAttributeValues()
     {
         return attributeValues;

=== 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	2014-11-08 17:30:22 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSet.java	2014-12-19 16:13:54 +0000
@@ -28,13 +28,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonView;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
 import org.hisp.dhis.attribute.AttributeValue;
 import org.hisp.dhis.common.BaseDimensionalObject;
 import org.hisp.dhis.common.BaseIdentifiableObject;
@@ -48,12 +47,12 @@
 import org.hisp.dhis.common.view.DimensionalView;
 import org.hisp.dhis.common.view.ExportView;
 
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonView;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
 
 /**
  * @author Kristian Nordal
@@ -231,7 +230,7 @@
         this.compulsory = compulsory;
     }
 
-    @JsonProperty( value = "organisationUnitGroups" )
+    @JsonProperty( "organisationUnitGroups" )
     // @JsonSerialize(contentAs = BaseIdentifiableObject.class)
     @JsonSerialize( contentUsing = JacksonOrganisationUnitGroupSymbolSerializer.class )
     @JsonView( { DetailedView.class, ExportView.class } )
@@ -260,10 +259,10 @@
         this.dataDimension = dataDimension;
     }
 
-    @JsonProperty( value = "attributeValues" )
+    @JsonProperty( "attributeValues" )
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
     public Set<AttributeValue> getAttributeValues()
     {
         return attributeValues;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2014-12-19 15:36:44 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2014-12-19 16:13:54 +0000
@@ -28,12 +28,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonView;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.DxfNamespaces;
 import org.hisp.dhis.common.IdentifiableObject;
@@ -51,12 +51,11 @@
 import org.hisp.dhis.user.UserAuthorityGroup;
 import org.hisp.dhis.validation.ValidationCriteria;
 
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonView;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
 
 /**
  * @author Abyot Asalefew
@@ -245,7 +244,7 @@
         this.version = version;
     }
 
-    @JsonProperty( value = "organisationUnits" )
+    @JsonProperty( "organisationUnits" )
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
     @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlElementWrapper( localName = "organisationUnits", namespace = DxfNamespaces.DXF_2_0 )
@@ -260,7 +259,7 @@
         this.organisationUnits = organisationUnits;
     }
 
-    @JsonProperty( value = "programStages" )
+    @JsonProperty( "programStages" )
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
     @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlElementWrapper( localName = "programStages", namespace = DxfNamespaces.DXF_2_0 )
@@ -322,7 +321,7 @@
         this.type = type;
     }
 
-    @JsonProperty( value = "validationCriterias" )
+    @JsonProperty( "validationCriterias" )
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
     @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlElementWrapper( localName = "validationCriterias", namespace = DxfNamespaces.DXF_2_0 )
@@ -512,7 +511,7 @@
         this.dataEntryMethod = dataEntryMethod;
     }
 
-    @JsonProperty( value = "programTrackedEntityAttributes" )
+    @JsonProperty( "programTrackedEntityAttributes" )
     @JsonView( { DetailedView.class, ExportView.class, WithoutOrganisationUnitsView.class } )
     @JacksonXmlElementWrapper( localName = "programTrackedEntityAttributes", namespace = DxfNamespaces.DXF_2_0 )
     @JacksonXmlProperty( localName = "programTrackedEntityAttribute", namespace = DxfNamespaces.DXF_2_0 )

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java	2014-12-19 15:36:44 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java	2014-12-19 16:13:54 +0000
@@ -178,7 +178,7 @@
         this.remindCompleted = remindCompleted;
     }
 
-    @JsonProperty( value = "trackedEntityInstanceReminders" )
+    @JsonProperty( "trackedEntityInstanceReminders" )
     @JsonView( { DetailedView.class } )
     @JacksonXmlElementWrapper( localName = "trackedEntityInstanceReminders", namespace = DxfNamespaces.DXF_2_0 )
     @JacksonXmlProperty( localName = "trackedEntityInstanceReminder", namespace = DxfNamespaces.DXF_2_0 )
@@ -219,7 +219,7 @@
         this.description = description;
     }
 
-    @JsonProperty( value = "programStageSections" )
+    @JsonProperty( "programStageSections" )
     @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlElementWrapper( localName = "programStageSections", namespace = DxfNamespaces.DXF_2_0 )
     @JacksonXmlProperty( localName = "programStageSection", namespace = DxfNamespaces.DXF_2_0 )

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/Report.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/Report.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/report/Report.java	2014-12-19 16:13:54 +0000
@@ -28,6 +28,11 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonView;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.DxfNamespaces;
 import org.hisp.dhis.common.IdentifiableObject;
@@ -37,12 +42,6 @@
 import org.hisp.dhis.reporttable.ReportParams;
 import org.hisp.dhis.reporttable.ReportTable;
 
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonView;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-
 /**
  * @author Lars Helge Overland
  */
@@ -53,13 +52,13 @@
     private static final long serialVersionUID = 7880117720157807526L;
 
     public static final String TEMPLATE_DIR = "templates";
-    
+
     public static final String TYPE_JASPER_REPORT_TABLE = "jasperReportTable";
     public static final String TYPE_JASPER_JDBC = "jasperJdbc";
     public static final String TYPE_HTML = "html";
 
     private String type;
-    
+
     private String designContent;
 
     private ReportTable reportTable;
@@ -67,7 +66,7 @@
     private RelativePeriods relatives;
 
     private ReportParams reportParams;
-    
+
     // -------------------------------------------------------------------------
     // Constructors
     // -------------------------------------------------------------------------
@@ -82,7 +81,7 @@
         this.designContent = designContent;
         this.reportTable = reportTable;
     }
-    
+
     public Report( String name, String type, String designContent, RelativePeriods relatives, ReportParams reportParams )
     {
         this.name = name;
@@ -99,17 +98,17 @@
     {
         return type != null && TYPE_JASPER_REPORT_TABLE.equals( type );
     }
-    
+
     public boolean isTypeJdbc()
     {
         return type != null && TYPE_JASPER_JDBC.equals( type );
     }
-    
+
     public boolean isTypeHtml()
     {
         return type != null && TYPE_HTML.equals( type );
     }
-        
+
     public boolean hasReportTable()
     {
         return reportTable != null;
@@ -122,7 +121,7 @@
     {
         return relatives != null && !relatives.isEmpty();
     }
-    
+
     /**
      * Indicates whether this report has report parameters set.
      */
@@ -130,7 +129,7 @@
     {
         return reportParams != null && reportParams.isSet();
     }
-    
+
     // -------------------------------------------------------------------------
     // Getters and setters
     // -------------------------------------------------------------------------
@@ -142,7 +141,7 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
+    @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getType()
     {
@@ -155,7 +154,7 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
+    @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getDesignContent()
     {
@@ -169,7 +168,7 @@
 
     @JsonProperty
     @JsonSerialize( as = BaseIdentifiableObject.class )
-    @JsonView( {DetailedView.class, ExportView.class} )
+    @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public ReportTable getReportTable()
     {
@@ -181,8 +180,8 @@
         this.reportTable = reportTable;
     }
 
-    @JsonProperty( value = "relativePeriods" )
-    @JsonView( {DetailedView.class, ExportView.class} )
+    @JsonProperty( "relativePeriods" )
+    @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public RelativePeriods getRelatives()
     {
@@ -195,7 +194,7 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
+    @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public ReportParams getReportParams()
     {

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2014-11-03 00:24:32 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2014-12-19 16:13:54 +0000
@@ -28,18 +28,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static org.hisp.dhis.common.DimensionalObject.CATEGORYOPTIONCOMBO_DIM_ID;
-import static org.hisp.dhis.common.DimensionalObject.DATA_X_DIM_ID;
-import static org.hisp.dhis.common.DimensionalObject.ORGUNIT_DIM_ID;
-import static org.hisp.dhis.common.DimensionalObject.PERIOD_DIM_ID;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonView;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
 import org.apache.commons.lang.StringUtils;
 import org.hisp.dhis.common.BaseAnalyticalObject;
 import org.hisp.dhis.common.CombinationGenerator;
@@ -65,17 +59,19 @@
 import org.hisp.dhis.period.RelativePeriods;
 import org.hisp.dhis.user.User;
 
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonView;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.hisp.dhis.common.DimensionalObject.*;
 
 /**
  * @author Lars Helge Overland
  */
-@JacksonXmlRootElement( localName = "reportTable", namespace = DxfNamespaces.DXF_2_0)
+@JacksonXmlRootElement( localName = "reportTable", namespace = DxfNamespaces.DXF_2_0 )
 public class ReportTable
     extends BaseAnalyticalObject
 {
@@ -89,7 +85,7 @@
 
     public static final String TOTAL_COLUMN_NAME = "total";
     public static final String TOTAL_COLUMN_PRETTY_NAME = "Total";
-    
+
     public static final String AGGREGATION_TYPE_DEFAULT = "default";
     public static final String AGGREGATION_TYPE_COUNT = "count";
     public static final String AGGREGATION_TYPE_SUM = "sum";
@@ -97,7 +93,7 @@
     public static final String DISPLAY_DENSITY_COMFORTABLE = "comfortable";
     public static final String DISPLAY_DENSITY_NORMAL = "normal";
     public static final String DISPLAY_DENSITY_COMPACT = "compact";
-    
+
     public static final String FONT_SIZE_LARGE = "large";
     public static final String FONT_SIZE_NORMAL = "normal";
     public static final String FONT_SIZE_SMALL = "small";
@@ -109,13 +105,13 @@
 
     private static final String ILLEGAL_FILENAME_CHARS_REGEX = "[/\\?%*:|\"'<>.]";
 
-    private static final Map<String, String> COLUMN_NAMES = DimensionalObjectUtils.asMap( 
+    private static final Map<String, String> COLUMN_NAMES = DimensionalObjectUtils.asMap(
         DATA_X_DIM_ID, "data",
         CATEGORYOPTIONCOMBO_DIM_ID, "categoryoptioncombo",
         PERIOD_DIM_ID, "period",
         ORGUNIT_DIM_ID, "organisationunit"
     );
-    
+
     // -------------------------------------------------------------------------
     // Persisted properties
     // -------------------------------------------------------------------------
@@ -134,17 +130,17 @@
      * Dimensions to crosstabulate / use as columns.
      */
     private List<String> columnDimensions = new ArrayList<>();
-    
+
     /**
      * Dimensions to use as rows.
      */
     private List<String> rowDimensions = new ArrayList<>();
-    
+
     /**
      * Dimensions to use as filter.
      */
     private List<String> filterDimensions = new ArrayList<>();
-    
+
     /**
      * The ReportParams of the ReportTable.
      */
@@ -174,37 +170,37 @@
      * Indicates rendering of empty rows for the table.
      */
     private boolean hideEmptyRows;
-    
+
     /**
      * The display density of the text in the table.
      */
     private String displayDensity;
-    
+
     /**
      * The font size of the text in the table.
      */
     private String fontSize;
-    
+
     /**
      * The legend set in the table.
      */
     private MapLegendSet legendSet;
-    
+
     /**
      * Indicates showing organisation unit hierarchy names.
      */
     private boolean showHierarchy;
-    
+
     /**
      * Indicates the aggregation type.
      */
     private String aggregationType;
-    
+
     /**
      * Indicates showing organisation unit hierarchy names.
      */
     private boolean showDimensionLabels;
-    
+
     // -------------------------------------------------------------------------
     // Transient properties
     // -------------------------------------------------------------------------
@@ -243,26 +239,26 @@
     /**
      * Default constructor.
      *
-     * @param name the name.
-     * @param dataElements the data elements.
-     * @param indicators the indicators.
-     * @param dataSets the data sets.
-     * @param periods the periods. Cannot have the name property set.
-     * @param relativePeriods the relative periods. These periods must have the
-     *                        name property set. Not persisted.
+     * @param name              the name.
+     * @param dataElements      the data elements.
+     * @param indicators        the indicators.
+     * @param dataSets          the data sets.
+     * @param periods           the periods. Cannot have the name property set.
+     * @param relativePeriods   the relative periods. These periods must have the
+     *                          name property set. Not persisted.
      * @param organisationUnits the organisation units.
-     * @param relativeUnits the organisation units. Not persisted.
-     * @param doIndicators indicating whether indicators should be crosstabulated.
-     * @param doPeriods indicating whether periods should be crosstabulated.
-     * @param doUnits indicating whether organisation units should be crosstabulated.
-     * @param relatives the relative periods.
-     * @param i18nFormat the i18n format. Not persisted.
+     * @param relativeUnits     the organisation units. Not persisted.
+     * @param doIndicators      indicating whether indicators should be crosstabulated.
+     * @param doPeriods         indicating whether periods should be crosstabulated.
+     * @param doUnits           indicating whether organisation units should be crosstabulated.
+     * @param relatives         the relative periods.
+     * @param i18nFormat        the i18n format. Not persisted.
      */
     public ReportTable( String name, List<DataElement> dataElements, List<Indicator> indicators,
-                        List<DataSet> dataSets, List<Period> periods,
-                        List<OrganisationUnit> organisationUnits,
-                        boolean doIndicators, boolean doPeriods, boolean doUnits, RelativePeriods relatives, ReportParams reportParams,
-                        String reportingPeriodName )
+        List<DataSet> dataSets, List<Period> periods,
+        List<OrganisationUnit> organisationUnits,
+        boolean doIndicators, boolean doPeriods, boolean doUnits, RelativePeriods relatives, ReportParams reportParams,
+        String reportingPeriodName )
     {
         this.name = name;
         this.dataElements = dataElements;
@@ -273,7 +269,7 @@
         this.relatives = relatives;
         this.reportParams = reportParams;
         this.reportingPeriodName = reportingPeriodName;
-        
+
         if ( doIndicators )
         {
             columnDimensions.add( DATA_X_DIM_ID );
@@ -282,7 +278,7 @@
         {
             rowDimensions.add( DATA_X_DIM_ID );
         }
-        
+
         if ( doPeriods )
         {
             columnDimensions.add( PERIOD_DIM_ID );
@@ -291,7 +287,7 @@
         {
             rowDimensions.add( PERIOD_DIM_ID );
         }
-        
+
         if ( doUnits )
         {
             columnDimensions.add( ORGUNIT_DIM_ID );
@@ -307,15 +303,15 @@
     // -------------------------------------------------------------------------
 
     @Override
-    public void init( User user, Date date, OrganisationUnit organisationUnit, 
+    public void init( User user, Date date, OrganisationUnit organisationUnit,
         List<OrganisationUnit> organisationUnitsAtLevel, List<OrganisationUnit> organisationUnitsInGroups, I18nFormat format )
     {
-        verify( ( periods != null && !periods.isEmpty() ) || hasRelativePeriods(), "Must contain periods or relative periods" );
+        verify( (periods != null && !periods.isEmpty()) || hasRelativePeriods(), "Must contain periods or relative periods" );
 
         this.relativePeriodDate = date;
-        
+
         // Handle report parameters
-        
+
         if ( hasRelativePeriods() )
         {
             this.reportingPeriodName = relatives.getReportingPeriodName( date, format );
@@ -336,39 +332,39 @@
         }
 
         // Handle special dimension
-        
+
         if ( isDimensional() )
         {
             transientCategoryOptionCombos.addAll( getCategoryCombo().getSortedOptionCombos() );
             verify( nonEmptyLists( transientCategoryOptionCombos ) == 1, "Category option combos size must be larger than 0" );
         }
-        
+
         // Populate grid
-        
+
         this.populateGridColumnsAndRows( date, user, organisationUnitsAtLevel, organisationUnitsInGroups, format );
     }
-    
+
     // -------------------------------------------------------------------------
     // Public methods
     // -------------------------------------------------------------------------
-    
-    public void populateGridColumnsAndRows( Date date, User user, 
+
+    public void populateGridColumnsAndRows( Date date, User user,
         List<OrganisationUnit> organisationUnitsAtLevel, List<OrganisationUnit> organisationUnitsInGroups, I18nFormat format )
     {
         List<NameableObject[]> tableColumns = new ArrayList<>();
         List<NameableObject[]> tableRows = new ArrayList<>();
         List<NameableObject> filterItems = new ArrayList<>();
-        
+
         for ( String dimension : columnDimensions )
         {
             tableColumns.add( getDimensionalObject( dimension, date, user, false, organisationUnitsAtLevel, organisationUnitsInGroups, format ).getItems().toArray( IRT ) );
         }
-        
+
         for ( String dimension : rowDimensions )
         {
             tableRows.add( getDimensionalObject( dimension, date, user, true, organisationUnitsAtLevel, organisationUnitsInGroups, format ).getItems().toArray( IRT ) );
         }
-        
+
         for ( String filter : filterDimensions )
         {
             filterItems.addAll( getDimensionalObject( filter, date, user, true, organisationUnitsAtLevel, organisationUnitsInGroups, format ).getItems() );
@@ -377,12 +373,12 @@
         gridColumns = new CombinationGenerator<>( tableColumns.toArray( IRT2D ) ).getCombinations();
         gridRows = new CombinationGenerator<>( tableRows.toArray( IRT2D ) ).getCombinations();
 
-        addIfEmpty( gridColumns ); 
+        addIfEmpty( gridColumns );
         addIfEmpty( gridRows );
-        
+
         title = IdentifiableObjectUtils.join( filterItems );
     }
-    
+
     @Override
     public void populateAnalyticalProperties()
     {
@@ -390,25 +386,25 @@
         {
             columns.addAll( getDimensionalObjectList( column ) );
         }
-        
+
         for ( String row : rowDimensions )
         {
             rows.addAll( getDimensionalObjectList( row ) );
         }
-        
+
         for ( String filter : filterDimensions )
         {
             filters.addAll( getDimensionalObjectList( filter ) );
         }
     }
-    
+
     /**
      * Indicates whether this ReportTable is multi-dimensional.
      */
     public boolean isDimensional()
     {
-        return dataElements != null && !dataElements.isEmpty() && ( 
-            columnDimensions.contains( CATEGORYOPTIONCOMBO_DIM_ID ) || rowDimensions.contains( CATEGORYOPTIONCOMBO_DIM_ID ) );
+        return dataElements != null && !dataElements.isEmpty() && (
+            columnDimensions.contains( CATEGORYOPTIONCOMBO_DIM_ID ) || rowDimensions.contains( CATEGORYOPTIONCOMBO_DIM_ID ));
     }
 
     /**
@@ -421,7 +417,7 @@
 
         for ( NameableObject object : objects )
         {
-            buffer.append( object != null ? ( object.getShortName() + SPACE ) : EMPTY );
+            buffer.append( object != null ? (object.getShortName() + SPACE) : EMPTY );
         }
 
         return buffer.length() > 0 ? buffer.substring( 0, buffer.lastIndexOf( SPACE ) ) : TOTAL_COLUMN_PRETTY_NAME;
@@ -430,7 +426,7 @@
     /**
      * Generates a column name based on short-names of the argument objects.
      * Null arguments are ignored in the name.
-     * 
+     * <p/>
      * The period column name must be static when on columns so it can be
      * re-used in reports, hence the name property is used which will be formatted
      * only when the period dimension is on rows.
@@ -447,7 +443,7 @@
             }
             else
             {
-                buffer.append( object != null ? ( object.getShortName() + SEPARATOR ) : EMPTY );
+                buffer.append( object != null ? (object.getShortName() + SEPARATOR) : EMPTY );
             }
         }
 
@@ -492,7 +488,7 @@
 
         return false;
     }
-    
+
     /**
      * Tests whether this report table has report params.
      */
@@ -517,13 +513,13 @@
     public void setDoIndicators( boolean doIndicators )
     {
         this.columnDimensions.remove( DATA_X_DIM_ID );
-        
+
         if ( doIndicators )
         {
             this.columnDimensions.add( DATA_X_DIM_ID );
         }
     }
-    
+
     public boolean isDoPeriods()
     {
         return columnDimensions.contains( PERIOD_DIM_ID );
@@ -532,22 +528,22 @@
     public void setDoPeriods( boolean doPeriods )
     {
         this.columnDimensions.remove( PERIOD_DIM_ID );
-        
+
         if ( doPeriods )
         {
             this.columnDimensions.add( PERIOD_DIM_ID );
         }
     }
-    
+
     public boolean isDoUnits()
     {
         return columnDimensions.contains( ORGUNIT_DIM_ID );
     }
-    
+
     public void setDoUnits( boolean doUnits )
     {
         this.columnDimensions.remove( ORGUNIT_DIM_ID );
-        
+
         if ( doUnits )
         {
             this.columnDimensions.add( ORGUNIT_DIM_ID );
@@ -569,16 +565,16 @@
      * Generates a grid for this report table based on the given aggregate value
      * map.
      *
-     * @param grid the grid, should be empty and not null.
-     * @param valueMap the mapping of identifiers to aggregate values.
+     * @param grid         the grid, should be empty and not null.
+     * @param valueMap     the mapping of identifiers to aggregate values.
      * @param paramColumns whether to include report parameter columns.
      * @return a grid.
      */
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings( "unchecked" )
     public Grid getGrid( Grid grid, Map<String, Object> valueMap, boolean paramColumns )
     {
         valueMap = new HashMap<>( valueMap );
-        
+
         sortKeys( valueMap );
 
         // ---------------------------------------------------------------------
@@ -586,7 +582,7 @@
         // ---------------------------------------------------------------------
 
         if ( name != null )
-        {        
+        {
             grid.setTitle( name );
             grid.setSubtitle( title );
         }
@@ -601,18 +597,18 @@
 
         Map<String, String> metaData = getMetaData();
         metaData.putAll( DimensionalObject.PRETTY_NAMES );
-        
+
         for ( String row : rowDimensions )
         {
-            String name = StringUtils.defaultIfEmpty( metaData.get( row ), row );            
+            String name = StringUtils.defaultIfEmpty( metaData.get( row ), row );
             String col = StringUtils.defaultIfEmpty( COLUMN_NAMES.get( row ), row );
-            
+
             grid.addHeader( new GridHeader( name + " ID", col + "id", String.class.getName(), true, true ) );
             grid.addHeader( new GridHeader( name, col + "name", String.class.getName(), false, true ) );
             grid.addHeader( new GridHeader( name + " code", col + "code", String.class.getName(), true, true ) );
             grid.addHeader( new GridHeader( name + " description", col + "description", String.class.getName(), true, true ) );
         }
-        
+
         if ( paramColumns )
         {
             grid.addHeader( new GridHeader( "Reporting month", REPORTING_MONTH_COLUMN_NAME,
@@ -651,7 +647,7 @@
                 grid.addValue( object.getCode() );
                 grid.addValue( object.getDescription() );
             }
-            
+
             if ( paramColumns )
             {
                 grid.addValue( reportingPeriodName );
@@ -664,18 +660,18 @@
             // -----------------------------------------------------------------
 
             boolean hasValue = false;
-            
+
             for ( List<NameableObject> column : gridColumns )
             {
                 String key = getIdentifier( column, row );
-                
+
                 Object value = valueMap.get( key );
-                
+
                 grid.addValue( value );
-                
+
                 hasValue = !hasValue ? value != null : true;
             }
-            
+
             if ( hideEmptyRows && !hasValue )
             {
                 grid.removeCurrentWriteRow();
@@ -712,14 +708,14 @@
 
         if ( showHierarchy && rowDimensions.indexOf( ORGUNIT_DIM_ID ) != -1 && grid.hasMetaDataKey( "ouNameHierarchy" ) )
         {
-            int ouNameIndex = ( rowDimensions.indexOf( ORGUNIT_DIM_ID ) * 4 ) + 1; // Ou name position            
+            int ouNameIndex = (rowDimensions.indexOf( ORGUNIT_DIM_ID ) * 4) + 1; // Ou name position
             Map<Object, Object> hierarchyNameMap = (Map<Object, Object>) grid.getMetaData().get( "ouNameHierarchy" );
             grid.substituteMetaData( ouNameIndex, hierarchyNameMap );
         }
 
         return grid;
     }
-    
+
     // -------------------------------------------------------------------------
     // Supportive methods
     // -------------------------------------------------------------------------
@@ -762,7 +758,7 @@
         {
             return dataElements.get( 0 ).getCategoryCombo();
         }
-        
+
         return null;
     }
 
@@ -777,8 +773,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isRegression()
     {
         return regression;
@@ -790,8 +786,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isCumulative()
     {
         return cumulative;
@@ -803,9 +799,9 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlElementWrapper( localName = "columnDimensions", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "column", namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlElementWrapper( localName = "columnDimensions", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "column", namespace = DxfNamespaces.DXF_2_0 )
     public List<String> getColumnDimensions()
     {
         return columnDimensions;
@@ -817,9 +813,9 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlElementWrapper( localName = "rowDimensions", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "row", namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlElementWrapper( localName = "rowDimensions", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "row", namespace = DxfNamespaces.DXF_2_0 )
     public List<String> getRowDimensions()
     {
         return rowDimensions;
@@ -831,9 +827,9 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlElementWrapper( localName = "filterDimensions", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "filter", namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlElementWrapper( localName = "filterDimensions", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "filter", namespace = DxfNamespaces.DXF_2_0 )
     public List<String> getFilterDimensions()
     {
         return filterDimensions;
@@ -845,8 +841,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public ReportParams getReportParams()
     {
         return reportParams;
@@ -859,8 +855,8 @@
 
     @Override
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public int getSortOrder()
     {
         return sortOrder;
@@ -874,8 +870,8 @@
 
     @Override
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public int getTopLimit()
     {
         return topLimit;
@@ -888,8 +884,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isRowTotals()
     {
         return rowTotals;
@@ -901,8 +897,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isColTotals()
     {
         return colTotals;
@@ -914,8 +910,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isRowSubTotals()
     {
         return rowSubTotals;
@@ -924,11 +920,11 @@
     public void setRowSubTotals( boolean rowSubTotals )
     {
         this.rowSubTotals = rowSubTotals;
-    }    
+    }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isColSubTotals()
     {
         return colSubTotals;
@@ -940,8 +936,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isHideEmptyRows()
     {
         return hideEmptyRows;
@@ -954,8 +950,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getAggregationType()
     {
         return aggregationType;
@@ -967,8 +963,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getDisplayDensity()
     {
         return displayDensity;
@@ -980,8 +976,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getFontSize()
     {
         return fontSize;
@@ -993,8 +989,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public MapLegendSet getLegendSet()
     {
         return legendSet;
@@ -1006,8 +1002,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isShowHierarchy()
     {
         return showHierarchy;
@@ -1020,8 +1016,8 @@
 
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isShowDimensionLabels()
     {
         return showDimensionLabels;
@@ -1107,13 +1103,13 @@
             legendSet = reportTable.getLegendSet();
             showDimensionLabels = reportTable.isShowDimensionLabels();
             hideEmptyRows = reportTable.isHideEmptyRows();
-            
+
             columnDimensions.clear();
             columnDimensions.addAll( reportTable.getColumnDimensions() );
-            
+
             rowDimensions.clear();
             rowDimensions.addAll( reportTable.getRowDimensions() );
-            
+
             filterDimensions.clear();
             filterDimensions.addAll( reportTable.getFilterDimensions() );
         }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlView.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlView.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlView.java	2014-12-19 16:13:54 +0000
@@ -38,6 +38,7 @@
 import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.common.view.DetailedView;
 import org.hisp.dhis.common.view.ExportView;
+import org.hisp.dhis.schema.annotation.PropertyRange;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -132,6 +133,7 @@
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    @PropertyRange( min = 2 )
     public String getDescription()
     {
         return description;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstance.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstance.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstance.java	2014-12-19 16:13:54 +0000
@@ -28,9 +28,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.HashSet;
-import java.util.Set;
-
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonView;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.DxfNamespaces;
 import org.hisp.dhis.common.view.DetailedView;
@@ -39,12 +42,8 @@
 import org.hisp.dhis.program.ProgramInstance;
 import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue;
 
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonView;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import java.util.HashSet;
+import java.util.Set;
 
 /**
  * @author Abyot Asalefew Gizaw
@@ -93,7 +92,7 @@
         attributeValues.remove( attributeValue );
         attributeValue.setEntityInstance( null );
     }
-    
+
     // -------------------------------------------------------------------------
     // Getters and setters
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java	2014-12-19 15:36:44 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java	2014-12-19 16:13:54 +0000
@@ -501,7 +501,7 @@
         this.dataViewOrganisationUnits = dataViewOrganisationUnits;
     }
 
-    @JsonProperty( value = "attributeValues" )
+    @JsonProperty( "attributeValues" )
     @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
     @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserAuthorityGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserAuthorityGroup.java	2014-12-19 12:01:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserAuthorityGroup.java	2014-12-19 16:13:54 +0000
@@ -35,7 +35,6 @@
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
 import com.google.common.collect.Sets;
-
 import org.apache.commons.collections.CollectionUtils;
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.DxfNamespaces;
@@ -44,6 +43,7 @@
 import org.hisp.dhis.common.view.DetailedView;
 import org.hisp.dhis.common.view.ExportView;
 import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.schema.annotation.PropertyRange;
 
 import java.util.HashSet;
 import java.util.Set;
@@ -102,7 +102,7 @@
     {
         return authorities != null && authorities.contains( AUTHORITY_ALL );
     }
-    
+
     public boolean hasCriticalAuthorities()
     {
         return authorities != null && CollectionUtils.containsAny( authorities, Sets.newHashSet( CRITICAL_AUTHS ) );
@@ -121,6 +121,7 @@
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    @PropertyRange( min = 2 )
     public String getDescription()
     {
         return description;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserGroup.java	2014-11-25 03:16:09 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserGroup.java	2014-12-19 16:13:54 +0000
@@ -46,7 +46,7 @@
 import java.util.HashSet;
 import java.util.Set;
 
-@JacksonXmlRootElement(localName = "userGroup", namespace = DxfNamespaces.DXF_2_0)
+@JacksonXmlRootElement( localName = "userGroup", namespace = DxfNamespaces.DXF_2_0 )
 public class UserGroup
     extends BaseIdentifiableObject
 {
@@ -157,11 +157,11 @@
         this.user = user;
     }
 
-    @JsonProperty(value = "users")
-    @JsonSerialize(contentAs = BaseIdentifiableObject.class)
-    @JsonView({ DetailedView.class, ExportView.class })
-    @JacksonXmlElementWrapper(localName = "users", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty(localName = "user", namespace = DxfNamespaces.DXF_2_0)
+    @JsonProperty( "users" )
+    @JsonSerialize( contentAs = BaseIdentifiableObject.class )
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlElementWrapper( localName = "users", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "user", namespace = DxfNamespaces.DXF_2_0 )
     public Set<User> getMembers()
     {
         return members;
@@ -172,11 +172,11 @@
         this.members = members;
     }
 
-    @JsonProperty(value = "managedGroups")
-    @JsonSerialize(contentAs = BaseIdentifiableObject.class)
-    @JsonView({ DetailedView.class, ExportView.class })
-    @JacksonXmlElementWrapper(localName = "managedGroups", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty(localName = "managedGroup", namespace = DxfNamespaces.DXF_2_0)
+    @JsonProperty( "managedGroups" )
+    @JsonSerialize( contentAs = BaseIdentifiableObject.class )
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlElementWrapper( localName = "managedGroups", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "managedGroup", namespace = DxfNamespaces.DXF_2_0 )
     public Set<UserGroup> getManagedGroups()
     {
         return managedGroups;
@@ -187,7 +187,7 @@
         this.managedGroups = managedGroups;
     }
 
-    @JsonProperty(value = "managedByGroups")
+    @JsonProperty( "managedByGroups" )
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
     @JsonView( { DetailedView.class } )
     @JacksonXmlElementWrapper( localName = "managedByGroups", namespace = DxfNamespaces.DXF_2_0 )
@@ -202,10 +202,10 @@
         this.managedByGroups = managedByGroups;
     }
 
-    @JsonProperty( value = "attributeValues" )
+    @JsonProperty( "attributeValues" )
     @JsonView( { DetailedView.class, ExportView.class } )
-    @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0)
+    @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "attributeValue", namespace = DxfNamespaces.DXF_2_0 )
     public Set<AttributeValue> getAttributeValues()
     {
         return attributeValues;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRule.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRule.java	2014-12-19 15:36:44 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRule.java	2014-12-19 16:13:54 +0000
@@ -462,7 +462,7 @@
         this.rightSide = rightSide;
     }
 
-    @JsonProperty( value = "validationRuleGroups" )
+    @JsonProperty( "validationRuleGroups" )
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
     @JsonView( { DetailedView.class } )
     @JacksonXmlElementWrapper( localName = "validationRuleGroups", namespace = DxfNamespaces.DXF_2_0 )

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRuleGroup.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRuleGroup.java	2014-12-19 15:36:44 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/validation/ValidationRuleGroup.java	2014-12-19 16:13:54 +0000
@@ -28,9 +28,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.HashSet;
-import java.util.Set;
-
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonView;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.DxfNamespaces;
 import org.hisp.dhis.common.IdentifiableObject;
@@ -40,17 +43,13 @@
 import org.hisp.dhis.schema.annotation.PropertyRange;
 import org.hisp.dhis.user.UserGroup;
 
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonView;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import java.util.HashSet;
+import java.util.Set;
 
 /**
  * @author Lars Helge Overland
  */
-@JacksonXmlRootElement( localName = "validationRuleGroup", namespace = DxfNamespaces.DXF_2_0)
+@JacksonXmlRootElement( localName = "validationRuleGroup", namespace = DxfNamespaces.DXF_2_0 )
 public class ValidationRuleGroup
     extends BaseIdentifiableObject
 {
@@ -106,7 +105,7 @@
     {
         members.clear();
     }
-    
+
     /**
      * Indicates whether this group has user roles to alert.
      */
@@ -120,8 +119,8 @@
     // -------------------------------------------------------------------------     
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     @PropertyRange( min = 2 )
     public String getDescription()
     {
@@ -133,11 +132,11 @@
         this.description = description;
     }
 
-    @JsonProperty( value = "validationRules" )
+    @JsonProperty( "validationRules" )
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlElementWrapper( localName = "validationRules", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "validationRule", namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlElementWrapper( localName = "validationRules", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "validationRule", namespace = DxfNamespaces.DXF_2_0 )
     public Set<ValidationRule> getMembers()
     {
         return members;
@@ -150,9 +149,9 @@
 
     @JsonProperty
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlElementWrapper( localName = "userGroupsToAlert", namespace = DxfNamespaces.DXF_2_0)
-    @JacksonXmlProperty( localName = "userGroupToAlert", namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlElementWrapper( localName = "userGroupsToAlert", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "userGroupToAlert", namespace = DxfNamespaces.DXF_2_0 )
     public Set<UserGroup> getUserGroupsToAlert()
     {
         return userGroupsToAlert;
@@ -164,8 +163,8 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public boolean isAlertByOrgUnits()
     {
         return alertByOrgUnits;