You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Carl Hall <ca...@hallwaytech.com> on 2010/10/26 19:07:49 UTC

Delete Node with resourceType Handler

I have a node, /var/proxy/scribd, that has sling:resourceType='sakai/proxy'
which triggers a proxy handling servlet.  While in development, I often need
to change properties on this node or delete the node entirely.  Since my
servlet handles POST, it catches my call when I do "curl -F
:operation=delete http://localhost:8080/var/proxy/scribd" leaving me with
the results of the servlet processing which is a 400 return code and thusly
doesn't run the delete post processor.  Is there a way I can not run the
resource type processor or do I need to add a catch for the delete command
so my servlet stops processing gracefully to allow deletion?

Re: Delete Node with resourceType Handler

Posted by Carl Hall <ca...@hallwaytech.com>.
We've disabled/removed the webdav functionality because of how we shard data
in an area and users viewing that data getting confused.  Removing the
webdav stuff seemed to remove the DELETE method goodness.  I'll take a look
at bringing the DELETE handling servlet back into our build.  Thanks!

On Tue, Oct 26, 2010 at 4:27 PM, Justin Edelson <ju...@justinedelson.com>wrote:

> Why not use the DELETE method?
>
> In general, the :operation parameter is specific to the default POST
> servlet, so yes, you would need to look for this parameter value in your
> servlet. Or just use the DELETE method.
>
> Justin
>
> On Oct 26, 2010, at 1:07 PM, Carl Hall <ca...@hallwaytech.com> wrote:
>
> > I have a node, /var/proxy/scribd, that has
> sling:resourceType='sakai/proxy'
> > which triggers a proxy handling servlet.  While in development, I often
> need
> > to change properties on this node or delete the node entirely.  Since my
> > servlet handles POST, it catches my call when I do "curl -F
> > :operation=delete http://localhost:8080/var/proxy/scribd" leaving me
> with
> > the results of the servlet processing which is a 400 return code and
> thusly
> > doesn't run the delete post processor.  Is there a way I can not run the
> > resource type processor or do I need to add a catch for the delete
> command
> > so my servlet stops processing gracefully to allow deletion?
>

Re: Delete Node with resourceType Handler

Posted by Justin Edelson <ju...@justinedelson.com>.
Why not use the DELETE method?

In general, the :operation parameter is specific to the default POST servlet, so yes, you would need to look for this parameter value in your servlet. Or just use the DELETE method.

Justin

On Oct 26, 2010, at 1:07 PM, Carl Hall <ca...@hallwaytech.com> wrote:

> I have a node, /var/proxy/scribd, that has sling:resourceType='sakai/proxy'
> which triggers a proxy handling servlet.  While in development, I often need
> to change properties on this node or delete the node entirely.  Since my
> servlet handles POST, it catches my call when I do "curl -F
> :operation=delete http://localhost:8080/var/proxy/scribd" leaving me with
> the results of the servlet processing which is a 400 return code and thusly
> doesn't run the delete post processor.  Is there a way I can not run the
> resource type processor or do I need to add a catch for the delete command
> so my servlet stops processing gracefully to allow deletion?

Re: Delete Node with resourceType Handler

Posted by Carl Hall <ca...@hallwaytech.com>.
Fantastic!  Thanks for pointing out this interface.


On Wed, Oct 27, 2010 at 1:21 AM, Felix Meschberger <fm...@gmail.com>wrote:

> Hi,
>
> Have your servlet implement the OptingServlet [1] interface and return
> false from the accepts method if you encounter the ":operation" request
> parameter.
>
> This way, your servlet will not be called in these circumstances and
> thus the search for a servlet to call will continue ultimatelively
> leading to the default POST servlet.
>
> Regards
> Felix
>
> [1]
>
> http://sling.apache.org/apidocs/sling5/index.html?org/apache/sling/api/servlets/OptingServlet.html
>
> On 26.10.2010 19:07, Carl Hall wrote:
> > I have a node, /var/proxy/scribd, that has
> sling:resourceType='sakai/proxy'
> > which triggers a proxy handling servlet.  While in development, I often
> need
> > to change properties on this node or delete the node entirely.  Since my
> > servlet handles POST, it catches my call when I do "curl -F
> > :operation=delete http://localhost:8080/var/proxy/scribd" leaving me
> with
> > the results of the servlet processing which is a 400 return code and
> thusly
> > doesn't run the delete post processor.  Is there a way I can not run the
> > resource type processor or do I need to add a catch for the delete
> command
> > so my servlet stops processing gracefully to allow deletion?
> >
>

Re: Delete Node with resourceType Handler

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Have your servlet implement the OptingServlet [1] interface and return
false from the accepts method if you encounter the ":operation" request
parameter.

This way, your servlet will not be called in these circumstances and
thus the search for a servlet to call will continue ultimatelively
leading to the default POST servlet.

Regards
Felix

[1]
http://sling.apache.org/apidocs/sling5/index.html?org/apache/sling/api/servlets/OptingServlet.html

On 26.10.2010 19:07, Carl Hall wrote:
> I have a node, /var/proxy/scribd, that has sling:resourceType='sakai/proxy'
> which triggers a proxy handling servlet.  While in development, I often need
> to change properties on this node or delete the node entirely.  Since my
> servlet handles POST, it catches my call when I do "curl -F
> :operation=delete http://localhost:8080/var/proxy/scribd" leaving me with
> the results of the servlet processing which is a 400 return code and thusly
> doesn't run the delete post processor.  Is there a way I can not run the
> resource type processor or do I need to add a catch for the delete command
> so my servlet stops processing gracefully to allow deletion?
>