Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import DataSource Restructuring (1) #2951

Merged
merged 9 commits into from
Oct 16, 2017
6 changes: 3 additions & 3 deletions contribs/gmf/examples/displayquerygrid.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
goog.provide('gmfapp.displayquerygrid');

goog.require('gmf.DataSourcesManager');
goog.require('gmf.datasource.DataSourcesManager');
goog.require('gmf.Themes');
/** @suppress {extraRequire} */
goog.require('gmf.displayquerygridComponent');
Expand Down Expand Up @@ -87,8 +87,8 @@ gmfapp.module.controller('gmfappQueryresultController', gmfapp.QueryresultContro
/**
* @constructor
* @param {gmf.Themes} gmfThemes The gmf themes service.
* @param {gmf.DataSourcesManager} gmfDataSourcesManager The gmf data sources
* manager service.
* @param {gmf.datasource.DataSourcesManager} gmfDataSourcesManager The gmf
* data sources manager service.
* @param {ngeo.FeatureOverlayMgr} ngeoFeatureOverlayMgr The ngeo feature
* overlay manager service.
* @ngInject
Expand Down
3 changes: 2 additions & 1 deletion contribs/gmf/examples/displayquerywindow.html
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@

<p id="desc">
This example shows how to use the <code>ngeo-map-query</code>
directive in combination with the <code>gmf.DataSourcesManager</code>.
directive in combination with the
<code>gmf.datasource.DataSourcesManager</code>.
The DataSourcesManager fetches the themes returned by the theme
service and adds one DataSource, which is used by the querent service
per layer definition found. In this example, the layer tree is
Expand Down
6 changes: 3 additions & 3 deletions contribs/gmf/examples/displayquerywindow.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
goog.provide('gmfapp.displayquerywindow');

goog.require('gmf.DataSourcesManager');
goog.require('gmf.datasource.DataSourcesManager');
goog.require('gmf.Themes');
/** @suppress {extraRequire} */
goog.require('gmf.displayquerywindowComponent');
Expand Down Expand Up @@ -81,8 +81,8 @@ gmfapp.module.controller('AppQueryresultController', gmfapp.QueryresultControlle
/**
* @constructor
* @param {gmf.Themes} gmfThemes The gmf themes service.
* @param {gmf.DataSourcesManager} gmfDataSourcesManager The gmf data sources
* manager service.
* @param {gmf.datasource.DataSourcesManager} gmfDataSourcesManager The gmf
* data sources manager service.
* @param {ngeo.FeatureOverlayMgr} ngeoFeatureOverlayMgr The ngeo feature
* overlay manager service.
* @ngInject
Expand Down
10 changes: 5 additions & 5 deletions contribs/gmf/examples/filterselector.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ goog.require('gmf.authenticationDirective');
goog.require('gmf.Themes');
goog.require('gmf.TreeManager');
/** @suppress {extraRequire} */
goog.require('gmf.DataSourcesManager');
goog.require('gmf.datasource.DataSourcesManager');
/** @suppress {extraRequire} */
goog.require('gmf.filterselectorComponent');
/** @suppress {extraRequire} */
Expand Down Expand Up @@ -53,12 +53,12 @@ gmfapp.MainController = class {

/**
* @param {!angular.Scope} $scope Angular scope.
* @param {gmf.DataSourcesManager} gmfDataSourcesManager The gmf data sources
* manager service.
* @param {gmf.datasource.DataSourcesManager} gmfDataSourcesManager The gmf
* data sources manager service.
* @param {gmf.Themes} gmfThemes The gmf themes service.
* @param {gmf.TreeManager} gmfTreeManager gmf Tree Manager service.
* @param {ngeo.DataSources} ngeoDataSources Ngeo collection of data sources
* objects.
* @param {ngeo.datasource.DataSources} ngeoDataSources Ngeo collection of
* data sources objects.
* @param {ngeo.ToolActivateMgr} ngeoToolActivateMgr Ngeo ToolActivate manager
* service.
* @ngInject
Expand Down
76 changes: 43 additions & 33 deletions contribs/gmf/options/gmfx.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,6 @@ gmfx.ComparisonFilter.prototype.value;
gmfx.Config;


/**
* The options to create a `gmf.DataSource` with.
* @record
* @struct
* @extends ngeox.DataSourceOptions
*/
gmfx.DataSourceOptions;


/**
* A reference to the GMF layer node that was used to create the data source.
* It may contains additionnal information, such as metadata, about the data
* source.
* @type {gmfThemes.GmfLayer}
*/
gmfx.DataSourceOptions.prototype.gmfLayer;


/**
* Configuration for a grid tab.
* @typedef {{
Expand Down Expand Up @@ -564,21 +546,6 @@ gmfx.User.prototype.role_name;
*/
gmfx.User.prototype.username;

/**
* @typedef {{
* columns : Array.<string>,
* data : Array.<Array.<string|number|boolean>>
* }}
*/
gmfx.DataSourceTableObject;

/**
* @typedef {{
* title : string,
* table : gmfx.DataSourceTableObject
* }}
*/
gmfx.DataSourcePrintReportObject;

/**
* @typedef {{
Expand Down Expand Up @@ -656,6 +623,49 @@ gmfx.openIframePopup;
gmfx.openTextPopup;


/**
* Namespace.
* @type {Object}
*/
gmfx.datasource;


/**
* The options required to create a `gmf.datasource.OGC`.
* @record
* @struct
* @extends ngeox.datasource.OGCOptions
*/
gmfx.datasource.OGCOptions;


/**
* A reference to the GMF layer node that was used to create the data source.
* It may contains additionnal information, such as metadata, about the data
* source.
* @type {gmfThemes.GmfLayer}
*/
gmfx.datasource.OGCOptions.prototype.gmfLayer;


/**
* @typedef {{
* columns : Array.<string>,
* data : Array.<Array.<string|number|boolean>>
* }}
*/
gmfx.datasource.DataSourceTableObject;


/**
* @typedef {{
* title : string,
* table : gmfx.datasource.DataSourceTableObject
* }}
*/
gmfx.datasource.DataSourcePrintReportObject;


/**
* @type {Object}
*/
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/src/controllers/abstract.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ goog.require('gmf.authenticationDirective');
/** @suppress {extraRequire} */
goog.require('gmf.backgroundlayerselectorComponent');
/** @suppress {extraRequire} */
goog.require('gmf.DataSourcesManager');
goog.require('gmf.datasource.DataSourcesManager');
/** @suppress {extraRequire} */
goog.require('gmf.TreeManager');
/** @suppress {extraRequire} */
Expand Down
23 changes: 23 additions & 0 deletions contribs/gmf/src/datasource/datasourcebeingfiltered.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
goog.provide('gmf.datasource.DataSourceBeingFiltered');

goog.require('gmf');


gmf.module.value('gmfDataSourceBeingFiltered', {
dataSource: null
});


/**
* @record
* @struct
* @export
*/
gmf.datasource.DataSourceBeingFiltered = function() {};


/**
* @type {?gmf.datasource.OGC}
* @export
*/
gmf.datasource.DataSourceBeingFiltered.prototype.dataSource;
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
goog.provide('gmf.DataSourcesHelper');
goog.provide('gmf.datasource.DataSourcesHelper');

goog.require('gmf');
goog.require('gmf.EnumerateAttribute');
goog.require('ngeo.DataSourcesHelper');
goog.require('ngeo.datasource.DataSourcesHelper');


gmf.DataSourcesHelper = class {
gmf.datasource.DataSourcesHelper = class {

/**
* A service that provides utility methods to manipulate or get data sources.
* A service that provides utility methods to manipulate or get GMF data
* sources.
*
* @struct
* @param {angular.$q} $q The Angular $q service.
* @param {gmf.EnumerateAttribute} gmfEnumerateAttribute The Gmf enumerate
* attribute service.
* @param {ngeo.DataSourcesHelper} ngeoDataSourcesHelper Ngeo data source
* helper service.
* @param {ngeo.datasource.DataSourcesHelper} ngeoDataSourcesHelper Ngeo data
* source helper service.
* @ngdoc service
* @ngname gmfDataSourcesHelper
* @ngInject
Expand All @@ -37,7 +38,7 @@ gmf.DataSourcesHelper = class {
this.gmfEnumerateAttribute_ = gmfEnumerateAttribute;

/**
* @type {ngeo.DataSourcesHelper}
* @type {ngeo.datasource.DataSourcesHelper}
* @private
*/
this.ngeoDataSourcesHelper_ = ngeoDataSourcesHelper;
Expand All @@ -46,42 +47,42 @@ gmf.DataSourcesHelper = class {
// === Other properties ===

/**
* @type {gmf.DataSources}
* @type {gmf.datasource.DataSources}
* @protected
*/
this.collection_;

/**
* @type {Object.<number, gmf.DataSource>}
* @type {Object.<number, gmf.datasource.OGC>}
* @protected
*/
this.cache_;
}

/**
* @return {gmf.DataSources} Data sources collection.
* @return {gmf.datasource.DataSources} Data sources collection.
* @export
*/
get collection() {
return /** @type {gmf.DataSources} */ (
return /** @type {gmf.datasource.DataSources} */ (
this.ngeoDataSourcesHelper_.collection
);
}

/**
* Return a data source using its id.
* @param {number} id Data source id.
* @return {?gmf.DataSource} Data source.
* @return {?gmf.datasource.OGC} Data source.
* @export
*/
getDataSource(id) {
return /** @type {?gmf.DataSource} */ (
return /** @type {?gmf.datasource.OGC} */ (
this.ngeoDataSourcesHelper_.getDataSource(id)
);
}

/**
* @param {gmf.DataSource} dataSource Filtrable data source.
* @param {gmf.datasource.OGC} dataSource Filtrable data source.
* @return {angular.$q.Promise} Promise.
* @export
*/
Expand Down Expand Up @@ -130,10 +131,10 @@ gmf.DataSourcesHelper = class {
};


gmf.module.service('gmfDataSourcesHelper', gmf.DataSourcesHelper);
gmf.module.service('gmfDataSourcesHelper', gmf.datasource.DataSourcesHelper);


/**
* @typedef {ol.Collection.<gmf.DataSource>}
* @typedef {ol.Collection.<gmf.datasource.OGC>}
*/
gmf.DataSources;
gmf.datasource.DataSources;