← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17432: updates to controllers, removing unused deps, syntax updates

 

------------------------------------------------------------
revno: 17432
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-11-11 18:36:06 +0545
message:
  updates to controllers, removing unused deps, syntax updates
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AccountController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AppController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ChartController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ConfigurationController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DashboardController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataValueController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DimensionController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/EmailController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/FileController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/I18nController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/IdentifiableObjectController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/LocaleController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/MenuController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/MetaDataController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/PdfFormController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ReportController.java
  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/SharingController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SynchronizationController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/organisationunit/OrganisationUnitLocationController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/CurrentUserController.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-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AccountController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AccountController.java	2014-09-30 12:29:45 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AccountController.java	2014-11-11 12:51:06 +0000
@@ -304,7 +304,7 @@
             return;
         }
 
-        if ( password.trim().equals( username.trim() ) )
+        if ( password.trim().equals( username != null ? username.trim() : null ) )
         {
             ContextUtils.badRequestResponse( response, "Password cannot be equal to username" );
             return;

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AppController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AppController.java	2014-07-08 16:48:00 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AppController.java	2014-11-11 12:51:06 +0000
@@ -29,11 +29,11 @@
  */
 
 import com.google.common.collect.Lists;
-import org.hisp.dhis.webapi.utils.ContextUtils;
 import org.hisp.dhis.appmanager.App;
 import org.hisp.dhis.appmanager.AppManager;
 import org.hisp.dhis.dxf2.utils.JacksonUtils;
 import org.hisp.dhis.system.util.DateUtils;
+import org.hisp.dhis.webapi.utils.ContextUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.io.DefaultResourceLoader;
 import org.springframework.core.io.Resource;

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ChartController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ChartController.java	2014-10-23 10:07:41 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ChartController.java	2014-11-11 12:51:06 +0000
@@ -28,17 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static org.hisp.dhis.common.DimensionalObjectUtils.getUniqueDimensions;
-import static org.hisp.dhis.common.DimensionalObjectUtils.toDimension;
-import static org.hisp.dhis.webapi.utils.ContextUtils.DATE_PATTERN;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Date;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 import org.hisp.dhis.chart.Chart;
 import org.hisp.dhis.chart.ChartService;
 import org.hisp.dhis.common.DimensionService;
@@ -69,6 +58,16 @@
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Date;
+
+import static org.hisp.dhis.common.DimensionalObjectUtils.getUniqueDimensions;
+import static org.hisp.dhis.common.DimensionalObjectUtils.toDimension;
+import static org.hisp.dhis.webapi.utils.ContextUtils.DATE_PATTERN;
+
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  * @author Lars Helge Overland

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ConfigurationController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ConfigurationController.java	2014-05-22 12:40:24 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ConfigurationController.java	2014-11-11 12:51:06 +0000
@@ -28,8 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import javax.servlet.http.HttpServletRequest;
-
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.configuration.ConfigurationService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -38,6 +36,8 @@
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 
+import javax.servlet.http.HttpServletRequest;
+
 /**
  * @author Lars Helge Overland
  */
@@ -47,7 +47,7 @@
 {
     @Autowired
     private ConfigurationService configurationService;
-    
+
     @RequestMapping( value = "/systemId", method = RequestMethod.GET )
     private String getSystemId( Model model, HttpServletRequest request )
     {
@@ -55,13 +55,13 @@
     }
 
     @RequestMapping( value = "/feedbackRecipients", method = RequestMethod.GET )
-    private String getFeedbackRecipients(  Model model, HttpServletRequest request )
+    private String getFeedbackRecipients( Model model, HttpServletRequest request )
     {
         return setModel( model, configurationService.getConfiguration().getFeedbackRecipients() );
     }
-    
+
     @RequestMapping( value = "/offlineOrganisationUnitLevel", method = RequestMethod.GET )
-    private String getOfflineOrganisationUnitLevel(  Model model, HttpServletRequest request )
+    private String getOfflineOrganisationUnitLevel( Model model, HttpServletRequest request )
     {
         return setModel( model, configurationService.getConfiguration().getOfflineOrganisationUnitLevel() );
     }
@@ -77,7 +77,7 @@
     {
         String name = configurationService.getConfiguration().getInfrastructuralPeriodTypeDefaultIfNull().getName();
         BaseIdentifiableObject entity = new BaseIdentifiableObject( name, name, name );
-        
+
         return setModel( model, entity );
     }
 

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DashboardController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DashboardController.java	2014-10-23 10:07:41 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DashboardController.java	2014-11-11 12:51:06 +0000
@@ -28,16 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static org.hisp.dhis.dashboard.Dashboard.MAX_ITEMS;
-
-import java.io.InputStream;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.dashboard.Dashboard;
 import org.hisp.dhis.dashboard.DashboardItem;
@@ -57,19 +47,28 @@
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import static org.hisp.dhis.dashboard.Dashboard.MAX_ITEMS;
+
 /**
  * @author Lars Helge Overland
  */
 @Controller
-@RequestMapping(value = DashboardSchemaDescriptor.API_ENDPOINT)
+@RequestMapping( value = DashboardSchemaDescriptor.API_ENDPOINT )
 public class DashboardController
     extends AbstractCrudController<Dashboard>
 {
     @Autowired
     private DashboardService dashboardService;
 
-    @RequestMapping(value = "/q/{query}", method = RequestMethod.GET)
-    public String search( @PathVariable String query, @RequestParam(required = false) Set<String> max,
+    @RequestMapping( value = "/q/{query}", method = RequestMethod.GET )
+    public String search( @PathVariable String query, @RequestParam( required = false ) Set<String> max,
         Model model, HttpServletResponse response ) throws Exception
     {
         DashboardSearchResult result = dashboardService.search( query, max );
@@ -80,7 +79,7 @@
     }
 
     @Override
-    @RequestMapping(method = RequestMethod.POST, consumes = "application/json")
+    @RequestMapping( method = RequestMethod.POST, consumes = "application/json" )
     public void postJsonObject( HttpServletResponse response, HttpServletRequest request, InputStream input ) throws Exception
     {
         Dashboard dashboard = JacksonUtils.fromJson( input, Dashboard.class );
@@ -92,8 +91,8 @@
     }
 
     @Override
-    @RequestMapping(value = "/{uid}", method = RequestMethod.PUT, consumes = "application/json")
-    public void putJsonObject( HttpServletResponse response, HttpServletRequest request, @PathVariable("uid") String uid, InputStream input ) throws Exception
+    @RequestMapping( value = "/{uid}", method = RequestMethod.PUT, consumes = "application/json" )
+    public void putJsonObject( HttpServletResponse response, HttpServletRequest request, @PathVariable( "uid" ) String uid, InputStream input ) throws Exception
     {
         Dashboard dashboard = dashboardService.getDashboard( uid );
 

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataValueController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataValueController.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataValueController.java	2014-11-11 12:51:06 +0000
@@ -29,8 +29,6 @@
  */
 
 import org.apache.commons.lang.StringUtils;
-import org.hisp.dhis.webapi.utils.ContextUtils;
-import org.hisp.dhis.webapi.utils.InputUtils;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
@@ -44,6 +42,8 @@
 import org.hisp.dhis.period.PeriodType;
 import org.hisp.dhis.system.util.ValidationUtils;
 import org.hisp.dhis.user.CurrentUserService;
+import org.hisp.dhis.webapi.utils.ContextUtils;
+import org.hisp.dhis.webapi.utils.InputUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Controller;

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DimensionController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DimensionController.java	2014-07-30 09:46:29 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DimensionController.java	2014-11-11 12:51:06 +0000
@@ -28,14 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 import org.hisp.dhis.common.DimensionService;
 import org.hisp.dhis.common.DimensionalObject;
 import org.hisp.dhis.common.IdentifiableObjectManager;
@@ -56,6 +48,13 @@
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
 @Controller
 @RequestMapping( value = DimensionController.RESOURCE_PATH )
 public class DimensionController
@@ -71,7 +70,7 @@
 
     @Autowired
     private IdentifiableObjectManager identifiableObjectManager;
-    
+
     @Autowired
     private LinkService linkService;
 
@@ -159,37 +158,37 @@
     }
 
     @RequestMapping( value = "/dataSet/{uid}", method = RequestMethod.GET )
-    public String getDimensionsForDataSet( @PathVariable String uid, 
+    public String getDimensionsForDataSet( @PathVariable String uid,
         @RequestParam( value = "links", defaultValue = "true", required = false ) Boolean links,
         Model model, HttpServletResponse response )
     {
         WebMetaData metaData = new WebMetaData();
 
         DataSet dataSet = identifiableObjectManager.get( DataSet.class, uid );
-        
+
         if ( dataSet == null )
         {
             ContextUtils.notFoundResponse( response, "Data set does not exist: " + uid );
             return null;
         }
-        
+
         if ( !dataSet.hasCategoryCombo() )
         {
             ContextUtils.conflictResponse( response, "Data set does not have a category combination: " + uid );
             return null;
         }
-        
+
         List<DimensionalObject> dimensions = new ArrayList<>();
         dimensions.addAll( dataSet.getCategoryCombo().getCategories() );
         dimensions.addAll( dataSet.getCategoryOptionGroupSets() );
-        
+
         dimensions = dimensionService.getCanReadObjects( dimensions );
-        
+
         for ( DimensionalObject dim : dimensions )
         {
             metaData.getDimensions().add( dimensionService.getDimensionalObjectCopy( dim.getUid(), true ) );
         }
-        
+
         model.addAttribute( "model", metaData );
 
         if ( links )

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/EmailController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/EmailController.java	2014-06-20 09:42:03 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/EmailController.java	2014-11-11 12:51:06 +0000
@@ -28,9 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 import org.hisp.dhis.email.EmailService;
 import org.hisp.dhis.user.CurrentUserService;
 import org.hisp.dhis.webapi.utils.ContextUtils;
@@ -39,6 +36,9 @@
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 /**
  * @author Halvdan Hoem Grelland <halvdanhg@xxxxxxxxx>
  */
@@ -58,7 +58,7 @@
     @Autowired
     private CurrentUserService currentUserService;
 
-    @RequestMapping( value = "/test" , method = RequestMethod.POST )
+    @RequestMapping( value = "/test", method = RequestMethod.POST )
     public void sendTestEmail( HttpServletRequest request, HttpServletResponse response )
     {
         String userEmail = currentUserService.getCurrentUser().getEmail();
@@ -67,7 +67,7 @@
 
         if ( smtpConfigured && userEmailConfigured )
         {
-            emailService.sendTestEmail( );
+            emailService.sendTestEmail();
 
             ContextUtils.okResponse( response, "A test email was sent to " + userEmail );
         }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/FileController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/FileController.java	2014-10-17 13:04:14 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/FileController.java	2014-11-11 12:51:06 +0000
@@ -28,11 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.io.IOException;
-import java.io.Writer;
-
-import javax.servlet.http.HttpServletResponse;
-
 import org.apache.commons.lang.StringUtils;
 import org.hisp.dhis.setting.SystemSettingManager;
 import org.hisp.dhis.webapi.utils.ContextUtils;
@@ -44,6 +39,10 @@
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.Writer;
+
 /**
  * @author Lars Helge Overland
  */
@@ -52,13 +51,13 @@
 public class FileController
 {
     public static final String RESOURCE_PATH = "/files";
-    
+
     private static final String KEY_CUSTOM_JS = "keyCustomJs";
     private static final String KEY_CUSTOM_CSS = "keyCustomCss";
 
     @Autowired
     private SystemSettingManager systemSettingManager;
-    
+
     @Autowired
     private ContextUtils contextUtils;
 
@@ -71,9 +70,9 @@
         throws IOException
     {
         contextUtils.configureResponse( response, ContextUtils.CONTENT_TYPE_JAVASCRIPT, CacheStrategy.CACHE_TWO_WEEKS );
-        
+
         String content = (String) systemSettingManager.getSystemSetting( KEY_CUSTOM_JS, StringUtils.EMPTY );
-        
+
         writer.write( content );
     }
 
@@ -94,7 +93,7 @@
     {
         systemSettingManager.deleteSystemSetting( KEY_CUSTOM_JS );
     }
-    
+
     // -------------------------------------------------------------------------
     // Custom style
     // -------------------------------------------------------------------------
@@ -107,9 +106,9 @@
         throws IOException
     {
         contextUtils.configureResponse( response, ContextUtils.CONTENT_TYPE_CSS, CacheStrategy.CACHE_TWO_WEEKS );
-        
+
         String content = (String) systemSettingManager.getSystemSetting( KEY_CUSTOM_CSS, StringUtils.EMPTY );
-        
+
         writer.write( content );
     }
 
@@ -129,5 +128,5 @@
     public void removeCustomStyle( HttpServletResponse response )
     {
         systemSettingManager.deleteSystemSetting( KEY_CUSTOM_CSS );
-    }    
+    }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/I18nController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/I18nController.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/I18nController.java	2014-11-11 12:51:06 +0000
@@ -29,6 +29,7 @@
  */
 
 import com.fasterxml.jackson.core.type.TypeReference;
+import org.hisp.dhis.dxf2.render.RenderService;
 import org.hisp.dhis.dxf2.utils.JacksonUtils;
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nManager;
@@ -48,13 +49,16 @@
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
 @Controller
-@RequestMapping(value = "/i18n")
+@RequestMapping( value = "/i18n" )
 public class I18nController
 {
     @Autowired
     private I18nManager i18nManager;
 
-    @RequestMapping(method = RequestMethod.POST)
+    @Autowired
+    private RenderService renderService;
+
+    @RequestMapping( method = RequestMethod.POST )
     public void postI18n( @RequestParam( value = "package", required = false, defaultValue = "org.hisp.dhis" ) String searchPackage,
         OutputStream outputStream, InputStream inputStream ) throws Exception
     {
@@ -75,6 +79,6 @@
             }
         }
 
-        JacksonUtils.getJsonMapper().writeValue( outputStream, output );
+        renderService.toJson( outputStream, output );
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/IdentifiableObjectController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/IdentifiableObjectController.java	2014-11-07 18:23:57 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/IdentifiableObjectController.java	2014-11-11 12:51:06 +0000
@@ -30,7 +30,6 @@
 
 import com.google.common.base.Optional;
 import com.google.common.collect.Lists;
-
 import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.webapi.webdomain.WebOptions;
 import org.springframework.stereotype.Controller;
@@ -40,7 +39,6 @@
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-
 import java.io.InputStream;
 import java.util.List;
 
@@ -48,7 +46,7 @@
  * @author Lars Helge Overland
  */
 @Controller
-@RequestMapping(value = IdentifiableObjectController.RESOURCE_PATH)
+@RequestMapping( value = IdentifiableObjectController.RESOURCE_PATH )
 public class IdentifiableObjectController
     extends AbstractCrudController<IdentifiableObject>
 {

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/LocaleController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/LocaleController.java	2014-10-31 17:36:31 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/LocaleController.java	2014-11-11 12:51:06 +0000
@@ -28,9 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.List;
-import java.util.Locale;
-
 import org.hisp.dhis.i18n.I18nService;
 import org.hisp.dhis.i18n.locale.LocaleManager;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -39,16 +36,19 @@
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 
+import java.util.List;
+import java.util.Locale;
+
 @Controller
 @RequestMapping( value = "/locales" )
 public class LocaleController
 {
     @Autowired
     private LocaleManager localeManager;
-    
+
     @Autowired
     private I18nService i18nService;
-    
+
     @RequestMapping( value = "/ui", method = RequestMethod.GET )
     public String getUiLocales( Model model )
     {
@@ -56,7 +56,7 @@
         model.addAttribute( "model", locales );
         return "locales";
     }
-    
+
     @RequestMapping( value = "/db", method = RequestMethod.GET )
     public String getDbLocales( Model model )
     {

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/MenuController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/MenuController.java	2014-10-23 10:07:41 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/MenuController.java	2014-11-11 12:51:06 +0000
@@ -28,10 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.io.InputStream;
-import java.util.List;
-
-import org.hisp.dhis.dxf2.utils.JacksonUtils;
+import org.hisp.dhis.dxf2.render.RenderService;
 import org.hisp.dhis.user.CurrentUserService;
 import org.hisp.dhis.user.User;
 import org.hisp.dhis.user.UserService;
@@ -40,6 +37,9 @@
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 
+import java.io.InputStream;
+import java.util.List;
+
 @Controller
 @RequestMapping( value = MenuController.RESOURCE_PATH )
 public class MenuController
@@ -52,16 +52,19 @@
     @Autowired
     private UserService userService;
 
+    @Autowired
+    private RenderService renderService;
+
     @RequestMapping( method = RequestMethod.POST, consumes = "application/json" )
     public void saveMenuOrder( InputStream input )
         throws Exception
     {
-        List<String> apps = JacksonUtils.fromJson( input, List.class );
+        List<String> apps = renderService.fromJson( input, List.class );
 
         User user = currentUserService.getCurrentUser();
 
         if ( apps != null && !apps.isEmpty() && user != null )
-        {        
+        {
             user.getApps().clear();
             user.getApps().addAll( apps );
 

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/MetaDataController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/MetaDataController.java	2014-09-22 09:56:45 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/MetaDataController.java	2014-11-11 12:51:06 +0000
@@ -28,17 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.io.IOException;
-import java.util.Map;
-import java.util.zip.GZIPInputStream;
-import java.util.zip.GZIPOutputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-import java.util.zip.ZipOutputStream;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 import org.hisp.dhis.dxf2.metadata.ExportService;
 import org.hisp.dhis.dxf2.metadata.ImportOptions;
 import org.hisp.dhis.dxf2.metadata.ImportService;
@@ -62,6 +51,16 @@
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.Map;
+import java.util.zip.GZIPInputStream;
+import java.util.zip.GZIPOutputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+import java.util.zip.ZipOutputStream;
+
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/PdfFormController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/PdfFormController.java	2014-10-15 18:59:11 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/PdfFormController.java	2014-11-11 12:51:06 +0000
@@ -28,15 +28,8 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
+import com.lowagie.text.Document;
+import com.lowagie.text.pdf.PdfWriter;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.hisp.dhis.common.IdentifiableProperty;
@@ -65,14 +58,19 @@
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 
-import com.lowagie.text.Document;
-import com.lowagie.text.pdf.PdfWriter;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 
 /**
  * @author James Chang <jamesbchang@xxxxxxxxx>
  */
 @Controller
-@RequestMapping(value = "/pdfForm")
+@RequestMapping( value = "/pdfForm" )
 public class PdfFormController
 {
     private static final Log log = LogFactory.getLog( PdfFormController.class );
@@ -109,19 +107,19 @@
     // DataSet
     //--------------------------------------------------------------------------
 
-    @RequestMapping(value = "/dataSet/{dataSetUid}", method = RequestMethod.GET)
-    public void getFormPdfDataSet( @PathVariable String dataSetUid, HttpServletRequest request, 
+    @RequestMapping( value = "/dataSet/{dataSetUid}", method = RequestMethod.GET )
+    public void getFormPdfDataSet( @PathVariable String dataSetUid, HttpServletRequest request,
         HttpServletResponse response, OutputStream out ) throws Exception
     {
         // 1. - Create Document and PdfWriter
-        
+
         Document document = new Document();
-        
+
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         PdfWriter writer = PdfWriter.getInstance( document, baos );
 
         // 2. Generate PDF Document Content
-        
+
         PdfFormFontSettings pdfFormFontSettings = new PdfFormFontSettings();
 
         PdfDataEntryFormUtil.setDefaultFooterOnDocument( document, request.getServerName(),
@@ -135,49 +133,49 @@
         // 3. - Response Header/Content Type Set
 
         String fileName = dataSetService.getDataSet( dataSetUid ).getName() + " " + (new SimpleDateFormat(
-            Period.DEFAULT_DATE_FORMAT )).format( new Date() ) ;
-        
+            Period.DEFAULT_DATE_FORMAT )).format( new Date() );
+
         contextUtils.configureResponse( response, ContextUtils.CONTENT_TYPE_PDF, CacheStrategy.NO_CACHE, fileName, false );
-        response.setContentLength( baos.size() );        
-        
+        response.setContentLength( baos.size() );
+
         // 4. - Output the data into Stream and close the stream.
-        
+
         baos.writeTo( out );
     }
 
-    @RequestMapping(value = "/dataSet", method = RequestMethod.POST)
+    @RequestMapping( value = "/dataSet", method = RequestMethod.POST )
     @PreAuthorize( "hasRole('ALL') or hasRole('F_DATAVALUE_ADD')" )
     public void sendFormPdfDataSet( HttpServletRequest request, HttpServletResponse response )
         throws Exception
     {
         // 1. Set up Import Option
-        
+
         ImportStrategy strategy = ImportStrategy.NEW_AND_UPDATES;
         IdentifiableProperty dataElementIdScheme = IdentifiableProperty.UID;
         IdentifiableProperty orgUnitIdScheme = IdentifiableProperty.UID;
 
         ImportOptions options = new ImportOptions( dataElementIdScheme, orgUnitIdScheme, false, true, strategy, false );
-                
+
         log.info( options );
 
         // 2. Generate Task ID
-        
+
         TaskId taskId = new TaskId( TaskCategory.DATAVALUE_IMPORT, currentUserService.getCurrentUser() );
 
         notifier.clear( taskId );
 
         // 3. Input Stream Check
-        
+
         InputStream in = request.getInputStream();
 
         in = StreamUtils.wrapAndCheckCompressionFormat( in );
 
         // 4. Save (Import) the data values.
-        
+
         dataValueSetService.saveDataValueSetPdf( in, options, taskId );
 
         // Step 5. Set the response - just simple OK response.
-        
+
         ContextUtils.okResponse( response, "" );
     }
 
@@ -185,18 +183,18 @@
     // Program Stage
     //--------------------------------------------------------------------------
 
-    @RequestMapping(value = "/programStage/{programStageUid}", method = RequestMethod.GET)
-    public void getFormPdfProgramStage( @PathVariable String programStageUid, HttpServletRequest request, 
-        HttpServletResponse response, OutputStream out  ) throws Exception
+    @RequestMapping( value = "/programStage/{programStageUid}", method = RequestMethod.GET )
+    public void getFormPdfProgramStage( @PathVariable String programStageUid, HttpServletRequest request,
+        HttpServletResponse response, OutputStream out ) throws Exception
     {
         // 1. - Create Document and PdfWriter
-        
+
         Document document = new Document();
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         PdfWriter writer = PdfWriter.getInstance( document, baos );
 
         // 2. Generate PDF Document Contents
-        
+
         PdfFormFontSettings pdfFormFontSettings = new PdfFormFontSettings();
 
         PdfDataEntryFormUtil.setDefaultFooterOnDocument( document, request.getServerName(),
@@ -204,13 +202,13 @@
 
         pdfDataEntryFormService.generatePDFDataEntryForm( document, writer, programStageUid,
             PdfDataEntryFormUtil.DATATYPE_PROGRAMSTAGE,
-            PdfDataEntryFormUtil.getDefaultPageSize( PdfDataEntryFormUtil.DATATYPE_PROGRAMSTAGE ), 
+            PdfDataEntryFormUtil.getDefaultPageSize( PdfDataEntryFormUtil.DATATYPE_PROGRAMSTAGE ),
             pdfFormFontSettings, i18nManager.getI18nFormat() );
 
         // 3. - Response Header/Content Type Set
-        
-        String fileName = programStageService.getProgramStage( programStageUid ).getName() + " " 
-            + (new SimpleDateFormat(Period.DEFAULT_DATE_FORMAT )).format( new Date() ) ;
+
+        String fileName = programStageService.getProgramStage( programStageUid ).getName() + " "
+            + (new SimpleDateFormat( Period.DEFAULT_DATE_FORMAT )).format( new Date() );
 
         contextUtils.configureResponse( response, ContextUtils.CONTENT_TYPE_PDF, CacheStrategy.NO_CACHE, fileName, false );
         response.setContentLength( baos.size() );
@@ -221,20 +219,20 @@
     }
 
     @RequestMapping( value = "/programStage", method = RequestMethod.POST )
-    @PreAuthorize("hasRole('ALL') or hasRole('F_PATIENT_DATAVALUE_ADD')")
+    @PreAuthorize( "hasRole('ALL') or hasRole('F_PATIENT_DATAVALUE_ADD')" )
     public void sendFormPdfProgramStage( HttpServletRequest request, HttpServletResponse response )
         throws Exception
     {
         InputStream in = request.getInputStream();
 
         // Temporarily using Util class from same project.
-        
+
         PdfDataEntryFormImportUtil pdfDataEntryFormImportUtil = new PdfDataEntryFormImportUtil();
 
         pdfDataEntryFormImportUtil.ImportProgramStage( in, i18nManager.getI18nFormat() );
 
         // Step 5. Set the response - just simple OK response.
-        
+
         ContextUtils.okResponse( response, "" );
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ReportController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ReportController.java	2014-10-07 21:16:53 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ReportController.java	2014-11-11 12:51:06 +0000
@@ -28,18 +28,9 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static org.hisp.dhis.system.util.CodecUtils.filenameEncode;
-import static org.hisp.dhis.webapi.utils.ContextUtils.DATE_PATTERN;
-
-import java.util.Date;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 import net.sf.jasperreports.engine.JasperPrint;
 import net.sf.jasperreports.j2ee.servlets.BaseHttpServlet;
 import net.sf.jasperreports.j2ee.servlets.ImageServlet;
-
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.i18n.I18nManager;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
@@ -63,6 +54,13 @@
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+
+import static org.hisp.dhis.system.util.CodecUtils.filenameEncode;
+import static org.hisp.dhis.webapi.utils.ContextUtils.DATE_PATTERN;
+
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  * @author Lars Helge Overland

=== 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-07-11 19:12:01 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ResourceTableController.java	2014-11-11 12:51:06 +0000
@@ -28,11 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
-
 import org.hisp.dhis.analytics.scheduling.AnalyticsTableTask;
-import org.hisp.dhis.webapi.utils.ContextUtils;
 import org.hisp.dhis.resourcetable.scheduling.ResourceTableTask;
 import org.hisp.dhis.scheduling.DataMartTask;
 import org.hisp.dhis.scheduling.TaskCategory;
@@ -40,6 +36,7 @@
 import org.hisp.dhis.system.scheduling.Scheduler;
 import org.hisp.dhis.user.CurrentUserService;
 import org.hisp.dhis.validation.scheduling.MonitoringTask;
+import org.hisp.dhis.webapi.utils.ContextUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Controller;
@@ -47,6 +44,9 @@
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+
 /**
  * @author Lars Helge Overland
  */
@@ -55,34 +55,34 @@
 public class ResourceTableController
 {
     public static final String RESOURCE_PATH = "/resourceTables";
-    
-    @Resource(name="analyticsAllTask")
+
+    @Resource( name = "analyticsAllTask" )
     private AnalyticsTableTask analyticsTableTask;
 
     @Autowired
     private DataMartTask dataMartTask;
-    
+
     @Autowired
     private ResourceTableTask resourceTableTask;
-    
+
     @Autowired
     private MonitoringTask monitoringTask;
-    
+
     @Autowired
     private Scheduler scheduler;
-    
+
     @Autowired
     private CurrentUserService currentUserService;
-    
+
     //TODO make tasks prototypes to avoid potential concurrency issues?
-    
+
     @RequestMapping( value = "/analytics", method = { RequestMethod.PUT, RequestMethod.POST } )
     @PreAuthorize( "hasRole('ALL') or hasRole('F_DATA_MART_ADMIN')" )
-    public void analytics( 
-        @RequestParam(required=false) boolean skipResourceTables, 
-        @RequestParam(required=false) boolean skipAggregate,
-        @RequestParam(required=false) boolean skipEvents,
-        @RequestParam(required=false) Integer lastYears,
+    public void analytics(
+        @RequestParam( required = false ) boolean skipResourceTables,
+        @RequestParam( required = false ) boolean skipAggregate,
+        @RequestParam( required = false ) boolean skipEvents,
+        @RequestParam( required = false ) Integer lastYears,
         HttpServletResponse response )
     {
         analyticsTableTask.setSkipResourceTables( skipResourceTables );
@@ -90,9 +90,9 @@
         analyticsTableTask.setSkipEvents( skipEvents );
         analyticsTableTask.setLastYears( lastYears );
         analyticsTableTask.setTaskId( new TaskId( TaskCategory.DATAMART, currentUserService.getCurrentUser() ) );
-        
+
         scheduler.executeTask( analyticsTableTask );
-        
+
         ContextUtils.okResponse( response, "Initiated analytics table update" );
     }
 
@@ -101,31 +101,31 @@
     public void dataMart( HttpServletResponse response )
     {
         dataMartTask.setTaskId( new TaskId( TaskCategory.DATAMART, currentUserService.getCurrentUser() ) );
-        
+
         scheduler.executeTask( dataMartTask );
-        
+
         ContextUtils.okResponse( response, "Initiated data mart update" );
     }
-    
+
     @RequestMapping( method = { RequestMethod.PUT, RequestMethod.POST } )
     @PreAuthorize( "hasRole('ALL') or hasRole('F_PERFORM_MAINTENANCE')" )
     public void resourceTables( HttpServletResponse response )
     {
         resourceTableTask.setTaskId( new TaskId( TaskCategory.RESOURCETABLE_UPDATE, currentUserService.getCurrentUser() ) );
-        
+
         scheduler.executeTask( resourceTableTask );
-        
+
         ContextUtils.okResponse( response, "Initiated resource table update" );
-    }    
+    }
 
     @RequestMapping( value = "/monitoring", method = { RequestMethod.PUT, RequestMethod.POST } )
     @PreAuthorize( "hasRole('ALL') or hasRole('F_PERFORM_MAINTENANCE')" )
     public void monitoring( HttpServletResponse response )
     {
         monitoringTask.setTaskId( new TaskId( TaskCategory.MONITORING, currentUserService.getCurrentUser() ) );
-        
+
         scheduler.executeTask( monitoringTask );
-        
+
         ContextUtils.okResponse( response, "Initiated data monitoring" );
-    }   
+    }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SharingController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SharingController.java	2014-10-06 13:02:52 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SharingController.java	2014-11-11 12:51:06 +0000
@@ -32,10 +32,6 @@
 import org.apache.commons.logging.LogFactory;
 import org.hisp.dhis.acl.AccessStringHelper;
 import org.hisp.dhis.acl.AclService;
-import org.hisp.dhis.webapi.utils.ContextUtils;
-import org.hisp.dhis.webapi.webdomain.sharing.Sharing;
-import org.hisp.dhis.webapi.webdomain.sharing.SharingUserGroupAccess;
-import org.hisp.dhis.webapi.webdomain.sharing.SharingUserGroups;
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.common.IdentifiableObjectManager;
@@ -45,6 +41,10 @@
 import org.hisp.dhis.user.UserGroupAccess;
 import org.hisp.dhis.user.UserGroupAccessService;
 import org.hisp.dhis.user.UserGroupService;
+import org.hisp.dhis.webapi.utils.ContextUtils;
+import org.hisp.dhis.webapi.webdomain.sharing.Sharing;
+import org.hisp.dhis.webapi.webdomain.sharing.SharingUserGroupAccess;
+import org.hisp.dhis.webapi.webdomain.sharing.SharingUserGroups;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.AccessDeniedException;
 import org.springframework.stereotype.Controller;

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SynchronizationController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SynchronizationController.java	2014-07-10 16:06:48 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/SynchronizationController.java	2014-11-11 12:51:06 +0000
@@ -28,12 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static org.hisp.dhis.webapi.utils.ContextUtils.CONTENT_TYPE_JSON;
-
-import java.io.IOException;
-
-import javax.servlet.http.HttpServletResponse;
-
 import org.hisp.dhis.dxf2.importsummary.ImportSummary;
 import org.hisp.dhis.dxf2.synch.AvailabilityStatus;
 import org.hisp.dhis.dxf2.synch.SynchronizationManager;
@@ -45,6 +39,11 @@
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.client.RestTemplate;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+import static org.hisp.dhis.webapi.utils.ContextUtils.CONTENT_TYPE_JSON;
+
 /**
  * @author Lars Helge Overland
  */
@@ -53,10 +52,7 @@
 public class SynchronizationController
 {
     public static final String RESOURCE_PATH = "/synchronization";
-    
-    @Autowired
-    private RestTemplate restTemplate;
-    
+
     @Autowired
     private SynchronizationManager synchronizationManager;
 
@@ -69,7 +65,7 @@
         response.setContentType( CONTENT_TYPE_JSON );
         JacksonUtils.toJson( response.getOutputStream(), summary );
     }
-    
+
     @RequestMapping( value = "/availability", method = RequestMethod.GET, produces = "application/json" )
     public @ResponseBody AvailabilityStatus isRemoteServerAvailable()
     {

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/organisationunit/OrganisationUnitLocationController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/organisationunit/OrganisationUnitLocationController.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/organisationunit/OrganisationUnitLocationController.java	2014-11-11 12:51:06 +0000
@@ -28,15 +28,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 import org.hisp.dhis.attribute.Attribute;
 import org.hisp.dhis.attribute.AttributeValue;
 import org.hisp.dhis.dxf2.utils.JacksonUtils;
@@ -46,7 +37,6 @@
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.system.filter.OrganisationUnitPolygonCoveringCoordinateFilter;
 import org.hisp.dhis.system.util.FilterUtils;
-import org.hisp.dhis.user.CurrentUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
@@ -54,6 +44,14 @@
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 /**
  * @author James Chang <jamesbchang@xxxxxxxxx>
  */
@@ -62,76 +60,73 @@
 public class OrganisationUnitLocationController
 {
     public static final String RESOURCE_PATH = "/organisationUnitLocations";
-    
+
     private static final String ORGUNIGROUP_SYMBOL = "orgUnitGroupSymbol";
 
     @Autowired
     private OrganisationUnitService organisationUnitService;
 
-    @Autowired
-    private CurrentUserService currentUserService;
-
     /**
      * Get Organisation Units within a distance from a location
      */
     @RequestMapping( value = "/withinRange", method = RequestMethod.GET, produces = { "*/*", "application/json" } )
-    public void getEntitiesWithinRange( 
-        @RequestParam Double longitude, 
-        @RequestParam Double latitude, 
-        @RequestParam Double distance, 
-        @RequestParam( required = false ) String orgUnitGroupSetId, 
+    public void getEntitiesWithinRange(
+        @RequestParam Double longitude,
+        @RequestParam Double latitude,
+        @RequestParam Double distance,
+        @RequestParam( required = false ) String orgUnitGroupSetId,
         Model model, HttpServletRequest request, HttpServletResponse response )
         throws Exception
     {
         List<OrganisationUnit> entityList = new ArrayList<>(
             organisationUnitService.getOrganisationUnitWithinDistance( longitude, latitude, distance ) );
 
-        for ( OrganisationUnit orgunit : entityList )
+        for ( OrganisationUnit organisationUnit : entityList )
         {
-            Set<AttributeValue> attributeValues = orgunit.getAttributeValues();
+            Set<AttributeValue> attributeValues = organisationUnit.getAttributeValues();
             attributeValues.clear();
 
             if ( orgUnitGroupSetId != null )
             {
-                for ( OrganisationUnitGroup orgunitGroup : orgunit.getGroups() )
+                for ( OrganisationUnitGroup organisationUnitGroup : organisationUnit.getGroups() )
                 {
-                    if ( orgunitGroup.getGroupSet() != null )
+                    if ( organisationUnitGroup.getGroupSet() != null )
                     {
-                        OrganisationUnitGroupSet orgunitGroupSet = orgunitGroup.getGroupSet();
+                        OrganisationUnitGroupSet orgunitGroupSet = organisationUnitGroup.getGroupSet();
 
                         if ( orgunitGroupSet.getUid().compareTo( orgUnitGroupSetId ) == 0 )
                         {
                             AttributeValue attributeValue = new AttributeValue();
                             attributeValue.setAttribute( new Attribute( ORGUNIGROUP_SYMBOL, ORGUNIGROUP_SYMBOL ) );
-                            attributeValue.setValue( orgunitGroup.getSymbol() );
+                            attributeValue.setValue( organisationUnitGroup.getSymbol() );
                             attributeValues.add( attributeValue );
                         }
                     }
                 }
             }
 
-            orgunit.setAttributeValues( attributeValues );
+            organisationUnit.setAttributeValues( attributeValues );
 
             // Clear out all data not needed for this task
-            
-            orgunit.removeAllDataSets();
-            orgunit.removeAllUsers();
-            orgunit.removeAllOrganisationUnitGroups();
+
+            organisationUnit.removeAllDataSets();
+            organisationUnit.removeAllUsers();
+            organisationUnit.removeAllOrganisationUnitGroups();
         }
 
         JacksonUtils.toJson( response.getOutputStream(), entityList );
     }
 
     /**
-     * Get lowest level Org Units that includes the location in their polygon shape.  
+     * Get lowest level Org Units that includes the location in their polygon shape.
      */
     @RequestMapping( value = "/orgUnitByLocation", method = RequestMethod.GET, produces = { "*/*", "application/json" } )
-    public void getParentByLocation( 
-        @RequestParam Double longitude, 
+    public void getParentByLocation(
+        @RequestParam Double longitude,
         @RequestParam Double latitude,
-        @RequestParam(required=false) String topOrgUnit,
-        @RequestParam(required=false) Integer targetLevel,
-        @RequestParam Map<String, String> parameters, 
+        @RequestParam( required = false ) String topOrgUnit,
+        @RequestParam( required = false ) Integer targetLevel,
+        @RequestParam Map<String, String> parameters,
         Model model, HttpServletRequest request, HttpServletResponse response )
         throws Exception
     {
@@ -139,14 +134,14 @@
             organisationUnitService.getOrganisationUnitByCoordinate( longitude, latitude, topOrgUnit, targetLevel ) );
 
         // Remove unrelated details and output in JSON format
-        
-        for ( OrganisationUnit orgunit : entityList )
+
+        for ( OrganisationUnit organisationUnit : entityList )
         {
-            Set<AttributeValue> attributeValues = orgunit.getAttributeValues();
+            Set<AttributeValue> attributeValues = organisationUnit.getAttributeValues();
             attributeValues.clear();
-            orgunit.removeAllDataSets();
-            orgunit.removeAllUsers();
-            orgunit.removeAllOrganisationUnitGroups();
+            organisationUnit.removeAllDataSets();
+            organisationUnit.removeAllUsers();
+            organisationUnit.removeAllOrganisationUnitGroups();
         }
 
         JacksonUtils.toJson( response.getOutputStream(), entityList );
@@ -156,20 +151,20 @@
      * Check if the location lies within the organisation unit boundary
      */
     @RequestMapping( value = "/locationWithinOrgUnitBoundary", method = RequestMethod.GET, produces = { "*/*", "application/json" } )
-    public void checkLocationWithinOrgUnit( 
-        @RequestParam String orgUnitUid, 
-        @RequestParam Double longitude, 
-        @RequestParam Double latitude, 
+    public void checkLocationWithinOrgUnit(
+        @RequestParam String orgUnitUid,
+        @RequestParam Double longitude,
+        @RequestParam Double latitude,
         Model model, HttpServletRequest request, HttpServletResponse response )
         throws Exception
     {
         boolean withinOrgUnit = false;
 
-        Collection<OrganisationUnit> orgUnits = new ArrayList<>();
-        orgUnits.add( organisationUnitService.getOrganisationUnit( orgUnitUid ) );
-        FilterUtils.filter( orgUnits, new OrganisationUnitPolygonCoveringCoordinateFilter( longitude, latitude ) );
-        
-        if ( !orgUnits.isEmpty() )
+        Collection<OrganisationUnit> organisationUnits = new ArrayList<>();
+        organisationUnits.add( organisationUnitService.getOrganisationUnit( orgUnitUid ) );
+        FilterUtils.filter( organisationUnits, new OrganisationUnitPolygonCoveringCoordinateFilter( longitude, latitude ) );
+
+        if ( !organisationUnits.isEmpty() )
         {
             withinOrgUnit = true;
         }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/CurrentUserController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/CurrentUserController.java	2014-11-03 12:30:39 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/CurrentUserController.java	2014-11-11 12:51:06 +0000
@@ -94,7 +94,7 @@
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
 @Controller
-@RequestMapping(value = { CurrentUserController.RESOURCE_PATH, "/me" }, method = RequestMethod.GET)
+@RequestMapping( value = { CurrentUserController.RESOURCE_PATH, "/me" }, method = RequestMethod.GET )
 public class CurrentUserController
 {
     public static final String RESOURCE_PATH = "/currentUser";
@@ -162,7 +162,7 @@
         renderService.toJson( response.getOutputStream(), currentUser, DetailedView.class );
     }
 
-    @RequestMapping(value = "/dashboards", produces = { "application/json", "text/*" })
+    @RequestMapping( value = "/dashboards", produces = { "application/json", "text/*" } )
     public void getDashboards( HttpServletResponse response ) throws NotAuthenticatedException, IOException
     {
         User currentUser = currentUserService.getCurrentUser();
@@ -188,7 +188,7 @@
         renderService.toJson( response.getOutputStream(), dashboards, DetailedView.class );
     }
 
-    @RequestMapping(value = "/inbox", produces = { "application/json", "text/*" })
+    @RequestMapping( value = "/inbox", produces = { "application/json", "text/*" } )
     public void getInbox( HttpServletResponse response ) throws Exception
     {
         User currentUser = currentUserService.getCurrentUser();
@@ -216,7 +216,7 @@
         renderService.toJson( response.getOutputStream(), inbox );
     }
 
-    @RequestMapping(value = "/inbox/messageConversations", produces = { "application/json", "text/*" })
+    @RequestMapping( value = "/inbox/messageConversations", produces = { "application/json", "text/*" } )
     public void getInboxMessageConversations( HttpServletResponse response ) throws Exception
     {
         User currentUser = currentUserService.getCurrentUser();
@@ -238,7 +238,7 @@
         renderService.toJson( response.getOutputStream(), messageConversations );
     }
 
-    @RequestMapping(value = "/inbox/interpretations", produces = { "application/json", "text/*" })
+    @RequestMapping( value = "/inbox/interpretations", produces = { "application/json", "text/*" } )
     public void getInboxInterpretations( HttpServletResponse response ) throws Exception
     {
         User currentUser = currentUserService.getCurrentUser();
@@ -259,7 +259,7 @@
         renderService.toJson( response.getOutputStream(), interpretations );
     }
 
-    @RequestMapping(value = "/dashboard", produces = { "application/json", "text/*" })
+    @RequestMapping( value = "/dashboard", produces = { "application/json", "text/*" } )
     public void getDashboard( HttpServletResponse response ) throws Exception
     {
         User currentUser = currentUserService.getCurrentUser();
@@ -337,7 +337,7 @@
         return userAccount;
     }
 
-    @RequestMapping(value = { "/profile", "/user-account" }, method = RequestMethod.POST, consumes = "application/json")
+    @RequestMapping( value = { "/profile", "/user-account" }, method = RequestMethod.POST, consumes = "application/json" )
     public void postUserAccountJson( HttpServletResponse response, HttpServletRequest request ) throws Exception
     {
         UserAccount userAccount = renderService.fromJson( request.getInputStream(), UserAccount.class );
@@ -373,7 +373,7 @@
         userService.updateUser( currentUser );
     }
 
-    @RequestMapping(value = "/authorization", produces = { "application/json", "text/*" })
+    @RequestMapping( value = "/authorization", produces = { "application/json", "text/*" } )
     public void getAuthorization( HttpServletResponse response ) throws IOException
     {
         User currentUser = currentUserService.getCurrentUser();
@@ -382,7 +382,7 @@
         renderService.toJson( response.getOutputStream(), currentUser.getUserCredentials().getAllAuthorities() );
     }
 
-    @RequestMapping(value = "/authorization/{auth}", produces = { "application/json", "text/*" })
+    @RequestMapping( value = "/authorization/{auth}", produces = { "application/json", "text/*" } )
     public void hasAuthorization( @PathVariable String auth, HttpServletResponse response ) throws IOException
     {
         User currentUser = currentUserService.getCurrentUser();
@@ -393,9 +393,9 @@
         renderService.toJson( response.getOutputStream(), hasAuth );
     }
 
-    @RequestMapping(value = "/recipients", produces = { "application/json", "text/*" })
+    @RequestMapping( value = "/recipients", produces = { "application/json", "text/*" } )
     public void recipientsJson( HttpServletResponse response,
-        @RequestParam(value = "filter") String filter ) throws IOException, NotAuthenticatedException, FilterTooShortException
+        @RequestParam( value = "filter" ) String filter ) throws IOException, NotAuthenticatedException, FilterTooShortException
     {
         User currentUser = currentUserService.getCurrentUser();
 
@@ -421,7 +421,7 @@
         renderService.toJson( response.getOutputStream(), recipients );
     }
 
-    @RequestMapping(value = { "/assignedOrganisationUnits", "/organisationUnits" }, produces = { "application/json", "text/*" })
+    @RequestMapping( value = { "/assignedOrganisationUnits", "/organisationUnits" }, produces = { "application/json", "text/*" } )
     public void getAssignedOrganisationUnits( HttpServletResponse response, @RequestParam Map<String, String> parameters ) throws IOException, NotAuthenticatedException
     {
         User currentUser = currentUserService.getCurrentUser();
@@ -470,9 +470,9 @@
         renderService.toJson( response.getOutputStream(), userOrganisationUnits, viewClass );
     }
 
-    @RequestMapping(value = { "/assignedPrograms", "/programs" }, produces = { "application/json", "text/*" })
+    @RequestMapping( value = { "/assignedPrograms", "/programs" }, produces = { "application/json", "text/*" } )
     public void getPrograms( HttpServletResponse response, @RequestParam Map<String, String> parameters,
-        @RequestParam(required = false) Integer type )
+        @RequestParam( required = false ) Integer type )
         throws IOException, NotAuthenticatedException
     {
         User currentUser = currentUserService.getCurrentUser();
@@ -590,9 +590,9 @@
         renderService.toJson( response.getOutputStream(), forms );
     }
 
-    @SuppressWarnings("unchecked")
-    @RequestMapping(value = { "/assignedDataSets", "/dataSets" }, produces = { "application/json", "text/*" })
-    public void getDataSets( @RequestParam(defaultValue = "false") boolean optionSets, @RequestParam(defaultValue = "50") int maxOptions,
+    @SuppressWarnings( "unchecked" )
+    @RequestMapping( value = { "/assignedDataSets", "/dataSets" }, produces = { "application/json", "text/*" } )
+    public void getDataSets( @RequestParam( defaultValue = "false" ) boolean optionSets, @RequestParam( defaultValue = "50" ) int maxOptions,
         HttpServletResponse response, @RequestParam Map<String, String> parameters ) throws IOException, NotAuthenticatedException
     {
         User currentUser = currentUserService.getCurrentUser();
@@ -712,7 +712,7 @@
         renderService.toJson( response.getOutputStream(), forms );
     }
 
-    @RequestMapping(value = "/dataApprovalLevels", produces = { "application/json", "text/*" })
+    @RequestMapping( value = "/dataApprovalLevels", produces = { "application/json", "text/*" } )
     public void getApprovalLevels( HttpServletResponse response ) throws IOException
     {
         List<DataApprovalLevel> approvalLevels = approvalLevelService.getUserDataApprovalLevels();