/** * @see org.opencms.file.wrapper.I_CmsResourceWrapper#unlockResource(CmsObject, String) */ public boolean unlockResource(CmsObject cms, String resourcename) throws CmsException { if (m_isWrappedResource) { cms.unlockResource(resourcename); return true; } return false; }
/** * @see org.opencms.file.wrapper.I_CmsResourceWrapper#unlockResource(CmsObject, String) */ public boolean unlockResource(CmsObject cms, String resourcename) throws CmsException { if (m_isWrappedResource) { cms.unlockResource(resourcename); return true; } return false; }
/** * Tries to unlock a resource.<p> * * @param resource the resource to unlock */ private void tryUnlock(CmsResource resource) { try { m_cms.unlockResource(resource); } catch (Exception unlockError) { LOG.debug(unlockError.getLocalizedMessage(), unlockError); } }
/** * Tries to unlock a resource.<p> * * @param cms the cms context * @param resource the resource to unlock */ private static void tryUnlock(CmsObject cms, CmsResource resource) { try { cms.unlockResource(resource); } catch (CmsException e) { LOG.debug("Unable to unlock " + resource.getRootPath(), e); } }
/** * Tries to unlock the given resource.<p> * * @param resource the resource to unlock */ private void tryUnlock(CmsResource resource) { try { m_cms.unlockResource(resource); } catch (CmsException e) { // usually not a problem LOG.debug("failed to unlock " + resource.getRootPath(), e); } }
/** * Tries to unlock the current resource.<p> */ private void tryUnlock() { if (m_resource != null) { try { A_CmsUI.getCmsObject().unlockResource(m_resource); } catch (CmsException e) { LOG.debug("Unlocking resource " + m_resource.getRootPath() + " failed", e); } } } }
/** * Tries to unlock a resource.<p> * * @param resource the resource to unlock */ protected void tryUnlock(CmsResource resource) { try { getCmsObject().unlockResource(resource); } catch (CmsException e) { LOG.debug("Unable to unlock " + resource.getRootPath(), e); } } }
public boolean unlock() throws CmsException { if (!m_lockRecord.getChange().equals(LockChange.unchanged) || m_new) { m_cms.unlockResource(m_file); return true; } else { return false; } }
/** * Unlocks the given resource (if required).<p> * * @param cms the OpenCms user context * @param lock the lock of the resource * @param res the resource to lock * * @throws CmsException in case something goes wrong */ private void unlockResource(CmsObject cms, CmsLock lock, CmsResource res) throws CmsException { if (lock.isNullLock()) { cms.unlockResource(res.getRootPath()); } } }
/** * Unlocks the given resource (if required).<p> * * @param cms the OpenCms user context * @param lock the lock of the resource * @param res the resource to lock * * @throws CmsException in case something goes wrong */ private void unlockResource(CmsObject cms, CmsLock lock, CmsResource res) throws CmsException { if (lock.isNullLock()) { cms.unlockResource(res.getRootPath()); } } }
/** * @see org.opencms.ui.actions.I_CmsWorkplaceAction#executeAction(org.opencms.ui.I_CmsDialogContext) */ public void executeAction(I_CmsDialogContext context) { CmsObject cms = A_CmsUI.getCmsObject(); List<CmsUUID> changedIds = Lists.newArrayList(); for (CmsResource res : context.getResources()) { try { cms.unlockResource(res); changedIds.add(res.getStructureId()); } catch (CmsException e) { LOG.warn(e.getLocalizedMessage(), e); } context.finish(changedIds); } }
/** * Clears the resource lock.<p> * * @throws CmsException in case reading the resource fails */ private void clearLock() throws CmsException { if ((m_lockActionRecord != null) && (m_lockActionRecord.getChange() == LockChange.locked)) { CmsResource updatedRes = m_cms.readResource(m_resource.getStructureId(), CmsResourceFilter.ALL); try { m_cms.unlockResource(updatedRes); } catch (CmsLockException e) { LOG.warn(e.getLocalizedMessage(), e); } m_lockActionRecord = null; } }
/** * @see org.opencms.file.wrapper.A_CmsResourceWrapper#unlockResource(org.opencms.file.CmsObject, java.lang.String) */ @Override public boolean unlockResource(CmsObject cms, String resourcename) throws CmsException { CmsResource res = getResource(cms, resourcename, CmsResourceFilter.DEFAULT); if (res != null) { cms.unlockResource(cms.getRequestContext().removeSiteRoot(res.getRootPath())); return true; } return false; }
/** * @see org.opencms.file.wrapper.A_CmsResourceWrapper#unlockResource(org.opencms.file.CmsObject, java.lang.String) */ @Override public boolean unlockResource(CmsObject cms, String resourcename) throws CmsException { CmsResource res = findXmlPage(cms, resourcename); if (res != null) { cms.unlockResource(cms.getRequestContext().removeSiteRoot(res.getRootPath())); return true; } return false; }
/** * @see org.opencms.file.wrapper.A_CmsResourceWrapper#unlockResource(org.opencms.file.CmsObject, java.lang.String) */ @Override public boolean unlockResource(CmsObject cms, String resourcename) throws CmsException { CmsResource res = findXmlPage(cms, resourcename); if (res != null) { cms.unlockResource(cms.getRequestContext().removeSiteRoot(res.getRootPath())); return true; } return false; }
/** * @see org.opencms.file.wrapper.A_CmsResourceWrapper#unlockResource(org.opencms.file.CmsObject, java.lang.String) */ @Override public boolean unlockResource(CmsObject cms, String resourcename) throws CmsException { CmsResource res = getResource(cms, resourcename); if (res != null) { cms.unlockResource(cms.getRequestContext().removeSiteRoot(res.getRootPath())); return true; } return false; }
/** * @see org.opencms.file.wrapper.A_CmsResourceWrapper#unlockResource(org.opencms.file.CmsObject, java.lang.String) */ @Override public boolean unlockResource(CmsObject cms, String resourcename) throws CmsException { CmsResource res = getResource(cms, resourcename); if (res != null) { cms.unlockResource(cms.getRequestContext().removeSiteRoot(res.getRootPath())); return true; } return false; }
/** * @see org.opencms.file.wrapper.A_CmsResourceWrapper#unlockResource(org.opencms.file.CmsObject, java.lang.String) */ @Override public boolean unlockResource(CmsObject cms, String resourcename) throws CmsException { CmsResource res = getResource(cms, resourcename, CmsResourceFilter.DEFAULT); if (res != null) { cms.unlockResource(cms.getRequestContext().removeSiteRoot(res.getRootPath())); return true; } return false; }
/** * Cancels the edit process. Unlocks the resource if required.<p> * * @see org.opencms.ui.components.I_CmsFilePropertyEditHandler#cancel() */ public void cancel() { if (m_lockActionRecord.getChange() == LockChange.locked) { CmsObject cms = A_CmsUI.getCmsObject(); try { CmsResource res = cms.readResource(m_editId); cms.unlockResource(res); } catch (CmsException e) { LOG.warn("Failed to unlock resource " + m_editId.toString(), e); } } CmsAppWorkplaceUi.get().enableGlobalShortcuts(); }
/** The dialog mode. */ public static enum DialogMode { /** Allow copy only. */ copy, /** Allow copy and move. */ copy_and_move, /** Allow move only. */ move }