Ok, I think I have managed to totally confuse you, so will try to come up with a concrete example.

Restlet User example:
   POST {
       firstName: "First",
       lastName: "Last",
       address: {
         line1: "Line 1",
         line2: "Line 2",
         city: "City", ... etc.
      }
   }
to /users creates /users/123

This will now return the same json representation when a GET is performed on the /users/123 uri (PUT against this uri will update the user, and DELETE will remove them). All of this is being performed through the restlet part of the system.

Then say across the fence on the portal part of the system (which is being delivered by sling) we have a uri /addressbook/users/123.html that will display an html representation of the user along with their address, and this will be rendered into the portal template etc. by a script say /apps/addressbook/html.ftl

I think that this part might be able to be accomplished with ResourceProvider, though slightly confused how this works, but I am not sure if I would also be able to do a PUT against /addressbook/users/123 in order to update the user entry or whether I would have to go straight to the /users/123 uri to do this?

Bertrand Delacretaz wrote:
On Wed, Jul 2, 2008 at 11:41 AM, Bryce Ewing <[EMAIL PROTECTED]> wrote:
...What I have done at present is to move all the restlet based api under /api
(managed by a restlet servlet).  But I would also like to be able to access
the data from within Sling and use the same rendering methods etc....

That's where I'm not sure what you mean, can you give an example of an
URL that would be processed by Sling, and what you expect it to do?
And what would differentiate that URL from one that's processed by
Restlet?

-Bertrand

Reply via email to