-
Proposal:
Hide
Define a client-side function odata.fillUriTemplate 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.uriEncode that takes one argument of primitive type and returns the URL encoded literal that can be used as a key value in OData URLs or in the query part of OData URLs.
Example:
In case you KNOW that there are no special characters in Genre names:
<Apply Function="odata.fillUriTemplate">
<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.fillUriTemplate">
<String>
http://odata.netflix.com/v2/Catalog/Genres('{genreName}
')</String>
<LabeledElement Name="genreName">
<Apply Function="odata.uriEncode" >
<Path>NameOfMovieGenre</Path>
</Apply>
</LabeledElement>
</Apply>
We also need to make sure we reserve odata. for names of apply functions.
Accepted: https://www.oasis-open.org/committees/download.php/48411/odata-meeting-27_on-20130228-minutes.html#odata-257
Show
Define a client-side function odata.fillUriTemplate 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.uriEncode that takes one argument of primitive type and returns the URL encoded literal that can be used as a key value in OData URLs or in the query part of OData URLs.
Example:
In case you KNOW that there are no special characters in Genre names:
<Apply Function="odata.fillUriTemplate">
<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.fillUriTemplate">
<String> http://odata.netflix.com/v2/Catalog/Genres( '{genreName}
')</String>
<LabeledElement Name="genreName">
<Apply Function="odata.uriEncode" >
<Path>NameOfMovieGenre</Path>
</Apply>
</LabeledElement>
</Apply>
We also need to make sure we reserve odata. for names of apply functions.
Accepted: https://www.oasis-open.org/committees/download.php/48411/odata-meeting-27_on-20130228-minutes.html#odata-257
-
Resolution:
Show
https://www.oasis-open.org/committees/download.php/48440/odata-core-v4.0-wd01-part3-csdl-2013-03-05-RH.doc
Accepted: https://www.oasis-open.org/committees/download.php/48549/odata-meeting-29_on-20130314-minutes.html#odata-257
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.
{"report":{"apdex":1,"isInitial":true,"journeyId":"c053ba0f-d1a9-429a-92c9-5dc4ccf837f1","key":"jira.project.issue.view-issue","navigationType":0,"readyForUser":730.9000000953674,"redirectCount":0,"resourceLoadedEnd":839.5,"resourceLoadedStart":207.5,"resourceTiming":[{"duration":141.30000019073486,"initiatorType":"link","name":"https://issues.oasis-open.org/s/3edeca31ab9ba77980aae0809fbe7121-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/0a4716d29b2d5b1bdcdb168b4efc119e/_/download/contextbatch/css/_super/batch.css","startTime":207.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":207.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":348.80000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":141.30000019073486,"initiatorType":"link","name":"https://issues.oasis-open.org/s/7d2823769c2e7b66e860863fe879b7f8-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/9aebb1c0aaa4c36289529757ec9dbb54/_/download/contextbatch/css/project.issue.navigator,jira.view.issue,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&richediton=true","startTime":207.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":207.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":349.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":141.2000002861023,"initiatorType":"link","name":"https://issues.oasis-open.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/8.0.5/_/download/batch/com.atlassian.auiplugin:split_aui.pattern.label/com.atlassian.auiplugin:split_aui.pattern.label.css","startTime":208,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":208,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":349.2000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":141.09999990463257,"initiatorType":"link","name":"https://issues.oasis-open.org/s/645acc233eb869f48a571293b8358a7d-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:global-static-adgs/jira.webresources:global-static-adgs.css","startTime":208.2000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":208.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":349.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":140.90000009536743,"initiatorType":"link","name":"https://issues.oasis-open.org/s/a0dd6509771c1de0667aae5429c04cda-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:global-static/jira.webresources:global-static.css","startTime":208.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":208.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":349.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":203.5,"initiatorType":"script","name":"https://issues.oasis-open.org/s/e5479157e7a0c08b005e6522f2f04104-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/0a4716d29b2d5b1bdcdb168b4efc119e/_/download/contextbatch/js/_super/batch.js?locale=en-US","startTime":208.7000002861023,"connectEnd":208.7000002861023,"connectStart":208.7000002861023,"domainLookupEnd":208.7000002861023,"domainLookupStart":208.7000002861023,"fetchStart":208.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":208.7000002861023,"responseEnd":412.2000002861023,"responseStart":412.2000002861023,"secureConnectionStart":208.7000002861023},{"duration":215.7999997138977,"initiatorType":"script","name":"https://issues.oasis-open.org/s/83514d5d4e8543747b02042eafcdc99c-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/9aebb1c0aaa4c36289529757ec9dbb54/_/download/contextbatch/js/project.issue.navigator,jira.view.issue,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en-US&richediton=true","startTime":209.2000002861023,"connectEnd":209.2000002861023,"connectStart":209.2000002861023,"domainLookupEnd":209.2000002861023,"domainLookupStart":209.2000002861023,"fetchStart":209.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":209.2000002861023,"responseEnd":425,"responseStart":425,"secureConnectionStart":209.2000002861023},{"duration":217.60000038146973,"initiatorType":"script","name":"https://issues.oasis-open.org/s/70bb2263e59e7e1f04fbd137c80b895b-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/aae1242f5fc81cc6a5bb8bc963ccda29/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en-US","startTime":209.5,"connectEnd":209.5,"connectStart":209.5,"domainLookupEnd":209.5,"domainLookupStart":209.5,"fetchStart":209.5,"redirectEnd":0,"redirectStart":0,"requestStart":209.5,"responseEnd":427.1000003814697,"responseStart":427.1000003814697,"secureConnectionStart":209.5},{"duration":217.7999997138977,"initiatorType":"script","name":"https://issues.oasis-open.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":209.7000002861023,"connectEnd":209.7000002861023,"connectStart":209.7000002861023,"domainLookupEnd":209.7000002861023,"domainLookupStart":209.7000002861023,"fetchStart":209.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":209.7000002861023,"responseEnd":427.5,"responseStart":427.5,"secureConnectionStart":209.7000002861023},{"duration":218.09999990463257,"initiatorType":"script","name":"https://issues.oasis-open.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":209.80000019073486,"connectEnd":209.80000019073486,"connectStart":209.80000019073486,"domainLookupEnd":209.80000019073486,"domainLookupStart":209.80000019073486,"fetchStart":209.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":209.80000019073486,"responseEnd":427.90000009536743,"responseStart":427.90000009536743,"secureConnectionStart":209.80000019073486},{"duration":218.30000019073486,"initiatorType":"script","name":"https://issues.oasis-open.org/s/cda37faab827dbdf305de8efe8282062-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/8.0.5/_/download/batch/com.atlassian.auiplugin:split_aui.pattern.label/com.atlassian.auiplugin:split_aui.pattern.label.js?locale=en-US","startTime":210,"connectEnd":210,"connectStart":210,"domainLookupEnd":210,"domainLookupStart":210,"fetchStart":210,"redirectEnd":0,"redirectStart":0,"requestStart":210,"responseEnd":428.30000019073486,"responseStart":428.30000019073486,"secureConnectionStart":210},{"duration":218.5,"initiatorType":"link","name":"https://issues.oasis-open.org/s/07245784f53abc49bad9d9d4d36c577a-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/cadc4f20cc5c138dee060d42cf85f220/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":210.2000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":210.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":428.7000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":218.30000019073486,"initiatorType":"script","name":"https://issues.oasis-open.org/rest/api/1.0/shortcuts/803004/a29179d70fa8562374ee16707692af77/shortcuts.js?context=issuenavigation&context=issueaction","startTime":210.40000009536743,"connectEnd":210.40000009536743,"connectStart":210.40000009536743,"domainLookupEnd":210.40000009536743,"domainLookupStart":210.40000009536743,"fetchStart":210.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":210.40000009536743,"responseEnd":428.7000002861023,"responseStart":428.7000002861023,"secureConnectionStart":210.40000009536743},{"duration":309.1000003814697,"initiatorType":"link","name":"https://issues.oasis-open.org/s/f77fd89aa211a76b20e9b0e63564383c-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/4a9288299d147101bf66484f4be48925/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-jira.view.issue,-project.issue.navigator/batch.css?jira.create.linked.issue=true&richediton=true","startTime":245,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":245,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":554.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":205.40000009536743,"initiatorType":"script","name":"https://issues.oasis-open.org/s/41525c48ddceeb9b11e54085268fc285-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/4a9288299d147101bf66484f4be48925/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-jira.view.issue,-project.issue.navigator/batch.js?jira.create.linked.issue=true&locale=en-US&richediton=true","startTime":245.2000002861023,"connectEnd":245.2000002861023,"connectStart":245.2000002861023,"domainLookupEnd":245.2000002861023,"domainLookupStart":245.2000002861023,"fetchStart":245.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":245.2000002861023,"responseEnd":450.6000003814697,"responseStart":450.6000003814697,"secureConnectionStart":245.2000002861023}],"threshold":1000,"fetchStart":0,"domainLookupStart":99,"domainLookupEnd":99,"connectStart":99,"connectEnd":150,"secureConnectionStart":125,"requestStart":150,"responseStart":199,"responseEnd":263,"domLoading":202,"domInteractive":862,"domContentLoadedEventStart":862,"domContentLoadedEventEnd":902,"domComplete":1051,"loadEventStart":1051,"loadEventEnd":1053,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[],"measures":[],"correlationId":"462e0e0a2f2624","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":85,"dbReadsTimeInMs":12,"dbConnsTimeInMs":15,"applicationHash":"4d4040e0714d65b7fffa4801569d014c0b16eaa9","experiments":[]}}
Changed UriEncode to uriEncode to be consistent with concat and fillTemplate, all of which start with a lower case letter, as do the odata.* annotations in the new JSON format, e.g. odata.navigationLink.