/** * Deletes a temporary file from the OpenCms VFS, needed when exiting an editor.<p> */ protected void deleteTempFile() { try { // switch to the temporary file project switchToTempProject(); // delete the temporary file getCms().deleteResource(getParamTempfile(), CmsResource.DELETE_PRESERVE_SIBLINGS); } catch (CmsException e) { // should usually never happen if (LOG.isInfoEnabled()) { LOG.info(e); } } finally { try { // switch back to the current project switchToCurrentProject(); } catch (CmsException e) { // should usually never happen if (LOG.isInfoEnabled()) { LOG.info(e); } } } }
/** * Deletes a temporary file from the OpenCms VFS, needed when exiting an editor.<p> */ protected void deleteTempFile() { try { // switch to the temporary file project switchToTempProject(); // delete the temporary file getCms().deleteResource(getParamTempfile(), CmsResource.DELETE_PRESERVE_SIBLINGS); } catch (CmsException e) { // should usually never happen if (LOG.isInfoEnabled()) { LOG.info(e); } } finally { try { // switch back to the current project switchToCurrentProject(); } catch (CmsException e) { // should usually never happen if (LOG.isInfoEnabled()) { LOG.info(e); } } } }
} else if (PARAM_RESOURCE.equals(paramName) || PARAM_TEMPFILE.equals(paramName)) { String filename = CmsEncoder.decode(paramValue, getCms().getRequestContext().getEncoding()); if (PARAM_TEMPFILE.equals(paramName) || CmsStringUtil.isEmpty(getParamTempfile())) {
} else if (PARAM_RESOURCE.equals(paramName) || PARAM_TEMPFILE.equals(paramName)) { String filename = CmsEncoder.decode(paramValue, getCms().getRequestContext().getEncoding()); if (PARAM_TEMPFILE.equals(paramName) || CmsStringUtil.isEmpty(getParamTempfile())) {
try { switchToTempProject(); tempFile = cms.readFile(getParamTempfile(), CmsResourceFilter.ALL); properties = cms.readPropertyObjects(getParamTempfile(), false); } finally { cms.changeLock(getParamTempfile()); cms.rmacc(getParamTempfile(), I_CmsPrincipal.PRINCIPAL_GROUP, OpenCms.getDefaultUsers().getGroupUsers()); cms.rmacc( getParamTempfile(), I_CmsPrincipal.PRINCIPAL_GROUP, OpenCms.getDefaultUsers().getGroupProjectmanagers()); cms.copyResource(getParamTempfile(), getParamResource(), CmsResource.COPY_AS_NEW);
try { switchToTempProject(); tempFile = cms.readFile(getParamTempfile(), CmsResourceFilter.ALL); properties = cms.readPropertyObjects(getParamTempfile(), false); } finally { switchToTempProject(); cms.changeLock(getParamTempfile()); getParamTempfile(), I_CmsPrincipal.PRINCIPAL_GROUP, OpenCms.getDefaultUsers().getGroupUsers()); cms.copyResource(getParamTempfile(), getParamResource(), CmsResource.COPY_AS_NEW);