← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5956: Improved Notifier

 

------------------------------------------------------------
revno: 5956
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-02-14 13:53:25 +0100
message:
  Improved Notifier
added:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/completed.png
modified:
  dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/notification/InMemoryNotifier.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/notification/Notification.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/notification/Notifier.java
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/htmlNotifications.vm


--
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-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java	2012-02-12 20:32:14 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java	2012-02-14 12:53:25 +0000
@@ -30,6 +30,7 @@
 import static org.hisp.dhis.setting.SystemSettingManager.DEFAULT_ORGUNITGROUPSET_AGG_LEVEL;
 import static org.hisp.dhis.setting.SystemSettingManager.KEY_ORGUNITGROUPSET_AGG_LEVEL;
 import static org.hisp.dhis.system.notification.NotificationCategory.DATAMART;
+import static org.hisp.dhis.system.notification.NotificationLevel.INFO;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -524,6 +525,6 @@
         
         clock.logTime( "Dropped crosstab table" );
         clock.logTime( "Data mart export process completed" );
-        notifier.notify( DATAMART, "Data mart process completed" );
+        notifier.notify( INFO, DATAMART, "Data mart process completed", true );
     }
 }

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/notification/InMemoryNotifier.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/notification/InMemoryNotifier.java	2012-02-12 20:32:14 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/notification/InMemoryNotifier.java	2012-02-14 12:53:25 +0000
@@ -56,13 +56,13 @@
     @Override
     public void notify( NotificationCategory category, String message )
     {
-        notify( NotificationLevel.INFO, category, message );
+        notify( NotificationLevel.INFO, category, message, false );
     }
     
     @Override
-    public void notify( NotificationLevel level, NotificationCategory category, String message )
+    public void notify( NotificationLevel level, NotificationCategory category, String message, boolean completed )
     {
-        Notification notification = new Notification( level, category, new Date(), message );
+        Notification notification = new Notification( level, category, new Date(), message, completed );
         
         notifications.add( 0, notification );
         

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/notification/Notification.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/notification/Notification.java	2012-02-12 20:32:14 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/notification/Notification.java	2012-02-14 12:53:25 +0000
@@ -45,6 +45,8 @@
     private Date time;
     
     private String message;
+    
+    private boolean completed;
 
     // -------------------------------------------------------------------------
     // Constructors
@@ -55,13 +57,14 @@
         this.uid = CodeGenerator.generateCode();
     }
 
-    public Notification( NotificationLevel level, NotificationCategory category, Date time, String message )
+    public Notification( NotificationLevel level, NotificationCategory category, Date time, String message, boolean completed )
     {
         this.uid = CodeGenerator.generateCode();
         this.level = level;
         this.category = category;
         this.time = time;
         this.message = message;
+        this.completed = completed;
     }
 
     // -------------------------------------------------------------------------
@@ -118,6 +121,16 @@
         this.message = message;
     }
 
+    public boolean isCompleted()
+    {
+        return completed;
+    }
+
+    public void setCompleted( boolean completed )
+    {
+        this.completed = completed;
+    }
+
     // -------------------------------------------------------------------------
     // equals, hashCode, toString
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/notification/Notifier.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/notification/Notifier.java	2012-02-12 20:32:14 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/notification/Notifier.java	2012-02-14 12:53:25 +0000
@@ -36,7 +36,7 @@
 {
     void notify( NotificationCategory category, String message );
     
-    void notify(  NotificationLevel level, NotificationCategory category, String message );
+    void notify(  NotificationLevel level, NotificationCategory category, String message, boolean completed );
     
     List<Notification> getNotifications( int max );
     

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/htmlNotifications.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/htmlNotifications.vm	2012-02-12 19:23:31 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/htmlNotifications.vm	2012-02-14 12:53:25 +0000
@@ -18,7 +18,8 @@
 #foreach( $notification in $notifications )
 <tr>
 	<td>${format.formatDateTime( $notification.time )}:</td>
-	<td>${encoder.htmlEncode( $notification.message )} #if( $velocityCount == 1 )&nbsp;&nbsp;<img src='../images/ajax-loader-bar.gif'>#end</td>
+	<td>${encoder.htmlEncode( $notification.message )} #if( $velocityCount == 1 )&nbsp;
+		#if( $notification.completed )<img src='../images/completed.png'>#else<img src='../images/ajax-loader-bar.gif'>#end#end</td>
 </tr>
 #end
 </table>

=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/completed.png'
Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/completed.png	1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/completed.png	2012-02-14 12:53:25 +0000 differ