← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2114: Centralized request

 

------------------------------------------------------------
revno: 2114
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2010-11-20 09:35:36 +0100
message:
  Centralized request
removed:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/responseOrganisationUnitObject.vm
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/i18n/I18nFormat.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/Task.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/provider/AbstractDataSerializableConsumer.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/ActivityReportingServiceImpl.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/DefaultProgramService.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateReportAction.java
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/xmlOrganisationUnit.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/hierarchyOperations.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js


--
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/i18n/I18nFormat.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/i18n/I18nFormat.java	2010-10-25 07:05:55 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/i18n/I18nFormat.java	2010-11-20 08:35:36 +0000
@@ -160,12 +160,14 @@
 
         return commonFormatting( date, resourceBundle.getString( "format.datetime" ) );
     }
-    
-   
 
     public String formatPeriod( Period period )
     {
-
+        if ( period == null )
+        {
+            return null;
+        }
+        
         String typeName = period.getPeriodType().getName();
 
         String keyStartDate = "format." + typeName + ".startDate";
@@ -177,41 +179,6 @@
         return Character.toUpperCase( startDate.charAt( 0 ) ) + startDate.substring( 1 ) + endDate;
     }
     
-    
-    
-    /*
-
-    public String formatPeriod( Period period )
-    {
-        Date startdate = period.getStartDate();
-
-        if ( period.getPeriodType().getName().equals( QuarterlyPeriodType.NAME ) )
-        {
-
-            int year = startdate.getYear() + 1900;
-
-            Calendar c = Calendar.getInstance();
-            c.set( Calendar.YEAR, year );
-            c.set( Calendar.MONTH, Calendar.JANUARY );
-            c.set( Calendar.DATE, 1 );
-            
-            startdate = c.getTime();
-
-        }
-
-        String typeName = period.getPeriodType().getName();
-
-        String keyStartDate = "format." + typeName + ".startDate";
-        String keyEndDate = "format." + typeName + ".endDate";
-
-        String startDate = commonFormatting( startdate, resourceBundle.getString( keyStartDate ) );
-        String endDate = commonFormatting( period.getEndDate(), resourceBundle.getString( keyEndDate ) );
-
-        return Character.toUpperCase( startDate.charAt( 0 ) ) + startDate.substring( 1 ) + endDate;
-    }
-    
-    */
-
     // -------------------------------------------------------------------------
     // Support methods
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/Task.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/Task.java	2010-11-18 06:08:29 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/model/Task.java	2010-11-20 08:35:36 +0000
@@ -27,14 +27,9 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.io.ByteArrayOutputStream;
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.IOException;
-import java.io.OutputStream;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
 
 public class Task implements DataStreamSerializable
 {
@@ -90,6 +85,4 @@
         // Fixme
         
     }
-
-
 }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/provider/AbstractDataSerializableConsumer.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/provider/AbstractDataSerializableConsumer.java	2010-11-18 11:32:14 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/provider/AbstractDataSerializableConsumer.java	2010-11-20 08:35:36 +0000
@@ -33,18 +33,14 @@
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
 
-import javax.ws.rs.Consumes;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.Provider;
 
 import org.hisp.dhis.web.api.model.DataStreamSerializable;
 import org.hisp.dhis.web.api.resources.DhisMediaType;
 
-import com.sun.jersey.spi.resource.Singleton;
-
 /**
  * An abstract class mapping from the {@link DhisMediaType.MOBILE_SERIALIZED} to implementations of {@link DataStreamSerializable}
  * 
@@ -54,8 +50,6 @@
  */
 public abstract class AbstractDataSerializableConsumer<T extends DataStreamSerializable> implements MessageBodyReader<T>
 {
-
-
     @Override
     public boolean isReadable( Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType )
     {

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/ActivityReportingServiceImpl.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/ActivityReportingServiceImpl.java	2010-11-18 06:08:29 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/ActivityReportingServiceImpl.java	2010-11-20 08:35:36 +0000
@@ -319,7 +319,7 @@
 
                     dataValue = new PatientDataValue( programStageInstance, dataElement, cateOptCombo, orgUnit,
                         new Date(), value, false );
-                    ;
+                    
                     dataValueService.savePatientDataValue( dataValue );
                 }
             }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/DefaultProgramService.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/DefaultProgramService.java	2010-11-18 06:08:29 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/DefaultProgramService.java	2010-11-20 08:35:36 +0000
@@ -3,17 +3,15 @@
 import static org.hisp.dhis.i18n.I18nUtils.i18n;
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.List;
 import java.util.Locale;
 import java.util.Set;
 
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.user.CurrentUserService;
+import org.hisp.dhis.web.api.model.DataElement;
 import org.hisp.dhis.web.api.model.Model;
 import org.hisp.dhis.web.api.model.ModelList;
