← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15222: expose dataEntryForm in ProgramStage

 

------------------------------------------------------------
revno: 15222
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-05-12 09:16:07 +0200
message:
  expose dataEntryForm in ProgramStage
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/Calendar.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SystemController.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/calendar/Calendar.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/Calendar.java	2014-05-09 18:53:24 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/Calendar.java	2014-05-12 07:16:07 +0000
@@ -136,8 +136,8 @@
     DateInterval toInterval( DateUnit dateUnit, DateIntervalType type );
 
     /**
-     * Gets interval of type based on todays date
-     * @param type     Interval type to get
+     * Gets interval of type based on today's date
+     * @param type Interval type to get
      * @return Interval for interval type based on dateUnit
      * @see DateIntervalType
      */
@@ -145,7 +145,7 @@
 
     /**
      * Gets interval of type based on today's date
-     * @param type     Interval type to get
+     * @param type   Interval type to get
      * @param offset Offset to start at, can be negative of positive
      * @param length How many periods to asks for, i.e. type = MONTH, length = 2, two months
      * @return Interval for interval type based on dateUnit

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStage.java	2014-05-12 07:16:07 +0000
@@ -180,6 +180,9 @@
         this.reminders = reminders;
     }
 
+    @JsonProperty
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public DataEntryForm getDataEntryForm()
     {
         return dataEntryForm;

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SystemController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SystemController.java	2014-04-25 13:14:41 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/SystemController.java	2014-05-12 07:16:07 +0000
@@ -29,6 +29,9 @@
  */
 
 import org.hisp.dhis.api.utils.ContextUtils;
+import org.hisp.dhis.calendar.Calendar;
+import org.hisp.dhis.calendar.CalendarService;
+import org.hisp.dhis.calendar.DateIntervalType;
 import org.hisp.dhis.common.CodeGenerator;
 import org.hisp.dhis.dxf2.metadata.ImportSummary;
 import org.hisp.dhis.dxf2.utils.JacksonUtils;
@@ -76,6 +79,9 @@
     @Autowired
     private Notifier notifier;
 
+    @Autowired
+    private CalendarService calendarService;
+
     //--------------------------------------------------------------------------
     // UID Generator
     //--------------------------------------------------------------------------
@@ -104,6 +110,15 @@
             }
         }
 
+        Calendar calendar = calendarService.getSystemCalendar();
+        System.err.println( "Current Calendar: " + calendar.name() );
+        System.err.println( "Today: " + calendar.today() );
+
+        System.err.println( "Year: " + calendar.toInterval( DateIntervalType.ISO8601_YEAR, 0, 1 ) );
+        System.err.println( "Month: " + calendar.toInterval( DateIntervalType.ISO8601_MONTH, 0, 1 ) );
+        System.err.println( "Week: " + calendar.toInterval( DateIntervalType.ISO8601_WEEK, 0, 1 ) );
+        System.err.println( "Day: " + calendar.toInterval( DateIntervalType.ISO8601_DAY, 0, 1 ) );
+
         JacksonUtils.toJson( response.getOutputStream(), codes );
     }