OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

odata message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [OASIS Issue Tracker] Updated: (ODATA-257) Define standard client-side function for filling URL templates (RFC6570)


     [ http://tools.oasis-open.org/issues/browse/ODATA-257?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Zurmuehl updated ODATA-257:
----------------------------------

    Proposal: 
Define a client-side function odata.fillTemplate that takes two or more arguments.

The first argument MUST be of type String and specifies the URL template, the other arguments MUST be LabeledElement expressions that specify the template parameter name and evaluate to the template parameter value.

RFC6570 defines three kinds of template parameters: simple values, lists of values, and key-value maps.

Simple values are represented as LabeledElement expressions that evaluate to a single primitive value. The literal representation of this value according to ODATA-ABNF is used to fill the corresponding template parameter.

Lists of values are represented as LabeledElement expressions that evaluate to a collection of primitive values.

Key-value maps are represented as LabeledElement expressions that evaluate to a collection of complex types with two properties that are used in lexicographic order. The first property is used as key, the second property as value.


Define a second client-side function odata.keyEncode that takes one argument of primitive type and returns the URL encoded literal that can be used as a key value in OData URLs.


Example:
In case you KNOW that there are no special characters in Genre names:

<Apply Function="odata.fillTemplate">
  <String>http://odata.netflix.com/v2/Catalog/Genres('{genreName}')</String>
  <LabeledElement Name="genreName" Path="NameOfMovieGenre" />
</Apply>


Example:
If you want to be on the safe side:

<Apply Function="odata.fillTemplate">
  <String>http://odata.netflix.com/v2/Catalog/Genres('{genreName}')</String>
  <LabeledElement Name="genreName">
    <Apply Function="odata.keyEncode" >
      <Path>NameOfMovieGenre</Path>
    </Apply>
  </LabeledElement>
</Apply>

  was:
Define a client-side function odata.fillTemplate that takes two or more arguments.

The first argument MUST be of type String and specifies the URL template, the other arguments MUST be LabeledElement expressions that specify the template parameter name and evaluate to the template parameter value.

RFC6570 defines three kinds of template parameters: simple values, lists of values, and key-value maps.

Simple values are represented as LabeledElement expressions that evaluate to a single primitive value. The literal representation of this value according to ODATA-ABNF is used to fill the corresponding template parameter.

Lists of values are represented as LabeledElement expressions that evaluate to a collection of primitive values.

Key-value maps are represented as LabeledElement expressions that evaluate to a collection of complex types with two properties that are used in lexicographic order. The first property is used as key, the second property as value.


Example:

<Apply Function="odata.fillTemplate">
  <String>http://odata.netflix.com/v2/Catalog/Genres('{genreName}')</String>
  <LabeledElement Name="genreName" Path="NameOfMovieGenre" />
</Apply>


> Define standard client-side function for filling URL templates (RFC6570)
> ------------------------------------------------------------------------
>
>                 Key: ODATA-257
>                 URL: http://tools.oasis-open.org/issues/browse/ODATA-257
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Improvement
>          Components: OData CSDL v1.0
>    Affects Versions: WD01
>         Environment: [Proposed]
>            Reporter: Ralf Handl
>             Fix For: WD01
>
>
> In mashup scenarios it is often the case that a third party can detect a rule that allows constructing URLs from information provided in an entity that allow navigation to other resources in the web.
> Annotations allow to express these construction rules via the odata.concat client-side function, but that can become tedious if the URL patterns to construct are non-trivial.
> RFC6570 (http://tools.ietf.org/html/rfc6570) defines a simple notation for URL templates and a simple set of rules on how to translate the template and a set of variable values into a URL.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://tools.oasis-open.org/issues/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]