-import org.hisp.dhis.web.api.model.DataElement;
 import org.hisp.dhis.web.api.model.Program;
 import org.hisp.dhis.web.api.model.ProgramStage;
 import org.hisp.dhis.web.api.utils.LocaleUtil;

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateReportAction.java	2010-10-30 10:56:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateReportAction.java	2010-11-20 08:35:36 +0000
@@ -36,7 +36,6 @@
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.paging.ActionPagingSupport;
-import org.hisp.dhis.patient.Patient;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramInstance;
 import org.hisp.dhis.program.ProgramInstanceService;

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/xmlOrganisationUnit.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/xmlOrganisationUnit.vm	2010-03-18 09:31:22 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/xmlOrganisationUnit.vm	2010-11-20 08:35:36 +0000
@@ -9,6 +9,6 @@
     <active>$organisationUnit.active</active>
     <comment>$!encoder.xmlEncode( $organisationUnit.comment )</comment>
     <geoCode>$!encoder.xmlEncode( $organisationUnit.geoCode )</geoCode>
-    <latitude>$!encoder.xmlEncode( $organisationUnit.latitude )</latitude>
-    <longitude>$!encoder.xmlEncode( $organisationUnit.longitude )</longitude>
+	<url>$!encoder.xmlEncode( $organisationUnit.url )</url>
+    <lastUpdated>$!format.formatDate( $organisationUnit.lastUpdated )</lastUpdated>
 </organisationUnit>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/struts.xml	2010-09-14 09:03:41 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/resources/struts.xml	2010-11-20 08:35:36 +0000
@@ -30,14 +30,6 @@
 			<interceptor-ref name="organisationUnitTreeStack" />
 		</action>
 
-		<action name="getOrganisationUnit"
-			class="org.hisp.dhis.oum.action.organisationunit.GetOrganisationUnitAction">
-			<result name="success" type="velocity-xml">
-				/dhis-web-maintenance-organisationunit/responseOrganisationUnitObject.vm
-			</result>
-			<param name="onExceptionReturn">plainTextError</param>
-		</action>
-
 		<action name="validateOrganisationUnit"
 			class="org.hisp.dhis.oum.action.organisationunit.ValidateOrganisationUnitAction">
 			<result name="success" type="velocity-json">../dhis-web-commons/ajax/jsonResponseSuccess.vm

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/hierarchyOperations.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/hierarchyOperations.js	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/hierarchyOperations.js	2010-11-20 08:35:36 +0000
@@ -12,7 +12,7 @@
         var request = new Request();
         request.setResponseTypeXML( 'organisationUnit' );
         request.setCallbackSuccess( organisationUnitToMoveReceived );
-        request.send( 'getOrganisationUnit.action?id=' + orgUnitIds[0] );
+        request.send( '../dhis-web-commons-ajax/getOrganisationUnit.action?id=' + orgUnitIds[0] );
     }
 }
 
@@ -77,7 +77,7 @@
         var request = new Request();
         request.setResponseTypeXML( 'organisationUnit' );
         request.setCallbackSuccess( newParentOrganisationUnitReceived );
-        request.send( 'getOrganisationUnit.action?id=' + orgUnitIds[0] );
+        request.send( '../dhis-web-commons-ajax/getOrganisationUnit.action?id=' + orgUnitIds[0] );
     }
     else if ( orgUnitIds.length == 0 )
     {

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js	2010-09-09 09:38:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js	2010-11-20 08:35:36 +0000
@@ -16,7 +16,7 @@
     var request = new Request();
     request.setResponseTypeXML( 'organisationUnit' );
     request.setCallbackSuccess( organisationUnitReceived );
-    request.send( 'getOrganisationUnit.action?id=' + unitId );
+    request.send( '../dhis-web-commons-ajax/getOrganisationUnit.action?id=' + unitId );
 }
 
 function organisationUnitReceived( unitElement )

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/responseOrganisationUnitObject.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/responseOrganisationUnitObject.vm	2009-11-03 13:11:45 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/responseOrganisationUnitObject.vm	1970-01-01 00:00:00 +0000
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<organisationUnit>
-	<id>$organisationUnit.id</id>
-	<name>$encoder.xmlEncode( $organisationUnit.name )</name>
-	<shortName>$encoder.xmlEncode( $organisationUnit.shortName )</shortName>
-	<code>$!encoder.xmlEncode( $organisationUnit.code )</code>
-	<openingDate>$!format.formatDate( $organisationUnit.openingDate )</openingDate>
-	<closedDate>$!format.formatDate( $organisationUnit.closedDate )</closedDate>
-	<active>$organisationUnit.active</active>
-	<comment>$!encoder.xmlEncode( $organisationUnit.comment )</comment>
-	<url>$!encoder.xmlEncode( $organisationUnit.url )</url>
-    <lastUpdated>$!format.formatDate( $organisationUnit.lastUpdated )</lastUpdated>
-</organisationUnit>
\ No newline at end of file