1
|
package eu.dnetlib.validator.admin.actions.rules;
|
2
|
|
3
|
import java.util.List;
|
4
|
|
5
|
import org.apache.log4j.Logger;
|
6
|
|
7
|
import com.opensymphony.xwork2.Action;
|
8
|
|
9
|
import eu.dnetlib.domain.functionality.validator.Rule;
|
10
|
import eu.dnetlib.validator.admin.actions.BaseValidatorAction;
|
11
|
|
12
|
public class PopulateRuleList extends BaseValidatorAction {
|
13
|
|
14
|
private static final long serialVersionUID = -4035025449768015129L;
|
15
|
private List<Rule> rules;
|
16
|
private static final Logger logger = Logger.getLogger(PopulateRuleList.class);
|
17
|
|
18
|
public String execute() {
|
19
|
this.clearErrorsAndMessages();
|
20
|
try {
|
21
|
logger.debug("populating rule list");
|
22
|
rules = this.getAdminAPI().getAllRules();
|
23
|
return Action.SUCCESS;
|
24
|
}
|
25
|
catch(Exception e) {
|
26
|
logger.error("Error redirecting to job", e);
|
27
|
this.addActionError(this.getText("generic.error"));
|
28
|
reportException(e);
|
29
|
return "exception";
|
30
|
}
|
31
|
}
|
32
|
|
33
|
public List<Rule> getRules() {
|
34
|
return rules;
|
35
|
}
|
36
|
|
37
|
public void setRules(List<Rule> rules) {
|
38
|
this.rules = rules;
|
39
|
}
|
40
|
|
41
|
|
42
|
}
|