← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8585: Minor

 

------------------------------------------------------------
revno: 8585
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-10-18 23:27:32 +0200
message:
  Minor
modified:
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/GridUtils.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/ContextUtils.java
  dhis-2/dhis-web/dhis-web-api/src/main/resources/META-INF/dhis/beans.xml


--
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-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/GridUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/GridUtils.java	2012-10-18 19:13:26 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/GridUtils.java	2012-10-18 21:27:32 +0000
@@ -560,7 +560,7 @@
      */
     public static String getValue( TagNode cell )
     {
-        return cell.getFirstChild() != null ? cell.getFirstChild().getText().trim().replaceAll( "&nbsp;", "" ) : "";
+        return cell.getFirstChild() != null ? cell.getFirstChild().getText().trim().replaceAll( "&nbsp;", EMPTY ) : EMPTY;
     }
     
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/ContextUtils.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/ContextUtils.java	2012-10-17 17:04:50 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/ContextUtils.java	2012-10-18 21:27:32 +0000
@@ -143,32 +143,34 @@
         }
     }
 
-    public static void conflictResponse( HttpServletResponse response, String message )
-    {
-        response.setStatus( HttpServletResponse.SC_CONFLICT );
-        printResponse( response, message );
-    }
-
     public static void okResponse( HttpServletResponse response, String message )
     {
-        response.setStatus( HttpServletResponse.SC_OK );
-        printResponse( response, message );
+        setResponse( response, HttpServletResponse.SC_OK, message );
     }
 
     public static void createdResponse( HttpServletResponse response, String message )
     {
-        response.setStatus( HttpServletResponse.SC_CREATED );
-        printResponse( response, message );
+        setResponse( response, HttpServletResponse.SC_CREATED, message );
     }
 
     public static void notFoundResponse( HttpServletResponse response, String message )
     {
-        response.setStatus( HttpServletResponse.SC_NOT_FOUND );
-        printResponse( response, message );
-    }
-
-    private static void printResponse( HttpServletResponse response, String message )
-    {
+        setResponse( response, HttpServletResponse.SC_NOT_FOUND, message );
+    }
+
+    public static void conflictResponse( HttpServletResponse response, String message )
+    {
+        setResponse( response, HttpServletResponse.SC_CONFLICT, message );
+    }
+
+    public static void errorResponse( HttpServletResponse response, String message )
+    {
+        setResponse( response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, message );
+    }
+    
+    private static void setResponse( HttpServletResponse response, int statusCode, String message )
+    {
+        response.setStatus( statusCode );
         response.setContentType( CONTENT_TYPE_TEXT );
 
         try

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-api/src/main/resources/META-INF/dhis/beans.xml	2012-04-06 14:30:50 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/META-INF/dhis/beans.xml	2012-10-18 21:27:32 +0000
@@ -6,4 +6,5 @@
 	
   <bean id="contextUtils" class="org.hisp.dhis.api.utils.ContextUtils"/>
 
+  <bean id="restTemplate" class="org.springframework.web.client.RestTemplate"/>
 </beans>