Difference between revisions of "Discovery Hack-a-thon Details"

From Earth Science Information Partners (ESIP)
Line 72: Line 72:
  
 
Learn how to generate simple interfaces to OpenSearch cast feeds. ESIP Discovery casts extend the Atom casts format and thus these transforms will expose additional information to the user interface.
 
Learn how to generate simple interfaces to OpenSearch cast feeds. ESIP Discovery casts extend the Atom casts format and thus these transforms will expose additional information to the user interface.
 +
 +
The XSLT processors we'll try out are
 +
# your modern browser
 +
# [http://saxon.sourceforge.net/#F9.4HE Saxon-HE 9.4] (open source home edition)
 +
 +
 +
Getting Saxon
 +
* download: [http://sourceforge.net/projects/saxon/files/Saxon-HE/9.4/SaxonHE9-4-0-4J.zip/download SaxonHE9-4-0-4J.zip]
 +
* reference: [http://www.saxonica.com/documentation/index.html Saxon documentation]
 +
* unzip SaxonHE9-4-0-4J.zip
 +
* we only need to use the "saxon9he.jar" library
 +
 +
 +
Saxon command-line interface
 +
* [http://www.saxonica.com/documentation/using-xsl/commandline.xml Saxon command-line options]
 +
<pre>
 +
# -t  Display version and timing information to the standard error output. The output also traces the files that are read and writing, and extension modules that are loaded.
 +
# -tree:(linked|tiny|tinyc)  Selects the implementation of the internal tree model. -tree:tiny selects the "tiny tree" model (the default). -tree:linked selects the linked tree model. -tree:tinyc selects the "condensed tiny tree" model.
 +
 +
java -cp saxon9he.jar  net.sf.saxon.Transform  -tree:linked -t -s:{source-xml-filename}  -xsl:{xsl-filename}  -o:{output-filename}
 +
</pre>
 +
 +
 +
A complete working example tutorial of an XSL to process Atom 1.0 to XHTML
 +
* [http://www.ibm.com/developerworks/xml/tutorials/x-atomxsl/section3.html Tutorial on Processing Atom 1.0 to XHTML]
 +
* [http://www.ibm.com/developerworks/xml/tutorials/x-atomxsl/section3.html#listing6 listing 6] has a complete XSLT transform providing an XHTML view of an Atom feed. save as "atom2xhtml.xsl"
 +
 +
Download a sample ESIP OpenSearch granule response.
 +
 +
Edit the response to include the sytle-sheet directive.
 +
<pre>
 +
<?xml version='1.0' encoding='UTF-8'?>
 +
 +
<?xml-stylesheet type="text/xsl" href="opensearch2xhtml.xsl"?>
 +
 +
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:os="http://a9.com/-/spec/opensearch/1.1/" xmlns:time="http://a9.com/-/opensearch/extensions/time/1.0/" xmlns:geo="http://a9.com/-/opensearch/extensions/geo/1.0/" xmlns:nsidc="http://nsidc.org/ns/opensearch/1.1/">
 +
 +
...
 +
</pre>
 +
 +
Try the OpenSearch feed with your browser and Saxon.
 +
  
 
'''Mentors:''' Hook Hua and ...
 
'''Mentors:''' Hook Hua and ...
 
  
 
= Hack-a-thon Resources =
 
= Hack-a-thon Resources =

Revision as of 09:02, July 17, 2012

Overview

What's the Plan? Get together to make some simple Discovery clients! All are welcome, no previous experience or coding skills necessary!

  • Two back-to-back sessions:
  1. Tuesday, July 17, 2012. 1:30pm-3:00pm
  2. Tuesday, July 17, 2012. 3:30pm-5:00pm

Abstract: The set of ESIP Discovery services encompass the overlapping conventions of Earth science federated OpenSearch, Collection Casting, Granule Casting, and Service Casting feed standards. To help lower the barrier of entry, we will provide a set of hands-on and simple approaches to using Discovery services. These include walking through some "low-hanging fruit" approaches to calling OpenSearch, Collection Casting, Granule Casting, and Service Casting.

Tuesday, July 17, 2012. 1:30pm-3:00pm: Non-Coders

Discovery Hack-a-thon Overview (20-mins)

Quick overview of ESIP Discovery services and set the stage for call the ESIP Discovery services from various simple clients.

Poll the audience for interest.

Hack-a-thon Breakout (70-mins)

Geoportal

We will have a Geoportal from our testbed up and running. You'll learn what protocols the geoportal already supports for service validation, how to use the geoportal to validate and register data and services, and how to add configurations for validation to a geoportal instance. Or, just take the Discovery Cluster geoportal instance out for a spin!

Mentor: Christine White

Browsers and News Readers

It's even possible to interact with both Data "casts" and OpenSearch servers using a simple browser. Also, News Readers, especially useful for Data casts!

Mentors: Ruth Duerr and ...

Cast Publishing and Aggregation

Learn how to use existing web apps create 1-off data casts. Come, create a cast or two and then see it found (that's the idea anyway).

Mentors: Ruth Duerr and ...

Command line

Yes, you can interact with an OpenSearch server or a Data Cast using basic command-line URL getters, like wget (available for all platforms) and curl.

Mentors: Hook Hua and Chris Lynnes


Tuesday, July 17, 2012. 3:30pm-5:00pm: Coders

Discovery Hack-a-thon Overview (15-mins)

Quick overview of ESIP Discovery services and set the stage for call the ESIP Discovery services from various simple clients.

Poll the audience for interest.

Hack-a-thon Breakout (75-mins)

Perl Monks

Learn how to hack a quick client together. Particularly useful for doing scripted search/acquire for datasets following your own, possibly idiosyncratic needs.

Sample code: Media:esip_fedsearch2.pl.txt

Mentors: Chris Lynnes and ...

Python Scripters

Learn how to use Python, an easy to use, but powerful scripting language, to interact with OpenSearch servers and find the data you need.

Mentors: Nga Chung and ...

Java Programmers

Mentors: Eric Rozell and ...

XSL Transforms

Learn how to generate simple interfaces to OpenSearch cast feeds. ESIP Discovery casts extend the Atom casts format and thus these transforms will expose additional information to the user interface.

The XSLT processors we'll try out are

  1. your modern browser
  2. Saxon-HE 9.4 (open source home edition)


Getting Saxon


Saxon command-line interface

# -t  Display version and timing information to the standard error output. The output also traces the files that are read and writing, and extension modules that are loaded.
# -tree:(linked|tiny|tinyc)  Selects the implementation of the internal tree model. -tree:tiny selects the "tiny tree" model (the default). -tree:linked selects the linked tree model. -tree:tinyc selects the "condensed tiny tree" model. 

java -cp saxon9he.jar  net.sf.saxon.Transform  -tree:linked -t -s:{source-xml-filename}  -xsl:{xsl-filename}  -o:{output-filename}


A complete working example tutorial of an XSL to process Atom 1.0 to XHTML

Download a sample ESIP OpenSearch granule response.

Edit the response to include the sytle-sheet directive.

<?xml version='1.0' encoding='UTF-8'?>

<?xml-stylesheet type="text/xsl" href="opensearch2xhtml.xsl"?>

<feed xmlns="http://www.w3.org/2005/Atom" xmlns:os="http://a9.com/-/spec/opensearch/1.1/" xmlns:time="http://a9.com/-/opensearch/extensions/time/1.0/" xmlns:geo="http://a9.com/-/opensearch/extensions/geo/1.0/" xmlns:nsidc="http://nsidc.org/ns/opensearch/1.1/">

...

Try the OpenSearch feed with your browser and Saxon.


Mentors: Hook Hua and ...

Hack-a-thon Resources

Casts

Collection Casts

Granule-level Casts

Service Casts

OpenSearch Description Documents

Top Level (search for datasets)

Granule-level Examples

Example URLs

OpenSearch

How-To Guides


Back to Discovery_Hack-a-thon