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 Component (2) #2956

Closed
wants to merge 10 commits into from
Closed

Import DataSource Component (2) #2956

wants to merge 10 commits into from

Conversation

adube
Copy link
Contributor

@adube adube commented Oct 5, 2017

This PR introduces the gmf-importdatasource component:

  • contains 2 modes:
  • local (currently does nothing as part of this PR. Will come in an other PR)
  • online (currently shows a plain text input instead of a list as part of this PR. The list will come in an other PR)

The ngeo.Querent service is now able to issue WMS GetCapatilities requests, and even cache the result in case we're using the OnlineResource url as unique key for the cache.

A gmf.datasource.ExternalDataSourcesManager service is introduced in the PR to take care of managing the creation of the data sources that are created from the WMS Capabilities (WMTS and files will come in other tickets).

The component has also been added to the desktop_alt app, in order to be able to test the logging in and out, i.e. while doing so, external data sources should be kept (this is the case in this PR).

Change to the gmf.datasource.DataSourcesManager service

The manager used to always clear the collection of ngeo data sources upon changing theme, i.e. when logging in/out we cleared all of the ngeo data sources. This is no longer the case as part of this PR, as external data sources are added in there as well, and changing theme should not remove them.

To fix this, only the data sources that are in the manager cache are removed, thus leaving the external data sources in there, untouched.

Id of the external data sources

The concept of data source id is critical for the manager, queries, etc. to do their job accordingly. Each data source must have a unique numeric id. This is the case already for the data source that are created from the theme JSON.

For external data sources, we do not have an id, only a name. Also, a name is not enough as id, since multiple servers could have layers of the same name. As part of this PR, the id issue is addressed like this:

  • generate an id on the capabilities object using ol.getUid
  • add a million

This solution works as part of GMF, as long as the ids returned by the theme remain under the million. Please, validate this.

Todo

Example

You can use the following url to test: http://wms.geo.admin.ch/?lang=fr

You can test either in the GMF example, or in the desktop_alt app.

As part of this PR, no layer is actually added. The data source is simply pushed in the ngeoDataSources collection, nothing else. The creation of an OpenLayers layer will come in a separate PR.

@adube adube force-pushed the import-ds-02-component branch 2 times, most recently from 24baa6c to 8646dd7 Compare October 10, 2017 14:22
@adube adube requested a review from fredj October 10, 2017 14:36
@adube adube changed the title WIP Import DataSource Component (2) Import DataSource Component (2) Oct 10, 2017
@adube
Copy link
Contributor Author

adube commented Oct 10, 2017

@fredj Once #2951 gets merged and this is rebased on top of master, then it would be ready for review.

@adube adube force-pushed the import-ds-02-component branch 4 times, most recently from 4f6d09d to 7311faf Compare October 11, 2017 14:03
@adube adube force-pushed the import-ds-02-component branch 4 times, most recently from 7257963 to e9299cd Compare October 13, 2017 13:17
@adube
Copy link
Contributor Author

adube commented Oct 16, 2017

The revision will take place in #2988.

@adube adube closed this Oct 16, 2017
@adube adube deleted the import-ds-02-component branch October 16, 2017 15:26
@sbrunner sbrunner added this to the dummy milestone Apr 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants