Select to view content in your preferred language

Search Results LINK: FGDC HTML Formatted View

4596
5
01-20-2011 07:59 AM
KristenWobbe
Deactivated User
I worked with our web developer to add an HTML view of the metadata in our Geoportal (v9.3.1.sp1) for easier metadata review. This customized code added to the results.jsp file displayed a link in the search results called "FGDC Formatted XML." A user can click on the link and another page pops-up with a user-friendly view of the metadata (as opposed to viewing raw XML).

The problem is that when I migrated this code to the same file in Geoportal (v10), it no longer worked properly. (It broke 🙂 We tried to trouble-shoot this problem, after giving consideration to the metadata itself, we concluded the XSL we were currently using should work because the metadata in our Geoportal (v10) database is the same as what was in the previous (9.3.1.sp1) database.

Even if we had Upgraded our metadata to ArcGIS 10 Metadata --> it would still only contain the FGDC elements Exported to XML --> then Published to Geoportal (v10).

It's just strange that the links don't work in FGDC Plus, and the font doesn't wrap for items like Abstract and Purpose in FGDC Classic when applied in Geoportal (v10).

Now we are wondering if the problem is related to the server, or changes to the underlying code and configuration files in support of new functionality in Geoportal (v10)? Does anyone have any helpful thoughts or tips we could try?
0 Kudos
5 Replies
KristenWobbe
Deactivated User
We added the following code to the Results.jsp file directly above the following line as shown below:
<% // Zoom map to this metadata extent %>

<% // Hard coded link to xsl %>
<f:verbatim>
<a name="fgdcLink" class="resultsLink" target="_blank" href="#">FGDC Formatted XML</a>
<script language="javascript">
  //Loop them all
  var LinkToEdit = null;
  var LinkCount = document.links.length;
  for (i=0; i < LinkCount; i++) {
   //This loop does not break because we need the last qualifying link on the page
             if(document.links.name.match('fgdcLink')) { LinkToEdit = i; }
  }
  //edit the last one we found
  if (LinkToEdit != null) {
   baseURL = "http://web.or.blm.gov/gis/metadata/?xmlfile=";
   xmlURL = document.links[LinkToEdit - 1].href;
   document.links[LinkToEdit].href = baseURL + xmlURL;
  }
</script>
</f:verbatim>
<% // Zoom map to this metadata extent %>
0 Kudos
MartenHogeweg
Frequent Contributor
it seems to render the XML in nicely formatted HTML you pass it to a separate page that handles the formatting. is that done by applying an XSLT or different? we're looking to build a sample customization for the Geoportal Server (http://esriurl.com/geoportalserver) and perhaps your work could be a basis for that.

Marten
0 Kudos
KristenWobbe
Deactivated User
Hi Marten:
Our web developer is out today, and there is a portion of this code that works outside the Geoportal because it ties to a similar solution we use on our external website: http://www.blm.gov/or/gis/data.php
When you download a GIS dataset you can view the full metadata.

The reason I blogged about it was because this works perfectly in GPT version 9.3.1.sp1, but the links don't work in GPT version 10 for the FGDC Plus stylesheet, and the font doesn't wrap for items like Abstract and Purpose in the FGDC Classic view when applied in Geoportal (v10). See attachments!

Did you notice this? Can you think of any new code in the v10 results.jsp file that would affect this?

I know our "web guy" was looking for a XSL file that might work better with GPT v10, and was thinking he may have to re-write the solution. We'll talk when he returns. I think we would like to work with you on the code sample customization for the Geoportal Server for the web page you described (http://esriurl.com/geoportalserver). What is the protocol? How do we go about it?

Thanks for your reply.
...~Kris
0 Kudos
KristenWobbe
Deactivated User
Hi Marten:
Here is the rest of the code to complete the story. I hope this helps in assisting you to build a sample customization for the Geoportal Server to share on http://esriurl.com/geoportalserver! Maybe I could benefit from that, because this solution has a couple of minor problems in v10.

Here's the code from our Web Developer Chris Zwemke:


"Here is how it works.

1. Edit the results.jsp file with a simple bit of JavaScript.
(This by the way, is the only thing I have written originally)

/**
On link clicked, change the href to include the info from the previous link
@param clickedLink is the DOM object clicked
**/
function orwaFGDCLinkage(clickedLink ) {
baseURL = "http://web.or.blm.gov/gis/metadata/?xmlfile=";
xmlURL = clickedLink .previousSibling.href;
clickedLink .href = baseURL + xmlURL;
}

And this code is used down the page

.........
.........
<h:outputText escape="false" value="#{record.resourceLinks}">
<f:converter converterId="gpt.ResourceLinksToHtml" />
</h:outputText>
<% // Custom hard coded link to xsl %>
<f:verbatim>
<a name="fgdcLink" class="resultsLink" target="_blank" href="#" onclick="orwaFGDCLinkage(this)">FGDC Formatted XML</a>
</f:verbatim>
<% // Zoom map to this metadata extent %>
<h:outputLink id="_lnkZoomTo" value="javascript:void(0)"
.........
.........

So the result is a link that will take the path to the dynamically generated XML and send it to a tool I have written on a different server. This causes the Cross Site Authentication issue. It would be very much better to keep this link on the same server as geoportal, but I don't know how to port code to it offhand.

2. Have a page on a different server that applies a .xsl file to the XML output
This is what we are doing on a different server in the Intranet. None of this code was written here.

I use a JS file that full of copied code from both O'Reilly publishing and Manning Publications
http://web.or.blm.gov/gis/metadata/js/or_gis.js

Then a Cascading Style Sheet file that came from the examples that gave me the JS files
http://web.or.blm.gov/gis/metadata/css/metadata.css

And a super simple HTML file that calls the functions in the JS file.
http://web.or.blm.gov/gis/metadata/index.html


There are mounds of improvements to make in this process. It would be better to have a server side language apply the xsl to the XML, and it would be clearly better to host it all on a single server. Again however, I would not know how to write code on the server that is hosting the Geoportal."



Here's our disclaimer: There may be other better methods to do this, but this worked for us in v9.3.1.sp1.

What Chris means about, "not knowing how to write the code on the server that is hosting the Geoportal," is that he doesn't have time to figure out where to put the code within the Apache Struts structure. So that may be part of the solution (as you have in the past) maybe you could tell us where to put the programming code?

For now I will have to live with the
Classic FGDC view and the text in the abstract & purpose not wrapping until a better solution is found.

Let me know what you think.
Thanks...~Kristen


it seems to render the XML in nicely formatted HTML you pass it to a separate page that handles the formatting. is that done by applying an XSLT or different? we're looking to build a sample customization for the Geoportal Server (  http://esriurl.com/geoportalserver) and perhaps your work could be a basis for that. 

Marten
0 Kudos
KristenWobbe
Deactivated User
I discovered the mystery about why the text in the Abstract & Purpose were not wrapping in version 10 Geoportal.

Well as it turns out, it may not be a version 10 problem at all!  A metadata writer in our group was typing the Abstract and Purpose in Notepad, and then copying and pasting that into the metadata.  We came across it and noticed it when he published a batch of metadata in 9.3.1.sp1 recently.  I recommend he changed his workflow and type in Word, or Wordpad.  He made the change and it worked.  So hopefully this is the answer, and was easily resolved.
...~Kris
0 Kudos