← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16089: Scheduling, replaced the option for last 6 months daily + last 6-12 months weekly with simply las...

 

------------------------------------------------------------
revno: 16089
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-07-11 21:12:01 +0200
message:
  Scheduling, replaced the option for last 6 months daily + last 6-12 months weekly with simply last year daily. Simplified code. Put data mart under more options link.
removed:
  dhis-2/dhis-api/src/test/java/org/hisp/dhis/dataentryform/
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/RelativePeriods.java
  dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/RelativePeriodTest.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/DataMartTask.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/SchedulingManager.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/scheduling/SchedulingManagerTest.java
  dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/scheduling/TaskTest.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/Scheduler.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ResourceTableController.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/scheduling/ScheduleTasksAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/scheduling.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewScheduledTasks.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-api/src/main/java/org/hisp/dhis/period/RelativePeriods.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/RelativePeriods.java	2014-05-23 15:37:38 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/RelativePeriods.java	2014-07-11 19:12:01 +0000
@@ -589,18 +589,18 @@
      * @param periodTypes a set of period type represented as names.
      * @return a list of periods.
      */
-    public List<Period> getLast6Months( Set<String> periodTypes )
+    public List<Period> getLast12Months( Set<String> periodTypes )
     {
         List<Period> periods = new ArrayList<Period>();
         
         Date date = subtractMonths( 1, new Date() );
         Date weekDate = subtractWeeks( 1, new Date() );
 
-        periods.addAll( periodTypes.contains( WeeklyPeriodType.NAME ) ? new WeeklyPeriodType().generateRollingPeriods( weekDate ).subList( 26, 52 ) : NO );
-        periods.addAll( periodTypes.contains( MonthlyPeriodType.NAME ) ? new MonthlyPeriodType().generateRollingPeriods( date ).subList( 6, 12 ) : NO );
-        periods.addAll( periodTypes.contains( BiMonthlyPeriodType.NAME ) ? new BiMonthlyPeriodType().generateRollingPeriods( date ).subList( 3, 6 ) : NO );
-        periods.addAll( periodTypes.contains( QuarterlyPeriodType.NAME ) ? new QuarterlyPeriodType().generateRollingPeriods( date ).subList( 2, 4 ) : NO );
-        periods.addAll( periodTypes.contains( SixMonthlyPeriodType.NAME ) ? new SixMonthlyPeriodType().generateRollingPeriods( date ).subList( 1, 2 ) : NO );        
+        periods.addAll( periodTypes.contains( WeeklyPeriodType.NAME ) ? new WeeklyPeriodType().generateRollingPeriods( weekDate ) : NO );
+        periods.addAll( periodTypes.contains( MonthlyPeriodType.NAME ) ? new MonthlyPeriodType().generateRollingPeriods( date ) : NO );
+        periods.addAll( periodTypes.contains( BiMonthlyPeriodType.NAME ) ? new BiMonthlyPeriodType().generateRollingPeriods( date ) : NO );
+        periods.addAll( periodTypes.contains( QuarterlyPeriodType.NAME ) ? new QuarterlyPeriodType().generateRollingPeriods( date ) : NO );
+        periods.addAll( periodTypes.contains( SixMonthlyPeriodType.NAME ) ? new SixMonthlyPeriodType().generateRollingPeriods( date ) : NO );        
         periods.addAll( periodTypes.contains( YearlyPeriodType.NAME ) ? new YearlyPeriodType().generateRollingPeriods( date ).subList( 4, 5 ) : NO );
         periods.addAll( periodTypes.contains( FinancialJulyPeriodType.NAME ) ? new FinancialJulyPeriodType().generateRollingPeriods( date ).subList( 4, 5 ) : NO );
         
@@ -608,30 +608,6 @@
     }
 
     /**
-     * Returns periods for the last 6 to 12 months based on the given period types.
-     * 
-     * @param periodTypes a set of period type represented as names.
-     * @return a list of periods.
-     */
-    public List<Period> getLast6To12Months( Set<String> periodTypes )
-    {
-        List<Period> periods = new ArrayList<Period>();
-
-        Date date = subtractMonths( 1, new Date() );
-        Date weekDate = subtractWeeks( 1, new Date() );
-
-        periods.addAll( periodTypes.contains( WeeklyPeriodType.NAME ) ? new WeeklyPeriodType().generateRollingPeriods( weekDate ).subList( 0, 26 ) : NO );
-        periods.addAll( periodTypes.contains( MonthlyPeriodType.NAME ) ? new MonthlyPeriodType().generateRollingPeriods( date ).subList( 0, 6 ) : NO );
-        periods.addAll( periodTypes.contains( BiMonthlyPeriodType.NAME ) ? new BiMonthlyPeriodType().generateRollingPeriods( date ).subList( 0, 3 ) : NO );
-        periods.addAll( periodTypes.contains( QuarterlyPeriodType.NAME ) ? new QuarterlyPeriodType().generateRollingPeriods( date ).subList( 0, 2 ) : NO );
-        periods.addAll( periodTypes.contains( SixMonthlyPeriodType.NAME ) ? new SixMonthlyPeriodType().generateRollingPeriods( date ).subList( 0, 1 ) : NO );        
-        periods.addAll( periodTypes.contains( YearlyPeriodType.NAME ) ? new YearlyPeriodType().generateRollingPeriods( date ).subList( 3, 4 ) : NO );
-        periods.addAll( periodTypes.contains( FinancialJulyPeriodType.NAME ) ? new FinancialJulyPeriodType().generateRollingPeriods( date ).subList( 3, 4 ) : NO );
-        
-        return periods;
-    }
-    
-    /**
      * Returns a list of relative periods. The name will be dynamic depending on
      * the dynamicNames argument. The short name will always be dynamic.
      *

=== removed directory 'dhis-2/dhis-api/src/test/java/org/hisp/dhis/dataentryform'
=== modified file 'dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/RelativePeriodTest.java'
--- dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/RelativePeriodTest.java	2014-06-27 10:41:42 +0000
+++ dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/RelativePeriodTest.java	2014-07-11 19:12:01 +0000
@@ -314,22 +314,7 @@
         periodTypes.add( YearlyPeriodType.NAME );
         periodTypes.add( FinancialJulyPeriodType.NAME );
 
-        List<Period> periods = new RelativePeriods().getLast6Months( periodTypes );
-
-        assertEquals( 14, periods.size() );
-
-        periods = new RelativePeriods().getLast6To12Months( periodTypes );
-
-        assertEquals( 14, periods.size() );
-
-        periodTypes.clear();
-        periodTypes.add( WeeklyPeriodType.NAME );
-
-        periods = new RelativePeriods().getLast6Months( periodTypes );
-
-        assertEquals( 26, periods.size() );
-
-        periods = new RelativePeriods().getLast6To12Months( periodTypes );
+        List<Period> periods = new RelativePeriods().getLast12Months( periodTypes );
 
         assertEquals( 26, periods.size() );
     }

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/DataMartTask.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/DataMartTask.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/DataMartTask.java	2014-07-11 19:12:01 +0000
@@ -32,7 +32,6 @@
 import static org.hisp.dhis.setting.SystemSettingManager.KEY_SCHEDULED_PERIOD_TYPES;
 import static org.hisp.dhis.system.notification.NotificationLevel.ERROR;
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.Set;
@@ -83,20 +82,6 @@
         this.periods = periods;
     }
     
-    private boolean last6Months;
-
-    public void setLast6Months( boolean last6Months )
-    {
-        this.last6Months = last6Months;
-    }
-
-    private boolean last6To12Months;
-
-    public void setLast6To12Months( boolean last6To12Months )
-    {
-        this.last6To12Months = last6To12Months;
-    }
-
     private TaskId taskId;
 
     public void setTaskId( TaskId taskId )
@@ -146,18 +131,6 @@
             return periods;
         }
         
-        List<Period> relatives =  new ArrayList<Period>();
-        
-        if  ( last6Months )
-        {
-            relatives.addAll( new RelativePeriods().getLast6Months( periodTypes ) );
-        }
-        
-        if ( last6To12Months )
-        {
-            relatives.addAll( new RelativePeriods().getLast6To12Months( periodTypes ) );
-        }
-        
-        return relatives;
+        return new RelativePeriods().getLast12Months( periodTypes );
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/SchedulingManager.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/SchedulingManager.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/SchedulingManager.java	2014-07-11 19:12:01 +0000
@@ -36,9 +36,7 @@
 public interface SchedulingManager
 {
     final String TASK_RESOURCE_TABLE = "resourceTableTask";
-    final String TASK_DATAMART_LAST_12_MONTHS = "dataMartLast12MonthsTask";
-    final String TASK_DATAMART_LAST_6_MONTHS = "dataMartLast6MonthsTask";
-    final String TASK_DATAMART_FROM_6_TO_12_MONTS = "dataMartFrom6To12MonthsTask";
+    final String TASK_DATAMART_LAST_YEAR = "dataMartLastYearTask";
     final String TASK_ANALYTICS_ALL = "analyticsAllTask";
     final String TASK_ANALYTICS_LAST_3_YEARS = "analyticsLast3YearsTask";
     final String TASK_MONITORING_LAST_DAY = "monitoringLastDayTask";

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml	2014-07-06 15:43:19 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml	2014-07-11 19:12:01 +0000
@@ -187,9 +187,7 @@
     <property name="tasks">
       <map>
         <entry key="resourceTableTask" value-ref="resourceTableTask" />
-        <entry key="dataMartLast12MonthsTask" value-ref="dataMartLast12MonthsTask" />
-        <entry key="dataMartLast6MonthsTask" value-ref="dataMartLast6MonthsTask" />
-        <entry key="dataMartFrom6To12MonthsTask" value-ref="dataMartFrom6To12MonthsTask" />
+        <entry key="dataMartLastYearTask" value-ref="dataMartLastYearTask" />
         <entry key="analyticsAllTask" value-ref="analyticsAllTask" />
         <entry key="analyticsLast3YearsTask" value-ref="analyticsLast3YearsTask" />
         <entry key="monitoringLastDayTask" value-ref="monitoringLastDayTask" />
@@ -199,18 +197,7 @@
 
   <!-- Scheduled tasks -->
 
-  <bean id="dataMartLast12MonthsTask" class="org.hisp.dhis.scheduling.DataMartTask">
-    <property name="last6Months" value="true" />
-    <property name="last6To12Months" value="true" />
-  </bean>
-
-  <bean id="dataMartLast6MonthsTask" class="org.hisp.dhis.scheduling.DataMartTask">
-    <property name="last6Months" value="true" />
-  </bean>
-
-  <bean id="dataMartFrom6To12MonthsTask" class="org.hisp.dhis.scheduling.DataMartTask">
-    <property name="last6To12Months" value="true" />
-  </bean>
+  <bean id="dataMartLastYearTask" class="org.hisp.dhis.scheduling.DataMartTask" />
 
   <bean id="org.hisp.dhis.common.ReportingIdentityPopulator" class="org.hisp.dhis.common.IdentityPopulator">
     <property name="name" value="ReportingIdentityPopulator" />

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/scheduling/SchedulingManagerTest.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/scheduling/SchedulingManagerTest.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/scheduling/SchedulingManagerTest.java	2014-07-11 19:12:01 +0000
@@ -29,10 +29,9 @@
  */
 
 import static org.hisp.dhis.scheduling.SchedulingManager.TASK_ANALYTICS_ALL;
