← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8894: Upgraded dashboard to use maps instead of mapviews

 

------------------------------------------------------------
revno: 8894
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-11-06 10:01:56 +0300
message:
  Upgraded dashboard to use maps instead of mapviews
removed:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/comparator/MapViewNameComparator.java
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardContent.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardContentStore.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/interpretation/Interpretation.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/DashboardContentDeletionHandler.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/hibernate/HibernateDashboardContentStore.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/impl/DefaultDashboardService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/provider/MapViewContentProvider.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/dashboard/hibernate/DashboardContent.hbm.xml
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionHandler.java
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/RemoveMapViewAction.java
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretationFeed.vm
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/map_view.vm
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddMapViewToDashboardAction.java
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllMapViewsAction.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/dashboard/DashboardContent.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardContent.java	2012-06-06 11:53:33 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardContent.java	2012-11-06 07:01:56 +0000
@@ -27,24 +27,25 @@
  * 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.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;
+
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.Dxf2Namespace;
 import org.hisp.dhis.common.view.BasicView;
 import org.hisp.dhis.common.view.DetailedView;
 import org.hisp.dhis.document.Document;
-import org.hisp.dhis.mapping.MapView;
+import org.hisp.dhis.mapping.Map;
 import org.hisp.dhis.report.Report;
 import org.hisp.dhis.reporttable.ReportTable;
 import org.hisp.dhis.user.User;
 
-import java.util.ArrayList;
-import java.util.List;
+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;
 
 /**
  * it would make sense to make this an idObject, so that we could have nameable (switchable?)
@@ -67,7 +68,7 @@
 
     private List<ReportTable> reportTables = new ArrayList<ReportTable>();
 
-    private List<MapView> mapViews = new ArrayList<MapView>();
+    private List<Map> maps = new ArrayList<Map>();
 
     public DashboardContent()
     {
@@ -148,15 +149,15 @@
         }
     }
 
-    public void addMapView( MapView mapView )
+    public void addMap( Map map )
     {
-        if ( !mapViews.contains( mapView ) )
+        if ( !maps.contains( map ) )
         {
-            mapViews.add( 0, mapView );
+            maps.add( 0, map );
 
-            while ( mapViews.size() > MAX_DASHBOARD_ELEMENTS )
+            while ( maps.size() > MAX_DASHBOARD_ELEMENTS )
             {
-                mapViews.remove( MAX_DASHBOARD_ELEMENTS );
+                maps.remove( MAX_DASHBOARD_ELEMENTS );
             }
         }
     }
@@ -239,15 +240,15 @@
     @JsonProperty
     @JsonSerialize( contentAs = BaseIdentifiableObject.class )
     @JsonView( {DetailedView.class} )
-    @JacksonXmlElementWrapper( localName = "mapViews" )
-    @JacksonXmlProperty( localName = "mapView" )
-    public List<MapView> getMapViews()
+    @JacksonXmlElementWrapper( localName = "maps" )
+    @JacksonXmlProperty( localName = "map" )
+    public List<Map> getMaps()
     {
-        return mapViews;
+        return maps;
     }
 
-    public void setMapViews( List<MapView> mapViews )
+    public void setMaps( List<Map> maps )
     {
-        this.mapViews = mapViews;
+        this.maps = maps;
     }
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardContentStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardContentStore.java	2012-07-03 21:19:51 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardContentStore.java	2012-11-06 07:01:56 +0000
@@ -31,7 +31,7 @@
 
 import org.hisp.dhis.common.GenericStore;
 import org.hisp.dhis.document.Document;
-import org.hisp.dhis.mapping.MapView;
+import org.hisp.dhis.mapping.Map;
 import org.hisp.dhis.report.Report;
 import org.hisp.dhis.reporttable.ReportTable;
 
@@ -43,7 +43,7 @@
 {
     Collection<DashboardContent> getByDocument( Document document );
     
-    Collection<DashboardContent> getByMapView( MapView mapView );
+    Collection<DashboardContent> getByMap( Map map );
     
     Collection<DashboardContent> getByReport( Report report );
     

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardService.java	2012-10-05 16:00:19 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardService.java	2012-11-06 07:01:56 +0000
@@ -27,16 +27,16 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.Collection;
+import java.util.List;
+
 import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.document.Document;
-import org.hisp.dhis.mapping.MapView;
+import org.hisp.dhis.mapping.Map;
 import org.hisp.dhis.report.Report;
 import org.hisp.dhis.reporttable.ReportTable;
 import org.hisp.dhis.user.User;
 
-import java.util.Collection;
-import java.util.List;
-
 /**
  * @author Lars Helge Overland
  */
