/** * Get raw content of the document, i.e. the content that is visible through the wiki editor. * * @return The raw content of the document. */ public String getContent() { return this.doc.getContent(); }
public void getContent(XWikiDocument doc, StringBuffer buf) { buf.append(doc.getContent()); }
/** * @return the first level 1 or level 1.1 title text in the document's content or "" if none are found * @todo this method has nothing to do in this class and should be moved elsewhere */ private String extractTitle10() { String content = getContent(); Matcher m = HEADING_PATTERN_10.matcher(content); if (m.find()) { return m.group(1).trim(); } return ""; }
public String getTranslatedContent(String language, XWikiContext context) throws XWikiException { XWikiDocument tdoc = getTranslatedDocument(language, context); return tdoc.getContent(); }
/** * {@inheritDoc} * * @see com.xpn.xwiki.doc.XWikiDocument#getContent() */ @Override public String getContent() { return getDocument().getContent(); }
/** * Append a string containing the result of {@link AbstractIndexData#getFullText} plus the full text content of this * document (in the given language) */ @Override protected void getFullText(StringBuilder sb, XWikiDocument doc, XWikiContext context) { super.getFullText(sb, doc, context); sb.append(" "); sb.append(StringUtils.lowerCase(doc.getContent())); sb.append(" "); getObjectFullText(sb, doc, context); }
/** * @return the XDOM corresponding to the document's string content. */ public XDOM getXDOM() { if (this.xdom == null) { try { this.xdom = parseContent(getContent()); } catch (XWikiException e) { LOG.error("Failed to parse document content to XDOM", e); } } return this.xdom.clone(); }
public List<Delta> getContentDiff(XWikiDocument fromDoc, XWikiDocument toDoc, XWikiContext context) throws XWikiException, DifferentiationFailedException { return getDeltas(Diff.diff(ToString.stringToArray(fromDoc.getContent()), ToString.stringToArray(toDoc.getContent()))); }
public String getTextArea() { return com.xpn.xwiki.XWiki.getTextArea(this.doc.getContent(), getXWikiContext()); }
public String getTemplate(XWikiContext context) throws XWikiException { return context.getWiki().getDocument(DEFAULT_GROUP_TEMPLATE, context).getContent(); }
/** * {@inheritDoc} * * @see DocumentAccessBridge#getDocumentContentForDefaultLanguage(java.lang.String) */ @Deprecated public String getDocumentContentForDefaultLanguage(String documentReference) throws Exception { XWikiContext xcontext = getContext(); return xcontext.getWiki().getDocument(documentReference, xcontext).getContent(); }
/** * {@inheritDoc} * * @see org.xwiki.bridge.DocumentAccessBridge#getDocumentContentForDefaultLanguage(org.xwiki.model.reference.DocumentReference) */ public String getDocumentContentForDefaultLanguage(DocumentReference documentReference) throws Exception { XWikiContext xcontext = getContext(); return xcontext.getWiki().getDocument(documentReference, xcontext).getContent(); }
public Object parseGroovyFromPage(String fullName, String jarWikiPage, XWikiContext context) throws XWikiException { return parseGroovyFromString(context.getWiki().getDocument(fullName, context).getContent(), jarWikiPage, context); }
public List<String> getIncludedMacros(XWikiContext context) { return context.getWiki().getIncludedMacros(getSpace(), getContent(), context); }
public Object parseGroovyFromPage(String fullname, XWikiContext context) throws XWikiException { return parseGroovyFromString(context.getWiki().getDocument(fullname, context).getContent(), context); }
public List<Delta> getLastChanges(XWikiContext context) throws XWikiException, DifferentiationFailedException { Version version = getRCSVersion(); try { String prev = getDocumentArchive(context).getPrevVersion(version).toString(); XWikiDocument prevDoc = context.getWiki().getDocument(this, prev, context); return getDeltas(Diff.diff(ToString.stringToArray(prevDoc.getContent()), ToString.stringToArray(getContent()))); } catch (Exception ex) { LOG.debug("Exception getting differences from previous version: " + ex.getMessage()); } return new ArrayList<Delta>(); }
public void insertText(String text, String marker, XWikiContext context) throws XWikiException { setContent(StringUtils.replaceOnce(getContent(), marker, text + marker)); context.getWiki().saveDocument(this, context); }
public List<Delta> getRenderedContentDiff(XWikiDocument fromDoc, XWikiDocument toDoc, XWikiContext context) throws XWikiException, DifferentiationFailedException { String originalContent, newContent; originalContent = context.getWiki().getRenderingEngine().renderText(fromDoc.getContent(), fromDoc, context); newContent = context.getWiki().getRenderingEngine().renderText(toDoc.getContent(), toDoc, context); return getDeltas(Diff.diff(ToString.stringToArray(originalContent), ToString.stringToArray(newContent))); }
@Override public String getDescription() { String result; BaseObject obj = this.document.getXObject(getType()); BaseClass cls = obj.getXClass(getXContext()); if (cls.getField(JSON_KEY_DESCRIPTION) != null) { result = obj.getLargeStringValue(JSON_KEY_DESCRIPTION); } else { result = this.document.getContent(); } return result; }
@Override public String getDescription() { String result; BaseObject obj = this.document.getXObject(getType()); BaseClass cls = obj.getXClass(getXContext()); if (cls.getField(JSON_KEY_DESCRIPTION) != null) { result = obj.getLargeStringValue(JSON_KEY_DESCRIPTION); } else { result = this.document.getContent(); } return result; }