/** * Performs the cleanup body action of the editor.<p> */ public void actionCleanupBodyElement() { try { // save eventually changed content of the editor to the temporary file Locale oldLocale = CmsLocaleManager.getLocale(getParamOldelementlanguage()); performSaveContent(getParamOldelementname(), oldLocale); } catch (CmsException e) { // show error page try { showErrorPage(this, e); } catch (JspException exc) { // should usually never happen if (LOG.isInfoEnabled()) { LOG.info(exc); } } } }
/** * Performs the cleanup body action of the editor.<p> */ public void actionCleanupBodyElement() { try { // save eventually changed content of the editor to the temporary file Locale oldLocale = CmsLocaleManager.getLocale(getParamOldelementlanguage()); performSaveContent(getParamOldelementname(), oldLocale); } catch (CmsException e) { // show error page try { showErrorPage(this, e); } catch (JspException exc) { // should usually never happen if (LOG.isInfoEnabled()) { LOG.info(exc); } } } }
/** * Performs the change body action of the editor.<p> */ public void actionChangeBodyElement() { try { // save eventually changed content of the editor to the temporary file Locale oldLocale = CmsLocaleManager.getLocale(getParamOldelementlanguage()); performSaveContent(getParamOldelementname(), oldLocale); } catch (CmsException e) { // show error page try { showErrorPage(this, e); } catch (JspException exc) { // should usually never happen if (LOG.isInfoEnabled()) { LOG.info(exc); } } } // re-initialize the element name if the language has changed if (!getParamElementlanguage().equals(getParamOldelementlanguage())) { initBodyElementName(getParamOldelementname()); } // get the new editor content initContent(); }
/** * Performs the change body action of the editor.<p> */ public void actionChangeBodyElement() { try { // save eventually changed content of the editor to the temporary file Locale oldLocale = CmsLocaleManager.getLocale(getParamOldelementlanguage()); performSaveContent(getParamOldelementname(), oldLocale); } catch (CmsException e) { // show error page try { showErrorPage(this, e); } catch (JspException exc) { // should usually never happen if (LOG.isInfoEnabled()) { LOG.info(exc); } } } // re-initialize the element name if the language has changed if (!getParamElementlanguage().equals(getParamOldelementlanguage())) { initBodyElementName(getParamOldelementname()); } // get the new editor content initContent(); }
/** * @see org.opencms.workplace.editors.CmsEditor#actionSave() */ @Override public void actionSave() throws JspException { try { // save content to temporary file performSaveContent(getParamElementname(), getElementLocale()); // copy the temporary file content back to the original file commitTempFile(); // set the modified parameter setParamModified(Boolean.TRUE.toString()); } catch (CmsException e) { showErrorPage(e); } if (getAction() != ACTION_CANCEL) { // save successful, set save action setAction(ACTION_SAVE); } }
/** * @see org.opencms.workplace.editors.CmsEditor#actionSave() */ @Override public void actionSave() throws JspException { try { // save content to temporary file performSaveContent(getParamElementname(), getElementLocale()); // copy the temporary file content back to the original file commitTempFile(); // set the modified parameter setParamModified(Boolean.TRUE.toString()); } catch (CmsException e) { showErrorPage(e); } if (getAction() != ACTION_CANCEL) { // save successful, set save action setAction(ACTION_SAVE); } }
/** * Performs the preview page action in a new browser window.<p> * * @throws IOException if redirect fails * @throws JspException if inclusion of error page fails */ public void actionPreview() throws IOException, JspException { try { // save content of the editor to the temporary file performSaveContent(getParamElementname(), getElementLocale()); } catch (CmsException e) { // show error page showErrorPage(this, e); } // redirect to the temporary file with current active element language String param = "?" + org.opencms.i18n.CmsLocaleManager.PARAMETER_LOCALE + "=" + getParamElementlanguage(); sendCmsRedirect(getParamTempfile() + param); }
/** * Performs the preview page action in a new browser window.<p> * * @throws IOException if redirect fails * @throws JspException if inclusion of error page fails */ public void actionPreview() throws IOException, JspException { try { // save content of the editor to the temporary file performSaveContent(getParamElementname(), getElementLocale()); } catch (CmsException e) { // show error page showErrorPage(this, e); } // redirect to the temporary file with current active element language String param = "?" + org.opencms.i18n.CmsLocaleManager.PARAMETER_LOCALE + "=" + getParamElementlanguage(); sendCmsRedirect(getParamTempfile() + param); }