-import static org.hisp.dhis.scheduling.SchedulingManager.TASK_DATAMART_LAST_6_MONTHS;
 import static org.hisp.dhis.scheduling.SchedulingManager.TASK_RESOURCE_TABLE;
-import static org.hisp.dhis.system.scheduling.Scheduler.CRON_DAILY_0AM_EXCEPT_SUNDAY;
-import static org.hisp.dhis.system.scheduling.Scheduler.CRON_WEEKLY_SUNDAY_0AM;
+import static org.hisp.dhis.scheduling.SchedulingManager.TASK_DATAMART_LAST_YEAR;
+import static org.hisp.dhis.system.scheduling.Scheduler.CRON_DAILY_0AM;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
@@ -55,19 +54,17 @@
     public void testScheduleTasks()
     {
         ListMap<String, String> cronKeyMap = new ListMap<String, String>();
-        cronKeyMap.putValue( CRON_DAILY_0AM_EXCEPT_SUNDAY, TASK_RESOURCE_TABLE );
-        cronKeyMap.putValue( CRON_DAILY_0AM_EXCEPT_SUNDAY, TASK_ANALYTICS_ALL );
-        cronKeyMap.putValue( CRON_WEEKLY_SUNDAY_0AM, TASK_DATAMART_LAST_6_MONTHS );
+        cronKeyMap.putValue( CRON_DAILY_0AM, TASK_RESOURCE_TABLE );
+        cronKeyMap.putValue( CRON_DAILY_0AM, TASK_ANALYTICS_ALL );
+        cronKeyMap.putValue( CRON_DAILY_0AM, TASK_DATAMART_LAST_YEAR );
                 
         schedulingManager.scheduleTasks( cronKeyMap );
         
         cronKeyMap = schedulingManager.getCronKeyMap();
         
-        assertEquals( 2, cronKeyMap.size() );
-        assertTrue( cronKeyMap.containsKey( CRON_DAILY_0AM_EXCEPT_SUNDAY ) );
-        assertTrue( cronKeyMap.containsKey( CRON_WEEKLY_SUNDAY_0AM ) );
-        assertEquals( 2, cronKeyMap.get( CRON_DAILY_0AM_EXCEPT_SUNDAY ).size() );
-        assertEquals( 1, cronKeyMap.get( CRON_WEEKLY_SUNDAY_0AM ).size() );
+        assertEquals( 1, cronKeyMap.size() );
+        assertTrue( cronKeyMap.containsKey( CRON_DAILY_0AM ) );
+        assertEquals( 3, cronKeyMap.get( CRON_DAILY_0AM ).size() );
         
         assertEquals( Scheduler.STATUS_RUNNING, schedulingManager.getTaskStatus() );
     }
