I just was about to send a similar message.
I'd like to have a filter which does the following:
1. Versioned resources
/path/to/resources/{thing}/a/b/c --> /path/to/resource/a/b/c but with
{thing} available in a request attribute.
2. Resource aliases
/path/to/resources/foo/{thing}/a/b/c -->
/path/to/resource/foo/otherthing/a/b/c where the filter does the mapping
of "thing" to "otherthing"
In neither case do I want the headers removed; I want them transparently
passed through/
Use cases:
1. {thing} is an API version, a schema version, or some other piece of
metadata which I can use to encourage clients to cache responses
forever, but which is optional. Using query strings for this purpose
fails because it requires you to avoid conflicts with every possible
resource. Using a URI path component works because you can provide
/path/to/resources/v123 as the root for clients of a particular vintage
or time scale.
2. {thing} is an alias for some other thing. For example "User" could
be an alias for current user id.
In Restlet 2.0.1, so far failed..
For #1, I see no way to do it and need help.
For #2, I interpose a starts_with template matcher for each resource
under "/path/to/resources", and it decide dynamically between calling
the real resource or doing a Redirector.MODE_CLIENT_TEMPORARY to the
rewritten resource, which of course goes back to the client. The client
redirect is especially unpleasant.
Leigh.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2703463