Skip to content

Commit

Permalink
Merge pull request #50 from dan-bowerman/develop
Browse files Browse the repository at this point in the history
fix(registration): fix display field not being stored in layer registration
  • Loading branch information
james-rae authored Jul 15, 2016
2 parents 03f064c + 39ea3d5 commit 089de46
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@
# built documents.
#
# The short X.Y version.
version = '2.0'
version = '2.1'
# The full version, including alpha/beta/rc tags.
release = '2.0.0'
release = '2.1.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
11 changes: 7 additions & 4 deletions services/regparse/esri.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,13 @@ def make_server_node(req):
elif 'recursive' in req:
query_service = requests.get(req['service_url'] + "?f=pjson", proxies=flask.g.proxies)
service_json = query_service.json()
if service_json['type'] == 'Group Layer':
result['service_url'] = req['service_url'].rstrip('1234567890')
result['url'] = req['service_url'].rstrip('1234567890')
sublayer_json = service_json['subLayers']
result['service_url'] = req['service_url'].rstrip('1234567890')
result['url'] = req['service_url'].rstrip('1234567890')
sublayer_json = []
if 'type' not in service_json:
sublayer_json = [x for x in service_json['layers'] if x['parentLayerId'] == -1]
else:
sublayer_json = service_json['subLayers']
result['layerEntries'] = [{'index': sl['id']} for sl in sublayer_json]
else:
result['layerEntries'] = []
Expand Down
2 changes: 2 additions & 0 deletions services/regparse/universal.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ def make_node(key, json_request, config):
if c_url:
node[lang]['metadataUrl'] = m_url
node[lang]['catalogueUrl'] = c_url
if 'display_field' in json_request[lang]:
n['nameField'] = json_request[lang]['display_field']
n.update(parser_map[ltype](json_request[lang]))
if 'service_name' in json_request[lang]:
# important to do this last so it overwrites anything scraped from the custom parser
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
setup(
name="rcs",
description="RAMP Configuration Service",
version="2.0.1",
version="2.1.0",
author="Environment and Climate Change Canada",
author_email="[email protected]",
url="https://github.com/fgpv-vpgf/rcs",
Expand Down
32 changes: 32 additions & 0 deletions static/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@
<input type="button" class="btn btn-default samplejson" value="esriFeature (Specific Sublayers)" data-obj="sampleScrapeOnly" />
<input type="button" class="btn btn-default samplejson" value="esriFeature (w/ Metadata)" data-obj="sampleCatalogue" />
<input type="button" class="btn btn-default samplejson" value="esri Group Layer (recursive)" data-obj="sampleRecursive" />
<input type="button" class="btn btn-default samplejson" value="esriMapService (recursive)" data-obj="sampleRecursiveMapservice" />
<input type="button" class="btn btn-default samplejson" value="ogcWMS Group Layer (recursive)" data-obj="sampleRecursiveWMS" />
<input type="button" class="btn btn-default samplejson" value="esriFeature (Display Field)" data-obj="sampleDisplayField" />
</div>
</div>
<div class="row"><div id="log" class="form-group col-md-12">
Expand Down Expand Up @@ -281,6 +283,36 @@
"service_name": "WMS english"
},
"version": "2.0"
},
sampleDisplayField = {
"fr": {
"service_url": "http://section917.cloudapp.net/arcgis/rest/services/JOSM/Oilsands_fr/MapServer/20",
"service_type": "esriFeature",
"display_field": "siteShortName_fr",
"service_name": "Surveillance de la situation et des tendances d'oiseaux terrestres inscrits rares et difficiles à surveiller"
},
"en": {
"service_url": "http://section917.cloudapp.net/arcgis/rest/services/JOSM/Oilsands_en/MapServer/20",
"service_type": "esriFeature",
"display_field": "siteShortName_en",
"service_name": "Status and Trend Monitoring of Listed, Rare, and Difficult-to-Monitor Landbirds"
},
"version": "2.0"
},
sampleRecursiveMapservice = {
"en": {
"service_url": "http://geoappext.nrcan.gc.ca/arcgis/rest/services/NorthAmerica/energy_infrastructure_of_north_america_en/MapServer",
"recursive": true,
"service_type": "esriMapServer",
"service_name": "Energy Infrastructure of North America"
},
"fr": {
"service_url": "http://geoappext.nrcan.gc.ca/arcgis/rest/services/NorthAmerica/energy_infrastructure_of_north_america_fr/MapServer",
"recursive": true,
"service_type": "esriMapServer",
"service_name": "Infrastructure énergétique d'Amérique du Nord"
},
"version": "2.0"
};

function get_versioned_url() {
Expand Down

0 comments on commit 089de46

Please sign in to comment.