/** * Returns the system lock information tooltip for the explorer view.<p> * * @param forExplorer if the tool tip should be generated for the explorer view * * @return the system lock information tooltip */ public String getSystemLockInfo(boolean forExplorer) { if (getLock().getSystemLock().isPublish()) { if (!forExplorer) { return getMessages().key(Messages.GUI_PUBLISH_TOOLTIP_0); } else { // see explorer.js(sysLockInfo) and top_js.jsp(publishlock) return "p"; // should have length == 1 } } return ""; }
/** * Returns the system lock information tooltip for the explorer view.<p> * * @param forExplorer if the tool tip should be generated for the explorer view * * @return the system lock information tooltip */ public String getSystemLockInfo(boolean forExplorer) { if (getLock().getSystemLock().isPublish()) { if (!forExplorer) { return getMessages().key(Messages.GUI_PUBLISH_TOOLTIP_0); } else { // see explorer.js(sysLockInfo) and top_js.jsp(publishlock) return "p"; // should have length == 1 } } return ""; }
try { CmsLock lock = getLock(dbc, res); if (lock.isPublish()) {
try { CmsLock lock = getLock(dbc, res); if (lock.isPublish()) {
try { CmsLock lock = getLock(dbc, res); if (lock.isPublish()) {
try { CmsLock lock = getLock(dbc, res); if (lock.isPublish()) {
/** * Checks if a resource can be locked by a user.<p> * * The resource is not lockable if it already has a lock of type {@link CmsLockType#PUBLISH}.<p> * * The resource is lockable either * - if it is currently unlocked * - if it has a lock of another type set and the user is the lock owner * * @param user the user to test lockeability for * * @return <code>true</code> if this lock blocks any operation on the locked resource until it is unlocked */ public boolean isLockableBy(CmsUser user) { if (getSystemLock().isPublish()) { return false; } if (getEditionLock().isUnlocked() && getSystemLock().isUnlocked()) { return true; } return getEditionLock().isOwnedBy(user); }
/** * Checks if a resource can be locked by a user.<p> * * The resource is not lockable if it already has a lock of type {@link CmsLockType#PUBLISH}.<p> * * The resource is lockable either * - if it is currently unlocked * - if it has a lock of another type set and the user is the lock owner * * @param user the user to test lockeability for * * @return <code>true</code> if this lock blocks any operation on the locked resource until it is unlocked */ public boolean isLockableBy(CmsUser user) { if (getSystemLock().isPublish()) { return false; } if (getEditionLock().isUnlocked() && getSystemLock().isUnlocked()) { return true; } return getEditionLock().isOwnedBy(user); }
changeLock(dbc, resource, CmsLockType.PUBLISH); } else if (lock.getSystemLock().isPublish()) { if (LOG.isWarnEnabled()) { LOG.warn(Messages.get().getBundle().key( if (!lock.getSystemLock().isPublish()) { if (report != null) { report.println(Messages.get().container( CmsResource resource = (CmsResource)itResources.next(); CmsLock lock = m_lockManager.getLock(dbc, resource, false); if (lock.getSystemLock().isPublish() && lock.getSystemLock().isOwnedInProjectBy( cms.getRequestContext().currentUser(),
changeLock(dbc, resource, CmsLockType.PUBLISH); } else if (lock.getSystemLock().isPublish()) { if (LOG.isWarnEnabled()) { LOG.warn( if (!lock.getSystemLock().isPublish()) { if (report != null) { report.println( CmsResource resource = itResources.next(); CmsLock lock = m_lockManager.getLock(dbc, resource, false); if (lock.getSystemLock().isPublish() && lock.getSystemLock().isOwnedInProjectBy( cms.getRequestContext().getCurrentUser(),
/** * Returns the project state of the given resource.<p> * * <ul> * <li>null: unchanged.</li> * <li>true: locked in current project.</li> * <li>false: not locked in current project.</li> * </ul> * * @return the project state of the given resource */ public CmsResourceProjectState getProjectState() { if (getResource().getState().isUnchanged()) { return STATE_CLEAN; // STATE_CLEAN } else if (getLock().getSystemLock().isPublish()) { return STATE_LOCKED_FOR_PUBLISHING; } else if (getResource().getProjectLastModified().equals(getReferenceProject().getUuid())) { return STATE_MODIFIED_IN_CURRENT_PROJECT; // STATE_MODIFIED_CURRENT_PROJECT } else { return STATE_MODIFIED_IN_OTHER_PROJECT; // STATE_MODIFIED_OTHER_PROJECT } }
/** * Returns the project state of the given resource.<p> * * <ul> * <li>null: unchanged.</li> * <li>true: locked in current project.</li> * <li>false: not locked in current project.</li> * </ul> * * @return the project state of the given resource */ public CmsResourceProjectState getProjectState() { if (getResource().getState().isUnchanged()) { return STATE_CLEAN; // STATE_CLEAN } else if (getLock().getSystemLock().isPublish()) { return STATE_LOCKED_FOR_PUBLISHING; } else if (getResource().getProjectLastModified().equals(getReferenceProject().getUuid())) { return STATE_MODIFIED_IN_CURRENT_PROJECT; // STATE_MODIFIED_CURRENT_PROJECT } else { return STATE_MODIFIED_IN_OTHER_PROJECT; // STATE_MODIFIED_OTHER_PROJECT } }
if (!lock.getSystemLock().isPublish()) {
if (!lock.getSystemLock().isPublish()) {
/** * Checks is the current resource can be edited by the current user.<p> * * @param locale the locale to use for the messages * @param ignoreExpiration <code>true</code> to ignore resource release and expiration date * * @return an empty string if editable, or a localized string with the reason * * @throws CmsException if something goes wrong */ public String getNoEditReason(Locale locale, boolean ignoreExpiration) throws CmsException { String reason = ""; if (m_resource instanceof I_CmsHistoryResource) { reason = Messages.get().getBundle(locale).key(Messages.GUI_NO_EDIT_REASON_HISTORY_0); } else if (!m_cms.hasPermissions( m_resource, CmsPermissionSet.ACCESS_WRITE, false, ignoreExpiration ? CmsResourceFilter.IGNORE_EXPIRATION : CmsResourceFilter.DEFAULT) || !isEditable()) { reason = Messages.get().getBundle(locale).key(Messages.GUI_NO_EDIT_REASON_PERMISSION_0); } else if (!getLock().isLockableBy(m_cms.getRequestContext().getCurrentUser())) { if (getLock().getSystemLock().isPublish()) { reason = Messages.get().getBundle(locale).key(Messages.GUI_PUBLISH_TOOLTIP_0); } else { reason = Messages.get().getBundle(locale).key(Messages.GUI_NO_EDIT_REASON_LOCK_1, getLockedByName()); } } return reason; }
if (currentLock.getSystemLock().isPublish()) { message = Messages.get().container( Messages.ERR_RESOURCE_LOCKED_FORPUBLISH_1,
if (currentLock.getSystemLock().isPublish()) { message = Messages.get().container( Messages.ERR_RESOURCE_LOCKED_FORPUBLISH_1,
String lockIcon; String message = null; if (resUtil.getLock().getSystemLock().isPublish()) { lockIcon = OpenCmsTheme.LOCK_PUBLISH; message = CmsVaadinUtils.getMessageText(