dochelper.URLRecordSet Class Reference

The class URLRecordSet implements the RecordSet interface to represent a set of WebPage to be processed. More...

Inheritance diagram for dochelper.URLRecordSet:

Inheritance graph
[legend]
Collaboration diagram for dochelper.URLRecordSet:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void setParam (String paramName, Object value) throws IllegalParamterTypeException
 Add an initialization parameter to the Record Set.
void checkParams () throws InvalidValueException, MissingArgumentException, ResourceUnavailableException
 Checks that the parameters are correct for this File Record Set.
void init () throws InitializationException, ResourceUnavailableException
 Initialize the Record Set.
ResultNode execute (ResultNode doc) throws ResourceUnavailableException
 Main method of URLRecordSet.
String getName ()
 Name Accessors + Modifiers.
void setName (String name)
 Set the name of this Record Set.
void addPattern (DocPattern pattern)
 Add a single pattern to be applied to this record set.
void clearPatterns ()
 Empty pattern list.
String toString ()

Static Public Attributes

static final String ROOT_URL = "rooturl"
 Param key: URLRoot.
static final String DEPTH = "depth"
 Param key: depth.

Protected Attributes

HashMap< String, Object > params = new HashMap<String, Object>()
 Paramters for this configurable.
ArrayList< Recordrsfiles
 The files that are represented by this Path and Filter.
String name
 Reference Name for this instance.
int recordSetDepth
 The depth for this record set.
Pattern links = Pattern.compile("a href=\"([.]+)\"")
 Pattern tp identify links.

Private Member Functions

void fetchRecords (int depth, String rootURL)
 Fetch all the URLs from root node to a depth of 'depth'.

Private Attributes

ArrayList< DocPatternpatterns


Detailed Description

The class URLRecordSet implements the RecordSet interface to represent a set of WebPage to be processed.

This class is used to drive the DocHelper process by invoking the render function on each Record within the RecordSet passing in the DocPattern defined for this records set.

See also:
Record, DocumentSection
Author:
Guillermo Christen

Definition at line 37 of file URLRecordSet.java.


Member Function Documentation

void dochelper.URLRecordSet.setParam ( String  paramName,
Object  value 
) throws IllegalParamterTypeException

Add an initialization parameter to the Record Set.

These parameters are used during the call to init to Establish - Initialize the RecordSet. Eg. These paramters set the rootURL and the depth of the search. It is the responsibility of this method to check correct types for params used. For the URLRecordSet only string parameters are used

Parameters:
paramName String Name of the paramter to be stored
value String value of the named param
Exceptions:
IllegalParamterTypeException 

Implements dochelper.Configurable.

Definition at line 91 of file URLRecordSet.java.

void dochelper.URLRecordSet.checkParams (  )  throws InvalidValueException, MissingArgumentException, ResourceUnavailableException

Checks that the parameters are correct for this File Record Set.

Validate required parameters and semantic and format rules.

This method will not return a boolean indicating success, rather, it will fire an Exception indicating error type

Exceptions:
InvalidValueException 
MissingArgumentException 
ResourceUnavailableException 

Implements dochelper.Configurable.

Definition at line 110 of file URLRecordSet.java.

void dochelper.URLRecordSet.init (  )  throws InitializationException, ResourceUnavailableException

Initialize the Record Set.

Exceptions:
ResourceUnavailableException 

Implements dochelper.Configurable.

Definition at line 136 of file URLRecordSet.java.

Here is the call graph for this function:

void dochelper.URLRecordSet.fetchRecords ( int  depth,
String  rootURL 
) [private]

Fetch all the URLs from root node to a depth of 'depth'.

Make the record list while doing this.

Parameters:
depth currentDepth
rootURL String representing starting point
Returns:
List of Linked URLs

Definition at line 161 of file URLRecordSet.java.

Here is the call graph for this function:

Here is the caller graph for this function:

ResultNode dochelper.URLRecordSet.execute ( ResultNode  doc  )  throws ResourceUnavailableException

Main method of URLRecordSet.

This appends to the document tree the output generated by interpreting this URLRecordSet.

The results are obtained by matching each pattern (n number of times ) within the value returned by Record getValue().

Parameters:
doc The document ResultNode onto which the results of running this record set should be added to.
Returns:
The ResultNode node with the results of the matches and rendering appended to it.
Exceptions:
ResourceUnavailableException 
Exception 

Implements dochelper.RecordSet.

Definition at line 211 of file URLRecordSet.java.

Here is the call graph for this function:

String dochelper.URLRecordSet.getName (  ) 

Name Accessors + Modifiers.

Returns:

Definition at line 232 of file URLRecordSet.java.

Here is the caller graph for this function:

void dochelper.URLRecordSet.setName ( String  name  ) 

Set the name of this Record Set.

The name of the Record Set is used in conjunction with items that use the name to fetch the appropriate part of the result tree. This includes renderers.

Parameters:
name 

Implements dochelper.RecordSet.

Definition at line 236 of file URLRecordSet.java.

void dochelper.URLRecordSet.addPattern ( DocPattern  pattern  ) 

Add a single pattern to be applied to this record set.

Parameters:
pattern DocPettern to add to this Record Set.

Implements dochelper.RecordSet.

Definition at line 246 of file URLRecordSet.java.

void dochelper.URLRecordSet.clearPatterns (  ) 

Empty pattern list.

Implements dochelper.RecordSet.

Definition at line 258 of file URLRecordSet.java.

String dochelper.URLRecordSet.toString (  ) 

Definition at line 263 of file URLRecordSet.java.


Member Data Documentation

final String dochelper.URLRecordSet.ROOT_URL = "rooturl" [static]

Param key: URLRoot.

Definition at line 42 of file URLRecordSet.java.

final String dochelper.URLRecordSet.DEPTH = "depth" [static]

Param key: depth.

Definition at line 47 of file URLRecordSet.java.

HashMap<String, Object> dochelper.URLRecordSet.params = new HashMap<String, Object>() [protected]

Paramters for this configurable.

Definition at line 52 of file URLRecordSet.java.

ArrayList<Record> dochelper.URLRecordSet.rsfiles [protected]

The files that are represented by this Path and Filter.

This is equivalent to the records in this record set

Definition at line 57 of file URLRecordSet.java.

String dochelper.URLRecordSet.name [protected]

Reference Name for this instance.

Used to fetch info when rendering or processing.

Definition at line 62 of file URLRecordSet.java.

The depth for this record set.

Definition at line 67 of file URLRecordSet.java.

Pattern dochelper.URLRecordSet.links = Pattern.compile("a href=\"([.]+)\"") [protected]

Pattern tp identify links.

Definition at line 72 of file URLRecordSet.java.

Definition at line 76 of file URLRecordSet.java.


The documentation for this class was generated from the following file:

Generated on Wed Jun 17 14:22:18 2009 for DocHelper by  doxygen 1.5.6