Commit 2ae3283a authored by Noel Alonso's avatar Noel Alonso
Browse files

Corrige filtrado de catalogo OGC

Compatibiliza facets y búsqueda avanzada con requestJoiner.
parent 357357c6
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -54,11 +54,16 @@ define([
				pathProperty: this.pathProperty,
				pathSeparator: this.pathSeparator
			});

			this._subscribe(this.filter.getChannel('ADDED_TO_QUERY'), lang.hitch(this, function() {

				this._emitEvt('REFRESH');
			}))
		},

		_requestAtlasDataOnRefresh: function() {

			this._requestAtlasData();
			this._publish(this._buildChannel(this.queryChannel, "serialize"));
		},

		_requestAtlasData: function(queryObj) {
@@ -66,13 +71,6 @@ define([
			this._publish(this._atlasData.getChannel('REQUEST_TO_TARGETS'), queryObj || {});
		},

		postCreate: function() {

			this.inherited(arguments);

			this._emitEvt('REFRESH');
		},

		_handleFilterParams: function(filterParams) {

			if (filterParams.suggest) {
+3 −0
Original line number Diff line number Diff line
@@ -58,6 +58,9 @@ define([
			this.subscriptionsConfig.push({
				channel: this.filter.getChannel('SERIALIZED'),
				callback: '_subFilterSerialized'
			},{ // TODO: REQUEST_FILTER parece lo mismo que SERIALIZE, hacer que todo vaya por SERIALIZE
				channel: this.filter.getChannel('REQUEST_FILTER'),
				callback: '_subFilterSerialized'
			});
		},

+6 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ define([
				actions: {
					REFRESH: "refresh",
					ADD_TO_QUERY: "addToQuery",
					ADDED_TO_QUERY: "addedToQuery",
					REFRESHED: "refreshed",
					AVAILABLE_FACETS: "availableFacets",
					RESET: "reset",
@@ -233,6 +234,11 @@ define([
				serialize && this._isValid({
					callback: this._subSerialized
				});

				// TODO: Añadir comprobación en la suscripción no en la publicación
				if (query.aggs) {
					this._publish(this.getChannel('ADDED_TO_QUERY'));
				}
			} else {
				if (!this._pendingAddToQuery) {
					this._pendingAddToQuery = {};
+1 −5
Original line number Diff line number Diff line
@@ -123,11 +123,7 @@ define([
				};
			}

			if (queryParams && queryParams.text) {
				return queryParams;
			}

			return {};
			return queryParams || {};
		},

		_expandQueryWithPreviousResponse: function(target, queryParams, prevRes) {
+2 −7
Original line number Diff line number Diff line
@@ -117,19 +117,14 @@ define([

			var queryParams;
			if (queryObj) {
				if (!queryObj.target) {
				queryParams = queryObj.queryParams;
				} else {// if (queryObj.target === target) {
					queryParams = queryObj.queryParams;
				}
			}

			return {
				target: target,
				query: this._getRequestQuery(target, queryParams),
				method: 'POST',
				action: this._getRequestAction(target, queryObj) || '_search',
				requesterId: this.getOwnChannel()
				action: this._getRequestAction(target, queryObj) || '_search'
			};
		},