/** * Returns the the lock for the given resource.<p> * * @return the lock the given resource */ public CmsLock getLock() { if (m_lock == null) { try { m_lock = getCms().getLock(m_resource); } catch (Throwable e) { m_lock = CmsLock.getNullLock(); LOG.error(e.getLocalizedMessage(), e); } } return m_lock; }
/** * Returns the the lock for the given resource.<p> * * @return the lock the given resource */ public CmsLock getLock() { if (m_lock == null) { try { m_lock = getCms().getLock(m_resource); } catch (Throwable e) { m_lock = CmsLock.getNullLock(); LOG.error(e.getLocalizedMessage(), e); } } return m_lock; }
/** * Returns the inherited lock of a resource.<p> * * @param absoluteResourcename the absolute path of the resource * * @return the inherited lock or the null lock */ private CmsLock getParentLock(final String absoluteResourcename) { CmsLock parentFolderLock = getParentFolderLock(absoluteResourcename); if (!parentFolderLock.isNullLock()) { return parentFolderLock; } return CmsLock.getNullLock(); }
/** * @see org.opencms.file.wrapper.A_CmsResourceWrapper#getLock(org.opencms.file.CmsObject, org.opencms.file.CmsResource) */ @Override public CmsLock getLock(CmsObject cms, CmsResource resource) throws CmsException { if (isFakePath(resource.getRootPath())) { return CmsLock.getNullLock(); } else { return super.getLock(cms, resource); } }
/** * Returns the lock of a possible locked parent folder of a resource, system locks are ignored.<p> * * @param resourceName the name of the resource * * @return the lock of a parent folder, or {@link CmsLock#getNullLock()} if no parent folders are locked by a non system lock */ private CmsLock getParentFolderLock(String resourceName) { Iterator itLocks = OpenCms.getMemoryMonitor().getAllCachedLocks().iterator(); while (itLocks.hasNext()) { CmsLock lock = (CmsLock)itLocks.next(); if (lock.getResourceName().endsWith("/") && resourceName.startsWith(lock.getResourceName()) && !resourceName.equals(lock.getResourceName())) { // system locks does not get inherited lock = lock.getEditionLock(); // check the lock if (!lock.isUnlocked()) { return lock; } } } return CmsLock.getNullLock(); }
/** * Returns the lock of a possible locked parent folder of a resource, system locks are ignored.<p> * * @param resourceName the name of the resource * * @return the lock of a parent folder, or {@link CmsLock#getNullLock()} if no parent folders are locked by a non system lock */ private CmsLock getParentFolderLock(String resourceName) { Iterator<CmsLock> itLocks = OpenCms.getMemoryMonitor().getAllCachedLocks().iterator(); while (itLocks.hasNext()) { CmsLock lock = itLocks.next(); if (lock.getResourceName().endsWith("/") && resourceName.startsWith(lock.getResourceName()) && !resourceName.equals(lock.getResourceName())) { // system locks does not get inherited lock = lock.getEditionLock(); // check the lock if (!lock.isUnlocked()) { return lock; } } } return CmsLock.getNullLock(); }
/** * Returns the lock of a possible locked parent folder of a resource, system locks are ignored.<p> * * @param absoluteResourceName the name of the resource * * @return the lock of a parent folder, or {@link CmsLock#getNullLock()} * if no parent folders are locked by a non system lock */ private CmsLock getParentFolderLock(final String absoluteResourceName) { Iterator<CmsLock> itLocks = OpenCms.getMemoryMonitor().getAllCachedLocks().iterator(); while (itLocks.hasNext()) { CmsLock lock = itLocks.next(); if (lock.getResourceName().endsWith("/") && absoluteResourceName.startsWith(lock.getResourceName()) && !absoluteResourceName.equals(lock.getResourceName())) { // system locks does not get inherited lock = lock.getEditionLock(); // check the lock if (!lock.isUnlocked()) { return lock; } } } return CmsLock.getNullLock(); }
/** * Returns the inherited lock of a resource.<p> * * @param resourcename the name of the resource * @return the inherited lock or the null lock */ private CmsLock getParentLock(String resourcename) { CmsLock parentFolderLock = getParentFolderLock(resourcename); if (!parentFolderLock.isNullLock()) { return new CmsLock( resourcename, parentFolderLock.getUserId(), parentFolderLock.getProject(), CmsLockType.INHERITED); } return CmsLock.getNullLock(); }
/** * Returns the inherited lock of a resource.<p> * * @param resourcename the name of the resource * @return the inherited lock or the null lock */ private CmsLock getParentLock(String resourcename) { CmsLock parentFolderLock = getParentFolderLock(resourcename); if (!parentFolderLock.isNullLock()) { return new CmsLock( resourcename, parentFolderLock.getUserId(), parentFolderLock.getProject(), CmsLockType.INHERITED); } return CmsLock.getNullLock(); }
return CmsLock.getNullLock(); } else { return CmsLock.getNullLock(); } else { return CmsLock.getNullLock();
return CmsLock.getNullLock(); } else { return CmsLock.getNullLock(); } else { return CmsLock.getNullLock();
lock = CmsLock.getNullLock();
lock = CmsLock.getNullLock();
CmsLock newLock = CmsLock.getNullLock(); if (needNewLock) {
CmsLock newLock = CmsLock.getNullLock(); if (needNewLock) {
return CmsLock.getNullLock();
return CmsLock.getNullLock();
CmsLock lock = CmsLock.getNullLock(); try {
CmsLock lock = CmsLock.getNullLock(); try {