URLRecordSet
implements the RecordSet
interface to represent a set of WebPage
to be processed.
More...
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< Record > | rsfiles |
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< DocPattern > | patterns |
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.
Record
, DocumentSection
Definition at line 37 of file URLRecordSet.java.
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
paramName | String Name of the paramter to be stored | |
value | String value of the named param |
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
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.
ResourceUnavailableException |
Implements dochelper.Configurable.
Definition at line 136 of file URLRecordSet.java.
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.
depth | currentDepth | |
rootURL | String representing starting point |
Definition at line 161 of file URLRecordSet.java.
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().
doc | The document ResultNode onto which the results of running this record set should be added to. |
ResultNode
node with the results of the matches and rendering appended to it.ResourceUnavailableException | ||
Exception |
Implements dochelper.RecordSet.
Definition at line 211 of file URLRecordSet.java.
String dochelper.URLRecordSet.getName | ( | ) |
Name Accessors + Modifiers.
Definition at line 232 of file URLRecordSet.java.
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.
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.
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.
final String dochelper.URLRecordSet.ROOT_URL = "rooturl" [static] |
final String dochelper.URLRecordSet.DEPTH = "depth" [static] |
HashMap<String, Object> dochelper.URLRecordSet.params = new HashMap<String, Object>() [protected] |
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.
int dochelper.URLRecordSet.recordSetDepth [protected] |
Pattern dochelper.URLRecordSet.links = Pattern.compile("a href=\"([.]+)\"") [protected] |
ArrayList<DocPattern> dochelper.URLRecordSet.patterns [private] |
Definition at line 76 of file URLRecordSet.java.