← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17222: Mobile config, fixed NPE when saving data set for mobile

 

------------------------------------------------------------
revno: 17222
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-10-23 09:27:29 +0200
message:
  Mobile config, fixed NPE when saving data set for mobile
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/UpdateMobileDataSetAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/mobileDatasetList.vm
  tools/dhis-adhoc/src/main/java/org/hisp/dhis/adhoc/RunMe.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-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/UpdateMobileDataSetAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/UpdateMobileDataSetAction.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/UpdateMobileDataSetAction.java	2014-10-23 07:27:29 +0000
@@ -42,6 +42,7 @@
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
+    
     private DataSetService dataSetService;
 
     public void setDataSetService( DataSetService dataSetService )
@@ -52,6 +53,7 @@
     // -------------------------------------------------------------------------
     // Input/Output
     // -------------------------------------------------------------------------
+    
     private Collection<String> selectedList = new HashSet<>();
 
     public void setSelectedList( Collection<String> selectedList )
@@ -73,7 +75,8 @@
         DataSet dataset = null;
         for ( String id : selectedList )
         {
-            dataset = dataSetService.getDataSet( Integer.parseInt( id ) );
+            dataset = dataSetService.getDataSet( id );
+            
             if ( !dataset.isMobile() )
             {
                 dataset.setMobile( true );
@@ -83,7 +86,8 @@
      
         for ( String id : availableList )
         {
-            dataset = dataSetService.getDataSet( Integer.parseInt( id ) );
+            dataset = dataSetService.getDataSet( id );
+            
             if ( dataset.isMobile() )
             {
                 dataset.setMobile( false );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/mobileDatasetList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/mobileDatasetList.vm	2012-09-25 02:21:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/mobileDatasetList.vm	2014-10-23 07:27:29 +0000
@@ -39,7 +39,6 @@
 
     <tbody>
 		<tr>
-		  <!---->
 		  <td>
 		  	<select id="availableList" name="availableList" multiple="multiple" style="height: 200px; width: 100%;"></select>          
           </td>
@@ -54,7 +53,7 @@
         <td>
           <select id="selectedList" name="selectedList" multiple="multiple" style="height: 200px; width: 100%; margin-top: 22px;">
         	#foreach( $mobiledataset in $mobileDatasets )
-      			<option value="$mobiledataset.id">$encoder.htmlEncode( $mobiledataset.name )-Version $mobiledataset.version</option>
+      			<option value="$mobiledataset.uid">$encoder.htmlEncode( $mobiledataset.name )-Version $mobiledataset.version</option>
     		#end
           </select>
         </td>

=== modified file 'tools/dhis-adhoc/src/main/java/org/hisp/dhis/adhoc/RunMe.java'
--- tools/dhis-adhoc/src/main/java/org/hisp/dhis/adhoc/RunMe.java	2014-10-23 07:14:17 +0000
+++ tools/dhis-adhoc/src/main/java/org/hisp/dhis/adhoc/RunMe.java	2014-10-23 07:27:29 +0000
@@ -35,7 +35,7 @@
      */
     public static List<String> commands()
     {
-        return Arrays.asList( "analyticsTableGenerator" );
+        return Arrays.asList( "exampleCommand" );
     }
     
     public static void main( String[] args )