From: Aron Roberts Date: Sat, 28 Feb 2009 00:21:31 +0000 (+0000) Subject: An initial set of WADL-related resources, including the PDF copy of the spec, a RELAX... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=254922421394e07a8f48573979e1d0d45e5a4c31;p=tmp%2Fjakarta-migration.git An initial set of WADL-related resources, including the PDF copy of the spec, a RELAX NG Compact Format schema document for validating WADL documents, an XSLT stylesheet for generating HTML documentation from WADL documents, and a sample WADL document. --- diff --git a/sandbox/aron/wadl/samples/yahoo-news.html b/sandbox/aron/wadl/samples/yahoo-news.html new file mode 100644 index 000000000..9816c961b --- /dev/null +++ b/sandbox/aron/wadl/samples/yahoo-news.html @@ -0,0 +1,73 @@ + + +My Web Application

My Web Application

Resources

/newsSearch?appid&query&type&results&start&sort&language

Methods

GET

request query parameters
parametervaluedescription

appid

string (required)

query

string (required)

type

One of:

  • all (default)
  • any
  • phrase

results

int

Default: 10

start

int

Default: 1

sort

One of:

  • rank (default)
  • date

language

string

available response representations:

potential faults:

Representations

application/xml (yn:ResultSet)

XML Schema

Source:

Faults

Status Code 400 - application/xml (ya:Error)

XML Schema

Source:

diff --git a/sandbox/aron/wadl/samples/yahoo-news.wadl b/sandbox/aron/wadl/samples/yahoo-news.wadl new file mode 100644 index 000000000..06c5d908d --- /dev/null +++ b/sandbox/aron/wadl/samples/yahoo-news.wadl @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sandbox/aron/wadl/schema/wadl20061109.rnc b/sandbox/aron/wadl/schema/wadl20061109.rnc new file mode 100644 index 000000000..0387e4ef3 --- /dev/null +++ b/sandbox/aron/wadl/schema/wadl20061109.rnc @@ -0,0 +1,172 @@ +namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" +namespace local = "" +namespace wadl = "http://research.sun.com/wadl/2006/10" + +start = + element wadl:application { + doc*, + grammars?, + resources?, + ( resource_type | method | representation | fault )*, + foreign-attribute, + foreign-element + } +doc = + element wadl:doc { + attribute xml:lang { languageTag }?, + attribute title { text }?, + ( text | foreign-element )*, + foreign-attribute + } +grammars = + element wadl:grammars { + doc*, + incl*, + foreign-element + } +incl = + element wadl:include { + doc*, + attribute href { xsd:anyURI }, + foreign-attribute + } +resources = + element wadl:resources { + doc*, + resource+, + attribute base { xsd:anyURI }, + foreign-attribute, + foreign-element + } +resource_type = + element wadl:resource_type { + doc*, + param*, + method*, + attribute id { xsd:token }?, + foreign-element, + foreign-attribute + } +resource = + element wadl:resource { + doc*, + param*, + (method | resource)*, + attribute type { list {xsd:anyURI} } ?, + attribute path { text }?, + attribute id { xsd:token }?, + attribute queryType { text }?, + foreign-element, + foreign-attribute + } +method = + element wadl:method { + ( + ( + attribute href { xsd:anyURI } + ) | ( + doc*, + request?, + response?, + attribute id { xsd:token }?, + attribute name { + "DELETE" | "GET" | "HEAD" | "POST" | "PUT" | xsd:token + } + ) + ), + foreign-element, + foreign-attribute + } +request = + element wadl:request { + doc*, + param*, + representation*, + foreign-attribute, + foreign-element + } +response = + element wadl:response { + doc*, + param*, + (representation | fault)*, + foreign-attribute, + foreign-element + } +representation_type = + ( + ( + attribute href { xsd:anyURI } + ) | ( + doc*, + param*, + attribute id { xsd:token }?, + attribute element { xsd:QName }?, + attribute mediaType { text }?, + attribute profile { list { xsd:anyURI} }?, + attribute status { list { xsd:int+ } }? + ) + ) +representation = + element wadl:representation { + representation_type, + foreign-attribute, + foreign-element + } +fault = + element wadl:fault { + representation_type, + foreign-attribute, + foreign-element + } +param = + element wadl:param { + doc*, + option*, + link?, + attribute name {xsd:token }, + attribute style { + "plain" | "query" | "matrix" | "header" | "template" + }, + attribute id { xsd:token }?, + attribute type { text }?, + attribute default { text }?, + attribute path { text }?, + attribute required { xsd:boolean }?, + attribute repeating { xsd:boolean }?, + attribute fixed { text }?, + foreign-element, + foreign-attribute + } +option = + element wadl:option { + doc*, + attribute value { xsd:string }, + foreign-element, + foreign-attribute + } +link = + element wadl:link { + doc*, + attribute resource_type { xsd:anyURI }?, + attribute rel { xsd:token }?, + attribute rev { xsd:token }?, + foreign-element, + foreign-attribute + } +foreign-attribute = attribute * - (wadl:* | local:* | xml:*) { text }* +foreign-element = + element * - (wadl:* | local:*) { + (attribute * { text } + | text + | any-element)* + }* +any-element = + element * { + (attribute * { text } + | text + | any-element)* + }* +languageTag = xsd:string { + pattern = "[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*" +} diff --git a/sandbox/aron/wadl/spec/wadl20061109.pdf b/sandbox/aron/wadl/spec/wadl20061109.pdf new file mode 100644 index 000000000..73471fd58 Binary files /dev/null and b/sandbox/aron/wadl/spec/wadl20061109.pdf differ diff --git a/sandbox/aron/wadl/stylesheets/wadl_documentation.xsl b/sandbox/aron/wadl/stylesheets/wadl_documentation.xsl new file mode 100644 index 000000000..2733c2508 --- /dev/null +++ b/sandbox/aron/wadl/stylesheets/wadl_documentation.xsl @@ -0,0 +1,863 @@ + + + + + + + + + + http://research.sun.com/wadl/2006/10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # + + + + + + + + + + + + + + + + + + + + # + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:choose> + <xsl:when test="wadl:doc[@title]"> + <xsl:value-of select="wadl:doc[@title][1]/@title"/> + </xsl:when> + <xsl:otherwise>My Web Application</xsl:otherwise> + </xsl:choose> + + + + + +

