/** * Manipulates the content String and removes leading and trailing white spaces.<p> * * @param save if set to true, the content parameter is not updated * @return the prepared content String */ @Override protected String prepareContent(boolean save) { String content = getParamContent().trim(); // ensure all chars in the content are valid for the selected encoding content = CmsEncoder.adjustHtmlEncoding(content, getFileEncoding()); if (!save) { setParamContent(content); } return content; }
fillParamValues(request); setParamDialogtype(EDITOR_TYPE); if ((getParamTempfile() != null) && !"null".equals(getParamTempfile())) { try { m_file = getCms().readFile(getParamTempfile(), CmsResourceFilter.ALL); m_page = CmsXmlPageFactory.unmarshal(getCms(), m_file); } catch (CmsException e) { if (e instanceof CmsVfsResourceNotFoundException) { setParamTempfile(createTempFile()); m_file = getCms().readFile(getParamTempfile(), CmsResourceFilter.ALL); m_page = CmsXmlPageFactory.unmarshal(getCms(), m_file); } catch (CmsException e1) { showErrorPage(this, e1); } catch (JspException exc) { showErrorPage(this, e); } catch (JspException exc) { if (EDITOR_SAVE.equals(getParamAction())) { setAction(ACTION_SAVE); } else if (EDITOR_SAVEEXIT.equals(getParamAction())) { setAction(ACTION_SAVEEXIT); } else if (EDITOR_SAVEACTION.equals(getParamAction())) { setAction(ACTION_SAVEACTION); try {
/** * @see org.opencms.workplace.editors.CmsSimplePageEditor#prepareContent(boolean) */ protected String prepareContent(boolean save) { if (save) { String conversionSetting = CmsHtmlConverter.getConversionSettings(getCms(), m_file); if (CmsStringUtil.isEmptyOrWhitespaceOnly(conversionSetting)) { // by default we want to pretty-print and Xhtml format when saving the content in FCKeditor String content = getParamContent(); CmsHtmlConverter converter = new CmsHtmlConverter(getEncoding(), CmsHtmlConverter.PARAM_XHTML); content = converter.convertToStringSilent(content); setParamContent(content); } } // do further processing with super class return super.prepareContent(true); } }
fillParamValues(request); setParamDialogtype(EDITOR_TYPE); if ((getParamTempfile() != null) && !"null".equals(getParamTempfile())) { try { m_file = getCms().readFile(this.getParamTempfile(), CmsResourceFilter.ALL); m_page = CmsXmlPageFactory.unmarshal(getCms(), m_file); } catch (CmsException e) { if (e instanceof CmsVfsResourceNotFoundException) { setParamTempfile(createTempFile()); m_file = getCms().readFile(this.getParamTempfile(), CmsResourceFilter.ALL); m_page = CmsXmlPageFactory.unmarshal(getCms(), m_file); } catch (CmsException e1) { showErrorPage(this, e1); } catch (JspException exc) { showErrorPage(this, e); } catch (JspException exc) { if (EDITOR_SAVE.equals(getParamAction())) { setAction(ACTION_SAVE); } else if (EDITOR_SAVEEXIT.equals(getParamAction())) { setAction(ACTION_SAVEEXIT); } else if (EDITOR_SAVEACTION.equals(getParamAction())) { setAction(ACTION_SAVEACTION); try {
/** * Manipulates the content String and removes leading and trailing white spaces.<p> * * @param save if set to true, the content parameter is not updated * @return the prepared content String */ @Override protected String prepareContent(boolean save) { String content = getParamContent().trim(); // ensure all chars in the content are valid for the selected encoding content = CmsEncoder.adjustHtmlEncoding(content, getFileEncoding()); if (!save) { setParamContent(content); } return content; }