X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=crawler%2Fbasic%2Fsrc%2Forg%2Fwamblee%2Fcrawler%2Fimpl%2FActionImpl.java;fp=crawler%2Fbasic%2Fsrc%2Forg%2Fwamblee%2Fcrawler%2Fimpl%2FActionImpl.java;h=ab7068cbda32ee8e8895a6677a2c6db431c8f60f;hb=b4555b9b3548c23244f85aaad3b92a471af63b46;hp=0ff4252d98804712981f46f842748e0bc024215b;hpb=a0d686060a9bf655b8e6e9e0def4cdcd528fa0b6;p=utils diff --git a/crawler/basic/src/org/wamblee/crawler/impl/ActionImpl.java b/crawler/basic/src/org/wamblee/crawler/impl/ActionImpl.java index 0ff4252d..ab7068cb 100644 --- a/crawler/basic/src/org/wamblee/crawler/impl/ActionImpl.java +++ b/crawler/basic/src/org/wamblee/crawler/impl/ActionImpl.java @@ -16,6 +16,7 @@ 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; @@ -37,6 +38,8 @@ public class ActionImpl implements Action { private String _reference; private PageType _type; + + private NameValuePair[] _parameters; /** * Constructs the action. @@ -50,14 +53,16 @@ public class ActionImpl implements 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; } /** @@ -74,14 +79,16 @@ public class ActionImpl implements Action { * 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; } /* @@ -100,9 +107,9 @@ public class ActionImpl implements Action { */ 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); } /*