Project

General

Profile

« Previous | Next » 

Revision 50862

Moving branch folders to trunk.

View differences:

ValidatorApiImpl.java
13 13
import java.util.*;
14 14
import java.util.concurrent.ConcurrentHashMap;
15 15
import eu.dnetlib.api.functionality.ValidatorService;
16
import io.swagger.annotations.ApiParam;
17 16
import org.apache.log4j.Logger;
18 17
import org.json.JSONException;
19 18
import org.springframework.beans.factory.annotation.Autowired;
20 19
import org.springframework.stereotype.Component;
21 20
import org.springframework.web.bind.annotation.PathVariable;
22
import org.springframework.web.bind.annotation.RequestBody;
23
import org.springframework.web.bind.annotation.RequestParam;
24 21

  
25 22
import javax.annotation.PostConstruct;
26 23
import javax.annotation.Resource;
......
82 79
    }
83 80

  
84 81
    @Override
85
    public void submitJobForValidation(@RequestBody JobForValidation jobForValidation) {
82
    public void submitJobForValidation(JobForValidation jobForValidation) {
86 83
        LOGGER.debug("Submit job for validation with id : " + jobForValidation.getDatasourceId());
87 84
        try {
88 85
            this.getValidationService().submitValidationJob(jobForValidation);
......
92 89
    }
93 90

  
94 91
    @Override
95
    public void reSubmitJobForValidation(@PathVariable("jobId") String jobId) throws JSONException {
92
    public void reSubmitJobForValidation(String jobId) throws JSONException {
96 93
        LOGGER.debug("Resubmit validation job with id : " + jobId);
97 94
        StoredJob job = monitorApi.getJobSummary(jobId,"all");
98 95
        Set<Integer> contentRules = new HashSet<Integer>();
......
127 124
    }
128 125

  
129 126
    @Override
130
    public List<String> getSetsOfRepository(@RequestParam(value = "url", required = true) String url) {
127
    public List<String> getSetsOfRepository(@PathVariable("url") String url) {
131 128
        LOGGER.debug("Getting sets of repository with url : " + url);
132 129
        try {
133 130
            return OaiTools.getSetsOfRepo(url);
......
138 135
    }
139 136

  
140 137
    @Override
141
    public boolean identifyRepo(@RequestParam(value = "url", required = true) String url) {
138
    public boolean identifyRepo(@PathVariable("url") String url) {
142 139
        LOGGER.debug("Identify repository with url : " + url);
143 140
        try {
144 141
            return OaiTools.identifyRepository(url);
......
168 165
    }
169 166

  
170 167
    @Override
171
    public List<StoredJob> getStoredJobsNew(@RequestParam("user") @ApiParam(value = "User email", required = true) String user,
172
                                            @RequestParam(value = "jobType", required = false)
173
                                            @ApiParam(value = "Equals to filter job type on validation history page") String jobType,
174
                                            @RequestParam("offset") @ApiParam(value = "Page number", required = true) String offset,
175
                                            @RequestParam(value = "limit", required = false,defaultValue = "10") @ApiParam(value = "Null value") String limit,
176
                                            @RequestParam(value = "dateFrom", required = false) @ApiParam(value = "Null value") String dateFrom,
177
                                            @RequestParam(value = "dateTo", required = false) @ApiParam(value = "Null value") String dateTo,
178
                                            @RequestParam("validationStatus") @ApiParam(value = "Equals to filter validation jobs", required = true) String validationStatus
179
                                            ) throws ValidatorServiceException {
180
        return getValidationService().getStoredJobsNew(user, jobType, Integer.parseInt(offset), Integer.parseInt(limit), dateFrom, dateTo, validationStatus);
168
    public List<StoredJob> getStoredJobsNew(String user, String jobType, Integer offset, Integer limit, String dateFrom,
169
                                            String dateTo, String validationStatus) throws ValidatorServiceException {
170
        return getValidationService().getStoredJobsNew(user, jobType, offset, limit, dateFrom, dateTo, validationStatus);
181 171
    }
182 172

  
183 173
    @Override
......
186 176
    }
187 177

  
188 178
    @Override
189
    public InterfaceInformation getInterfaceInformation(@RequestParam(value = "baseUrl", required = true) String baseUrl) throws ValidationServiceException {
179
    public InterfaceInformation getInterfaceInformation(@PathVariable("baseUrl") String baseUrl) throws ValidationServiceException {
190 180
        try {
191 181
            LOGGER.debug("Getting interface information with url: " + baseUrl);
192 182
            InterfaceInformation interfaceInformation = new InterfaceInformation();

Also available in: Unified diff