+ + + + + + My Web Application + +

+ + +

Resources

+ + +

Representations

+ +

Faults

+ +
+ + +
+ + + + + + + + + + + + + +
    + + + +
+
+ + + + + + / +
  • + +
      + + + + +
    +
    +
  • +
    + + + + + + + + +
  • + + + +
  • +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + / + + ;=... + + + +
    +

    + + + + + + + + + + & + ? + + + + + + + + & + ? + + + + + + + + + + +

    + + + resource-wide + + template + + + resource-wide + matrix + +
    Methods
    +
    + + +
    +
    + + + +
    +
    +
    + + + + +
    +

    + + + +
    +
    + + + + request + query + + + request + + header + + +

    acceptable request representations:

    +
      + +
    +
    + +
    + + + + response + header + + +

    available response representations:

    + +
      + +
    +
    + +

    potential faults:

    +
      + + +
    +
    +
    + + + +
  • + + + + +
  • +
    + + + + + + + + + + + + + +

    + +

    + + + +
    + +
    XML Schema
    + + + + + +
    + + plain + + + header + +
    +
    +
    + +
    +
    + + + + + +
    parameters
    + + + + + + + + +
    parametervaluedescription
    + +
    +
    + + + + +

    + + +

    + + + (required) + (repeating) +

    + + + +

    One of:

    +
      + +
    +
    + +

    Default:

    +

    Fixed:

    + +
    +
    + + + + +
    + +
    + +
    + +
      +
    • XPath to value:
    • + +
    +
    + + + +
    + + +
  • + Link: +
  • +
    + + + +
  • + + (default) +
  • +
    + + +
    + + + (default) +
    +
    + +
    +
    + + + + 0 + + + +

    + +

    +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Source:

    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + + } + + + + + + + + + + + + + + + + ( + Status Code + - + + - + + + + + ) + + + Status Code + - + + + ( + + ) + + + + + + + + < + + + + > + + </> + + + + /> + + + + + + ="" + + + + + + + + + + + + + + + + + + + + + + + + + + + + +