dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #15586
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5680: (mobile) wip, messaging support + minor refactor
------------------------------------------------------------
revno: 5680
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-01-09 17:25:36 +0530
message:
(mobile) wip, messaging support + minor refactor
added:
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/action/MenuAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/message/
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/message/action/
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/message/action/GetMessage.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/message/action/GetMessages.java
dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/feedback.vm
dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/message.vm
dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/messages.vm
renamed:
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/action/settings/ => dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/settings/
modified:
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/settings/action/GetSettingsAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/settings/action/SaveSettingsFormAction.java
dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties
dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/menu.vm
dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/style/light.css
--
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
=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/action/MenuAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/action/MenuAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/action/MenuAction.java 2012-01-09 11:55:36 +0000
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2004-2012, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.hisp.dhis.light.action;
+
+import com.opensymphony.xwork2.Action;
+import org.hisp.dhis.message.MessageService;
+
+public class MenuAction
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private MessageService messageService;
+
+ public void setMessageService( MessageService messageService )
+ {
+ this.messageService = messageService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input & Output
+ // -------------------------------------------------------------------------
+
+ private long unreadMessageConversationCount;
+
+ public long getUnreadMessageConversationCount()
+ {
+ return unreadMessageConversationCount;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action Implementation
+ // -------------------------------------------------------------------------
+
+ @Override
+ public String execute()
+ {
+ unreadMessageConversationCount = messageService.getUnreadMessageConversationCount();
+
+ return SUCCESS;
+ }
+}
=== added directory 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/message'
=== added directory 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/message/action'
=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/message/action/GetMessage.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/message/action/GetMessage.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/message/action/GetMessage.java 2012-01-09 11:55:36 +0000
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2004-2012, University of Oslo
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+* * Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+* * Neither the name of the HISP project nor the names of its contributors may
+* be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package org.hisp.dhis.light.message.action;
+
+import com.opensymphony.xwork2.Action;
+import org.apache.struts2.ServletActionContext;
+import org.hisp.dhis.message.Message;
+import org.hisp.dhis.message.MessageConversation;
+import org.hisp.dhis.message.MessageService;
+import org.hisp.dhis.util.ContextUtils;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
+ */
+public class GetMessage
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private MessageService messageService;
+
+ public void setMessageService( MessageService messageService )
+ {
+ this.messageService = messageService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input & Output
+ // -------------------------------------------------------------------------
+
+ private String conversationId;
+
+ public void setConversationId( String conversationId )
+ {
+ this.conversationId = conversationId;
+ }
+
+ private String subject;
+
+ public String getSubject()
+ {
+ return subject;
+ }
+
+ private List<Message> messages;
+
+ public List<Message> getMessages()
+ {
+ return messages;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action Implementation
+ // -------------------------------------------------------------------------
+
+ @Override
+ public String execute() throws Exception
+ {
+ MessageConversation conversation = messageService.getMessageConversation( conversationId );
+
+ subject = conversation.getSubject();
+ messages = new ArrayList<Message>( conversation.getMessages() );
+ Collections.reverse( messages );
+
+ return SUCCESS;
+ }
+
+}
=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/message/action/GetMessages.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/message/action/GetMessages.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/message/action/GetMessages.java 2012-01-09 11:55:36 +0000
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2004-2012, University of Oslo
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+* * Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+* * Neither the name of the HISP project nor the names of its contributors may
+* be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package org.hisp.dhis.light.message.action;
+
+import com.opensymphony.xwork2.Action;
+import org.hisp.dhis.message.MessageConversation;
+import org.hisp.dhis.message.MessageService;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
+ */
+public class GetMessages
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private MessageService messageService;
+
+ public void setMessageService( MessageService messageService )
+ {
+ this.messageService = messageService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input & Output
+ // -------------------------------------------------------------------------
+
+ private List<MessageConversation> conversations;
+
+ public List<MessageConversation> getConversations()
+ {
+ return conversations;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action Implementation
+ // -------------------------------------------------------------------------
+
+ @Override
+ public String execute() throws Exception
+ {
+ conversations = new ArrayList<MessageConversation>( messageService.getMessageConversations( 0, 10 ) );
+
+ return SUCCESS;
+ }
+}
=== renamed directory 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/action/settings' => 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/settings'
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/settings/action/GetSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/action/settings/action/GetSettingsAction.java 2012-01-04 12:55:23 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/settings/action/GetSettingsAction.java 2012-01-09 11:55:36 +0000
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2004-2011, University of Oslo
+ * Copyright (c) 2004-2012, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,7 +26,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-package org.hisp.dhis.light.action.settings.action;
+package org.hisp.dhis.light.settings.action;
import com.opensymphony.xwork2.Action;
import org.apache.commons.lang.Validate;
@@ -38,7 +39,7 @@
import java.util.*;
/**
- * @author mortenoh
+ * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
*/
public class GetSettingsAction
implements Action
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/settings/action/SaveSettingsFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/action/settings/action/SaveSettingsFormAction.java 2012-01-04 12:55:23 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/settings/action/SaveSettingsFormAction.java 2012-01-09 11:55:36 +0000
@@ -25,7 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-package org.hisp.dhis.light.action.settings.action;
+package org.hisp.dhis.light.settings.action;
import com.opensymphony.xwork2.Action;
import org.apache.commons.lang.StringUtils;
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2012-01-05 20:39:23 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2012-01-09 11:55:36 +0000
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
+ xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
<bean id="org.hisp.dhis.light.action.NoAction" class="org.hisp.dhis.light.action.NoAction" />
@@ -11,52 +11,59 @@
<property name="dataValueService" ref="org.hisp.dhis.datavalue.DataValueService" />
<property name="stdDevOutlierAnalysisService" ref="org.hisp.dhis.dataanalysis.StdDevOutlierAnalysisService" />
<property name="minMaxOutlierAnalysisService" ref="org.hisp.dhis.dataanalysis.MinMaxOutlierAnalysisService" />
- <property name="minMaxValuesGenerationService" ref="org.hisp.dhis.minmax.validation.MinMaxValuesGenerationService" />
+ <property name="minMaxValuesGenerationService"
+ ref="org.hisp.dhis.minmax.validation.MinMaxValuesGenerationService" />
<property name="minMaxDataElementService" ref="org.hisp.dhis.minmax.MinMaxDataElementService" />
<property name="systemSettingManager" ref="org.hisp.dhis.options.SystemSettingManager" />
<property name="validationRuleService" ref="org.hisp.dhis.validation.ValidationRuleService" />
<property name="expressionService" ref="org.hisp.dhis.expression.ExpressionService" />
</bean>
- <bean id="org.hisp.dhis.light.dataentry.action.GetOrganisationUnitsAction" class="org.hisp.dhis.light.dataentry.action.GetOrganisationUnitsAction"
- scope="prototype">
- <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
- <property name="formUtils" ref="org.hisp.dhis.light.dataentry.utils.FormUtils" />
- </bean>
-
- <bean id="org.hisp.dhis.light.dataentry.action.GetDataSetsAction" class="org.hisp.dhis.light.dataentry.action.GetDataSetsAction"
- scope="prototype">
- <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
- <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
- </bean>
-
- <bean id="org.hisp.dhis.light.dataentry.action.GetPeriodsAction" class="org.hisp.dhis.light.dataentry.action.GetPeriodsAction"
- scope="prototype">
- <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
- <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
- <property name="registrationService" ref="org.hisp.dhis.dataset.CompleteDataSetRegistrationService" />
- </bean>
-
- <bean id="org.hisp.dhis.light.dataentry.action.GetDataSetOverviewAction" class="org.hisp.dhis.light.dataentry.action.GetDataSetOverviewAction"
- scope="prototype">
- <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
- <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
- <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
- <property name="registrationService" ref="org.hisp.dhis.dataset.CompleteDataSetRegistrationService" />
- <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
- <property name="formUtils" ref="org.hisp.dhis.light.dataentry.utils.FormUtils" />
- </bean>
-
- <bean id="org.hisp.dhis.light.dataentry.action.GetSectionFormAction" class="org.hisp.dhis.light.dataentry.action.GetSectionFormAction"
- scope="prototype">
- <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
- <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
- <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
- <property name="formUtils" ref="org.hisp.dhis.light.dataentry.utils.FormUtils" />
- </bean>
-
- <bean id="org.hisp.dhis.light.dataentry.action.SaveSectionFormAction" class="org.hisp.dhis.light.dataentry.action.SaveSectionFormAction"
- scope="prototype">
+ <bean id="org.hisp.dhis.light.dataentry.action.GetOrganisationUnitsAction"
+ class="org.hisp.dhis.light.dataentry.action.GetOrganisationUnitsAction"
+ scope="prototype">
+ <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+ <property name="formUtils" ref="org.hisp.dhis.light.dataentry.utils.FormUtils" />
+ </bean>
+
+ <bean id="org.hisp.dhis.light.dataentry.action.GetDataSetsAction"
+ class="org.hisp.dhis.light.dataentry.action.GetDataSetsAction"
+ scope="prototype">
+ <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+ <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+ </bean>
+
+ <bean id="org.hisp.dhis.light.dataentry.action.GetPeriodsAction"
+ class="org.hisp.dhis.light.dataentry.action.GetPeriodsAction"
+ scope="prototype">
+ <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+ <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+ <property name="registrationService" ref="org.hisp.dhis.dataset.CompleteDataSetRegistrationService" />
+ </bean>
+
+ <bean id="org.hisp.dhis.light.dataentry.action.GetDataSetOverviewAction"
+ class="org.hisp.dhis.light.dataentry.action.GetDataSetOverviewAction"
+ scope="prototype">
+ <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+ <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+ <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+ <property name="registrationService" ref="org.hisp.dhis.dataset.CompleteDataSetRegistrationService" />
+ <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+ <property name="formUtils" ref="org.hisp.dhis.light.dataentry.utils.FormUtils" />
+ </bean>
+
+ <bean id="org.hisp.dhis.light.dataentry.action.GetSectionFormAction"
+ class="org.hisp.dhis.light.dataentry.action.GetSectionFormAction"
+ scope="prototype">
+ <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+ <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+ <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+ <property name="formUtils" ref="org.hisp.dhis.light.dataentry.utils.FormUtils" />
+ </bean>
+
+ <bean id="org.hisp.dhis.light.dataentry.action.SaveSectionFormAction"
+ class="org.hisp.dhis.light.dataentry.action.SaveSectionFormAction"
+ scope="prototype">
<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
<property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
@@ -70,45 +77,63 @@
<!-- dashboard -->
- <bean id="org.hisp.dhis.light.dashboard.action.ProvideContentAction" class="org.hisp.dhis.light.dashboard.action.ProvideContentAction"
- scope="prototype">
+ <bean id="org.hisp.dhis.light.dashboard.action.ProvideContentAction"
+ class="org.hisp.dhis.light.dashboard.action.ProvideContentAction"
+ scope="prototype">
<property name="dashboardManager" ref="org.hisp.dhis.dashboard.DashboardManager" />
<property name="dashboardService" ref="org.hisp.dhis.dashboard.DashboardService" />
<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
</bean>
- <bean id="org.hisp.dhis.light.dashboard.action.GetReportAction" class="org.hisp.dhis.light.dashboard.action.GetReportAction"
- scope="prototype">
+ <bean id="org.hisp.dhis.light.dashboard.action.GetReportAction"
+ class="org.hisp.dhis.light.dashboard.action.GetReportAction"
+ scope="prototype">
<property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
</bean>
- <bean id="org.hisp.dhis.light.dashboard.action.GetChartAction" class="org.hisp.dhis.light.dashboard.action.GetChartAction"
- scope="prototype">
+ <bean id="org.hisp.dhis.light.dashboard.action.GetChartAction"
+ class="org.hisp.dhis.light.dashboard.action.GetChartAction"
+ scope="prototype">
<property name="chartService" ref="org.hisp.dhis.chart.ChartService" />
</bean>
- <bean id="org.hisp.dhis.light.dashboard.action.GetReportParamsAction" class="org.hisp.dhis.light.dashboard.action.GetReportParamsAction"
- scope="prototype">
+ <bean id="org.hisp.dhis.light.dashboard.action.GetReportParamsAction"
+ class="org.hisp.dhis.light.dashboard.action.GetReportParamsAction"
+ scope="prototype">
<property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
<property name="selectionTreeManager" ref="org.hisp.dhis.oust.manager.SelectionTreeManager" />
</bean>
<!-- Settings -->
- <bean id="org.hisp.dhis.light.action.settings.action.GetSettingsAction" class="org.hisp.dhis.light.action.settings.action.GetSettingsAction"
- scope="prototype">
+ <bean id="org.hisp.dhis.light.settings.action.GetSettingsAction"
+ class="org.hisp.dhis.light.settings.action.GetSettingsAction"
+ scope="prototype">
<property name="resourceBundleManager" ref="org.hisp.dhis.i18n.resourcebundle.ResourceBundleManager" />
<property name="localeManager" ref="org.hisp.dhis.i18n.locale.LocaleManager" />
<property name="i18nService" ref="org.hisp.dhis.i18n.I18nService" />
<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
</bean>
- <bean id="org.hisp.dhis.light.action.settings.action.SaveSettingsFormAction" class="org.hisp.dhis.light.action.settings.action.SaveSettingsFormAction"
- scope="prototype">
+ <bean id="org.hisp.dhis.light.settings.action.SaveSettingsFormAction"
+ class="org.hisp.dhis.light.settings.action.SaveSettingsFormAction"
+ scope="prototype">
<property name="localeManagerInterface" ref="org.hisp.dhis.i18n.locale.LocaleManager" />
<property name="localeManagerDB" ref="org.hisp.dhis.i18n.locale.LocaleManagerDb" />
<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
<property name="userService" ref="org.hisp.dhis.user.UserService" />
</bean>
-
+
+ <bean id="org.hisp.dhis.light.action.MenuAction" class="org.hisp.dhis.light.action.MenuAction">
+ <property name="messageService" ref="org.hisp.dhis.message.MessageService" />
+ </bean>
+
+ <bean id="org.hisp.dhis.light.message.action.GetMessages" class="org.hisp.dhis.light.message.action.GetMessages">
+ <property name="messageService" ref="org.hisp.dhis.message.MessageService" />
+ </bean>
+
+ <bean id="org.hisp.dhis.light.message.action.GetMessage" class="org.hisp.dhis.light.message.action.GetMessage">
+ <property name="messageService" ref="org.hisp.dhis.message.MessageService" />
+ </bean>
+
</beans>
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties 2011-12-27 12:16:47 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties 2012-01-09 11:55:36 +0000
@@ -40,3 +40,5 @@
mark_as_complete=Mark as complete
mark_as_not_complete=Mark as not complete
+
+messages=Messages
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml 2011-12-27 12:16:47 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml 2012-01-09 11:55:36 +0000
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
-"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
-"http://struts.apache.org/dtds/struts-2.0.dtd">
+ "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
+ "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="dhis-web-commons.xml" />
<package name="dhis-web-light" extends="dhis-web-commons" namespace="/mobile">
- <action name="index" class="org.hisp.dhis.light.action.NoAction">
+ <action name="index" class="org.hisp.dhis.light.action.MenuAction">
<result name="success" type="velocity">/dhis-web-light/main.vm</result>
<param name="page">/dhis-web-light/menu.vm</param>
</action>
@@ -87,14 +87,39 @@
<!-- Settings -->
- <action name="settings" class="org.hisp.dhis.light.action.settings.action.GetSettingsAction">
+ <action name="settings" class="org.hisp.dhis.light.settings.action.GetSettingsAction">
<result name="success" type="velocity">/dhis-web-light/main.vm</result>
<param name="page">/dhis-web-light/settings.vm</param>
</action>
- <action name="saveSettingsForm" class="org.hisp.dhis.light.action.settings.action.SaveSettingsFormAction">
- <result name="success" type="redirect">/mobile/index.action</result>
- </action>
-
+ <action name="saveSettingsForm" class="org.hisp.dhis.light.settings.action.SaveSettingsFormAction">
+ <result name="success" type="redirect">/mobile/index.action</result>
+ </action>
+
+ <!-- Messages -->
+
+ <action name="messages" class="org.hisp.dhis.light.message.action.GetMessages">
+ <result name="success" type="velocity">/dhis-web-light/main.vm</result>
+ <param name="page">/dhis-web-light/messages.vm</param>
+ </action>
+
+ <action name="reply" class="org.hisp.dhis.light.message.action.GetMessage">
+ <result name="success" type="velocity">/dhis-web-light/main.vm</result>
+ <param name="page">/dhis-web-light/message.vm</param>
+ </action>
+
+ <action name="sendReply" class="org.hisp.dhis.light.action.NoAction">
+ <result name="success" type="redirect">/mobile/messages.action</result>
+ </action>
+
+ <action name="feedback" class="org.hisp.dhis.light.action.NoAction">
+ <result name="success" type="velocity">/dhis-web-light/main.vm</result>
+ <param name="page">/dhis-web-light/feedback.vm</param>
+ </action>
+
+ <action name="sendFeedback" class="org.hisp.dhis.light.action.NoAction">
+ <result name="success" type="redirect">/mobile/index.action</result>
+ </action>
+
</package>
</struts>
=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/feedback.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/feedback.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/feedback.vm 2012-01-09 11:55:36 +0000
@@ -0,0 +1,10 @@
+
+<h2>$i18n.getString( "feedback" )</h2>
+
+<div id="footer">
+<h2>$i18n.getString( "navigate_to" )</h2>
+<ul>
+ <li><a href="messages.action">$i18n.getString("messages")</a></li>
+ <li><a href="index.action">$i18n.getString("home")</a></li>
+</ul>
+</div>
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/menu.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/menu.vm 2011-12-20 13:57:04 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/menu.vm 2012-01-09 11:55:36 +0000
@@ -3,6 +3,7 @@
<p>
<ul>
<li><a href="selectOrganisationUnit.action">$i18n.getString( "data_entry" )</a></li>
+ <li><a href="messages.action">$i18n.getString( "messages" ) #if($unreadMessageConversationCount > 0)($unreadMessageConversationCount)#end</a></li>
<li><a href="reports.action">$i18n.getString( "reports" )</a></li>
<li><a href="settings.action">$i18n.getString( "settings" )</a></li>
</ul>
=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/message.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/message.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/message.vm 2012-01-09 11:55:36 +0000
@@ -0,0 +1,27 @@
+
+<h2>$subject</h2>
+
+<form method="POST" action="sendReply.action">
+<div class="header-box" align="center">
+ <h3 style="text-align: left;">Reply</h3>
+ <p style="text-align: left;">
+ <input type="text" maxlength="255" size="24" name="text" />
+ <input type="submit" style="width: 100%;" value="$i18n.getString("send")" />
+ </p>
+</div>
+</form>
+
+#foreach( $message in $messages )
+<div class="header-box" align="center">
+ <h3 style="text-align: left;">Reply from $message.sender</h3>
+ <p style="text-align: left;">$message.text</p>
+</div>
+#end
+
+<div id="footer">
+<h2>$i18n.getString( "navigate_to" )</h2>
+<ul>
+ <li><a href="messages.action">$i18n.getString("messages")</a></li>
+ <li><a href="index.action">$i18n.getString("home")</a></li>
+</ul>
+</div>
=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/messages.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/messages.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/messages.vm 2012-01-09 11:55:36 +0000
@@ -0,0 +1,29 @@
+
+<h2>$i18n.getString( "feedback" )</h2>
+
+<p>
+<ul>
+ <li><a href="feedback.action">Write feedback</a></li>
+</ul>
+</p>
+
+<h2>$i18n.getString( "conversations" )</h2>
+
+<p>
+<ul>
+ #foreach( $conversation in $conversations )
+ #if( $conversation.read == false)
+ <li><a href="reply.action?conversationId=$conversation.uid" style="font-weight: bold;">$conversation.subject</a></li>
+ #else
+ <li><a href="reply.action?conversationId=$conversation.uid">$conversation.subject</a></li>
+ #end
+ #end
+</ul>
+</p>
+
+<div id="footer">
+<h2>$i18n.getString( "navigate_to" )</h2>
+<ul>
+ <li><a href="index.action">$i18n.getString("home")</a></li>
+</ul>
+</div>
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/style/light.css'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/style/light.css 2011-10-26 08:43:56 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/style/light.css 2012-01-09 11:55:36 +0000
@@ -135,7 +135,7 @@
padding-right: 0;
margin-bottom: 0;
margin-top: 0;
-
+
}
body div#footer ul li {
@@ -157,7 +157,7 @@
* BASIC ELEMENTS
*
*/
-
+
/*body required as early browsers don't understand p by itself */
body p {
margin-top: 0;
@@ -175,7 +175,7 @@
}
/*
* LINK STATES
- *
+ *
*/
a:link {
color:#003399;
@@ -199,7 +199,7 @@
body h1 {
font-size: 1.0em;
padding-left: 2%;
- padding-right: 2%;
+ padding-right: 2%;
margin-top: 0;
margin-bottom: 0.4em;
line-height: normal;
@@ -268,7 +268,7 @@
}
/*
* IMAGE WITH OPTIONAL CAPTION
- *
+ *
*/
body img.captioned {
margin: 0 0 0 2%;
@@ -282,7 +282,7 @@
}
/*
* BLOCKQUOTE
- *
+ *
*/
blockquote {
margin: 0 4% 0.4em 4%;
@@ -297,7 +297,7 @@
}
/*
* LISTS
- *
+ *
*/
/* compensates for smaller Opera Mini margins */
ol, ul, dl {
@@ -306,7 +306,7 @@
}
ul li {
- list-style-type: none;
+ list-style-type: none;
}
dd {
@@ -320,7 +320,7 @@
}
/*
* BREADCRUMBS
- *
+ *
*/
body ul.breadcrumbs {
padding-top: 0;
@@ -340,7 +340,7 @@
}
/*
* FORMS
- *
+ *
*/
body fieldset {
margin: 0;
@@ -366,7 +366,7 @@
font-size: 1.15em;
}
-body input {
+body input {
font-size: 1.15em;
padding: 0.2em;
margin-bottom: .5em;
@@ -387,7 +387,7 @@
display: block;
}
-body form input[type='radio'], body form input[type='checkbox'] {
+body form input[type='radio'], body form input[type='checkbox'] {
font-size: 1.15em;
margin:0.1em 0em;
padding: 0;
@@ -454,7 +454,7 @@
*/
body div.box p.box-text {
border: 1px solid #D8D8D8;
- width: 92%;
+ width: 96%;
margin: 0 auto 0.6em auto;
padding: 0.4em 0.4em;
background-color: #F6F6F6;
@@ -463,7 +463,7 @@
body div.header-box p {
font-size: 0.6em;
border: 1px solid #C8DBEA;
- width: 92%;
+ width: 96%;
margin: 0 auto 0.6em auto;
padding: 0.4em 0.4em;
background-color: #E8E8E8;
@@ -471,9 +471,9 @@
/* 2px border is required to ensure header is flush with the box */
body div.header-box h3 {
- font-size: 0.8em;
- border: 2px solid #D8D8D8;
- width: 92%;
+ font-size: 0.9em;
+ border: 2px solid #CBDDEB;
+ width: 96%;
margin: 0em auto;
padding: 0.3em 0.3em;
background-color: #CBDDEB;
@@ -482,7 +482,7 @@
/*
* BACK TO TOP/HOME
- *
+ *
*/
p.top {
font-size: small;
@@ -495,6 +495,7 @@
margin-bottom: 0.6em;
clear: both;
}
+
p.home {
font-size: small;
background-color: #F6F6F6;
@@ -506,6 +507,7 @@
margin-bottom: 0.6em;
clear: both;
}
+
p.top a, p.home a {
color: #333333;
text-decoration: none;