Commit 7d0d846e authored by Noel Alonso's avatar Noel Alonso
Browse files

Añade componentes para resourcetype + adapta tests

parent 8b251640
Loading
Loading
Loading
Loading
+36 −0
Original line number Diff line number Diff line
package es.redmic.es.maintenance.domain.administrative.repository;

/*-
 * #%L
 * ElasticSearch
 * %%
 * Copyright (C) 2019 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import org.springframework.stereotype.Repository;

import es.redmic.es.common.repository.DomainESRepository;
import es.redmic.models.es.maintenance.administrative.model.ResourceType;

@Repository
public class ResourceTypeESRepository extends DomainESRepository<ResourceType> {
	private static String[] INDEX = { "administrative-domains" };
	private static String TYPE = "resourcetype";

	public ResourceTypeESRepository() {
		super(INDEX, TYPE);
	}
}
+44 −0
Original line number Diff line number Diff line
package es.redmic.es.maintenance.domain.administrative.service;

/*-
 * #%L
 * ElasticSearch
 * %%
 * Copyright (C) 2019 REDMIC Project / Server
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import es.redmic.es.common.service.MetaDataESService;
import es.redmic.es.maintenance.domain.administrative.repository.ResourceTypeESRepository;
import es.redmic.models.es.common.model.ReferencesES;
import es.redmic.models.es.maintenance.administrative.dto.ResourceTypeDTO;
import es.redmic.models.es.maintenance.administrative.model.ResourceType;

@Service
public class ResourceTypeESService extends MetaDataESService<ResourceType, ResourceTypeDTO> {

	@Autowired
	public ResourceTypeESService(ResourceTypeESRepository repository) {
		super(repository);
	}

	@Override
	public void postUpdate(ReferencesES<ResourceType> reference) {
		// TODO: implementar
	}
}
+6 −2
Original line number Diff line number Diff line
@@ -26,8 +26,12 @@
	},
	"resources": [{
		"id": 1,
		"name": "Dataset",
		"description": "Descarga de dataset en CKAN",
		"resourceType": {
			"id":1,
			"name": "CKAN",
			"name_en": "CKAN",
			"description": "Descarga de dataset en CKAN"
		},
		"urlResource": "https://ckan.redmic.es"
	}],
	"accessibility": {
+6 −2
Original line number Diff line number Diff line
@@ -40,8 +40,12 @@
			},
			"resources": [{
				"id": 1,
				"name": "Dataset",
				"description": "Descarga de dataset en CKAN",
				"resourceType": {
					"id":1,
					"name": "CKAN",
					"name_en": "CKAN",
					"description": "Descarga de dataset en CKAN"
				},
				"urlResource": "https://ckan.redmic.es"
			}],
			"accessibility": {
+6 −2
Original line number Diff line number Diff line
@@ -11,8 +11,12 @@
	"endDate": "2014-10-06T09:00:00.000+00:00",
	"resources": [{
		"id": 1,
		"name": "Dataset",
		"description": "Descarga de dataset en CKAN",
		"resourceType": {
			"id":1,
			"name": "CKAN",
			"name_en": "CKAN",
			"description": "Descarga de dataset en CKAN"
		},
		"urlResource": "https://ckan.redmic.es"
	}],
	"accessibility": {
Loading