/** * Starts link processing for the given content in processing mode.<p> * * Macros are replaced by links.<p> * * @param content the content to process * @return the processed content with replaced macros * * @throws ParserException if something goes wrong */ public String processLinks(String content) throws ParserException { m_mode = PROCESS_LINKS; return process(content, m_encoding); }
/** * Process an embed tag.<p> * * @param tag the tag to process */ protected void processEmbedTag(Tag tag) { for (int i = 0; i < EMBED_TAG_LINKED_ATTRIBS.length; i++) { String attr = EMBED_TAG_LINKED_ATTRIBS[i]; processLink(tag, attr, CmsRelationType.EMBEDDED_OBJECT); } }
/** * Visitor method to process a tag (start).<p> * * @param tag the tag to process */ @Override public void visitTag(Tag tag) { if (tag instanceof LinkTag) { processLinkTag((LinkTag)tag); } else if (tag instanceof ImageTag) { processImageTag((ImageTag)tag); } else if (tag instanceof ObjectTag) { processObjectTag((ObjectTag)tag); } else { // there are no specialized tag classes for these tags :( if (TAG_EMBED.equals(tag.getTagName())) { processEmbedTag(tag); } else if (TAG_AREA.equals(tag.getTagName())) { processAreaTag(tag); } } // append text content of the tag (may have been changed by above methods) super.visitTag(tag); }
try { finalValue = linkProcessor.replaceLinks(finalValue); } catch (Exception exc) { throw new CmsRuntimeException(Messages.get().container(Messages.ERR_HTML_DATA_PROCESSING_0), exc); CmsLinkTable linkTable = linkProcessor.getLinkTable(); for (Iterator<CmsLink> i = linkTable.iterator(); i.hasNext();) { CmsLink link = i.next();
/** * @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); }
content = linkProcessor.processLinks(content); } catch (ParserException e) {
/** * Visitor method to process a tag (start).<p> * * @param tag the tag to process */ @Override public void visitTag(Tag tag) { if (tag instanceof LinkTag) { processLinkTag((LinkTag)tag); } else if (tag instanceof ImageTag) { processImageTag((ImageTag)tag); } else if (tag instanceof ObjectTag) { processObjectTag((ObjectTag)tag); } else { // there are no specialized tag classes for these tags :( if (TAG_EMBED.equals(tag.getTagName())) { processEmbedTag(tag); } else if (TAG_AREA.equals(tag.getTagName())) { processAreaTag(tag); } } // append text content of the tag (may have been changed by above methods) super.visitTag(tag); }
try { finalValue = linkProcessor.replaceLinks(finalValue); } catch (Exception exc) { throw new CmsRuntimeException(Messages.get().container(Messages.ERR_HTML_DATA_PROCESSING_0), exc); CmsLinkTable linkTable = linkProcessor.getLinkTable(); for (Iterator<CmsLink> i = linkTable.iterator(); i.hasNext();) { CmsLink link = i.next();
/** * @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_allowRelativeLinks) && (m_file != null)) { relativeRoot = CmsResource.getParentFolder(cms.getSitePath(m_file)); } return new CmsLinkProcessor(cms, linkTable, getEncoding(), relativeRoot); }
content = linkProcessor.processLinks(content); } catch (ParserException e) {
/** * Process an embed tag.<p> * * @param tag the tag to process */ protected void processEmbedTag(Tag tag) { for (int i = 0; i < EMBED_TAG_LINKED_ATTRIBS.length; i++) { String attr = EMBED_TAG_LINKED_ATTRIBS[i]; processLink(tag, attr, CmsRelationType.EMBEDDED_OBJECT); } }
/** * @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_allowRelativeLinks) && (m_file != null)) { relativeRoot = CmsResource.getParentFolder(cms.getSitePath(m_file)); } return new CmsLinkProcessor(cms, linkTable, getEncoding(), relativeRoot); }
/** * Starts link processing for the given content in replacement mode.<p> * * Links are replaced by macros.<p> * * @param content the content to process * @return the processed content with replaced links * * @throws ParserException if something goes wrong */ public String replaceLinks(String content) throws ParserException { m_mode = REPLACE_LINKS; return process(content, m_encoding); }
/** * Process an area tag.<p> * * @param tag the tag to process */ protected void processAreaTag(Tag tag) { processLink(tag, ATTRIBUTE_HREF, CmsRelationType.HYPERLINK); }
/** * @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); }
/** * Starts link processing for the given content in processing mode.<p> * * Macros are replaced by links.<p> * * @param content the content to process * @return the processed content with replaced macros * * @throws ParserException if something goes wrong */ public String processLinks(String content) throws ParserException { m_mode = PROCESS_LINKS; return process(content, m_encoding); }
/** * Process an area tag.<p> * * @param tag the tag to process */ protected void processAreaTag(Tag tag) { processLink(tag, ATTRIBUTE_HREF, CmsRelationType.HYPERLINK); }
/** * Starts link processing for the given content in replacement mode.<p> * * Links are replaced by macros.<p> * * @param content the content to process * @return the processed content with replaced links * * @throws ParserException if something goes wrong */ public String replaceLinks(String content) throws ParserException { m_mode = REPLACE_LINKS; return process(content, m_encoding); }
/** * Process a link tag.<p> * * @param tag the tag to process */ protected void processLinkTag(LinkTag tag) { processLink(tag, ATTRIBUTE_HREF, CmsRelationType.valueOf(tag.getTagName())); }
/** * Process an image tag.<p> * * @param tag the tag to process */ protected void processImageTag(ImageTag tag) { processLink(tag, ATTRIBUTE_SRC, CmsRelationType.valueOf(tag.getTagName())); }