← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7467: Properly solved issue with removing dashboard content of user before delete

 

------------------------------------------------------------
revno: 7467
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2012-06-30 18:16:19 +0200
message:
  Properly solved issue with removing dashboard content of user before delete
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardService.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/impl/DefaultDashboardService.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/DashboardService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardService.java	2012-06-30 16:05:30 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/DashboardService.java	2012-06-30 16:16:19 +0000
@@ -46,4 +46,6 @@
     DashboardContent getDashboardContent( User user );
 
     Collection<DashboardContent> getAllDashboardContent();
+    
+    void deleteDashboardContent( DashboardContent content );
 }

=== 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-06-30 16:05:30 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/DashboardContentDeletionHandler.java	2012-06-30 16:16:19 +0000
@@ -32,6 +32,7 @@
 import org.hisp.dhis.report.Report;
 import org.hisp.dhis.reporttable.ReportTable;
 import org.hisp.dhis.system.deletion.DeletionHandler;
+import org.hisp.dhis.user.User;
 
 /**
  * @author Lars Helge Overland
@@ -103,4 +104,12 @@
             }
         }
     }
+    
+    @Override
+    public void deleteUser( User user )
+    {
+        DashboardContent content = dashboardService.getDashboardContent( user );
+        
+        dashboardService.deleteDashboardContent( content );
+    }
 }

=== 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-06-30 16:05:30 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dashboard/impl/DefaultDashboardService.java	2012-06-30 16:16:19 +0000
@@ -80,4 +80,9 @@
     {
         return dashboardContentStore.getAll();
     }
+    
+    public void deleteDashboardContent( DashboardContent content )
+    {
+        dashboardContentStore.delete( content );
+    }
 }