=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/mapping/MapController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/mapping/MapController.java 2014-10-23 10:07:41 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/mapping/MapController.java 2014-11-11 12:36:27 +0000 @@ -28,24 +28,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import static org.hisp.dhis.webapi.utils.ContextUtils.DATE_PATTERN; - -import java.awt.image.BufferedImage; -import java.io.InputStream; -import java.util.Date; -import java.util.Iterator; - -import javax.imageio.ImageIO; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.hisp.dhis.common.DimensionService; -import org.hisp.dhis.dataelement.DataElementOperandService; -import org.hisp.dhis.dataelement.DataElementService; import org.hisp.dhis.dxf2.utils.JacksonUtils; import org.hisp.dhis.i18n.I18nFormat; import org.hisp.dhis.i18n.I18nManager; -import org.hisp.dhis.indicator.IndicatorService; import org.hisp.dhis.mapgeneration.MapGenerationService; import org.hisp.dhis.mapping.Map; import org.hisp.dhis.mapping.MapView; @@ -54,7 +40,6 @@ import org.hisp.dhis.organisationunit.OrganisationUnitGroupService; import org.hisp.dhis.organisationunit.OrganisationUnitService; import org.hisp.dhis.period.Period; -import org.hisp.dhis.period.PeriodService; import org.hisp.dhis.schema.descriptors.MapSchemaDescriptor; import org.hisp.dhis.user.CurrentUserService; import org.hisp.dhis.user.UserService; @@ -69,6 +54,16 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; +import javax.imageio.ImageIO; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.awt.image.BufferedImage; +import java.io.InputStream; +import java.util.Date; +import java.util.Iterator; + +import static org.hisp.dhis.webapi.utils.ContextUtils.DATE_PATTERN; + /** * @author Morten Olav Hansen * @author Lars Helge Overland @@ -80,7 +75,7 @@ { private static final int MAP_MIN_WIDTH = 140; private static final int MAP_MIN_HEIGHT = 25; - + @Autowired private MappingService mappingService; @@ -91,18 +86,6 @@ private OrganisationUnitGroupService organisationUnitGroupService; @Autowired - private IndicatorService indicatorService; - - @Autowired - private DataElementService dataElementService; - - @Autowired - private DataElementOperandService operandService; - - @Autowired - private PeriodService periodService; - - @Autowired private CurrentUserService currentUserService; @Autowired @@ -220,21 +203,21 @@ ContextUtils.notFoundResponse( response, "Map does not exist: " + uid ); return; } - + if ( width != null && width < MAP_MIN_WIDTH ) { ContextUtils.conflictResponse( response, "Min map width is " + MAP_MIN_WIDTH + ": " + width ); return; } - + if ( height != null && height < MAP_MIN_HEIGHT ) { ContextUtils.conflictResponse( response, "Min map height is " + MAP_MIN_HEIGHT + ": " + height ); - return; + return; } OrganisationUnit unit = ou != null ? organisationUnitService.getOrganisationUnit( ou ) : null; - + renderMapViewPng( map, date, unit, width, height, response ); }