The attached patch to Ft/Server/Server/Http extends
4Suite's ability
to register RESTful patterns for HTTP requests to
include the HTTP
method as a criteria. An extra 'http-methods'
attribute on the <Rule>
directive inside a server document takes a space seperated,
case-insensitive list of HTTP methods (currently supported:
GET/POST/PUT/DELETE). Only HTTP requests of these kind
trigger the
invokation of the stylesheet. If none is given then it
responds to
*all* requests. For example:
This rule will register a transform that renders every
container (when
requested via HTTP GET) as a directory listing. This
is useful for
when using 4Suite as a general web server.
<Rule pattern=".*/"
xslt-transform="/ftss/data/container.xslt"
http-methods="get"/>
In addition, the HTTP handler is updated to be able to
respond to
DELETE/PUT requests. The default behavior (if no
matching rules are
found) tries to follow RFC 2616 as closely as possible:
1) for PUTs, if the resource exists it is updated and a
200 status
code is returned. If it doesn't exist, it attempts to
create a new
resource using either createDocument or createRawFile
(depending on if
a content-type header is present and is text/*xml* or
application/*xml* - if none is present it attempts to
parse the
content to determine if it's XML).
Patch to cvs