← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9009: Improved caching in GIS facility layer

 

------------------------------------------------------------
revno: 9009
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-11-13 17:39:50 +0100
message:
  Improved caching in GIS facility layer
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonFacilitiesAction.java
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitGroupsByGroupSetAction.java
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/ext-ux/ext-ux-custom.js


--
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-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonFacilitiesAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonFacilitiesAction.java	2012-11-03 19:38:41 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonFacilitiesAction.java	2012-11-13 16:39:50 +0000
@@ -36,6 +36,7 @@
 import java.util.Set;
 
 import org.apache.struts2.ServletActionContext;
+import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
@@ -128,13 +129,6 @@
             groups.addAll( groupSet.getOrganisationUnitGroups() );
         }
         
-        boolean modified = !clearIfNotModified( ServletActionContext.getRequest(), ServletActionContext.getResponse(), groups );
-        
-        if ( !modified )
-        {
-            return SUCCESS;
-        }
-
         // ---------------------------------------------------------------------
         // Retrieve list of organisation units and populate group names
         // ---------------------------------------------------------------------
@@ -163,6 +157,21 @@
 
         FilterUtils.filter( organisationUnits, new OrganisationUnitWithValidCoordinatesFilter() );
 
+        // ---------------------------------------------------------------------
+        // Check both org unit groups and org units for caching purposes as both 
+        // membership and coordinates may have been modified
+        // ---------------------------------------------------------------------
+
+        Collection<IdentifiableObject> cachingCollection = new ArrayList<IdentifiableObject>( groups );
+        cachingCollection.addAll( organisationUnits );
+        
+        boolean modified = !clearIfNotModified( ServletActionContext.getRequest(), ServletActionContext.getResponse(), cachingCollection );
+        
+        if ( !modified )
+        {
+            return SUCCESS;
+        }
+        
         object = new ArrayList<OrganisationUnit>();
 
         for ( OrganisationUnit unit : organisationUnits )

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitGroupsByGroupSetAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitGroupsByGroupSetAction.java	2012-11-04 14:58:28 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetOrganisationUnitGroupsByGroupSetAction.java	2012-11-13 16:39:50 +0000
@@ -27,8 +27,11 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import static org.hisp.dhis.util.ContextUtils.clearIfNotModified;
+
 import java.util.Set;
 
+import org.apache.struts2.ServletActionContext;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
@@ -87,6 +90,8 @@
         if ( groupSet != null )
         {
             object = groupSet.getOrganisationUnitGroups();
+
+            boolean modified = !clearIfNotModified( ServletActionContext.getRequest(), ServletActionContext.getResponse(), object );
         }
         
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/ext-ux/ext-ux-custom.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/ext-ux/ext-ux-custom.js	2012-11-13 16:15:42 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/ext-ux/ext-ux-custom.js	2012-11-13 16:39:50 +0000
@@ -260,7 +260,6 @@
 				items: this.numberField
 			}
 		];
-		alert(this.width - this.checkbox.width - 6 - this.numberField.width);
 		
 		this.callParent();
 	}