Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44812 from tomkralidis/metasearch-ogcapi-records
[FEATURE][MetaSearch] add support for OGC API - Records
- Loading branch information
Showing
16 changed files
with
637 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
67 changes: 67 additions & 0 deletions
67
python/plugins/MetaSearch/resources/templates/oarec_service_metadata.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<!DOCTYPE html> | ||
<html lang="{{ language }}"> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<title>{{ gettext('Service Metadata') }}</title> | ||
<style type="text/css"> | ||
body,h3, h4 { | ||
background-color: #ffffff; | ||
font-family: arial, verdana, sans-serif; | ||
text-align: left; | ||
float: left; | ||
} | ||
header { | ||
display: inline-block; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<header> | ||
<h3>{{ gettext('Service Metadata') }}</h3> | ||
</header> | ||
<section id="service-metadata"> | ||
<h4>{{ gettext('Service Identification') }}</h4> | ||
<table> | ||
<tr> | ||
<td>{{ gettext('Title') }}</td> | ||
<td>{{ obj.title }}</td> | ||
</tr> | ||
<tr> | ||
<td>{{ gettext('Abstract') }}</td> | ||
<td>{{ obj.description or obj['title'] }}</td> | ||
</tr> | ||
<tr> | ||
<td>{{ gettext('Service URL') }}</td> | ||
<td><a href="{{ obj.url }}">{{ obj.url}}</a></td> | ||
</tr> | ||
</table> | ||
</section> | ||
|
||
<section id="collections"> | ||
<h4>{{ gettext('Collections') }}</h4> | ||
{% for j in obj.collections()['collections'] %} | ||
{% if j.id in obj.records() %} | ||
<p><b>{{ j.title }}</b><br/>{{ j.description }}</p> | ||
{% endif %} | ||
{% endfor %} | ||
</section> | ||
|
||
<section id="conformance"> | ||
<h4>{{ gettext('Conformance') }}</h4> | ||
<ul> | ||
{% for i in obj.conformance()['conformsTo'] %} | ||
<li><a href="{{ i }}">{{ i }}</a></li> | ||
{% endfor %} | ||
</ul> | ||
</section> | ||
|
||
<section id="links"> | ||
<h4>{{ gettext('Links') }}</h4> | ||
<ul> | ||
{% for link in obj.links %} | ||
<li><a href="{{ link['href'] }}">{{ link['title'] }}</a></li> | ||
{% endfor %} | ||
</ul> | ||
</section> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
python/plugins/MetaSearch/resources/templates/record_metadata_oarec.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<!DOCTYPE html> | ||
{% macro render_item_value(v, width) -%} | ||
{% set val = v | string | trim %} | ||
{% if val|length and val.lower().endswith(('.jpg', '.jpeg', '.png', '.gif', '.bmp')) %} | ||
{# Ends with image extension: render img element with link to image #} | ||
<a href="{{ val }}"><img src="{{ val }}" alt="{{ val.split('/') | last }}" width="{{ width }}"/></a> | ||
{% elif v is string or v is number %} | ||
{{ val | urlize() }} | ||
{% elif v is mapping %} | ||
<ul> | ||
{% for i,j in v.items() %} | ||
<li><i>{{ gettext(i) }}:</i> {{ render_item_value(j, 60) }}</li> | ||
{% endfor %}</ul> | ||
{% elif v is iterable %} | ||
<ul> | ||
{% for i in v %} | ||
<li>{{ render_item_value(i, 60) }}</li> | ||
{% endfor %} | ||
</ul> | ||
{% else %} | ||
{{ val | urlize() }} | ||
{% endif %} | ||
{%- endmacro %} | ||
<html lang="{{ language }}"> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<title>{{ gettext('Record Metadata') }}</title> | ||
<style type="text/css"> | ||
body, h3 { | ||
background-color: #ffffff; | ||
font-family: arial, verdana, sans-serif; | ||
text-align: left; | ||
float: left; | ||
} | ||
header { | ||
display: inline-block; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<header> | ||
<h3>{{ gettext('Record Metadata') }} (<a href="{{ obj.url }}">{{ gettext('View JSON') }}</a>)</h3> | ||
</header> | ||
<section id="record-metadata"> | ||
<table> | ||
<tr> | ||
<td>{{ gettext('Identifier') }}</td> | ||
<td>{{ obj['id'] }}</td> | ||
</tr> | ||
{% if (obj['properties']) %} | ||
{% for a,b in obj['properties'].items() %} | ||
{% if a not in ['extent'] %} | ||
<tr> | ||
<td>{{ gettext(a) }}</td> | ||
<td>{{ render_item_value( b, 120 ) }}</td> | ||
</tr> | ||
{% endif %} | ||
{% endfor %} | ||
{% endif %} | ||
</table> | ||
</section> | ||
</body> | ||
</html> |
Oops, something went wrong.