Commit 65986818 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Elimina GenericViewer y diseño sidebarAndContent

Tanto esta vista como el diseño (que usaba solamente ella) se han
borrado por completo. No se usan y su implementación mostraba muchas
deficiencias a simple vista. Si se pretende implementar en el futuro una
funcionalidad como la que se planeaba cubrir con ella, será mejor
empezar de nuevo.
parent cc4f6327
Loading
Loading
Loading
Loading
+0 −126
Original line number Diff line number Diff line
define([
	"app/base/views/extensions/_ShowInPopupResultsFromQueryOnMap"
	, "app/base/views/extensions/_QueryOnMap"
	, "app/designs/base/_Main"
	, "app/designs/mapWithSideContent/Controller"
	, "app/designs/mapWithSideContent/layout/MapAndContentAndTopbar"
	, "dijit/layout/ContentPane"
	, "dojo/_base/declare"
	, "dojo/_base/lang"
	, "redmic/modules/base/_Store"

	, "app/designs/primaryAndSecondaryContent/Controller"
	, "app/designs/primaryAndSecondaryContent/layout/Layout"
	, "app/designs/sidebarAndContent/main/GenericViewerPrimaryContent"
	, "app/designs/sidebarAndContent/main/GenericViewerSecondaryContent"
	, "app/designs/sidebarAndContent/main/GenericViewerConfigLayerContent"
	, "app/designs/sidebarAndContent/main/_LayersManagementTab"
], function(
	_ShowInPopupResultsFromQueryOnMap
	, _QueryOnMap
	, _Main
	, Controller
	, Layout
	, ContentPane
	, declare
	, lang
	, _Store

	, PrimaryAndSecondaryContentController
	, PrimaryAndSecondaryContentLayout
	, GenericViewerPrimaryContent
	, GenericViewerSecondaryContent
	, GenericViewerConfigLayerContent
	, _LayersManagementTab
){
	return declare([Layout, Controller, _Main, _Store, _QueryOnMap, _ShowInPopupResultsFromQueryOnMap], {
		//	summary:
		//		Main para visor genérico.
		//	description:
		//

		constructor: function (args) {

			this.config = {

			};

			lang.mixin(this, this.config, args);
		},

		_setMainConfigurations: function() {

			this.primaryContentConfig = this._merge([{
				parentChannel: this.getChannel(),
				viewerConfigByActivityCategory: this._viewerConfigByActivityCategory
			}, this.primaryContentConfig || {}]);

			this.secondaryContentConfig = this._merge([{
				parentChannel: this.getChannel(),
				viewerConfigByActivityCategory: this._viewerConfigByActivityCategory
			}, this.secondaryContentConfig || {}]);

			this.configLayerContentConfig = this._merge([{
				parentChannel: this.getChannel()
			}, this.configLayerContentConfig || {}]);
		},

		_initializeMain: function() {

			this.primaryContentConfig.getMapChannel = lang.hitch(this.map, this.map.getChannel);

			this.primaryContent = new declare([
				GenericViewerPrimaryContent,
				_LayersManagementTab
			])(this.primaryContentConfig);

			this.secondaryContent = new GenericViewerSecondaryContent(this.secondaryContentConfig);

			this.configLayerContent = new GenericViewerConfigLayerContent(this.configLayerContentConfig);

			this.primaryAndSecondaryContent = new declare([
				PrimaryAndSecondaryContentLayout,
				PrimaryAndSecondaryContentController
			])({
				parentChannel: this.getChannel(),
				primaryContentChannel: this.primaryContent.getChannel(),
				secondaryContentChannel: this.secondaryContent.getChannel(),
				title: this.i18n.viewer
			});
		},

		_defineMainSubscriptions: function() {

			this.subscriptionsConfig.push({
				channel : this.primaryContent.getChannel("CHANGE_TO_SECONDARY"),
				callback: "_subChangeToSecondary"
			});
		},

		postCreate: function() {

			this.inherited(arguments);

			this.sideNode = new ContentPane({
				splitter: true,
				region: "right",
				'class': "col-xs-6 col-sm-5 col-md-6 col-lg-5 sideTabContainer"
			});

			this.contentNode.addChild(this.sideNode);

			this._publish(this.primaryAndSecondaryContent.getChannel("SHOW"), {
				node: this.sideNode
			});
		},

		_subChangeToSecondary: function(req) {

			if (req.source === 'layers') {
				req.channel = this.configLayerContent.getChannel();
			}

			this._publish(this.primaryAndSecondaryContent.getChannel("CHANGE_TO_SECONDARY"), req);
		}
	});
});
+0 −88
Original line number Diff line number Diff line
define([
	'app/redmicConfig'
	, 'dojo/_base/declare'
	, 'redmic/modules/map/layer/_AddFilter'
	, 'redmic/modules/map/layer/_ListenBounds'
	, 'redmic/modules/map/layer/_RadiusOnClick'
	, 'redmic/modules/map/layer/GeoJsonLayerImpl'
	, 'redmic/modules/map/layer/PruneClusterLayerImpl'
	, 'redmic/modules/map/layer/TrackingLayerImpl'
	, "templates/AnimalListExpand"
], function(
	redmicConfig
	, declare
	, _AddFilter
	, _ListenBounds
	, _RadiusOnClick
	, GeoJsonLayerImpl
	, PruneClusterLayerImpl
	, TrackingLayerImpl
	, AnimalListTemplate
){

	return declare(null, {
		//	summary:
		//		Extensión para visor genérico, que lo habilita para representar datos de una categoría de actividad.

		constructor: function(args) {

			var config = {
				at: {
					activityContent: {
						register: {
							target: redmicConfig.services.elementsTrackingActivity,
							template: AnimalListTemplate
						}
					},
					map: {
						'default': {
							layerType: 'Tracking'
						},
						layer: {
							PointCluster: {
								props: {
									filterConfig: {
										initQuery: {
											returnFields: ['geometry']
										}
									}
								},
								// TODO esta ruta no puede ir literal aquí, definirla en redmicConfig
								target: '/api/activities/{id}/tracking/elements/75e6dd8e-da57-4a28-aa08-8488de13cad2/track/cluster'
							},
							Point: {
								props: {
									filterConfig: {
										initQuery: {
											returnFields: ['geometry']
										}
									}
								}
							},
							Tracking: {
								props: {
									drawFullTrack: true
								},
								// TODO esta ruta no puede ir literal aquí, definirla en redmicConfig
								target: '/api/activities/{id}/tracking/elements/75e6dd8e-da57-4a28-aa08-8488de13cad2/track/cluster'
							}
						},
						layerDefinition: {
							PointCluster: declare([PruneClusterLayerImpl, _AddFilter, _RadiusOnClick])
								.extend(_ListenBounds),

							Point: declare([GeoJsonLayerImpl, _AddFilter, _RadiusOnClick]).extend(_ListenBounds),

							Tracking: declare([TrackingLayerImpl, _AddFilter])
						}
					}
				}
			};

			this._viewerConfigByActivityCategory = this._merge([
				this._viewerConfigByActivityCategory || {},
				config
			]);
		}
	});
});
+0 −95
Original line number Diff line number Diff line
define([
	'app/redmicConfig'
	, 'app/viewers/models/PointClusterModel'
	, 'app/viewers/models/PointClusterCategorizeModel'
	, 'dojo/_base/declare'
	, 'redmic/modules/map/layer/_AddFilter'
	, 'redmic/modules/map/layer/_ListenBounds'
	, 'redmic/modules/map/layer/_RadiusOnClick'
	, 'redmic/modules/map/layer/GeoJsonLayerImpl'
	, 'redmic/modules/map/layer/PruneClusterLayerImpl'
	, 'templates/CitationListExpand'
], function(
	redmicConfig
	, pointClusterSchema
	, pointClusterCategorizeSchema
	, declare
	, _AddFilter
	, _ListenBounds
	, _RadiusOnClick
	, GeoJsonLayerImpl
	, PruneClusterLayerImpl
	, TaxonListTemplate
){

	return declare(null, {
		//	summary:
		//		Extensión para visor genérico, que lo habilita para representar datos de una categoría de actividad.

		constructor: function(args) {

			var config = {
				ci: {
					activityContent: {
						register: {
							target: redmicConfig.services.citationByActivity,
							template: TaxonListTemplate
						}
					},
					map: {
						'default': {
							layerType: 'PointCluster'
						},
						layer: {
							PointCluster: {
								props: {
									filterConfig: {
										initQuery: {
											returnFields: ['geometry']
										}
									}
								},
								target: redmicConfig.services.citationByActivity
							},
							Point: {
								props: {
									filterConfig: {
										initQuery: {
											returnFields: ['geometry']
										}
									}
								}
							}
						},
						layerDefinition: {
							PointCluster: declare([PruneClusterLayerImpl, _AddFilter, _RadiusOnClick])
								.extend(_ListenBounds),

							Point: declare([GeoJsonLayerImpl, _AddFilter, _RadiusOnClick])
								.extend(_ListenBounds)
						},
						layerStyle: {
							PointCluster: {
								template: "viewers/views/templates/forms/PointCluster",
								templateCategorize: "viewers/views/templates/forms/PointClusterCategorize",
								schema: pointClusterSchema,
								schemaCategorize: pointClusterCategorizeSchema
							},
							Point: {
								template: "viewers/views/templates/forms/PointCluster",
								templateCategorize: "viewers/views/templates/forms/PointClusterCategorize",
								schema: pointClusterSchema,
								schemaCategorize: pointClusterCategorizeSchema
							}
						}
					}
				}
			};

			this._viewerConfigByActivityCategory = this._merge([
				this._viewerConfigByActivityCategory || {},
				config
			]);
		}
	});
});
+0 −47
Original line number Diff line number Diff line
define([
	'app/redmicConfig'
	, 'dojo/_base/declare'
	, 'redmic/modules/map/layer/GeoJsonLayerImpl'
	, 'redmic/modules/map/layer/PruneClusterLayerImpl'
	, "templates/SurveyStationList"
], function(
	redmicConfig
	, declare
	, GeoJsonLayerImpl
	, PruneClusterLayerImpl
	, SurveyStationListTemplate
){

	return declare(null, {
		//	summary:
		//		Extensión para visor genérico, que lo habilita para representar datos de una categoría de actividad.

		constructor: function(args) {

			var config = {
				ft: {
					activityContent: {
						register: {
							target: redmicConfig.services.activityTimeSeriesStations,
							template: SurveyStationListTemplate
						}
					},
					map: {
						layer: [{
							definition: declare([GeoJsonLayerImpl]),
							props: {}
						}, {
							definition: declare([PruneClusterLayerImpl]),
							props: {}
						}]
					}
				}
			};

			this._viewerConfigByActivityCategory = this._merge([
				this._viewerConfigByActivityCategory || {},
				config
			]);
		}
	});
});
+0 −47
Original line number Diff line number Diff line
define([
	'app/redmicConfig'
	, 'dojo/_base/declare'
	, 'redmic/modules/map/layer/GeoJsonLayerImpl'
	, 'redmic/modules/map/layer/PruneClusterLayerImpl'
	, "templates/SurveyStationList"
], function(
	redmicConfig
	, declare
	, GeoJsonLayerImpl
	, PruneClusterLayerImpl
	, SurveyStationListTemplate
){

	return declare(null, {
		//	summary:
		//		Extensión para visor genérico, que lo habilita para representar datos de una categoría de actividad.

		constructor: function(args) {

			var config = {
				'if': {
					activityContent: {
						register: {
							target: redmicConfig.services.infrastructureByActivity,
							template: SurveyStationListTemplate
						}
					},
					map: {
						layer: [{
							definition: declare([GeoJsonLayerImpl]),
							props: {}
						}, {
							definition: declare([PruneClusterLayerImpl]),
							props: {}
						}]
					}
				}
			};

			this._viewerConfigByActivityCategory = this._merge([
				this._viewerConfigByActivityCategory || {},
				config
			]);
		}
	});
});
Loading