@@ -76,8 +73,8 @@
     public void testStopTasks()
     {
         ListMap<String, String> cronKeyMap = new ListMap<String, String>();
-        cronKeyMap.putValue( CRON_DAILY_0AM_EXCEPT_SUNDAY, TASK_RESOURCE_TABLE );
-        cronKeyMap.putValue( CRON_DAILY_0AM_EXCEPT_SUNDAY, TASK_ANALYTICS_ALL );
+        cronKeyMap.putValue( CRON_DAILY_0AM, TASK_RESOURCE_TABLE );
+        cronKeyMap.putValue( CRON_DAILY_0AM, TASK_ANALYTICS_ALL );
 
         assertEquals( Scheduler.STATUS_NOT_STARTED, schedulingManager.getTaskStatus() );
         

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/scheduling/TaskTest.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/scheduling/TaskTest.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/scheduling/TaskTest.java	2014-07-11 19:12:01 +0000
@@ -61,28 +61,9 @@
         
         DataMartTask dataMartTask = new DataMartTask();
 
-        dataMartTask.setLast6Months( true );
-        dataMartTask.setLast6To12Months( true );
-
         List<Period> periods = dataMartTask.getPeriods( periodTypes );
         
         assertNotNull( periods );
-        assertEquals( 28, periods.size() ); // 12 + 6 + 4 + 2 + 1 + 1 
-        
-        dataMartTask.setLast6Months( true );
-        dataMartTask.setLast6To12Months( false );
-        
-        periods = dataMartTask.getPeriods( periodTypes );
-
-        assertNotNull( periods );
-        assertEquals( 14, periods.size() ); // 6 + 3 + 2 + 1 + 1 + 1
-        
-        dataMartTask.setLast6Months( false );
-        dataMartTask.setLast6To12Months( true );
-
-        periods = dataMartTask.getPeriods( periodTypes );
-        
-        assertNotNull( periods );
-        assertEquals( 14, periods.size() ); // 6 + 3 + 2 + 1 + 1 + 1
+        assertEquals( 26, periods.size() ); // 12 + 6 + 4 + 2 + 1 + 1 
     }
 }

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/Scheduler.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/Scheduler.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/Scheduler.java	2014-07-11 19:12:01 +0000
@@ -34,8 +34,6 @@
 public interface Scheduler
 {
     final String CRON_DAILY_0AM = "0 0 0 * * ?";
-    final String CRON_DAILY_0AM_EXCEPT_SUNDAY = "0 0 0 ? * 1-6";
-    final String CRON_WEEKLY_SUNDAY_0AM = "0 0 0 ? * 0";
     final String CRON_TEST = "0 * * * * ?";
     
     final String STATUS_RUNNING = "running";

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ResourceTableController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ResourceTableController.java	2014-05-22 12:40:24 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ResourceTableController.java	2014-07-11 19:12:01 +0000
@@ -58,8 +58,8 @@
     
     @Resource(name="analyticsAllTask")
     private AnalyticsTableTask analyticsTableTask;
-    
-    @Resource(name="dataMartLast12MonthsTask")
+
+    @Autowired
     private DataMartTask dataMartTask;
     
     @Autowired

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/scheduling/ScheduleTasksAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/scheduling/ScheduleTasksAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/scheduling/ScheduleTasksAction.java	2014-07-11 19:12:01 +0000
@@ -30,17 +30,14 @@
 
 import static org.hisp.dhis.scheduling.SchedulingManager.TASK_ANALYTICS_ALL;
 import static org.hisp.dhis.scheduling.SchedulingManager.TASK_ANALYTICS_LAST_3_YEARS;
-import static org.hisp.dhis.scheduling.SchedulingManager.TASK_DATAMART_FROM_6_TO_12_MONTS;
-import static org.hisp.dhis.scheduling.SchedulingManager.TASK_DATAMART_LAST_12_MONTHS;
-import static org.hisp.dhis.scheduling.SchedulingManager.TASK_DATAMART_LAST_6_MONTHS;
+import static org.hisp.dhis.scheduling.SchedulingManager.TASK_DATAMART_LAST_YEAR;
 import static org.hisp.dhis.scheduling.SchedulingManager.TASK_RESOURCE_TABLE;
 import static org.hisp.dhis.scheduling.SchedulingManager.TASK_MONITORING_LAST_DAY;
 import static org.hisp.dhis.setting.SystemSettingManager.DEFAULT_ORGUNITGROUPSET_AGG_LEVEL;
 import static org.hisp.dhis.setting.SystemSettingManager.DEFAULT_SCHEDULED_PERIOD_TYPES;
 import static org.hisp.dhis.setting.SystemSettingManager.KEY_ORGUNITGROUPSET_AGG_LEVEL;
 import static org.hisp.dhis.setting.SystemSettingManager.KEY_SCHEDULED_PERIOD_TYPES;
-import static org.hisp.dhis.system.scheduling.Scheduler.CRON_DAILY_0AM_EXCEPT_SUNDAY;
-import static org.hisp.dhis.system.scheduling.Scheduler.CRON_WEEKLY_SUNDAY_0AM;
+import static org.hisp.dhis.system.scheduling.Scheduler.CRON_DAILY_0AM;
 import static org.hisp.dhis.system.scheduling.Scheduler.STATUS_RUNNING;
 import static org.hisp.dhis.system.util.CollectionUtils.emptyIfNull;
 
@@ -66,8 +63,6 @@
 public class ScheduleTasksAction
     implements Action
 {
-    private static final String STRATEGY_LAST_12_DAILY = "last12Daily";
-    private static final String STRATEGY_LAST_6_DAILY_6_TO_12_WEEKLY = "last6Daily6To12Weekly";
     private static final String STRATEGY_ALL_DAILY = "allDaily";
     private static final String STRATEGY_LAST_3_YEARS_DAILY = "last3YearsDaily";
     
@@ -232,8 +227,7 @@
 
                 if ( STRATEGY_ALL_DAILY.equals( resourceTableStrategy ) )
                 {
-                    cronKeyMap.putValue( CRON_DAILY_0AM_EXCEPT_SUNDAY, TASK_RESOURCE_TABLE );
-                    cronKeyMap.putValue( CRON_WEEKLY_SUNDAY_0AM, TASK_RESOURCE_TABLE );
+                    cronKeyMap.putValue( CRON_DAILY_0AM, TASK_RESOURCE_TABLE );
                 }
                 
                 // -------------------------------------------------------------
@@ -242,28 +236,20 @@
 
                 if ( STRATEGY_ALL_DAILY.equals( analyticsStrategy ) )
                 {
-                    cronKeyMap.putValue( CRON_DAILY_0AM_EXCEPT_SUNDAY, TASK_ANALYTICS_ALL );
-                    cronKeyMap.putValue( CRON_WEEKLY_SUNDAY_0AM, TASK_ANALYTICS_ALL );
+                    cronKeyMap.putValue( CRON_DAILY_0AM, TASK_ANALYTICS_ALL );
                 }
                 else if ( STRATEGY_LAST_3_YEARS_DAILY.equals( analyticsStrategy ) )
                 {
-                    cronKeyMap.putValue( CRON_DAILY_0AM_EXCEPT_SUNDAY, TASK_ANALYTICS_LAST_3_YEARS );
-                    cronKeyMap.putValue( CRON_WEEKLY_SUNDAY_0AM, TASK_ANALYTICS_LAST_3_YEARS );
+                    cronKeyMap.putValue( CRON_DAILY_0AM, TASK_ANALYTICS_LAST_3_YEARS );
                 }
                 
                 // -------------------------------------------------------------
                 // Data mart
                 // -------------------------------------------------------------
                 
-                if ( STRATEGY_LAST_12_DAILY.equals( dataMartStrategy ) )
-                {
-                    cronKeyMap.putValue( CRON_DAILY_0AM_EXCEPT_SUNDAY, TASK_DATAMART_LAST_12_MONTHS );
-                    cronKeyMap.putValue( CRON_WEEKLY_SUNDAY_0AM, TASK_DATAMART_LAST_12_MONTHS );
-                }
-                else if ( STRATEGY_LAST_6_DAILY_6_TO_12_WEEKLY.equals( dataMartStrategy ) )
-                {
-                    cronKeyMap.putValue( CRON_DAILY_0AM_EXCEPT_SUNDAY, TASK_DATAMART_LAST_6_MONTHS );
-                    cronKeyMap.putValue( CRON_WEEKLY_SUNDAY_0AM, TASK_DATAMART_FROM_6_TO_12_MONTS );
+                if ( STRATEGY_ALL_DAILY.equals( dataMartStrategy ) )
+                {
+                    cronKeyMap.putValue( CRON_DAILY_0AM, TASK_DATAMART_LAST_YEAR );
                 }
 
                 // -------------------------------------------------------------
@@ -272,8 +258,7 @@
                 
                 if ( STRATEGY_ALL_DAILY.equals( monitoringStrategy ) )
                 {
-                    cronKeyMap.putValue( CRON_DAILY_0AM_EXCEPT_SUNDAY, TASK_MONITORING_LAST_DAY );
-                    cronKeyMap.putValue( CRON_WEEKLY_SUNDAY_0AM, TASK_MONITORING_LAST_DAY );
+                    cronKeyMap.putValue( CRON_DAILY_0AM, TASK_MONITORING_LAST_DAY );
                 }
                 
                 schedulingManager.scheduleTasks( cronKeyMap );
@@ -281,7 +266,7 @@
         }
         else
         {
-            Collection<String> keys = emptyIfNull( schedulingManager.getCronKeyMap().get( CRON_DAILY_0AM_EXCEPT_SUNDAY ) );
+            Collection<String> keys = emptyIfNull( schedulingManager.getCronKeyMap().get( CRON_DAILY_0AM ) );
             
             // -----------------------------------------------------------------
             // Resource tables
@@ -309,13 +294,9 @@
             // Data mart
             // -----------------------------------------------------------------
 
-            if ( keys.contains( TASK_DATAMART_LAST_12_MONTHS ) )
-            {
-                dataMartStrategy = STRATEGY_LAST_12_DAILY;
-            }
-            else if ( keys.contains( TASK_DATAMART_LAST_6_MONTHS ) )
-            {
-                dataMartStrategy = STRATEGY_LAST_6_DAILY_6_TO_12_WEEKLY;
+            if ( keys.contains( TASK_DATAMART_LAST_YEAR ) )
+            {
+                dataMartStrategy = STRATEGY_ALL_DAILY;
             }
 
             // -------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties	2014-06-25 03:57:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties	2014-07-11 19:12:01 +0000
@@ -346,4 +346,7 @@
 data_monitoring=Data monitoring
 data_monitoring_strategy=Data monitoring strategy
 last_hour=Last hour
-data_set=Data Set
\ No newline at end of file
+data_set=Data Set
+last_year_daily=Last year daily
+show_fewer_options=Show fewer options
+show_more_options=Show more options
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/scheduling.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/scheduling.js	2013-03-06 10:51:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/scheduling.js	2014-07-11 19:12:01 +0000
@@ -32,4 +32,10 @@
 	{
 		$( '.dataMart' ).removeAttr( 'disabled' );
 	}
+}
+
+function toggleMoreOptions()
+{
+	$( "#moreOptionsLink" ).toggle();
+	$( "#moreOptionsDiv" ).toggle();
 }
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewScheduledTasks.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewScheduledTasks.vm	2014-05-04 12:21:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewScheduledTasks.vm	2014-07-11 19:12:01 +0000
@@ -28,11 +28,27 @@
 <select id="analyticsStrategy" name="analyticsStrategy" class="scheduling">
     <option value="never">$i18n.getString( "never" )</option>
     <option value="allDaily"#if( $analyticsStrategy && $analyticsStrategy == "allDaily" ) selected="selected"#end>$i18n.getString( "all_daily" )</option>
-    <option value="last2YearsDaily"#if( $analyticsStrategy && $analyticsStrategy == "last2YearsDaily" ) selected="selected"#end>$i18n.getString( "last_2_years_daily" )</option>
     <option value="last3YearsDaily"#if( $analyticsStrategy && $analyticsStrategy == "last3YearsDaily" ) selected="selected"#end>$i18n.getString( "last_3_years_daily" )</option>
 </select>
 </div>
 
+<!-- Monitoring -->
+
+<div class="settingHeader">$i18n.getString( "data_monitoring" )</div>
+
+<div class="settingLabel settingIndent">$i18n.getString( "data_monitoring_strategy" )</div>
+
+<div class="setting settingIndent">
+<select id="monitoringStrategy" name="monitoringStrategy" class="scheduling">
+    <option value="never">$i18n.getString( "never" )</option>
+    <option value="allDaily"#if( $monitoringStrategy && $monitoringStrategy == "allDaily" ) selected="selected"#end>$i18n.getString( "all_daily" )</option>
+</select>
+</div>
+
+<div id="moreOptionsLink" style="margin-bottom:10px"><a href="javascript:toggleMoreOptions()">$i18n.getString( "show_more_options" )</a></div>
+
+<div style="display:none" id="moreOptionsDiv">
+
 <!-- Data mart -->
 
 <div class="settingHeader">$i18n.getString( "data_mart" )</div>
@@ -42,8 +58,7 @@
 <div class="setting settingIndent">
 <select id="dataMartStrategy" name="dataMartStrategy" class="scheduling" onchange="toggleDataMart()">
     <option value="never">$i18n.getString( "never" )</option>
-    <option value="last12Daily"#if( $dataMartStrategy && $dataMartStrategy == "last12Daily" ) selected="selected"#end>$i18n.getString( "last_12_months_daily" )</option>
-    <option value="last6Daily6To12Weekly"#if( $dataMartStrategy && $dataMartStrategy == "last6Daily6To12Weekly" ) selected="selected"#end>$i18n.getString( "last_6_months_daily_6_to_12_months_weekly" )</option>       
+    <option value="allDaily"#if( $dataMartStrategy && $dataMartStrategy == "allDaily" ) selected="selected"#end>$i18n.getString( "last_year_daily" )</option>
 </select>
 </div>
 
@@ -71,19 +86,12 @@
 </select>
 </div>
 
-<!-- Monitoring -->
-
-<div class="settingHeader">$i18n.getString( "data_monitoring" )</div>
-
-<div class="settingLabel settingIndent">$i18n.getString( "data_monitoring_strategy" )</div>
-
-<div class="setting settingIndent">
-<select id="monitoringStrategy" name="monitoringStrategy" class="scheduling">
-    <option value="never">$i18n.getString( "never" )</option>
-    <option value="allDaily"#if( $monitoringStrategy && $monitoringStrategy == "allDaily" ) selected="selected"#end>$i18n.getString( "all_daily" )</option>
-</select>
+<div style="margin-bottom:10px"><a href="javascript:toggleMoreOptions()">$i18n.getString( "show_fewer_options" )</a></div>
+
 </div>
 
+<!-- Submit -->
+
 <div class="setting">
 	<input type="button" style="width:140px" onclick="submitSchedulingForm()"
 	#if ( $running )