Esri / geoportal-server

Geoportal Server is a standards-based, open source product that enables discovery and use of geospatial resources including data and services.
https://gptogc.esri.com/geoportal
Apache License 2.0
244 stars 149 forks source link

Embed metadata details in external web app #196

Closed rajk1 closed 8 years ago

rajk1 commented 8 years ago

Hi,

I need to embed the details of a metadata record from GeoPortal in an iFrame in an external web application (COTS product). I can only supply a URL to the external app. Launching the details of a metadata record (from within GeoPortal) provide me with the URL that I can use. However, I would like to view the metadata details without the GeoPortal page header and footer. Is this possible? I've looked at the following link: https://github.com/Esri/geoportal-server/wiki/Use-an-XSLT-to-Render-the-Details-Page but it doesn't help much.

Thanks. Raj

mhogeweg commented 8 years ago

hi Raj,

you can do this using the Geoportal Server REST API. with this API you can get an HTML doc of the individual snippet that may be embedded in an iframe. example:

http://gptogc.esri.com/geoportal/rest/find/document?f=htmlfragment&searchText=uuid%3A%5C%7B00C81E74%5C-337D%5C-4C1C%5C-A632%5C-4A3512021C7D%5C%7D

notice the document id value is url encoded and some of the characters are escaped as well. decoded this value is:

uuid:\{00C81E74\-337D\-4C1C\-A632\-4A3512021C7D\}

M

rajk1 commented 8 years ago

I noticed the REST API gives a truncated version of the Abstract with links at the bottom and no further details. Is there anyway to get more details in a simple HTML page? I'm looking for something similar to what is found at the following URL to be displayed in the iframe: http://www.blm.gov/az/GIS/meta_files/n_az_mineral_withdrawal.htm.

If it has those links at the bottom to jump into GeoPortal that would be awesome.

mhogeweg commented 8 years ago

you could use the json or xml formats for the item also and then apply styling as needed. for XML you could use the XSLT that renders that page. for example for FGDC: http://maps.helcom.fi/website/metadata/

I've uploaded a simple gist that has an HTML page that parses a local XML file (or string) and then picks selected elements and renders them in HTML.

you could take that and adapt to your needs.

rajk1 commented 8 years ago

Thanks for the guidance. I thought there might have been an easier way.