jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "BOUCHET Jean-Luc" <jean-luc.bouc...@sib.fr>
Subject disable webdav lock functionality, some consequences ?
Date Fri, 06 Mar 2009 15:46:43 GMT



Hi,

We use jackarabbit webdav server with  MS Word client 

To avoid locked  document , we first decided  to disable webdav lock
functionality  :  In situation of simultaneous access, the last one who
saves a document wins. 

Consequently, we wrote our own webdav servlet than inherits  from
simpleWebDavServet and rewrote doLock method, doUnlock method and
isPreconditionValid method  :  doLock et doUnlock don't lock,  and unlock
and isPreconditionValid always return true even if If Header is present into
http request.

 It  works but I wonder if this evolution could  cause storage persistence
inconsistency . Does anybody have an idea about this ? 

Later, we look forwoard to develop an administration GUI tool that will
list locked documents and  allow administrator to unlock the locked
documents. 

Here our webdav servlet

public class SimpleSibWebdavServlet extends SimpleWebdavServlet {

   /**

   * {@inheritDoc}

   */

  protected boolean isPreconditionValid(WebdavRequest request, DavResource
resource) {

    return true;

  }

  /**

   * {@inheritDoc}

   */

  protected void doLock(WebdavRequest request, WebdavResponse response,

                        DavResource resource) throws IOException,
DavException {

      LockInfo lockInfo = request.getLockInfo();

      // lock only to generate correct response and unlock after

      ActiveLock lock = resource.lock(lockInfo);

      response.sendLockResponse(lock);

      resource.unlock(lock.getToken());

  }

 

  /**

   * {@inheritDoc}

   */

  protected void doUnlock(WebdavRequest request, WebdavResponse response,
DavResource resource) throws DavException {

      response.setStatus(DavServletResponse.SC_NO_CONTENT);

  } 

}



-- 
Joseph Thibault
Syndicat Interhospitalier de Bretagne (SIB) - www.sib.fr
Tel : 02 99 54 75 87


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message