@@ -60,7 +60,7 @@
 
     Collection<DashboardContent> getByDocument( Document document );
     
-    Collection<DashboardContent> getByMapView( MapView mapView );
+    Collection<DashboardContent> getByMap( Map map );
     
     Collection<DashboardContent> getByReport( Report report );
     

=== 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	2012-11-03 20:54:57 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/interpretation/Interpretation.java	2012-11-06 07:01:56 +0000
@@ -27,12 +27,10 @@
  * 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.JacksonXmlElementWrapper;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
 import org.hisp.dhis.chart.Chart;
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.Dxf2Namespace;
@@ -41,16 +39,18 @@
 import org.hisp.dhis.common.view.ExportView;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.mapping.Map;
-import org.hisp.dhis.mapping.MapView;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.period.PeriodType;
 import org.hisp.dhis.reporttable.ReportTable;
 import org.hisp.dhis.user.User;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+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;
 
 /**
  * @author Lars Helge Overland

=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/comparator/MapViewNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/comparator/MapViewNameComparator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/comparator/MapViewNameComparator.java	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.mapping.comparator;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Comparator;
-
-import org.hisp.dhis.mapping.MapView;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class MapViewNameComparator
-    implements Comparator<MapView>
-{
-    public int compare( MapView mapView0, MapView mapView1 )
-    {
-        return mapView0.getName().compareToIgnoreCase( mapView1.getName() );
-    }
-}

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/DashboardContentDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/DashboardContentDeletionHandler.java	2012-07-03 21:19:51 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/DashboardContentDeletionHandler.java	2012-11-06 07:01:56 +0000
@@ -30,7 +30,7 @@
 import java.util.Collection;
 
 import org.hisp.dhis.document.Document;
-import org.hisp.dhis.mapping.MapView;
+import org.hisp.dhis.mapping.Map;
 import org.hisp.dhis.report.Report;
 import org.hisp.dhis.reporttable.ReportTable;
 import org.hisp.dhis.system.deletion.DeletionHandler;
@@ -97,13 +97,13 @@
     }
     
     @Override
-    public void deleteMapView( MapView mapView )
+    public void deleteMap( Map map )
     {
-        Collection<DashboardContent> contents = dashboardService.getByMapView( mapView );
+        Collection<DashboardContent> contents = dashboardService.getByMap( map );
         
         for ( DashboardContent content : contents )
         {
-            content.getMapViews().remove( mapView );
+            content.getMaps().remove( map );
             dashboardService.updateDashboardContent( content );
         }
     }

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/hibernate/HibernateDashboardContentStore.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/hibernate/HibernateDashboardContentStore.java	2012-07-03 21:19:51 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/hibernate/HibernateDashboardContentStore.java	2012-11-06 07:01:56 +0000
@@ -33,7 +33,7 @@
 import org.hisp.dhis.dashboard.DashboardContentStore;
 import org.hisp.dhis.document.Document;
 import org.hisp.dhis.hibernate.HibernateGenericStore;
-import org.hisp.dhis.mapping.MapView;
+import org.hisp.dhis.mapping.Map;
 import org.hisp.dhis.report.Report;
 import org.hisp.dhis.reporttable.ReportTable;
 
@@ -51,10 +51,10 @@
     }
 
     @SuppressWarnings("unchecked")
-    public Collection<DashboardContent> getByMapView( MapView mapView )
+    public Collection<DashboardContent> getByMap( Map map )
     {
-        String hql = "from DashboardContent dc where :mapView in elements(dc.mapViews)";
-        return getQuery( hql ).setEntity( "mapView", mapView ).list();
+        String hql = "from DashboardContent dc where :map in elements(dc.maps)";
+        return getQuery( hql ).setEntity( "map", map ).list();
     }    
 
     @SuppressWarnings("unchecked")

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/impl/DefaultDashboardService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/impl/DefaultDashboardService.java	2012-11-02 11:03:33 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/impl/DefaultDashboardService.java	2012-11-06 07:01:56 +0000
@@ -38,7 +38,7 @@
 import org.hisp.dhis.dashboard.DashboardService;
 import org.hisp.dhis.document.Document;
 import org.hisp.dhis.document.DocumentService;
-import org.hisp.dhis.mapping.MapView;
+import org.hisp.dhis.mapping.Map;
 import org.hisp.dhis.mapping.MappingService;
 import org.hisp.dhis.report.Report;
 import org.hisp.dhis.report.ReportService;
@@ -188,9 +188,9 @@
         return dashboardContentStore.getByDocument( document );
     }
     
-    public Collection<DashboardContent> getByMapView( MapView mapView )
+    public Collection<DashboardContent> getByMap( Map map )
     {
-        return dashboardContentStore.getByMapView( mapView );
+        return dashboardContentStore.getByMap( map );
     }
     
     public Collection<DashboardContent> getByReport( Report report )

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/provider/MapViewContentProvider.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/provider/MapViewContentProvider.java	2012-03-07 14:05:05 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/provider/MapViewContentProvider.java	2012-11-06 07:01:56 +0000
@@ -33,10 +33,9 @@
 import java.util.List;
 import java.util.Map;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dashboard.DashboardContent;
 import org.hisp.dhis.dashboard.DashboardService;
-import org.hisp.dhis.mapping.MapView;
-import org.hisp.dhis.mapping.comparator.MapViewNameComparator;
 import org.hisp.dhis.user.CurrentUserService;
 import org.hisp.dhis.user.User;
 
@@ -86,11 +85,11 @@
         {
             DashboardContent dashboardContent = dashboardService.getDashboardContent( user );
 
-            List<MapView> mapViews = new ArrayList<MapView>( dashboardContent.getMapViews() );
-
-            Collections.sort( mapViews, new MapViewNameComparator() );
-
-            content.put( key, mapViews );
+            List<org.hisp.dhis.mapping.Map> maps = new ArrayList<org.hisp.dhis.mapping.Map>( dashboardContent.getMaps() );
+
+            Collections.sort( maps, IdentifiableObjectNameComparator.INSTANCE );
+
+            content.put( key, maps );
         }
 
         return content;

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml	2012-10-14 18:31:58 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml	2012-11-06 07:01:56 +0000
@@ -186,7 +186,7 @@
   <bean id="mapViewContentProvider" class="org.hisp.dhis.dashboard.provider.MapViewContentProvider">
     <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
     <property name="dashboardService" ref="org.hisp.dhis.dashboard.DashboardService" />
-    <property name="key" value="mapViews" />
+    <property name="key" value="maps" />
   </bean>
 
   <bean id="rssHealthContentProvider" class="org.hisp.dhis.dashboard.provider.RssContentProvider">

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/dashboard/hibernate/DashboardContent.hbm.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/dashboard/hibernate/DashboardContent.hbm.xml	2012-03-12 21:35:41 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/dashboard/hibernate/DashboardContent.hbm.xml	2012-11-06 07:01:56 +0000
@@ -34,10 +34,10 @@
       <many-to-many column="reporttableid" class="org.hisp.dhis.reporttable.ReportTable" foreign-key="fk_dashboardcontent_reporttableid" />
     </list>
 
-    <list name="mapViews" table="dashboardcontent_mapviews">
-      <key column="userid" foreign-key="fk_dashboardcontent_mapviews_userid" />
+    <list name="maps" table="dashboardcontent_maps">
+      <key column="userid" foreign-key="fk_dashboardcontent_maps_userid" />
       <list-index column="sort_order" base="0" />
-      <many-to-many column="mapviewid" class="org.hisp.dhis.mapping.MapView" foreign-key="fk_dashboardcontent_mapviews_mapviewid" />
+      <many-to-many column="mapid" class="org.hisp.dhis.mapping.Map" foreign-key="fk_dashboardcontent_maps_mapid" />
     </list>
 
   </class>

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionHandler.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionHandler.java	2012-10-01 09:28:45 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionHandler.java	2012-11-06 07:01:56 +0000
@@ -53,6 +53,7 @@
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorGroupSet;
 import org.hisp.dhis.indicator.IndicatorType;
+import org.hisp.dhis.mapping.Map;
 import org.hisp.dhis.mapping.MapLegend;
 import org.hisp.dhis.mapping.MapLegendSet;
 import org.hisp.dhis.mapping.MapView;
@@ -477,6 +478,15 @@
         return null;
     }
 
+    public void deleteMap( Map map )
+    {
+    }
+    
+    public String allowDeleteMap( Map map )
+    {
+        return null;
+    }
+    
     public void deleteMapView( MapView mapView )
     {
     }

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/RemoveMapViewAction.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/RemoveMapViewAction.java	2012-10-03 15:43:35 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/RemoveMapViewAction.java	2012-11-06 07:01:56 +0000
@@ -29,7 +29,7 @@
 
 import org.hisp.dhis.dashboard.DashboardContent;
 import org.hisp.dhis.dashboard.DashboardService;
-import org.hisp.dhis.mapping.MapView;
+import org.hisp.dhis.mapping.Map;
 import org.hisp.dhis.mapping.MappingService;
 import org.hisp.dhis.user.CurrentUserService;
 import org.hisp.dhis.user.User;
@@ -90,9 +90,9 @@
         {
             DashboardContent content = dashboardService.getDashboardContent( user );
             
-            MapView mapView = mappingService.getMapView( id );
+            Map map = mappingService.getMap( id );
             
-            if ( content.getMapViews().remove( mapView ) )
+            if ( content.getMaps().remove( map ) )
             {
                 dashboardService.saveDashboardContent( content );
             }

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties	2012-10-16 12:18:26 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties	2012-11-06 07:01:56 +0000
@@ -7,7 +7,8 @@
 report=Reports
 document=Resources
 report_table=Report tables
-map_view=Map views
+map_view=Maps
+map=Maps
 this_is_a_link_area=This is a link area, click 'insert' and select links
 this_is_a_chart_area=This is a chart area, click 'insert' and select a chart
 insert_links_by_going_to=Insert links by going to

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml	2012-10-16 12:17:49 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml	2012-11-06 07:01:56 +0000
@@ -44,7 +44,7 @@
       <result name="success" type="redirect">index.action</result>
     </action>
 
-    <action name="removeMapView" class="org.hisp.dhis.dashboard.action.RemoveMapViewAction">
+    <action name="removeMap" class="org.hisp.dhis.dashboard.action.RemoveMapViewAction">
       <result name="success" type="redirect">index.action</result>
     </action>
     

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretationFeed.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretationFeed.vm	2012-10-07 19:07:53 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretationFeed.vm	2012-11-06 07:01:56 +0000
@@ -25,16 +25,17 @@
 	             src="../api/charts/${ip.chart.uid}/data?date=${format.formatDate( $ip.created )}&width=530&height=300" 
 	             onclick="javascript:window.location.href='../dhis-web-visualizer/app/index.html?id=${ip.chart.uid}&date=${format.formatDate( $ip.created )}'"
 	             title="$i18n.getString( 'click_to_view_in_data_visualizer' )">
-	    #elseif( $ip.mapViewInterpretation )
+	    #elseif( $ip.mapInterpretation )
 	        <a class="bold" 
 	           title="$i18n.getString( 'click_to_view_in_gis' )" 
-	           href="../dhis-web-mapping/mapping/index.html?id=${ip.mapView.uid}">$encoder.htmlEncode( $ip.mapView.name )</a>
+	           href="../dhis-web-mapping/mapping/app/index.html?id=${ip.map.uid}">
+	           $encoder.htmlEncode( $ip.map.name )</a>
 	    #elseif( $ip.reportTableInterpretation )
 	        #if( $ip.organisationUnit )#set( $ou = "&ou=" + $ip.organisationUnit.uid )#else#set( $ou = "" )#end
 	        <a class="bold"
 	           title="$i18n.getString( 'click_to_view_report_table' )" 
 	           href="../dhis-web-reporting/exportTable.action?uid=${ip.reportTable.uid}&pe=${format.formatDate( $ip.created )}${ou}">
-	            $encoder.htmlEncode( $ip.reportTable.name )</a>
+	           $encoder.htmlEncode( $ip.reportTable.name )</a>
 	    #elseif( $ip.dataSetReportInterpretation )
 	        <a class="bold"
 	           title="$i18n.getString( 'click_to_view_data_set_report' )"

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/map_view.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/map_view.vm	2012-06-07 14:16:27 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/map_view.vm	2012-11-06 07:01:56 +0000
@@ -1,22 +1,22 @@
 
 <table class="contentProviderTable">
     <tr>
-        <th colspan="2">$i18n.getString( "map_view" )</th>
+        <th colspan="2">$i18n.getString( "map" )</th>
     </tr>
-    #foreach ( $view in $mapViews )
+    #foreach ( $map in $maps )
     <tr>
         <td>
-            <a href="javascript:window.location.href='../dhis-web-mapping/mapping/index.html?id=${view.uid}'">$encoder.htmlEncode( $view.name )</a>
+            <a href="javascript:window.location.href='../dhis-web-mapping/app/index.html?id=${map.uid}'">$encoder.htmlEncode( $map.name )</a>
         </td>
         <td style="width:10px">
-            <a href="javascript:window.location.href='removeMapView.action?id=$view.id'" title="$i18n.getString( 'remove' )">
+            <a href="javascript:window.location.href='removeMap.action?id=$map.id'" title="$i18n.getString( 'remove' )">
             <img class="removeIcon" src="../images/hide.png" alt="$i18n.getString( 'remove' )"></a>
         </td>
     </tr>
     #end
 </table>
 
-#if( $mapViews.size() == 0 )
+#if( $maps.size() == 0 )
 <div class="labelText">$i18n.getString( "insert_links_by_going_to" ) 
-<a href="../dhis-web-mapping/mapping/index.html">$i18n.getString( "map_view" )</a></div>
+<a href="../dhis-web-mapping/app/index.html">$i18n.getString( "map" )</a></div>
 #end
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddMapViewToDashboardAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddMapViewToDashboardAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddMapViewToDashboardAction.java	2012-11-06 07:01:56 +0000
@@ -31,7 +31,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.hisp.dhis.dashboard.DashboardContent;
 import org.hisp.dhis.dashboard.DashboardService;
-import org.hisp.dhis.mapping.MapView;
+import org.hisp.dhis.mapping.Map;
 import org.hisp.dhis.mapping.MappingService;
 import org.hisp.dhis.user.CurrentUserService;
 import org.hisp.dhis.user.User;
@@ -76,9 +76,9 @@
     // Input
     // -------------------------------------------------------------------------
 
-    private Integer id;
+    private String id;
 
-    public void setId( Integer id )
+    public void setId( String id )
     {
         this.id = id;
     }
@@ -95,13 +95,13 @@
         {        
             DashboardContent content = dashboardService.getDashboardContent( user );
             
-            MapView mapView = mappingService.getMapView( id );
+            Map map = mappingService.getMap( id );
             
-            content.addMapView( mapView );
+            content.addMap( map );
             
             dashboardService.saveDashboardContent( content );
             
-            log.info( "Added mapview '" + mapView.getName() + "' to dashboard for user '" + user.getName() + "'" );
+            log.info( "Added mapview '" + map.getName() + "' to dashboard for user '" + user.getName() + "'" );
         }
         else
         {

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllMapViewsAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllMapViewsAction.java	2012-10-25 12:38:20 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetAllMapViewsAction.java	2012-11-06 07:01:56 +0000
@@ -31,9 +31,9 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.mapping.MapView;
 import org.hisp.dhis.mapping.MappingService;
-import org.hisp.dhis.mapping.comparator.MapViewNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -74,7 +74,7 @@
     {
         object = new ArrayList<MapView>( mappingService.getAllMapViews() );
 
-        Collections.sort( object, new MapViewNameComparator() );
+        Collections.sort( object, IdentifiableObjectNameComparator.INSTANCE );
 
         return SUCCESS;
     }