Package org.archive.modules.deciderules
Class TransclusionDecideRule
java.lang.Object
org.archive.modules.deciderules.DecideRule
org.archive.modules.deciderules.PredicatedDecideRule
org.archive.modules.deciderules.TransclusionDecideRule
- All Implemented Interfaces:
Serializable
,org.archive.spring.HasKeyedProperties
public class TransclusionDecideRule extends PredicatedDecideRule
Rule ACCEPTs any CrawlURIs whose path-from-seed ('hopsPath' -- see
CrawlURI.getPathFromSeed()
ends
with at least one, but not more than, the given number of
non-navlink ('L') hops.
Otherwise, if the path-from-seed is empty or if a navlink ('L') occurs
within max-trans-hops of the tail of the path-from-seed, this rule
returns PASS.
Thus, it allows things like embedded resources (frames/images/media) and redirects to be transitively included ('transcluded') in a crawl, even if they otherwise would not, for some reasonable number of hops (usually 1-5).
- Author:
- gojomo
- See Also:
- Transclusion, Serialized Form
-
Field Summary
Fields inherited from class org.archive.modules.deciderules.DecideRule
comment, kp
-
Constructor Summary
Constructors Constructor Description TransclusionDecideRule()
Usual constructor. -
Method Summary
Modifier and Type Method Description protected boolean
evaluate(CrawlURI curi)
Evaluate whether given object is within the acceptable thresholds of transitive hops.int
getMaxSpeculativeHops()
int
getMaxTransHops()
void
setMaxSpeculativeHops(int maxSpeculativeHops)
void
setMaxTransHops(int maxTransHops)
Methods inherited from class org.archive.modules.deciderules.PredicatedDecideRule
getDecision, innerDecide, onlyDecision, setDecision
Methods inherited from class org.archive.modules.deciderules.DecideRule
accepts, decisionFor, getComment, getEnabled, getKeyedProperties, setComment, setEnabled
-
Constructor Details
-
TransclusionDecideRule
public TransclusionDecideRule()Usual constructor.
-
-
Method Details
-
getMaxTransHops
public int getMaxTransHops() -
setMaxTransHops
public void setMaxTransHops(int maxTransHops) -
getMaxSpeculativeHops
public int getMaxSpeculativeHops() -
setMaxSpeculativeHops
public void setMaxSpeculativeHops(int maxSpeculativeHops) -
evaluate
Evaluate whether given object is within the acceptable thresholds of transitive hops.- Specified by:
evaluate
in classPredicatedDecideRule
- Parameters:
curi
- CrawlURI to make decision on.- Returns:
- true if the transitive hops >0 and <= max
-