← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3335: Added notification for new messages in dashboard front page

 

------------------------------------------------------------
revno: 3335
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-04-11 11:14:35 +0200
message:
  Added notification for new messages in dashboard front page
modified:
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/ProvideContentAction.java
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml
  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/webapp/dhis-web-dashboard-integration/mainForm.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-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/ProvideContentAction.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/ProvideContentAction.java	2011-04-07 08:52:20 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/ProvideContentAction.java	2011-04-11 09:14:35 +0000
@@ -37,6 +37,7 @@
 import org.hisp.dhis.chart.ChartService;
 import org.hisp.dhis.chart.comparator.ChartTitleComparator;
 import org.hisp.dhis.dashboard.DashboardManager;
+import org.hisp.dhis.message.MessageService;
 import org.hisp.dhis.options.UserSettingManager;
 
 import com.opensymphony.xwork2.Action;
@@ -74,6 +75,13 @@
         this.userSettingManager = userSettingManager;
     }
     
+    private MessageService messageService;
+
+    public void setMessageService( MessageService messageService )
+    {
+        this.messageService = messageService;
+    }
+
     // -------------------------------------------------------------------------
     // Output
     // -------------------------------------------------------------------------
@@ -98,6 +106,13 @@
     {
         return chartAreas;
     }
+    
+    private long messageCount;
+
+    public long getMessageCount()
+    {
+        return messageCount;
+    }
 
     // -------------------------------------------------------------------------
     // Action implementation
@@ -122,6 +137,8 @@
             chartAreas.add( content.get( DashboardManager.CHART_AREA_PREFIX + i ) );
         }
 
+        messageCount = messageService.getUnreadMessageCount();
+        
         return SUCCESS;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml	2011-04-06 11:39:06 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml	2011-04-11 09:14:35 +0000
@@ -12,6 +12,7 @@
     <property name="manager" ref="org.hisp.dhis.dashboard.DashboardManager"/>
     <property name="userSettingManager" ref="org.hisp.dhis.options.UserSettingManager" />
     <property name="chartService" ref="org.hisp.dhis.chart.ChartService"/>
+    <property name="messageService" ref="org.hisp.dhis.message.MessageService"/>
   </bean>
 
   <bean id="org.hisp.dhis.dashboard.action.SetAreaItemAction"

=== 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	2011-04-04 17:12:01 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties	2011-04-11 09:14:35 +0000
@@ -27,4 +27,5 @@
 mark_unread = Mark as unread
 operations = Operations
 read = Read
-confirm_delete_message = Are you sure you want to delete the message? 
\ No newline at end of file
+confirm_delete_message = Are you sure you want to delete the message?
+unread_messages = unread messages
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/mainForm.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/mainForm.vm	2011-04-07 08:52:20 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/mainForm.vm	2011-04-11 09:14:35 +0000
@@ -42,7 +42,7 @@
 </div>
 #end
 
-<h3>$i18n.getString( "dashboard" )</h3>
+<h3>$i18n.getString( "dashboard" ) #if( $messageCount > 0 )<a href="message.action">$messageCount $i18n.getString( "unread_messages" )</a>#end</h3>
 
 <table cellspacing="0" cellpadding="0" style="width:960px">
 <tr>