Project

General

Profile

« Previous | Next » 

Revision 58368

[Trunk | Admin Tools service]:
1. Statistics.java: Added "isActive" field (default value: true).
2. StatisticsController.java: Added toggleStatistics method (/statistics/{id}/toggle) for activating/ deactivating statistics.

View differences:

Statistics.java
14 14
    @JsonProperty("_id")
15 15
    private String id;
16 16
    private String pid;
17
    private boolean isActive = true;
17 18
    Map<String,StatisticsEntity> entities =  new HashMap<String, StatisticsEntity>();
18 19
    public Statistics(String pid){
19 20
        this.pid = pid;
21
        this.isActive = true;
20 22
        entities.put("publication",new StatisticsEntity());
21 23
        entities.put("dataset",new StatisticsEntity());
22 24
        entities.put("software",new StatisticsEntity());
......
38 40
        this.pid = pid;
39 41
    }
40 42

  
43
    public boolean getIsActive() {
44
        return isActive;
45
    }
46

  
47
    public void setIsActive(boolean isActive) {
48
        this.isActive = isActive;
49
    }
50

  
41 51
    public Map<String, StatisticsEntity> getEntities() {
42 52
        return entities;
43 53
    }
......
51 61
        return "Statistics{" +
52 62
                "id='" + id + '\'' +
53 63
                ", pid='" + pid + '\'' +
64
                ", isActive= "+isActive +
54 65
                ", entities=" + entities +
55 66
                '}';
56 67
    }

Also available in: Unified diff