/** * @see org.opencms.xml.A_CmsXmlDocument#getLinkProcessor(org.opencms.file.CmsObject, org.opencms.staticexport.CmsLinkTable) */ public CmsLinkProcessor getLinkProcessor(CmsObject cms, CmsLinkTable linkTable) { // initialize link processor String relativeRoot = null; if (m_file != null) { relativeRoot = CmsResource.getParentFolder(cms.getSitePath(m_file)); } return new CmsLinkProcessor(cms, linkTable, getEncoding(), relativeRoot); }
/** * @see org.opencms.xml.A_CmsXmlDocument#getLinkProcessor(org.opencms.file.CmsObject, org.opencms.staticexport.CmsLinkTable) */ public CmsLinkProcessor getLinkProcessor(CmsObject cms, CmsLinkTable linkTable) { // initialize link processor String relativeRoot = null; if (m_file != null) { relativeRoot = CmsResource.getParentFolder(cms.getSitePath(m_file)); } return new CmsLinkProcessor(cms, linkTable, getEncoding(), relativeRoot); }
/** * Builds the diff view for the XML text.<p> * * @param cms the CMS context * @param file1 the first file * @param file2 the second file * * @return the diff view */ private Component buildWholeFileDiffView(CmsObject cms, CmsFile file1, CmsFile file2) { String encoding = "UTF-8"; try { CmsXmlContent content1 = CmsXmlContentFactory.unmarshal(cms, file1); encoding = content1.getEncoding(); } catch (CmsException e) { String rootPath = file1.getRootPath(); LOG.error( "Could not unmarshal file " + rootPath + " for determining encoding: " + e.getLocalizedMessage(), e); } String text1 = decode(file1.getContents(), encoding); String text2 = decode(file2.getContents(), encoding); CmsTextDiffPanel diffPanel = new CmsTextDiffPanel(text1, text2, false, true); return diffPanel; }
file.setContents(decodedContent.getBytes(content.getEncoding())); } catch (UnsupportedEncodingException e) { throw new CmsException(Messages.get().container(
cms, locale, template.getEncoding(), template.getContentDefinition()); } else {
file.setContents(decodedContent.getBytes(content.getEncoding())); } catch (UnsupportedEncodingException e) { throw new CmsException(
getCms(), locale, template.getEncoding(), template.getContentDefinition());
initDocument(cms, document, model.getEncoding(), m_contentDefinition);
initDocument(cms, document, model.getEncoding(), m_contentDefinition);
parser.process(content, xmlcontent.getEncoding()); value.setStringValue(getCms(), parser.getResult()); } catch (ParserException e) {