com.opencms.linkmanagement
Class LinkChecker

java.lang.Object
  |
  +--com.opencms.linkmanagement.LinkChecker

public class LinkChecker
extends Object

Extracts all links (anchors) out of a OpenCms page.

Version:
1.0
Author:
Hanjo Riege

Constructor Summary
LinkChecker()
           
 
Method Summary
 void checkProject(CmsObject cms, int projectId, I_CmsReport report)
          This Method checks if the online project has broken links when the project with the projectId is published (if projectId = onlineProjectId it simply checks the online project).
 CmsPageLinks extractLinks(CmsObject cms, String page)
          Checks the content of the page and extracts all links that are on this page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkChecker

public LinkChecker()
Method Detail

extractLinks

public CmsPageLinks extractLinks(CmsObject cms,
                                 String page)
                          throws CmsException
Checks the content of the page and extracts all links that are on this page. Used by the linkmanagement to save the links in the database.

Parameters:
cms - The CmsObject.
page - The name(getAbsolutePath) of the page
Returns:
The compleate CmsPageLinks object for this page.
CmsException

checkProject

public void checkProject(CmsObject cms,
                         int projectId,
                         I_CmsReport report)
                  throws CmsException
This Method checks if the online project has broken links when the project with the projectId is published (if projectId = onlineProjectId it simply checks the online project).

Parameters:
cms - The CmsObject.
projectId - The id of the project to be published.
report - A cmsReport object for logging while the method is still running. The report is filled with a CmsPageLinks object for each page containing broken links this CmsPageLinks object contains all links on the page withouth a valid target.
CmsException