|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.cocoon.xml.AbstractXMLProducer org.apache.cocoon.generation.AbstractGenerator org.apache.cocoon.generation.ServiceableGenerator org.apache.cocoon.generation.LinkStatusGenerator
public class LinkStatusGenerator
Field Summary | |
---|---|
static String |
ACCEPT_CONFIG
Config element name specifying http header value for accept. |
static String |
ACCEPT_DEFAULT
Default value of accept configuration value. |
protected AttributesImpl |
attributes
|
protected static String |
CONTENT_ATTR_NAME
|
static String |
EXCLUDE_CONFIG
Config element name specifying excluding regular expression pattern. |
protected static String |
HREF_ATTR_NAME
|
static String |
INCLUDE_CONFIG
Config element name specifying including regular expression pattern. |
static String |
LINK_CONTENT_TYPE_CONFIG
Config element name specifying expected link content-typ. |
String |
LINK_CONTENT_TYPE_DEFAULT
Default value of link-content-type configuration value. |
protected static String |
LINK_NODE_NAME
|
static String |
LINK_VIEW_QUERY_CONFIG
Config element name specifying query-string appendend for requesting links of an URL. |
static String |
LINK_VIEW_QUERY_DEFAULT
Default value of link-view-query configuration value. |
protected static String |
MESSAGE_ATTR_NAME
|
protected static String |
PREFIX
The namespace prefix for this namespace. |
protected static String |
REFERRER_ATTR_NAME
|
protected static String |
STATUS_ATTR_NAME
|
protected static String |
TOP_NODE_NAME
|
protected static String |
URI
The URI of the namespace of this generator. |
static String |
USER_AGENT_CONFIG
Config element name specifying http header value for user-Agent. |
static 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(Configuration configuration)
Configure the crawler component. |
void |
generate()
Generate XML data. |
protected List |
getLinksFromConnection(String url_link_string,
URL url_of_referrer)
Retrieve a list of links of a url |
protected String |
processURL(URL url,
String referrer)
Generate xml attributes of a url, calculate url for retrieving links |
void |
recycle()
Recycle the generator by removing references |
void |
setup(SourceResolver resolver,
Map objectModel,
String src,
Parameters par)
Set the SourceResolver , object model Map ,
the source and sitemap Parameters used to process the request. |
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 String URI
protected static final String PREFIX
protected static final String TOP_NODE_NAME
protected static final String LINK_NODE_NAME
protected static final String HREF_ATTR_NAME
protected static final String REFERRER_ATTR_NAME
protected static final String CONTENT_ATTR_NAME
protected static final String STATUS_ATTR_NAME
protected static final String MESSAGE_ATTR_NAME
protected AttributesImpl attributes
public static final String LINK_CONTENT_TYPE_CONFIG
Its value is link-content-type
.
public final String LINK_CONTENT_TYPE_DEFAULT
link-content-type
configuration value.
Its value is application/x-cocoon-links
.
public static final String LINK_VIEW_QUERY_CONFIG
Its value is link-view-query
.
public static final String LINK_VIEW_QUERY_DEFAULT
link-view-query
configuration value.
Its value is ?cocoon-view=links
.
public static final String EXCLUDE_CONFIG
Its value is exclude
.
public static final String INCLUDE_CONFIG
Its value is include
.
public static final String USER_AGENT_CONFIG
Its value is user-agent
.
public static final String USER_AGENT_DEFAULT
user-agent
configuration value.
Constants.COMPLETE_NAME
public static final String ACCEPT_CONFIG
Its value is accept
.
public static final String ACCEPT_DEFAULT
accept
configuration value.
Its value is * / *
Constructor Detail |
---|
public LinkStatusGenerator()
Method Detail |
---|
public void configure(Configuration configuration) throws 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 Configurable
configuration
- XML configuration of this avalon component.
ConfigurationException
- is throwing if configuration is invalid.public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException
AbstractGenerator
SourceResolver
, object model Map
,
the source and sitemap Parameters
used to process the request.
setup
in interface SitemapModelComponent
setup
in class AbstractGenerator
ProcessingException
SAXException
IOException
public void generate() throws SAXException, ProcessingException
generate
in interface Generator
SAXException
- if an error occurs while outputting the document
ProcessingException
- if the requsted URI wasn't foundprotected List getLinksFromConnection(String url_link_string, URL url_of_referrer)
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=links
url_of_referrer
- base url of which links are requested, ie of the form
http://host/foo/bar
protected String processURL(URL url, String referrer) throws SAXException
url
- to processreferrer
- of the url
SAXException
public void recycle()
AbstractGenerator
recycle
in interface Recyclable
recycle
in class AbstractGenerator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |