public interface LinksUpdater
Modifier and Type | Interface and Description |
---|---|
static class |
LinksUpdater.AttachmentReferenceDetails |
static class |
LinksUpdater.PartialReferenceDetails |
Modifier and Type | Method and Description |
---|---|
String |
canonicalize(String content)
Applies the same rewriter as on any of contract/expand methods.
|
String |
contractAbsoluteReferencesInContent(SpaceContentEntityObject content)
A companion method to {
expandRelativeReferencesInContent(SpaceContentEntityObject) that will convert any absolute
references to itself to be relative. |
String |
expandRelativeReferencesInContent(Comment comment)
Expand any relative links or embedded files/images encountered in the supplied comment.
|
String |
expandRelativeReferencesInContent(SpaceContentEntityObject content)
Expand any relative links or embedded images encountered in the supplied content.
|
String |
updateAttachmentReferencesInContent(String content,
LinksUpdater.AttachmentReferenceDetails old,
LinksUpdater.AttachmentReferenceDetails updated)
Update all the attachment references in the content that referred to the 'old' attachment to now refer to the 'updated' attachment.
|
String |
updateAttachmentReferencesInContent(String content,
Map<LinksUpdater.AttachmentReferenceDetails,LinksUpdater.AttachmentReferenceDetails> oldToNewLinkDetails)
Update all the attachment references in the content that referred to the 'old' attachment to now refer to the 'updated' attachment.
|
String |
updateReferencesInContent(String content,
LinksUpdater.PartialReferenceDetails oldLinkDetails,
LinksUpdater.PartialReferenceDetails newLinkDetails)
Update all the links and embedded image references in the content that referred to 'oldDetails' to now refer to 'newDetails'.
|
String |
updateReferencesInContent(String content,
Map<LinksUpdater.PartialReferenceDetails,LinksUpdater.PartialReferenceDetails> oldToNewMapping)
Update all the links and embedded image references in the content that referred to 'oldDetails' to now refer to 'newDetails'.
|
String updateReferencesInContent(String content, LinksUpdater.PartialReferenceDetails oldLinkDetails, LinksUpdater.PartialReferenceDetails newLinkDetails)
expandRelativeReferencesInContent(SpaceContentEntityObject)
prior to calling this method to ensure there are no relative links in the content to confuse matters.content
- the content to update references inoldLinkDetails
- specifies the references to be modifiednewLinkDetails
- specifies the reference to be used in place of those identified by 'oldDetails'.String updateReferencesInContent(String content, Map<LinksUpdater.PartialReferenceDetails,LinksUpdater.PartialReferenceDetails> oldToNewMapping)
expandRelativeReferencesInContent(SpaceContentEntityObject)
prior to calling this method to ensure there are no relative links in the content to confuse matters.content
- the content to update references inoldToNewMapping
- the map from old reference to new referenceString updateAttachmentReferencesInContent(String content, LinksUpdater.AttachmentReferenceDetails old, LinksUpdater.AttachmentReferenceDetails updated)
expandRelativeReferencesInContent(SpaceContentEntityObject)
prior to calling this
method to ensure there are no relative attachment references in the content to confuse matters.content
- the content to update attachment references inold
- specifies the attachment references to be modifiedupdated
- specifies the new attachment reference to replace the old one withString updateAttachmentReferencesInContent(String content, Map<LinksUpdater.AttachmentReferenceDetails,LinksUpdater.AttachmentReferenceDetails> oldToNewLinkDetails)
expandRelativeReferencesInContent(SpaceContentEntityObject)
prior to calling this
method to ensure there are no relative attachment references in the content to confuse matters.content
- the content to update attachment references inoldToNewLinkDetails
- the map from old reference to new referenceString expandRelativeReferencesInContent(SpaceContentEntityObject content)
This method will convert such references to an absolute reference to either it's containing space or itself (in the case of an attachment or link with no resource identifier at all).
content
- the content to be expandedString expandRelativeReferencesInContent(Comment comment)
This method will convert such references to an absolute reference to either it's containing space or itself (in the case of an attachment or link with no resource identifier at all).
comment
- the comment to be expandedString contractAbsoluteReferencesInContent(SpaceContentEntityObject content)
expandRelativeReferencesInContent(SpaceContentEntityObject)
that will convert any absolute
references to itself to be relative. So in a ResourceIdentifier, if a space key is present for the same space as the supplied
content then this will be dropped. If the ResourceIdentifier actually refers to the SpaceContentEntityObject supplied then it
will be dropped altogether.content
- the content to have any suitable absolute references contracted.String canonicalize(String content)
This method is needed because even if xml structure of content is the same entity replacing by javax.xml.* and substitution done in ConfluenceXMLEventWriter will make two equal contents look different on equals method.
Copyright © 2003–2020 Atlassian. All rights reserved.