X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=crawler%2Fbasic%2Fsrc%2Forg%2Fwamblee%2Fcrawler%2Fimpl%2FActionImpl.java;h=ab7068cbda32ee8e8895a6677a2c6db431c8f60f;hb=f53c06ddca33e21e772c479179b7f858a3a8b8d4;hp=0ff4252d98804712981f46f842748e0bc024215b;hpb=5685a836b9208ff8babfe5ac5b30c5f86d27cf96;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); } /*