Package com.atlassian.confluence.links
Class DefaultLinkManager
- java.lang.Object
-
- com.atlassian.confluence.links.DefaultLinkManager
-
- All Implemented Interfaces:
LinkManager
public class DefaultLinkManager extends Object implements LinkManager
-
-
Field Summary
-
Fields inherited from interface com.atlassian.confluence.links.LinkManager
CAMELCASE_LINK_PATTERN, NORMAL_LINK_PATTERN
-
-
Constructor Summary
Constructors Constructor Description DefaultLinkManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Stream<OutgoingLinkMeta>
countIncomingLinksForContents(SpaceContentEntityObject rootPage, SpaceContentEntityObject parentPage)
Helping method to get all incoming links of multiple contents at once.int
countPagesWithIncomingLinks(SpaceContentEntityObject rootPage)
Get the number of pages in a page hierarchy that have incoming links.List<OutgoingLink>
getIncomingLinksToContent(ContentEntityObject content)
Collection<ContentEntityObject>
getReferringContent(ContentEntityObject content)
Collection<ContentEntityObject>
getReferringContent(String spaceKey, List<ContentEntityObject> collection)
Gets collection of referring content with given set of pages within single spacevoid
removeCorruptOutgoingLinks()
void
removeLink(OutgoingLink link)
Remove an internal linkvoid
saveLink(OutgoingLink link)
Save an internal linkvoid
setAttachmentLinksUpdater(AttachmentLinksUpdater attachmentLinksUpdater)
Deprecated.since 7.7 unusedvoid
setLinkDao(LinkDao linkDao)
void
setLinkResolver(com.atlassian.renderer.links.LinkResolver linkResolver)
Deprecated.since 7.7 unusedvoid
setLinksUpdater(LinksUpdater linksUpdater)
Deprecated.since 7.7 unusedvoid
setMacroManager(com.atlassian.renderer.v2.macro.MacroManager macroManager)
Deprecated.since 7.7 unusedvoid
setOutgoingLinksExtractor(OutgoingLinksExtractor outgoingLinksExtractor)
void
setSettingsManager(SettingsManager settingsManager)
Deprecated.since 7.7 unusedvoid
updateOutgoingLinks(ContentEntityObject content)
-
-
-
Method Detail
-
setLinkDao
public void setLinkDao(LinkDao linkDao)
-
setLinkResolver
@Deprecated public void setLinkResolver(com.atlassian.renderer.links.LinkResolver linkResolver)
Deprecated.since 7.7 unused
-
removeLink
public void removeLink(OutgoingLink link)
Description copied from interface:LinkManager
Remove an internal link- Specified by:
removeLink
in interfaceLinkManager
-
saveLink
public void saveLink(OutgoingLink link)
Description copied from interface:LinkManager
Save an internal link- Specified by:
saveLink
in interfaceLinkManager
-
getIncomingLinksToContent
public List<OutgoingLink> getIncomingLinksToContent(ContentEntityObject content)
- Specified by:
getIncomingLinksToContent
in interfaceLinkManager
- Parameters:
content
-- Returns:
- a sorted list of link objects to the content object passed in. does _not_ sort out duplicate links
-
countIncomingLinksForContents
public Stream<OutgoingLinkMeta> countIncomingLinksForContents(SpaceContentEntityObject rootPage, SpaceContentEntityObject parentPage)
Description copied from interface:LinkManager
Helping method to get all incoming links of multiple contents at once.- Specified by:
countIncomingLinksForContents
in interfaceLinkManager
- Returns:
- Stream of OutgoingLinkMeta
-
countPagesWithIncomingLinks
public int countPagesWithIncomingLinks(SpaceContentEntityObject rootPage)
Description copied from interface:LinkManager
Get the number of pages in a page hierarchy that have incoming links. Note that this excludes links within the hierarchy.- Specified by:
countPagesWithIncomingLinks
in interfaceLinkManager
- Parameters:
rootPage
- the root page of the hierarchy. Links to this page are also counted.- Returns:
- The number of pages in the hierarchy that have incoming links, excluding links within the hierarchy.
-
updateOutgoingLinks
public void updateOutgoingLinks(ContentEntityObject content)
- Specified by:
updateOutgoingLinks
in interfaceLinkManager
-
getReferringContent
public Collection<ContentEntityObject> getReferringContent(ContentEntityObject content)
- Specified by:
getReferringContent
in interfaceLinkManager
- Parameters:
content
-- Returns:
- a collection of content that currently links to the content object passed in here
-
getReferringContent
public Collection<ContentEntityObject> getReferringContent(String spaceKey, List<ContentEntityObject> collection)
Description copied from interface:LinkManager
Gets collection of referring content with given set of pages within single space- Specified by:
getReferringContent
in interfaceLinkManager
-
removeCorruptOutgoingLinks
public void removeCorruptOutgoingLinks()
- Specified by:
removeCorruptOutgoingLinks
in interfaceLinkManager
-
setSettingsManager
@Deprecated public void setSettingsManager(SettingsManager settingsManager)
Deprecated.since 7.7 unused
-
setMacroManager
@Deprecated public void setMacroManager(com.atlassian.renderer.v2.macro.MacroManager macroManager)
Deprecated.since 7.7 unused
-
setOutgoingLinksExtractor
public void setOutgoingLinksExtractor(OutgoingLinksExtractor outgoingLinksExtractor)
-
setLinksUpdater
@Deprecated public void setLinksUpdater(LinksUpdater linksUpdater)
Deprecated.since 7.7 unused
-
setAttachmentLinksUpdater
@Deprecated public void setAttachmentLinksUpdater(AttachmentLinksUpdater attachmentLinksUpdater)
Deprecated.since 7.7 unused
-
-