protected SupportedLock getSupportedLock() { SupportedLock supportedLock = new SupportedLock(); supportedLock.addEntry(Type.WRITE, Scope.EXCLUSIVE); return supportedLock; }
/** * Initialize the {@link org.apache.jackrabbit.webdav.lock.SupportedLock} property * with entries that are valid for any type item resources. * * @see org.apache.jackrabbit.webdav.lock.SupportedLock * @see org.apache.jackrabbit.webdav.transaction.TxLockEntry * @see AbstractResource#initLockSupport() */ @Override protected void initLockSupport() { if (exists()) { // add supported lock entries for local and eventually for global // transaction locks supportedLock.addEntry(new TxLockEntry(true)); supportedLock.addEntry(new TxLockEntry(false)); } }
/** * Extend the general {@link AbstractResource#supportedLock} field by * lock entries specific for this resource: write locks (exclusive or * exclusive session-scoped) in case the underlying node has the node * type mix:lockable. * * @see org.apache.jackrabbit.JcrConstants#MIX_LOCKABLE */ @Override protected void initLockSupport() { super.initLockSupport(); // add exclusive write lock if allowed for the given node try { if (exists() && ((Node)item).isNodeType(JcrConstants.MIX_LOCKABLE)) { supportedLock.addEntry(Type.WRITE, Scope.EXCLUSIVE); supportedLock.addEntry(new SessionScopedLockEntry()); } } catch (RepositoryException e) { log.warn(e.getMessage()); } }
supportedLock.addEntry(Type.WRITE, Scope.EXCLUSIVE); propertySet.add(supportedLock);
supportedLock.addEntry(Type.WRITE, Scope.EXCLUSIVE); properties.add(supportedLock);