package org.wamblee.crawler.impl;
+import org.apache.commons.httpclient.NameValuePair;
import org.dom4j.Element;
import org.wamblee.crawler.Action;
import org.wamblee.crawler.Crawler;
private String _reference;
private PageType _type;
+
+ private NameValuePair[] _parameters;
/**
* Constructs the action.
* Name of the action.
* @param aReference
* URL of the reference.
+ * @param aParameters Parameters to use for the action.
*/
public ActionImpl(Crawler aCrawler, Element aContent, String aName,
- String aReference) {
+ String aReference, NameValuePair[] aParameters) {
_crawler = aCrawler;
_content = aContent;
_name = aName;
_reference = aReference;
_type = null;
+ _parameters = aParameters;
}
/**
* URL of the reference.
* @param aType
* Type of the referenced page.
+ * @param aParameters Parameters to use.
*/
public ActionImpl(Crawler aCrawler, Element aContent, String aName,
- String aReference, PageType aType) {
+ String aReference, PageType aType, NameValuePair[] aParameters) {
_crawler = aCrawler;
_content = aContent;
_name = aName;
_reference = aReference;
_type = aType;
+ _parameters = aParameters;
}
/*
*/
public Page execute() throws PageException {
if (_type == null) {
- return _crawler.getPage(_reference);
+ return _crawler.getPage(_reference, _parameters);
}
- return _crawler.getPage(_reference, _type);
+ return _crawler.getPage(_reference, _parameters, _type);
}
/*