/** * Returns the edition lock.<p> * * @return the edition lock */ public CmsLock getEditionLock() { if (isSystemLock()) { return getRelatedLock(); } return this; }
/** * Returns the system lock.<p> * * @return the system lock */ public CmsLock getSystemLock() { if (!isSystemLock()) { return getRelatedLock(); } return this; }
/** * Returns the edition lock.<p> * * @return the edition lock */ public CmsLock getEditionLock() { if (isSystemLock()) { return getRelatedLock(); } return this; }
/** * Returns the system lock.<p> * * @return the system lock */ public CmsLock getSystemLock() { if (!isSystemLock()) { return getRelatedLock(); } return this; }
/** * Builds a string representation of the current state.<p> * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuffer buf = new StringBuffer(); buf.append("[CmsLock: resource: "); buf.append(getResourceName()); buf.append(", type: "); buf.append(getType()); buf.append(", project: "); buf.append(getProjectId()); buf.append(", user: "); buf.append(getUserId()); if (getRelatedLock() != null) { buf.append(", related lock: "); buf.append(getRelatedLock().getType()); } buf.append("]"); return buf.toString(); }
/** * Builds a string representation of the current state.<p> * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuffer buf = new StringBuffer(); buf.append("[CmsLock: resource: "); buf.append(getResourceName()); buf.append(", type: "); buf.append(getType()); buf.append(", project: "); buf.append(getProjectId()); buf.append(", user: "); buf.append(getUserId()); if (getRelatedLock() != null) { buf.append(", related lock: "); buf.append(getRelatedLock().getType()); } buf.append("]"); return buf.toString(); }
if (!match && !lock.getRelatedLock().isNullLock()) { match = match(rootPath, lock.getRelatedLock());
if (!match && !lock.getRelatedLock().isNullLock()) { match = match(rootPath, lock.getRelatedLock());
/** * Moves a lock during the move resource operation.<p> * * @param source the source root path * @param destination the destination root path */ public void moveResource(String source, String destination) { CmsLock lock = OpenCms.getMemoryMonitor().getCachedLock(source); if (lock != null) { OpenCms.getMemoryMonitor().uncacheLock(lock.getResourceName()); CmsLock newLock = new CmsLock(destination, lock.getUserId(), lock.getProject(), lock.getType()); lock = lock.getRelatedLock(); if ((lock != null) && !lock.isNullLock()) { CmsLock relatedLock = new CmsLock(destination, lock.getUserId(), lock.getProject(), lock.getType()); newLock.setRelatedLock(relatedLock); } OpenCms.getMemoryMonitor().cacheLock(newLock); } }
/** * Moves a lock during the move resource operation.<p> * * @param source the source root path * @param destination the destination root path */ public void moveResource(String source, String destination) { CmsLock lock = OpenCms.getMemoryMonitor().getCachedLock(source); if (lock != null) { OpenCms.getMemoryMonitor().uncacheLock(lock.getResourceName()); CmsLock newLock = new CmsLock(destination, lock.getUserId(), lock.getProject(), lock.getType()); lock = lock.getRelatedLock(); if ((lock != null) && !lock.isNullLock()) { CmsLock relatedLock = new CmsLock(destination, lock.getUserId(), lock.getProject(), lock.getType()); newLock.setRelatedLock(relatedLock); } OpenCms.getMemoryMonitor().cacheLock(newLock); } }