import org.wamblee.conditions.AndCondition;
import org.wamblee.conditions.Condition;
import org.wamblee.conditions.PropertyRegexCondition;
-import org.wamblee.crawler.kiss.ProgramFilter.ProgramAction;
/**
* Parse the configuration of desired programs.
Element program = (Element) i.next();
Element actionElem = program.element(ELEM_ACTION);
- ProgramAction action = ProgramAction.RECORD;
+ ProgramAction action = new RecordProgramAction();
if (actionElem != null) {
if (actionElem.getText().equals(ACTION_NOTIFY)) {
- action = ProgramAction.NOTIFY;
+ action = new InterestingProgramAction("");
}
}
List<Condition<Program>> regexConditions =
if ( fieldAttribute != null ) {
fieldName = fieldAttribute.getText();
}
- String pattern = ".*" + patternElem.getText()
- + ".*";
+ String pattern = ".*(" + patternElem.getText()
+ + ").*";
regexConditions.add(new PropertyRegexCondition<Program>(fieldName, pattern, true));
}
Condition<Program> condition = new AndCondition<Program>(regexConditions);