My first thought was to build something in shindig to serve out the document (on receiving the Accept: application/xrds+xml header), that way it doesn't matter to much where we put it.

However i checked the spec and it says that the container needs to serve this document which != shindig, so that won't work unfortunately.

Maybe make a docs dir, put in a README and a template discovery document with instructions on how to use it ?

ps, we could also ask the implementing container to emit a X-XRDS- Location: header that points to the shindig driven url, and serve it from there i guess... putting in the correct host name & path would be easy then (on the PHP side this would translate to ${HTTP_HOST}/$ {WEB_PREFIX}/social/rest)

        -- Chris


Discovery:
A container declares what collection and features it supports, and provides templates for discovering them, via a simple discovery document. A client starts the discovery process at the container's identifier URI (e.g., example.org). The full flow is available at http://xrds-simple.net/core/1.0/ ; in a nutshell:
Client GETs {container-url} with Accept: application/xrds+xml
Container responds with either an X-XRDS-Location: header pointing to the discovery document, or the document itself. If the client received an X-XRDS-Location: header, follow it to get the discovery document.

On May 24, 2008, at 11:21 AM, Cassie wrote:

Thanks John for writing this up!(btw - all the urls should be
localhost:8080/social/rest -- but thats easy to fix)

Everyone - I'm not sure where we want to put this... An easy thing would be
to dump it in the javascript dir cause then it would get hosted under
localhost:8080/gadgets/files. This seems like a funny location though - so perhaps we want to just bundle it with the social code and put it under
localhost:8080/social by default?

Also, we will want to be able to substitute the host name in this doc so
that it is configurable - any ideas on how to do that?
Thanks.

- Cassie



On Sat, May 24, 2008 at 3:06 AM, John Panzer <[EMAIL PROTECTED]> wrote:

By popular demand, I'm sending this out in email for quick review :)

Based on

http://svn.apache.org/viewvc/incubator/shindig/trunk/java/social-api/src/main/java/org/apache/shindig/social/abdera/RequestUrlTemplate.java?revision=656522&view=markup

I think the following XRDS discovery document is correct:

<XRDS xmlns="xri://$xrds">
  <XRD xmlns:simple="http://xrds-simple.net/core/1.0";
xmlns="xri://$XRD*($v*2.0)" xmlns:os="http://ns.opensocial.org/";
version="2.0">

      <Type>xri://$xrds*simple</Type>
      <Service>
        <Type>http://ns.opensocial.org/people/0.8</Type>

         <os:URI-Template>
http://localhost:8080/rest/people/{guid}/{selector}
<http://localhost:8080/people/%7Bguid%7D/%7Bselector%7D></URI- Template>
       </Service>
      <Service>

        <Type>http://ns.opensocial.org/activities/0.8</Type>
         <os:URI-Template>
http://localhost:8080/rest/activities/{guid}/{selector}
<http://localhost:8080/activities/%7Bguid%7D/%7Bselector%7D
</URI-Template>

      </Service>
      <Service>
        <Type>http://ns.opensocial.org/appdata/0.8</Type>
         <os:URI-Template>
http://localhost:8080/rest/appdata/{guid}/{selector}
<http://localhost:8080/appdata/%7Bguid%7D/%7Bselector%7D></URI- Template>

      </Service>
  </XRD>
</XRDS>

...where guid is a globally unique user id, selector is in [EMAIL PROTECTED], @self, @friends, ...}. Obviously localhost:8080 should be auto-configured but to start with this could just be a static file and edited separately from the
config.

This file can be hosted anywhere (static path?). The only requirement is that it be discoverable from whatever the sample container considers to be its well known URL; so if that's http://localhost:8080/, a simple option
is
to add a header

X-XRDS-Location: http://localhost:8080/.../opensocial_disco.xrds

to GET requests for that that root document. There are more complicated
discovery options too if you like.


Reply via email to