Loading ...
Sorry, an error occurred while loading the content.

17967Re: [rest-discuss] Re: Using URI templates in XHTML

Expand Messages
  • mike amundsen
    Nov 15, 2011
    • 0 Attachment
      PM:

      <puts-on-his-client-developer-hat>
      the choice between adding a custom LINK element to XHTML or one based
      on XRD is not too interesting; i suspect they would both need
      essentially the same development effort in order to recognize, parse,
      and process in representations.
      </puts-on-his-client-developer-hat>

      <puts-on-media-type-designer-hat>
      when implementing these "templates" (whether via HTML FORM, URI
      Template, or some other method), i include the possible "fields" that
      would appear in a template as documentation. this is totally
      out-of-band data, of course. and that data must be "incorporated" by
      server and client devs in some way. it's basically a dictionary of
      possible data points that both client and server need to keep in mind
      as possible values passed in transitions (templates) or steady-states
      (response representations). what/how implementors handle this is up to
      each case.
      </puts-on-media-type-designer-hat>

      hopefully that helps.

      MCA

      mca
      http://amundsen.com/blog/
      http://twitter.com@mamund
      http://mamund.com/foaf.rdf#me





      On Tue, Nov 15, 2011 at 09:31, Philippe Mougin <pmougin@...> wrote:
      >
      >
      >
      >
      >
      >> > Interesting. This resonates with the problem Eric wrote about:
      >> > dynamically passing a declarative description of constraints on allowed
      >> > values for expansion. In your example, you communicate a list of
      >> > possible contexts for expansion. A context is a set of value for
      >> > performing a given expansion. Do I understand correctly? If so, I'm not
      >> > sure why you don't directly pass to the client a list of URI generated
      >> > server-side by expanding the "templates" using the various contexts? I'm
      >>
      >> Well, that surely *is* an option as I mentioned myself, but if you go
      >> this path, then you don't need to provide the client with uri-templates
      >> nor contexts, and you don't need anything else then the xhtml we already
      >> have...
      >> So I just assumed you meant this, if not it seemed to make your question
      >> void?
      >
      > Yes, I need client side expansion, as I want to use URI templates to dynamically communicate how to build certain URIs. However, my clients are purpose-built programs whose developers will be given some informations out of band. For example, I might communicate http://example.com/stockquote/{symbol} dynamically, associated with a given rel value for finding it in a representation, but specify in my service documentation (i.e., out of band) that it must be expanded using a variable named "symbol" whose value must be the stock symbol of the company you want a stock quote for.
      >
      > So my main question is what you labeled as "question [1]": what is the best way to embed such an URI template in XHTML.
      >
      > One viable option is  creating a specific "link" element with a rel and hreft attribute, which would give:
      >
      > <html xmlns="http://www.w3.org/1999/xhtml" xmlns:my="http://example.com/my">
      >    <body>
      >        <my:link rel="http://example.com/rels/stockquote" hreft="http://example.com/stockquote/{symbol}" />
      >    </body>
      > </html>
      >
      > Another idea I have is to use the existing xrd's link element, which has support for URI templates (xrd is specified at http://docs.oasis-open.org/xri/xrd/v1.0/xrd-1.0.html).
      >
      > This would give:
      >
      > <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xrd="http://docs.oasis-open.org/ns/xri/xrd-1.0">
      >    <body>
      >        <xrd:link rel="http://example.com/rels/stockquote" template="http://example.com/stockquote/{symbol}" />
      >    </body>
      > </html>
      >
      > I'd be grateful for any feedback on these as well as other ideas on how to best use URI templates as hypermedia controls in XHTML.
      >
      > Philippe
      >
      >
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
    • Show all 19 messages in this topic