Commit 0ae678ea authored by Noel Alonso's avatar Noel Alonso
Browse files

Adapta componentes por cambio en modelo

parent 0642880f
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
package es.redmic.atlasview.model.layer;

/*-
 * #%L
 * Atlas-view
 * %%
 * 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%
 */


public class Activity {

	public Activity() {
	}

	String id;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
}
+37 −0
Original line number Diff line number Diff line
package es.redmic.atlasview.model.layer;

/*-
 * #%L
 * Atlas-view
 * %%
 * 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%
 */

public class LayerActivity {

	public LayerActivity() {
	}

	private Activity activity;

	public Activity getActivity() {
		return this.activity;
	}

	public void setActivity(Activity activity) {
		this.activity = activity;
	}
}
+5 −6
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ import org.locationtech.jts.geom.Polygon;
import com.fasterxml.jackson.annotation.JsonIgnore;

import es.redmic.elasticsearchlib.common.model.JoinIndex;
import es.redmic.models.es.administrative.model.ActivityCompact;
import es.redmic.models.es.common.model.BaseAbstractStringES;

public class LayerWMS extends BaseAbstractStringES {
@@ -45,7 +44,7 @@ public class LayerWMS extends BaseAbstractStringES {
	private List<String> srs;
	private List<StyleLayer> stylesLayer;
	private Contact contact;
	private List<ActivityCompact> activities;
	private List<LayerActivity> activities;
	private List<String> formats;
	private Polygon geometry;
	private String legend;
@@ -131,11 +130,11 @@ public class LayerWMS extends BaseAbstractStringES {
		this.contact = contact;
	}

	public List<ActivityCompact> getActivities() {
	public List<LayerActivity> getActivities() {
		return activities;
	}

	public void setActivities(List<ActivityCompact> activities) {
	public void setActivities(List<LayerActivity> activities) {
		this.activities = activities;
	}

+1 −1
Original line number Diff line number Diff line
@@ -282,7 +282,7 @@ public class LayerESRepository extends RWDataESRepository<Layer, GeoDataQueryDTO
		if (terms.containsKey("activities")) {

			List<Integer> ids = (List<Integer>) terms.get("activities");
			query.must(QueryBuilders.nestedQuery("activities", QueryBuilders.boolQuery().filter(QueryBuilders.termsQuery("activities.id", ids)),
			query.must(QueryBuilders.nestedQuery("activities", QueryBuilders.boolQuery().filter(QueryBuilders.termsQuery("activities.activity.id", ids)),
				ScoreMode.Avg));
		}
		return super.getTermQuery(terms, query);
+4 −18
Original line number Diff line number Diff line
@@ -48,25 +48,11 @@
				"activities": {
					"dynamic": false,
					"type": "nested",
					"properties": {
						"activity": {
							"properties": {
								"id": {
									"type": "long"
						},
						"name": {
							"type": "text",
							"fields": {
								"keyword": {
									"type": "keyword",
									"ignore_above": 256
								}
							}
						},
						"path": {
							"type": "text",
							"fields": {
								"keyword": {
									"type": "keyword",
									"ignore_above": 256
								}
							}
						}
Loading