Commit b0d9ea59 authored by Noel Alonso's avatar Noel Alonso
Browse files

Cambia tipo de dato retornado

parent 24c68bcd
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import es.redmic.atlascommands.service.OGCLayerService;
import es.redmic.atlaslib.dto.layer.LayerDTO;
import es.redmic.atlaslib.dto.layerwms.LayerWMSDTO;
import es.redmic.exception.data.ItemAlreadyExistException;
import es.redmic.exception.databinding.DTONotValidException;
import es.redmic.models.es.common.dto.BodyItemDTO;
@@ -59,11 +59,11 @@ public class OGCLayerController {
		if (errorDto.hasErrors())
			throw new DTONotValidException(errorDto);

		List<LayerDTO> result = service.discoverWMSLayers(workSpace.getUrl());
		List<LayerWMSDTO> result = service.discoverWMSLayers(workSpace.getUrl());

		if (result == null)
			throw new ItemAlreadyExistException();

		return new BodyItemDTO<List<LayerDTO>>(result);
		return new BodyItemDTO<List<LayerWMSDTO>>(result);
	}
}
+1 −2
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ import java.util.List;
import org.springframework.stereotype.Service;

import es.redmic.atlascommands.utils.Capabilities;
import es.redmic.atlaslib.dto.layer.LayerDTO;
import es.redmic.atlaslib.dto.layerwms.LayerWMSDTO;
import es.redmic.exception.atlas.LayerNotFoundException;

@@ -35,7 +34,7 @@ import es.redmic.exception.atlas.LayerNotFoundException;
public class OGCLayerService {

	@SuppressWarnings({ "unchecked", "rawtypes" })
	public List<LayerDTO> discoverWMSLayers(String urlSource) {
	public List<LayerWMSDTO> discoverWMSLayers(String urlSource) {

		HashMap<String, LayerWMSDTO> result = Capabilities.getCapabilities(urlSource);