|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.xml.AbstractXMLProducer
org.apache.cocoon.generation.AbstractGenerator
org.apache.cocoon.generation.ServiceableGenerator
org.apache.lenya.cms.cocoon.generation.LinkStatusGenerator
public class LinkStatusGenerator
Generates a list of links that are reachable from the src and their status.
<map:generator name="linkStatus" src="org.apache.lenya.cms.cocoon.generation.LinkStatusGenerator"/>
<map:generate type="linkStatus" src="/{pubid}/{area}/{doc-id}.html">
<map:parameter name="depth" value="1"/>
</map:generate>
| Field Summary | |
|---|---|
static java.lang.String |
ACCEPT_CONFIG
Config element name specifying http header value for accept. |
static java.lang.String |
ACCEPT_DEFAULT
Default value of accept configuration value. |
protected org.xml.sax.helpers.AttributesImpl |
attributes
|
protected static java.lang.String |
CONTENT_ATTR_NAME
|
protected int |
depth
The depth parameter determines how deep the EnhancedLinkStatusGenerator should delve. |
static java.lang.String |
EXCLUDE_CONFIG
Config element name specifying excluding regular expression pattern. |
protected static java.lang.String |
HREF_ATTR_NAME
|
static java.lang.String |
INCLUDE_CONFIG
Config element name specifying including regular expression pattern. |
protected org.apache.excalibur.source.Source |
inputSource
|
static java.lang.String |
LINK_CONTENT_TYPE_CONFIG
Config element name specifying expected link content-typ. |
java.lang.String |
LINK_CONTENT_TYPE_DEFAULT
Default value of link-content-type configuration value. |
protected static java.lang.String |
LINK_NODE_NAME
|
static java.lang.String |
LINK_VIEW_QUERY_CONFIG
Config element name specifying query-string appendend for requesting links of an URL. |
static java.lang.String |
LINK_VIEW_QUERY_DEFAULT
Default value of link-view-query configuration value. |
protected static java.lang.String |
MESSAGE_ATTR_NAME
|
protected static java.lang.String |
PREFIX
The namespace prefix for this namespace. |
protected static java.lang.String |
REFERRER_ATTR_NAME
|
protected static java.lang.String |
STATUS_ATTR_NAME
|
protected static java.lang.String |
TOP_NODE_NAME
|
protected static java.lang.String |
URI
The URI of the namespace of this generator. |
static java.lang.String |
USER_AGENT_CONFIG
Config element name specifying http header value for user-Agent. |
static java.lang.String |
USER_AGENT_DEFAULT
Default value of user-agent configuration value. |
| Fields inherited from class org.apache.cocoon.generation.ServiceableGenerator |
|---|
manager |
| Fields inherited from class org.apache.cocoon.generation.AbstractGenerator |
|---|
objectModel, parameters, resolver, source |
| Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
|---|
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer |
| Fields inherited from interface org.apache.cocoon.generation.Generator |
|---|
ROLE |
| Constructor Summary | |
|---|---|
LinkStatusGenerator()
|
|
| Method Summary | |
|---|---|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
Configure the crawler component. |
void |
generate()
Generate XML data. |
protected java.util.List |
getLinksFromConnection(java.lang.String url_link_string,
java.lang.String url_of_referrer,
int referrerDepth)
Retrieve a list of links of a url |
protected java.lang.String |
processURL(java.lang.String uri,
java.lang.String referrer,
int referrerDepth)
Generate xml attributes of a url, calculate url for retrieving links |
void |
recycle()
|
void |
setup(org.apache.cocoon.environment.SourceResolver resolver,
java.util.Map objectModel,
java.lang.String src,
org.apache.avalon.framework.parameters.Parameters par)
|
| Methods inherited from class org.apache.cocoon.generation.ServiceableGenerator |
|---|
dispose, service |
| Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
|---|
setConsumer, setContentHandler, setLexicalHandler |
| Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
|---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.cocoon.xml.XMLProducer |
|---|
setConsumer |
| Field Detail |
|---|
protected static final java.lang.String URI
protected static final java.lang.String PREFIX
protected static final java.lang.String TOP_NODE_NAME
protected static final java.lang.String LINK_NODE_NAME
protected static final java.lang.String HREF_ATTR_NAME
protected static final java.lang.String REFERRER_ATTR_NAME
protected static final java.lang.String CONTENT_ATTR_NAME
protected static final java.lang.String STATUS_ATTR_NAME
protected static final java.lang.String MESSAGE_ATTR_NAME
protected org.xml.sax.helpers.AttributesImpl attributes
public static final java.lang.String LINK_CONTENT_TYPE_CONFIG
Its value is link-content-type.
public final java.lang.String LINK_CONTENT_TYPE_DEFAULT
link-content-type configuration value.
Its value is application/x-cocoon-links.
public static final java.lang.String LINK_VIEW_QUERY_CONFIG
Its value is link-view-query.
public static final java.lang.String LINK_VIEW_QUERY_DEFAULT
link-view-query configuration value.
Its value is ?cocoon-view=links.
public static final java.lang.String EXCLUDE_CONFIG
Its value is exclude.
public static final java.lang.String INCLUDE_CONFIG
Its value is include.
public static final java.lang.String USER_AGENT_CONFIG
Its value is user-agent.
public static final java.lang.String USER_AGENT_DEFAULT
user-agent configuration value.
Constants.COMPLETE_NAMEpublic static final java.lang.String ACCEPT_CONFIG
Its value is accept.
public static final java.lang.String ACCEPT_DEFAULT
accept configuration value.
Its value is * / *
protected int depth
protected org.apache.excalibur.source.Source inputSource
| Constructor Detail |
|---|
public LinkStatusGenerator()
| Method Detail |
|---|
public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
throws org.apache.avalon.framework.configuration.ConfigurationException
Configure can specify which URI to include, and which URI to exclude from crawling. You specify the patterns as regular expressions.
Morover you can configure the required content-type of crawling request, and the query-string appended to each crawling request.
<include>.*\.html?</include> or <include>.*\.html?, .*\.xsp</include> <exclude>.*\.gif</exclude> or <exclude>.*\.gif, .*\.jpe?g</exclude> <link-content-type> application/x-cocoon-links </link-content-type> <link-view-query> ?cocoon-view=links </link-view-query> <user-agent> Cocoon </user-agent> <accept> text/xml </accept>
configure in interface org.apache.avalon.framework.configuration.Configurableconfiguration - XML configuration of this avalon component.
org.apache.avalon.framework.configuration.ConfigurationException - is throwing if configuration is invalid.
public void setup(org.apache.cocoon.environment.SourceResolver resolver,
java.util.Map objectModel,
java.lang.String src,
org.apache.avalon.framework.parameters.Parameters par)
throws org.apache.cocoon.ProcessingException,
org.xml.sax.SAXException,
java.io.IOException
setup in interface org.apache.cocoon.sitemap.SitemapModelComponentsetup in class org.apache.cocoon.generation.AbstractGeneratororg.apache.cocoon.ProcessingException
org.xml.sax.SAXException
java.io.IOException
public void generate()
throws org.xml.sax.SAXException,
org.apache.cocoon.ProcessingException
generate in interface org.apache.cocoon.generation.Generatororg.xml.sax.SAXException - if an error occurs while outputting the document
org.apache.cocoon.ProcessingException - if the requsted URI wasn't found
protected java.util.List getLinksFromConnection(java.lang.String url_link_string,
java.lang.String url_of_referrer,
int referrerDepth)
url_link_string - url for requesting links, it is assumed that
url_link_string queries the cocoon view links, ie of the form
http://host/foo/bar?cocoon-view=linksurl_of_referrer - base url of which links are requested, ie of the form
http://host/foo/bar
protected java.lang.String processURL(java.lang.String uri,
java.lang.String referrer,
int referrerDepth)
throws org.xml.sax.SAXException
url - to processreferrer - of the url
org.xml.sax.SAXExceptionpublic void recycle()
recycle in interface org.apache.avalon.excalibur.pool.Recyclablerecycle in class org.apache.cocoon.generation.AbstractGenerator
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||