/** * Changes the lock of a resource to the current user, that is "steals" the lock from another user.<p> * * @param context the current request context * @param resource the resource to change the lock for * * @throws CmsException if something goes wrong * * @see org.opencms.file.types.I_CmsResourceType#changeLock(CmsObject, CmsSecurityManager, CmsResource) */ public void changeLock(CmsRequestContext context, CmsResource resource) throws CmsException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); checkOfflineProject(dbc); try { m_driverManager.changeLock(dbc, resource, CmsLockType.EXCLUSIVE); } catch (Exception e) { dbc.report( null, Messages.get().container( Messages.ERR_CHANGE_LOCK_OF_RESOURCE_2, context.getSitePath(resource), " - " + e.getMessage()), e); } finally { dbc.clear(); } }
/** * Changes the lock of a resource to the current user, that is "steals" the lock from another user.<p> * * @param context the current request context * @param resource the resource to change the lock for * * @throws CmsException if something goes wrong * * @see org.opencms.file.types.I_CmsResourceType#changeLock(CmsObject, CmsSecurityManager, CmsResource) */ public void changeLock(CmsRequestContext context, CmsResource resource) throws CmsException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); checkOfflineProject(dbc); try { m_driverManager.changeLock(dbc, resource, CmsLockType.EXCLUSIVE); } catch (Exception e) { dbc.report(null, Messages.get().container( Messages.ERR_CHANGE_LOCK_OF_RESOURCE_2, context.getSitePath(resource), " - " + e.getMessage()), e); } finally { dbc.clear(); } }
lockResource(dbc, resource, CmsLockType.PUBLISH); } else { changeLock(dbc, resource, CmsLockType.PUBLISH); } else { changeLock(dbc, resource, CmsLockType.PUBLISH);
lockResource(dbc, resource, CmsLockType.PUBLISH); } else { changeLock(dbc, resource, CmsLockType.PUBLISH); } else { changeLock(dbc, resource, CmsLockType.PUBLISH);
changeLock(dbc, currentFile, CmsLockType.EXCLUSIVE); changeLock(dbc, currentFolder, CmsLockType.EXCLUSIVE); } else if (!lock.isOwnedInProjectBy(dbc.currentUser(), dbc.currentProject())) { if (lock.isLockableBy(dbc.currentUser())) { changeLock(dbc, currentFile, CmsLockType.EXCLUSIVE);
changeLock(dbc, currentFile, CmsLockType.EXCLUSIVE); changeLock(dbc, currentFolder, CmsLockType.EXCLUSIVE); } else if (!lock.isOwnedInProjectBy(dbc.currentUser(), dbc.currentProject())) { if (lock.isLockableBy(dbc.currentUser())) { changeLock(dbc, currentFile, CmsLockType.EXCLUSIVE);