You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by BOUCHET Jean-Luc <je...@sib.fr> on 2009/03/06 16:46:43 UTC
disable webdav lock functionality, some consequences ?
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