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

Modifica referencias deprecated

parent 3d3a8f02
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
+7 −8
Original line number Diff line number Diff line
@@ -24,12 +24,11 @@ import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@@ -50,12 +49,12 @@ import es.redmic.models.es.common.query.dto.SimpleQueryDTO;
@RequestMapping(value = "${controller.mapping.PROJECT_BY_PROGRAM}")
public class ProjectProgramController extends RBaseController<Project, ProjectDTO, MetadataQueryDTO>{

	ProjectESService service;
	private ProjectESService _service;

	@Autowired
	public ProjectProgramController(ProjectESService service) {
		super(service);
		this.service = service;
		this._service = service;
	}

	@PostMapping(value = "/_search")
@@ -67,7 +66,7 @@ public class ProjectProgramController extends RBaseController<Project, ProjectDT

		processQuery(queryDTO, bindingResult);

		JSONCollectionDTO result = service.find(queryDTO);
		JSONCollectionDTO result = _service.find(queryDTO);
		return new ElasticSearchDTO(result, result.getTotal());
	}

@@ -77,11 +76,11 @@ public class ProjectProgramController extends RBaseController<Project, ProjectDT
			@RequestParam("text") String text,
			@RequestParam(required = false, value = "size") Integer size) {

		SimpleQueryDTO queryDTO = service.createSimpleQueryDTOFromSuggestQueryParams(fields, text, size);
		SimpleQueryDTO queryDTO = _service.createSimpleQueryDTOFromSuggestQueryParams(fields, text, size);
		processQuery((DataQueryDTO) queryDTO);
		queryDTO.addTerm("path.split", programId);

		List<String> response = service.suggest(convertToDataQuery((DataQueryDTO)queryDTO));
		List<String> response = _service.suggest(convertToDataQuery((DataQueryDTO)queryDTO));

		return new ElasticSearchDTO(response, response.size());
	}
@@ -90,6 +89,6 @@ public class ProjectProgramController extends RBaseController<Project, ProjectDT
	@ResponseBody
	public SuperDTO findById(@PathVariable("programId") String programId, @PathVariable("id") String id) {

		return new BodyItemDTO<ProjectDTO>(service.get(id));
		return new BodyItemDTO<ProjectDTO>(_service.get(id));
	}
}
+8 −9
Original line number Diff line number Diff line
@@ -31,15 +31,14 @@ import java.util.Set;

import javax.servlet.http.HttpServletResponse;

import com.fasterxml.jackson.databind.ObjectMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindException;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fasterxml.jackson.databind.ObjectMapper;

import es.redmic.api.common.service.UserUtilsService;
import es.redmic.es.common.service.RBaseESService;
import es.redmic.es.config.OrikaScanBeanESItfc;
@@ -62,7 +61,7 @@ public abstract class RBaseController<TModel extends BaseES<?>, TDTO extends Bas
	@Autowired
	protected ObjectMapper objectMapper;

	private Map<String, Object> fixedQuery = new HashMap<String, Object>();
	private Map<String, Object> fixedQuery = new HashMap<>();

	RBaseESService<TModel, TDTO> service;

@@ -72,14 +71,14 @@ public abstract class RBaseController<TModel extends BaseES<?>, TDTO extends Bas
	protected Class<TDTO> typeOfTDTO;
	protected Class<TQueryDTO> typeOfTQueryDTO;

	private Set<String> fieldsExcludedOnQuery = new HashSet<String>();
	private Set<String> fieldsExcludedOnQuery = new HashSet<>();

	public RBaseController(RBaseESService<TModel, TDTO> service) {
	protected RBaseController(RBaseESService<TModel, TDTO> service) {
		this.service = service;
		defineTypeOfArguments();
	}

	@RequestMapping(value = { "${controller.mapping.FILTER_SCHEMA}", "${contoller.mapping.FILTERED_DOCUMENTS_SCHEMA}",
	@GetMapping(value = { "${controller.mapping.FILTER_SCHEMA}", "${contoller.mapping.FILTERED_DOCUMENTS_SCHEMA}",
			"${contoller.mapping.ANCESTORS_SCHEMA}", "${controller.mapping.TRACK_CLUSTER_SCHEMA}",
			"${controller.mapping.OBJECT_CLASSIFICATION_LIST_SCHEMA}",
			"${controller.mapping.OBJECT_CLASSIFICATION_SCHEMA}", "${controller.mapping.SERIES_TEMPORALDATA_SCHEMA}",
@@ -87,7 +86,7 @@ public abstract class RBaseController<TModel extends BaseES<?>, TDTO extends Bas
			"${controller.mapping.GRID100_BY_ID_SCHEMA}", "${controller.mapping.GRID500_SCHEMA}",
			"${controller.mapping.GRID500_BY_ID_SCHEMA}", "${controller.mapping.GRID1000_SCHEMA}",
			"${controller.mapping.GRID1000_BY_ID_SCHEMA}", "${controller.mapping.GRID5000_SCHEMA}",
			"${controller.mapping.GRID5000_BY_ID_SCHEMA}" }, method = RequestMethod.GET)
			"${controller.mapping.GRID5000_BY_ID_SCHEMA}" })
	@ResponseBody
	public ElasticSearchDTO getFilterSchema(HttpServletResponse response) {

+0 −2
Original line number Diff line number Diff line
@@ -29,8 +29,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

+0 −2
Original line number Diff line number Diff line
@@ -29,8 +29,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

Loading