org.opencms.validation
Interface I_CmsXmlDocumentLinkValidatable

All Known Implementing Classes:
CmsResourceTypeXmlPage

public interface I_CmsXmlDocumentLinkValidatable

HTML link validation of a Cms file is enabled if the file's resource type implements the interface I_CmsHtmlLinkValidatable. Cms files with resource types that do not implement this interface don't get validated on broken links for example when a project gets published. Thus, this interface serves to identify "validatable" Cms files in the OpenCms VFS.

HTML links are considered as href attribs in anchor tags and src attribs in image tags.

Since:
6.0.0
Version:
$Revision: 1.5 $
Author:
Thomas Weckert

Method Summary
 java.util.List findLinks(CmsObject cms, CmsResource resource)
          Returns a list with the Cms URIs of all linked resources (either via href attribs or img tags) in the (body) content of the specified Cms resource.
 

Method Detail

findLinks

public java.util.List findLinks(CmsObject cms,
                                CmsResource resource)
Returns a list with the Cms URIs of all linked resources (either via href attribs or img tags) in the (body) content of the specified Cms resource.

Implementations of this method must return an empty list, or better Collections.EMPTY_LIST, if no links are found at all.

Second, implementations of this method are responsible to filter out any "external" URLs pointing to targets outside the OpenCms VFS (http, https, mailto, ftp etc.) from the result list.

Parameters:
cms - the current user's Cms object
resource - a CmsResource with links
Returns:
a list with the URIs of all linked resources (either via href attribs or img tags)