← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15660: Data value, including attribute option combo in equals/hashcode.

 

------------------------------------------------------------
revno: 15660
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-06-12 20:37:50 +0200
message:
  Data value, including attribute option combo in equals/hashcode.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValue.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/CurrentUserService.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/datavalue/DataValue.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValue.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValue.java	2014-06-12 18:37:50 +0000
@@ -200,15 +200,19 @@
             return false;
         }
 
-        if ( !(o instanceof DataValue) )
+        if ( !getClass().isAssignableFrom( o.getClass() ) )
         {
             return false;
         }
 
         final DataValue other = (DataValue) o;
 
-        return dataElement.equals( other.getDataElement() ) && categoryOptionCombo.equals( other.getCategoryOptionCombo() )
-            && period.equals( other.getPeriod() ) && source.equals( other.getSource() );
+        return 
+            dataElement.equals( other.getDataElement() ) && 
+            period.equals( other.getPeriod() ) && 
+            source.equals( other.getSource() ) &&
+            categoryOptionCombo.equals( other.getCategoryOptionCombo() ) &&
+            attributeOptionCombo.equals( other.getAttributeOptionCombo() );
     }
 
     @Override
@@ -217,10 +221,11 @@
         final int prime = 31;
         int result = 1;
 
-        result = result * prime + categoryOptionCombo.hashCode();
+        result = result * prime + dataElement.hashCode();
         result = result * prime + period.hashCode();
-        result = result * prime + dataElement.hashCode();
         result = result * prime + source.hashCode();
+        result = result * prime + categoryOptionCombo.hashCode();
+        result = result * prime + attributeOptionCombo.hashCode();
 
         return result;
     }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java	2014-06-12 16:30:25 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java	2014-06-12 18:37:50 +0000
@@ -94,13 +94,13 @@
 {
     String ID = TrackedEntityInstanceService.class.getName();
 
-    public static final int ERROR_NONE = 0;
-
-    public static final int ERROR_DUPLICATE_IDENTIFIER = 1;
-
-    public static final int ERROR_ENROLLMENT = 2;
-
-    public static final String SEPARATOR = "_";
+    final int ERROR_NONE = 0;
+    final int ERROR_DUPLICATE_IDENTIFIER = 1;
+    final int ERROR_ENROLLMENT = 2;
+    
+    final String SEPARATOR = "_";
+    
+    final String F_TRACKED_ENTITY_INSTANCE_SEARCH_IN_ALL_ORGUNITS = "F_TRACKED_ENTITY_INSTANCE_SEARCH_IN_ALL_ORGUNITS";
 
     /**
      * Returns a grid with tracked entity instance values based on the given
@@ -140,6 +140,14 @@
         Date eventStartDate, Date eventEndDate, boolean skipMeta, Integer page, Integer pageSize );
 
     /**
+     * Decides whether current user is authorized to perform the given query.
+     * IllegalQueryException is thrown if not.
+     * 
+     * @param params the TrackedEntityInstanceQueryParams.
+     */
+    void decideAccess( TrackedEntityInstanceQueryParams params );
+    
+    /**
      * Validates the given TrackedEntityInstanceQueryParams. The params is
      * considered valid if no exception are thrown and the method returns
      * normally.

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/CurrentUserService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/CurrentUserService.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/CurrentUserService.java	2014-06-12 18:37:50 +0000
@@ -64,4 +64,9 @@
      * in user is logged out.
      */
     void clearCurrentUser();
+    
+    /**
+     * Indicates whether the current user has been granted the given authority.
+     */
+    boolean currenUserIsAuthorized( String auth );
 }