← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 233: Name property addition completed.

 

------------------------------------------------------------
revno: 233
committer: Jan Henrik Overland janhenrik.overland@xxxxxxxxx
branch nick: trunk
timestamp: Thu 2009-04-23 14:08:22 +0200
message:
  Name property addition completed.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MappingService.java
  dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java
  dhis-2/dhis-services/dhis-service-mapping/src/main/resources/org/hisp/dhis/mapping/hibernate/Map.hbm.xml

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MappingService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MappingService.java	2009-04-21 16:40:40 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MappingService.java	2009-04-23 12:08:22 +0000
@@ -66,7 +66,7 @@
      * @param zoom
      * @return a generated unique id of the added Map.
      */
-    int addMap( String mapLayerPath, int organisationUnitId, int organisationUnitLevelId, String uniqueColumn,
+    int addMap( String name, String mapLayerPath, int organisationUnitId, int organisationUnitLevelId, String uniqueColumn,
         String nameColumn, String longitude, String latitude, int zoom );
 
     /**
@@ -85,7 +85,7 @@
      * @param latitude
      * @param zoom
      */
-    void addOrUpdateMap( String mapLayerPath, int organisationUnitId, int organisationUnitLevelId, String uniqueColumn,
+    void addOrUpdateMap( String name, String mapLayerPath, int organisationUnitId, int organisationUnitLevelId, String uniqueColumn,
         String nameColumn, String longitude, String latitude, int zoom );
 
     /**

=== modified file 'dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java'
--- dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java	2009-04-21 16:40:40 +0000
+++ dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java	2009-04-23 12:08:22 +0000
@@ -82,7 +82,7 @@
         return mappingStore.addMap( map );
     }
 
-    public int addMap( String mapLayerPath, int organisationUnitId, int organisationUnitLevelId, String uniqueColumn,
+    public int addMap( String name, String mapLayerPath, int organisationUnitId, int organisationUnitLevelId, String uniqueColumn,
         String nameColumn, String longitude, String latitude, int zoom )
     {
         OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( organisationUnitId );
@@ -92,19 +92,20 @@
 
         Set<String> staticMapLayerPaths = null;
 
-        Map map = new Map( mapLayerPath, organisationUnit, organisationUnitLevel, uniqueColumn, nameColumn, longitude,
+        Map map = new Map( name, mapLayerPath, organisationUnit, organisationUnitLevel, uniqueColumn, nameColumn, longitude,
             latitude, zoom, staticMapLayerPaths );
 
         return addMap( map );
     }
 
-    public void addOrUpdateMap( String mapLayerPath, int organisationUnitId, int organisationUnitLevelId,
+    public void addOrUpdateMap( String name, String mapLayerPath, int organisationUnitId, int organisationUnitLevelId,
         String uniqueColumn, String nameColumn, String longitude, String latitude, int zoom )
     {
         Map map = getMapByMapLayerPath( mapLayerPath );
 
         if ( map != null )
         {
+            map.setNameColumn( name );
             map.setUniqueColumn( uniqueColumn );
             map.setNameColumn( nameColumn );
             map.setLongitude( longitude );
@@ -120,7 +121,7 @@
             OrganisationUnitLevel organisationUnitLevel = organisationUnitService
                 .getOrganisationUnitLevel( organisationUnitLevelId );
 
-            map = new Map( mapLayerPath, organisationUnit, organisationUnitLevel, uniqueColumn, nameColumn, longitude,
+            map = new Map( name, mapLayerPath, organisationUnit, organisationUnitLevel, uniqueColumn, nameColumn, longitude,
                 latitude, zoom, null );
 
             addMap( map );

=== modified file 'dhis-2/dhis-services/dhis-service-mapping/src/main/resources/org/hisp/dhis/mapping/hibernate/Map.hbm.xml'
--- dhis-2/dhis-services/dhis-service-mapping/src/main/resources/org/hisp/dhis/mapping/hibernate/Map.hbm.xml	2009-04-23 11:51:19 +0000
+++ dhis-2/dhis-services/dhis-service-mapping/src/main/resources/org/hisp/dhis/mapping/hibernate/Map.hbm.xml	2009-04-23 12:08:22 +0000
@@ -11,7 +11,7 @@
 			<generator class="native"/>
 		</id>
 			
-		<property name="name" column="name"/>	
+		<property name="name" column="name" unique="true"/>
 	
 		<property name="mapLayerPath" column="maplayerpath"/>
 			
@@ -29,7 +29,7 @@
 			
 		<property name="latitude" column="latitude"/>
 			
-		<property name="zoom" column="zoom"/>			
+		<property name="zoom" column="zoom"/>
 	
 	</class>
 	



--
Trunk
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.