/** * 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(); }
/** * Removes all resources locked in a project.<p> * * @param projectId the ID of the project where the resources have been locked * @param removeSystemLocks if <code>true</code>, also system locks are removed */ public void removeResourcesInProject(CmsUUID projectId, boolean removeSystemLocks) { Iterator<CmsLock> itLocks = OpenCms.getMemoryMonitor().getAllCachedLocks().iterator(); while (itLocks.hasNext()) { CmsLock currentLock = itLocks.next(); if (removeSystemLocks && currentLock.getSystemLock().getProjectId().equals(projectId)) { unlockResource(currentLock.getResourceName(), true); } if (currentLock.getEditionLock().getProjectId().equals(projectId)) { unlockResource(currentLock.getResourceName(), false); } } }
/** * Removes all resources locked in a project.<p> * * @param projectId the ID of the project where the resources have been locked * @param removeSystemLocks if <code>true</code>, also system locks are removed */ public void removeResourcesInProject(CmsUUID projectId, boolean removeSystemLocks) { Iterator itLocks = OpenCms.getMemoryMonitor().getAllCachedLocks().iterator(); while (itLocks.hasNext()) { CmsLock currentLock = (CmsLock)itLocks.next(); if (removeSystemLocks && currentLock.getSystemLock().getProjectId().equals(projectId)) { unlockResource(currentLock.getResourceName(), true); } if (currentLock.getEditionLock().getProjectId().equals(projectId)) { unlockResource(currentLock.getResourceName(), false); } } }
/** * Returns the id of the project which the resource belongs to.<p> * * @return the id of the project which the resource belongs to */ public CmsUUID getProjectId() { CmsUUID projectId = m_resource.getProjectLastModified(); if (!getLock().isUnlocked() && !getLock().isInherited()) { // use lock project ID only if lock is not inherited projectId = getLock().getProjectId(); } return projectId; }
/** * Returns the id of the project which the resource belongs to.<p> * * @return the id of the project which the resource belongs to */ public CmsUUID getProjectId() { CmsUUID projectId = m_resource.getProjectLastModified(); if (!getLock().isUnlocked() && !getLock().isInherited()) { // use lock project ID only if lock is not inherited projectId = getLock().getProjectId(); } return projectId; }
stmt.setString(3, sysLock.getProjectId().toString()); stmt.setInt(4, sysLock.getType().hashCode()); stmt.executeUpdate(); stmt.setString(3, editLock.getProjectId().toString()); stmt.setInt(4, editLock.getType().hashCode()); stmt.executeUpdate();
stmt.setString(3, sysLock.getProjectId().toString()); stmt.setInt(4, sysLock.getType().hashCode()); stmt.executeUpdate(); stmt.setString(3, editLock.getProjectId().toString()); stmt.setInt(4, editLock.getType().hashCode()); stmt.executeUpdate();
|| (currentLock.isOwnedBy(dbc.currentUser()) && (currentLock.getProjectId().equals(projectId)))) {
|| (currentLock.isOwnedBy(dbc.currentUser()) && (currentLock.getProjectId().equals(projectId)))) {
if (match && (m_projectId != null) && !m_projectId.isNullUUID() && (lock.getProjectId() != null)) { match = lock.getProjectId().equals(m_projectId);
if (match && (m_projectId != null) && !m_projectId.isNullUUID() && (lock.getProjectId() != null)) { match = lock.getProjectId().equals(m_projectId);
rl.setProjectId(sysLock.getProjectId().toString()); rl.setLockType(sysLock.getType().hashCode()); rl.setProjectId(editLock.getProjectId().toString()); rl.setLockType(editLock.getType().hashCode());
/** * Returns the id of the project in which the given resource is locked.<p> * * @return the id of the project in which the given resource is locked */ public CmsUUID getLockedInProjectId() { CmsUUID lockedInProject = null; if (getLock().isNullLock() && !getResource().getState().isUnchanged()) { // resource is unlocked and modified lockedInProject = getResource().getProjectLastModified(); } else if (!getResource().getState().isUnchanged()) { // resource is locked and modified lockedInProject = getProjectId(); } else if (!getLock().isNullLock()) { // resource is locked and unchanged lockedInProject = getLock().getProjectId(); } return lockedInProject; }
/** * Returns the id of the project in which the given resource is locked.<p> * * @return the id of the project in which the given resource is locked */ public CmsUUID getLockedInProjectId() { CmsUUID lockedInProject = null; if (getLock().isNullLock() && !getResource().getState().isUnchanged()) { // resource is unlocked and modified lockedInProject = getResource().getProjectLastModified(); } else if (!getResource().getState().isUnchanged()) { // resource is locked and modified lockedInProject = getProjectId(); } else if (!getLock().isNullLock()) { // resource is locked and unchanged lockedInProject = getLock().getProjectId(); } return lockedInProject; }