java.lang.Object | |
↳ | com.atlassian.confluence.content.render.xhtml.DefaultXhtmlContent |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a storage format fragment for the supplied
embeddedImage . | |||||||||||
Returns a view format fragment for the supplied
embeddedImage . | |||||||||||
Returns a storage format fragment for the supplied
link . | |||||||||||
Returns a view format fragment for the supplied
link . | |||||||||||
Returns an storage format fragment for the supplied
macroDefinition . | |||||||||||
Returns a view format fragment for the supplied
macroDefinition . | |||||||||||
Returns a view format fragment for the supplied
storageFragment . | |||||||||||
Convert the body of the supplied ContentEntityObject to Confluence Storage Format XHTML (if necessary). | |||||||||||
Returns the XHTML storage format equivalent of the supplied
wikiContent (wiki markup). | |||||||||||
Returns the HTML view format equivalent of the supplied
wikiContent . | |||||||||||
Perform an operation on
MacroDefinition s in the supplied storageFragment without making changes
to the storage representation. | |||||||||||
Provides a mechanism for finding arbitrary Xhtml elements in the supplied
storageFormat . | |||||||||||
Replaces
MacroDefinition s in the supplied storageFragment with a String. | |||||||||||
Updates
MacroDefinition s in the supplied storageFragment . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.atlassian.confluence.xhtml.api.XhtmlContent
|
Returns a storage format fragment for the supplied embeddedImage
.
embeddedImage | that describes the embedded image. |
---|---|
context | for the conversion. |
XhtmlException |
---|
Returns a view format fragment for the supplied embeddedImage
.
embeddedImage | that describes the embedded image. |
---|---|
context | for the conversion. |
XhtmlException |
---|
Returns a storage format fragment for the supplied link
.
link | that describes the link. |
---|---|
context | for the conversion. |
XhtmlException |
---|
Returns a view format fragment for the supplied link
.
link | that describes the link. |
---|---|
context | for the conversion. |
XhtmlException |
---|
Returns an storage format fragment for the supplied macroDefinition
.
macroDefinition | that describes the macro. |
---|---|
context | for the conversion. |
XhtmlException |
---|
Returns a view format fragment for the supplied macroDefinition
.
macroDefinition | that describes the macro. |
---|---|
context | for the conversion. |
XhtmlException |
---|
Returns a view format fragment for the supplied storageFragment
.
storageFragment | to be converted (for example the body of a macro). |
---|---|
context | for the conversion. |
XMLStreamException | |
---|---|
XhtmlException |
Convert the body of the supplied ContentEntityObject to Confluence Storage Format XHTML (if necessary).
Since for now and the near future Confluence may have both wiki formatted and XHTML formatted ContentEntityObjects in the system (wiki formatted historical versions may be present in an upgraded installation) this method provides a convenient way to ensure you only need to handle ContentEntityObjects with the new XHTML format of body.
Note that the returned ceo is a clone of the passed in version, even if no conversion was necessary.
ceo | the ContentEntityObject to be converted (if necessary). |
---|
Returns the XHTML storage format equivalent of the supplied wikiContent
(wiki markup).
wikiContent | to be converted. |
---|---|
context | for the conversion. |
migrationExceptions | that will be populated with any exceptions that take place during the migration. There may be multiple exceptions if there are multiple wiki markup sections. |
Returns the HTML view format equivalent of the supplied wikiContent
.
wikiContent | to be converted. |
---|---|
context | for the conversion. |
migrationExceptions | that will be populated with any exceptions that take place during the migration. There may be multiple exceptions if there are multiple wiki markup sections. |
XMLStreamException | |
---|---|
XhtmlException |
Perform an operation on MacroDefinition
s in the supplied storageFragment
without making changes
to the storage representation.
// Finds the last macro on a page final AtomicReferenceatomicMacroDefinition = new AtomicReference (); xhtmlContent.handleMacroDefinitions(page.getBodyAsString(), context, new MacroDefinitionHandler() { public void handle(MacroDefinition macroDefinition) { atomicMacroDefinition.set(macroDefinition); } }); MacroDefinition lastMacro = atomicMacroDefinition.get();
storageFragment | or more typically the storage representation of a complete ContentEntityObject
which might contain macro definitions. |
---|---|
context | for the conversion. |
handler | which is called each MacroDefinition found. |
XhtmlException |
---|
Provides a mechanism for finding arbitrary Xhtml elements in the supplied storageFormat
.
storageFragment | or more typically the storage representation of a complete ContentEntityObject |
---|---|
context | for the conversion |
visitors | a list of visitors |
XhtmlException |
---|
Replaces MacroDefinition
s in the supplied storageFragment
with a String. Use {link #updateMacroDefinitions}
rather than this method if you wish to replace or update one definition with another.
// Replaces "cheese" macros with some XHTML. page.setBodyAsString(xhtmlContent.replaceMacroDefinitionsWithString(page.getBodyAsString(), context, new MacroDefinitionReplacer() { public String replace(MacroDefinition macroDefinition) throws XhtmlException { if ("cheese".equals(macroDefinition.getName())) return "I hate cheese!
"; return xhtmlContent.convertMacroDefinitionToStorage(macroDefinition, context); } }));
storageFragment | or more typically the storage representation of a complete ContentEntityObject
which might contain macro definitions. |
---|---|
context | for the conversion. |
replacer | which is called to replace each MacroDefinition found with a replacement in storage format (typically XHTML). |
XhtmlException |
---|
Updates MacroDefinition
s in the supplied storageFragment
.
// Changes the name of all "mice" macros to "cheese". page.setBodyAsString(xhtmlContent.updateMacroDefinitions(page.getBodyAsString(), context, new XhtmlContent.MacroDefinitionUpdater() { public MacroDefinition update(MacroDefinition macroDefinition) { if ("mice".equals(macroDefinition.getName())) macroDefinition.setName("cheese"); return macroDefinition; } }));
storageFragment | or more typically the storage representation of a complete ContentEntityObject
which might contain macro definitions. |
---|---|
context | for the conversion. |
updater | which is called to update each MacroDefinition found. |
XhtmlException |
---|