Project

General

Profile

« Previous | Next » 

Revision 34955

Added by Nikon Gasparis about 9 years ago

*first BETA of validator admin panel
*written from scratch
*many new features
*based on the new version of validators db
*support for lareferencia

View differences:

GetRuleSets.java
1
package eu.dnetlib.validator.admin.actions.rulesets;
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.RuleSet;
10
import eu.dnetlib.validator.admin.actions.BaseValidatorAction;
11

  
12
public class GetRuleSets extends BaseValidatorAction {
13

  
14
	private static final long serialVersionUID = -5220242100308666597L;
15
	private List<RuleSet> sets;
16
	private static final Logger logger = Logger.getLogger(GetRuleSets.class);
17

  
18
	public List<RuleSet> getSets() {
19
		return sets;
20
	}
21

  
22
	public void setSets(List<RuleSet> sets) {
23
		this.sets = sets;
24
	}
25

  
26
	public String execute() throws Exception {
27
		this.clearErrorsAndMessages();
28
		try {
29
			logger.debug("getting all rule sets");
30
			sets = this.getAdminAPI().getRuleSets();
31
			return Action.SUCCESS;
32
		} catch (Exception e) {
33
			logger.error("Error getting rule sets", e);
34
			this.addActionError(this.getText("generic.error"));
35
			reportException(e);
36
			return "exception";
37
		}
38
	}
39
}

Also available in: Unified diff