com.atlassian.confluence.links
Class DefaultLinkManager

java.lang.Object
  extended bycom.atlassian.confluence.links.DefaultLinkManager
All Implemented Interfaces:
LinkManager

public class DefaultLinkManager
extends Object
implements LinkManager


Field Summary
static org.apache.log4j.Category log
           
 
Fields inherited from interface com.atlassian.confluence.links.LinkManager
CAMELCASE_LINK_PATTERN, NORMAL_LINK_PATTERN
 
Constructor Summary
DefaultLinkManager()
           
 
Method Summary
 List extractLinksFromContent(ContentEntityObject content)
           
 String getContentWithRenamedLinks(ContentEntityObject referringContent, SpaceContentEntityObject pageBeingChanged, String newSpaceKey, String newPageTitle)
          extracts the text from the referring page, renames links with newSpaceKey and newPageTitle and returns the content with updated links
 List getIncomingLinksToContent(ContentEntityObject content)
           
 Collection getReferringContent(ContentEntityObject content)
           
 String getSelfContentWithRenamedLinks(ContentEntityObject referringContent, String newSpaceKey)
          extracts the text from the page to be moved, renames links which target the old space and returns the content with the updated links
 void removeCorruptOutgoingLinks()
           
 void removeLink(OutgoingLink link)
          Remove an internal link
 void renameOutgoingLinksToAttachments(ContentEntityObject referringContent, String existingFileName, String newFileName)
          Renames all attachments links on the current page (srcContent) Used for simple renaming of attachments
 void renameOutgoingLinksToMovedAttachments(ContentEntityObject referringContent, String existingFileName, String newFileName, ContentEntityObject srcContent, ContentEntityObject destContent)
          Renames all attachment links on the current page.
 void saveLink(OutgoingLink link)
          Save an internal link
 void setLinkDao(LinkDao linkDao)
           
 void setLinkResolver(LinkResolver linkResolver)
           
 void setSettingsManager(SettingsManager settingsManager)
           
 void updateOutgoingLinks(ContentEntityObject content)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.apache.log4j.Category log
Constructor Detail

DefaultLinkManager

public DefaultLinkManager()
Method Detail

setLinkDao

public void setLinkDao(LinkDao linkDao)

setLinkResolver

public void setLinkResolver(LinkResolver linkResolver)

removeLink

public void removeLink(OutgoingLink link)
Description copied from interface: LinkManager
Remove an internal link

Specified by:
removeLink in interface LinkManager

saveLink

public void saveLink(OutgoingLink link)
Description copied from interface: LinkManager
Save an internal link

Specified by:
saveLink in interface LinkManager

getIncomingLinksToContent

public List getIncomingLinksToContent(ContentEntityObject content)
Specified by:
getIncomingLinksToContent in interface LinkManager
Parameters:
content -
Returns:
a sorted list of link objects to the content object passed in. does _not_ sort out duplicate links

extractLinksFromContent

public List extractLinksFromContent(ContentEntityObject content)
Specified by:
extractLinksFromContent in interface LinkManager

getSelfContentWithRenamedLinks

public String getSelfContentWithRenamedLinks(ContentEntityObject referringContent,
                                             String newSpaceKey)
Description copied from interface: LinkManager
extracts the text from the page to be moved, renames links which target the old space and returns the content with the updated links

Specified by:
getSelfContentWithRenamedLinks in interface LinkManager
Parameters:
referringContent -
newSpaceKey -
Returns:

getContentWithRenamedLinks

public String getContentWithRenamedLinks(ContentEntityObject referringContent,
                                         SpaceContentEntityObject pageBeingChanged,
                                         String newSpaceKey,
                                         String newPageTitle)
extracts the text from the referring page, renames links with newSpaceKey and newPageTitle and returns the content with updated links

Specified by:
getContentWithRenamedLinks in interface LinkManager
Parameters:
referringContent - page that contains a link to the pageBeingRenamed
pageBeingChanged - page that is being renamed or moved
newSpaceKey - the new space key of 'pageBeingRenamed'
newPageTitle - the new title for 'pageBeingRenamed'

renameOutgoingLinksToAttachments

public void renameOutgoingLinksToAttachments(ContentEntityObject referringContent,
                                             String existingFileName,
                                             String newFileName)
Description copied from interface: LinkManager
Renames all attachments links on the current page (srcContent) Used for simple renaming of attachments

Specified by:
renameOutgoingLinksToAttachments in interface LinkManager
Parameters:
referringContent -
existingFileName -
newFileName -

renameOutgoingLinksToMovedAttachments

public void renameOutgoingLinksToMovedAttachments(ContentEntityObject referringContent,
                                                  String existingFileName,
                                                  String newFileName,
                                                  ContentEntityObject srcContent,
                                                  ContentEntityObject destContent)
Description copied from interface: LinkManager
Renames all attachment links on the current page. This function has to be used when the attachment is moved.

Specified by:
renameOutgoingLinksToMovedAttachments in interface LinkManager
Parameters:
referringContent -
existingFileName -
newFileName -
srcContent -
destContent -

updateOutgoingLinks

public void updateOutgoingLinks(ContentEntityObject content)
Specified by:
updateOutgoingLinks in interface LinkManager

getReferringContent

public Collection getReferringContent(ContentEntityObject content)
Specified by:
getReferringContent in interface LinkManager
Parameters:
content -
Returns:
a collection of content that currently links to the content object passed in here

removeCorruptOutgoingLinks

public void removeCorruptOutgoingLinks()
Specified by:
removeCorruptOutgoingLinks in interface LinkManager

setSettingsManager

public void setSettingsManager(SettingsManager settingsManager)


Confluence is developed by Atlassian.