You should throw in setResourceCountent, not in createResource. Oliver
On Mon, 06 Dec 2004 12:10:04 -0500, John Rousseau <[EMAIL PROTECTED]> wrote: > But if I throw ObjectNotFoundException from createResource, then (as I > indicated in my initial post) rollback is called and the client gets a > "412 Precondition Failed". > > Thanks > -John > > > > > Oliver Zeigermann wrote: > > OK, then just throw the ObjectNotFoundException if the object is not > > there as indicated in the last post. > > > > Concerning the occurennce of the method calls, they are just needed by > > the Slide core... > > > > Oliver > > > > On Mon, 06 Dec 2004 10:51:18 -0500, John Rousseau > > <[EMAIL PROTECTED]> wrote: > > > >>Hmmmm. That's just not what I am seeing. I have a printout in each of my > >>BasicWebdavStore implementation methods. > >> > >>Here's what I see when I use the slide webdav client to "put > >>/etc/resolv.conf" into "/music" in my system. > >> > >>%% WebdavStoreImpl: begin > >>%% objectExists: /music/resolv.conf > >>%% objectExists: / > >>%% getChildrenNames: / > >>%% objectExists: /music > >>%% getChildrenNames: /music > >>%% objectExists: /music/resolv.conf > >>%% objectExists: /music/resolv.conf > >>%% objectExists: /music/resolv.conf > >>%% objectExists: /music/resolv.conf > >>%% objectExists: /music/resolv.conf > >>%% objectExists: /music > >>%% objectExists: /music > >>%% objectExists: /music > >>%% objectExists: /music/resolv.conf > >>%% setResourceContent: /music/resolv.conf > >>%% createResource: /music/resolv.conf > >>%% WebdavStoreImpl: commit > >> > >>Note the order of the setResourceContent and createResource calls. > >> > >>Here's the trace for setResourceContent: > >>java.lang.Exception: Stack trace > >> at java.lang.Thread.dumpStack(Thread.java:1064) > >> at > >> com.ris.manager.gateway.http.WebdavStoreImpl.setResourceContent(WebdavStoreImpl.java:195) > >> at > >> org.apache.slide.simple.store.WebdavStoreAdapter$TransactionId.storeRevisionContent(WebdavStoreAdapter.java:520) > >> at > >> org.apache.slide.simple.store.WebdavStoreAdapter.storeRevisionContent(WebdavStoreAdapter.java:159) > >> at > >> org.apache.slide.store.AbstractStore.storeRevisionContent(AbstractStore.java:1474) > >> at > >> org.apache.slide.store.ExtendedStore.storeRevisionContent(ExtendedStore.java:546) > >> at org.apache.slide.content.ContentImpl.create(ContentImpl.java:593) > >> at > >> org.apache.slide.webdav.method.PutMethod.executeRequest(PutMethod.java:407) > >> at > >> org.apache.slide.webdav.method.AbstractWebdavMethod.run(AbstractWebdavMethod.java:412) > >> at > >> org.apache.slide.webdav.WebdavServlet.service(WebdavServlet.java:151) > >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > >> at > >> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:354) > >> at > >> org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:342) > >> at > >> org.apache.slide.webdav.filter.LogFilter.doFilter(LogFilter.java:141) > >> at > >> org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:334) > >> at > >> com.ris.manager.gateway.http.IPAddressRestriction.doFilter(IPAddressRestriction.java:248) > >> at > >> org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:334) > >> at > >> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:286) > >> at > >> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567) > >> at org.mortbay.http.HttpContext.handle(HttpContext.java:1808) > >> at > >> org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:525) > >> at org.mortbay.http.HttpContext.handle(HttpContext.java:1758) > >> at org.mortbay.http.HttpServer.service(HttpServer.java:879) > >> at org.mortbay.http.HttpConnection.service(HttpConnection.java:790) > >> at > >> org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:952) > >> at org.mortbay.http.HttpConnection.handle(HttpConnection.java:807) > >> at > >> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:197) > >> at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289) > >> at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:501) > >> > >>Here's the trace for createResource: > >> at > >> com.ris.manager.gateway.http.WebdavStoreImpl.createResource(WebdavStoreImpl.java:176) > >> at > >> org.apache.slide.simple.store.WebdavStoreAdapter$TransactionId.storeRevisionDescriptor(WebdavStoreAdapter.java:675) > >> at > >> org.apache.slide.simple.store.WebdavStoreAdapter.storeRevisionDescriptor(WebdavStoreAdapter.java:255) > >> at > >> org.apache.slide.store.AbstractStore.storeRevisionDescriptor(AbstractStore.java:1305) > >> at > >> org.apache.slide.store.ExtendedStore.storeRevisionDescriptor(ExtendedStore.java:1060) > >> at org.apache.slide.content.ContentImpl.create(ContentImpl.java:608) > >> at > >> org.apache.slide.webdav.method.PutMethod.executeRequest(PutMethod.java:407) > >> at > >> org.apache.slide.webdav.method.AbstractWebdavMethod.run(AbstractWebdavMethod.java:412) > >> at > >> org.apache.slide.webdav.WebdavServlet.service(WebdavServlet.java:151) > >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > >> at > >> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:354) > >> at > >> org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:342) > >> at > >> org.apache.slide.webdav.filter.LogFilter.doFilter(LogFilter.java:141) > >> at > >> org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:334) > >> at > >> com.ris.manager.gateway.http.IPAddressRestriction.doFilter(IPAddressRestriction.java:248) > >> at > >> org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:334) > >> at > >> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:286) > >> at > >> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567) > >> at org.mortbay.http.HttpContext.handle(HttpContext.java:1808) > >> at > >> org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:525) > >> at org.mortbay.http.HttpContext.handle(HttpContext.java:1758) > >> at org.mortbay.http.HttpServer.service(HttpServer.java:879) > >> at org.mortbay.http.HttpConnection.service(HttpConnection.java:790) > >> at > >> org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:952) > >> at org.mortbay.http.HttpConnection.handle(HttpConnection.java:807) > >> at > >> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:197) > >> at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289) > >> at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:501) > >> > >>Also, why so many calls to "objectExists", and it is really necessary to > >>getChildrenNames on all the parents? > >> > >>Thanks again! > >>-John > >> > >> > >> > >> > >>Oliver Zeigermann wrote: > >> > >>>Just checked it and it works the way it should be. > >>> > >>>Maybe the confusion is caused by Slide's weird init proc where it > >>>tries to set content before creation of a folder? In this case you > >>>will have to throw an ObjectNotFoundException as you can not store > >>>anything to a non-existing file. The start of the code of > >>>setResourceContent in the file RI looks like this > >>> > >>> File file = getFile(resourceUri); > >>> if (!file.exists()) > >>> throw new ObjectNotFoundException(resourceUri); > >>> > >>>I hope this helps, > >>> > >>>Oliver > >>> > >>> > >>>On Fri, 3 Dec 2004 23:58:48 +0100, Oliver Zeigermann > >>><[EMAIL PROTECTED]> wrote: > >>> > >>> > >>>>What you expected is the way it should be. If it is not this is a bug. > >>>>I will check this with the reference implementation. > >>>> > >>>>Oliver > >>>> > >>>> > >>>> > >>>>On Fri, 03 Dec 2004 15:59:59 -0500, John Rousseau > >>>><[EMAIL PROTECTED]> wrote: > >>>> > >>>> > >>>>>I'm trying to understand the BasicWebdavStore API a bit better. > >>>>> > >>>>>I was expecting that during a PUT, createResource() would be called with > >>>>>the name of a new resource and then setResourceContent() would be then > >>>>>called to supply the content itself. > >>>>> > >>>>>What I'm seeing is that setResourceContent is being called first and > >>>>>then createResource. In my implementation of createResource, I check to > >>>>>see if the resource already exists and if so throw > >>>>>ObjectAlreadyExistsException. Since I just created the resource in > >>>>>setResourceCountent, this causes me to throw and the WCK then calls > >>>>>rollback. > >>>>> > >>>>>Can someone describe these two methods in a bit more detail and explain > >>>>>what I should be doing in them? > >>>>> > >>>>>Should I just make createResource a no-op? > >>>>> > >>>>>Thanks > >>>>>-John > >>>>> > >>>>>--- > >>>>>John Rousseau > >>>>>Archivas, Inc. > >>>>> > >>>>>--------------------------------------------------------------------- > >>>>>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>>>>For additional commands, e-mail: [EMAIL PROTECTED] > >>>>> > >>>>> > >>>> > >>>--------------------------------------------------------------------- > >>>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>>For additional commands, e-mail: [EMAIL PROTECTED] > >>> > >>> > >> > >>--------------------------------------------------------------------- > >> > >> > >>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]