Revision 51330
Added by Panagiotis Kanakakis over 6 years ago
modules/uoa-repository-manager-service/branches/dev-api/src/main/java/eu/dnetlib/repo/manager/service/utils/RequestFilter.java | ||
---|---|---|
1 |
package eu.dnetlib.repo.manager.service.utils; |
|
2 |
|
|
3 |
import com.fasterxml.jackson.annotation.JsonInclude; |
|
4 |
|
|
5 |
@JsonInclude(JsonInclude.Include.NON_NULL) |
|
6 |
public class RequestFilter{ |
|
7 |
|
|
8 |
private String registeredby = null; |
|
9 |
private String typology = null; |
|
10 |
private String country = null; |
|
11 |
private String id = null; |
|
12 |
private String officialname = null; |
|
13 |
|
|
14 |
|
|
15 |
public RequestFilter() { |
|
16 |
|
|
17 |
} |
|
18 |
|
|
19 |
public String getTypology() { |
|
20 |
return typology; |
|
21 |
} |
|
22 |
|
|
23 |
public void setTypology(String typology) { |
|
24 |
this.typology = typology; |
|
25 |
} |
|
26 |
|
|
27 |
public String getRegisteredby() { |
|
28 |
return registeredby; |
|
29 |
} |
|
30 |
|
|
31 |
public void setRegisteredby(String registeredby) { |
|
32 |
this.registeredby = registeredby; |
|
33 |
} |
|
34 |
|
|
35 |
public String getCountry() { |
|
36 |
return country; |
|
37 |
} |
|
38 |
|
|
39 |
public void setCountry(String country) { |
|
40 |
this.country = country; |
|
41 |
} |
|
42 |
|
|
43 |
public String getId() { |
|
44 |
return id; |
|
45 |
} |
|
46 |
|
|
47 |
public void setId(String id) { |
|
48 |
this.id = id; |
|
49 |
} |
|
50 |
|
|
51 |
public String getOfficialname() { |
|
52 |
return officialname; |
|
53 |
} |
|
54 |
|
|
55 |
public void setOfficialname(String officialname) { |
|
56 |
this.officialname = officialname; |
|
57 |
} |
|
58 |
} |
modules/uoa-repository-manager-service/branches/dev-api/src/main/java/eu/dnetlib/repo/manager/service/utils/Converter.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.repo.manager.service.utils; |
2 | 2 |
|
3 |
import com.fasterxml.jackson.core.JsonProcessingException; |
|
4 | 3 |
import com.fasterxml.jackson.databind.ObjectMapper; |
5 | 4 |
import eu.dnetlib.domain.data.Repository; |
6 | 5 |
import eu.dnetlib.domain.data.RepositoryInterface; |
7 |
import eu.dnetlib.repo.manager.shared.*; |
|
6 |
import eu.dnetlib.repo.manager.service.controllers.PiWikApi; |
|
7 |
import eu.dnetlib.repo.manager.shared.AggregationDetails; |
|
8 |
import eu.dnetlib.repo.manager.shared.Timezone; |
|
9 |
import org.apache.commons.codec.digest.DigestUtils; |
|
8 | 10 |
import org.apache.log4j.Logger; |
9 | 11 |
import org.json.JSONArray; |
10 | 12 |
import org.json.JSONException; |
11 | 13 |
import org.json.JSONObject; |
14 |
import org.springframework.beans.factory.annotation.Autowired; |
|
15 |
import org.springframework.web.bind.annotation.PathVariable; |
|
12 | 16 |
|
13 |
import java.io.*; |
|
17 |
import java.io.BufferedReader; |
|
18 |
import java.io.IOException; |
|
19 |
import java.io.InputStream; |
|
20 |
import java.io.InputStreamReader; |
|
14 | 21 |
import java.text.ParseException; |
15 | 22 |
import java.text.SimpleDateFormat; |
16 | 23 |
import java.util.*; |
... | ... | |
18 | 25 |
public class Converter { |
19 | 26 |
|
20 | 27 |
private static final Logger LOGGER = Logger.getLogger(Converter.class); |
21 |
|
|
28 |
|
|
22 | 29 |
public static Repository jsonToRepositoryObject(JSONObject repositoryObject) throws JSONException { |
23 | 30 |
|
24 | 31 |
Repository repository = new Repository(); |
... | ... | |
118 | 125 |
return repository; |
119 | 126 |
} |
120 | 127 |
|
121 |
|
|
122 |
|
|
123 | 128 |
public static Date convertStringToDate(String date){ |
124 | 129 |
|
125 | 130 |
if(Objects.equals(date, "null")) |
... | ... | |
182 | 187 |
//repositoryInterface.setActive(Boolean.parseBoolean(repositoryInterfaceObject.get("active").toString())); |
183 | 188 |
repositoryInterface.setRemovable(Boolean.parseBoolean(repositoryInterfaceObject.get("removable").toString())); |
184 | 189 |
repositoryInterface.setCompliance(repositoryInterfaceObject.get("compatibility").toString()); |
190 |
repositoryInterface.setLastCollectionDate(repositoryInterfaceObject.get("lastCollectionDate").toString()); |
|
185 | 191 |
|
192 |
|
|
186 | 193 |
Map<String, String> accessParams = new HashMap<>(); |
187 | 194 |
Map<String, String> extraFields = new HashMap<>(); |
188 | 195 |
|
... | ... | |
198 | 205 |
public static String repositoryObjectToJson(Repository repository) throws JSONException { |
199 | 206 |
|
200 | 207 |
JSONObject jsonObject = new JSONObject(); |
208 |
|
|
209 |
jsonObject.put("id",repository.getId()); |
|
210 |
jsonObject.put("openaireId",getOpenaireId(repository.getId())); |
|
211 |
jsonObject.put("officialname",repository.getOfficialName()); |
|
212 |
jsonObject.put("englishname",repository.getEnglishName()); |
|
213 |
jsonObject.put("websiteurl",repository.getWebsiteUrl()); |
|
214 |
jsonObject.put("logourl",repository.getLogoUrl()); |
|
215 |
jsonObject.put("contactemail",repository.getContactEmail()); |
|
216 |
jsonObject.put("longitude",repository.getLongitude().toString()); |
|
217 |
jsonObject.put("latitude",repository.getLatitude().toString()); |
|
218 |
jsonObject.put("timezone",repository.getTimezone()); |
|
219 |
jsonObject.put("namespaceprefix",repository.getNamespacePrefix()); |
|
220 |
jsonObject.put("languages",repository.getOdLanguages()); |
|
221 |
jsonObject.put("dateofvalidation",convertDateToString(repository.getDateOfValidation())); |
|
222 |
jsonObject.put("typology",repository.getTypology()); |
|
223 |
jsonObject.put("dateofcollection",convertDateToString(repository.getDateOfCollection())); |
|
224 |
// jsonObject.put("platform",repository.getPlatform()); |
|
201 | 225 |
jsonObject.put("activationId",repository.getActivationId()); |
226 |
jsonObject.put("description",repository.getDescription()); |
|
227 |
jsonObject.put("eissn",repository.getEissn()); |
|
228 |
jsonObject.put("issn",repository.getIssn()); |
|
229 |
jsonObject.put("lissn",repository.getLissn()); |
|
230 |
jsonObject.put("registeredby",repository.getRegisteredBy()); |
|
231 |
// jsonObject.put("subjects",repository.getSubjects()); |
|
202 | 232 |
jsonObject.put("aggregator",repository.getAggregator()); |
203 |
jsonObject.put("certificates",repository.getCertificates()); |
|
233 |
jsonObject.put("collectedfrom",repository.getCollectedFrom()); |
|
234 |
// jsonObject.put("managed",repository.getIsManaged()); |
|
235 |
|
|
236 |
// jsonObject.put("organizations",repository.getOrganization()); |
|
237 |
// for(repository.getOrganization()) |
|
238 |
|
|
239 |
//TODO check fields |
|
240 |
/* jsonObject.put("certificates",repository.getCertificates()); |
|
204 | 241 |
jsonObject.put("citationguidelineurl",repository.getCitationGuidelineUrl()); |
205 |
jsonObject.put("collectedfrom",repository.getCollectedFrom()); |
|
206 |
jsonObject.put("contactemail",repository.getContactEmail()); |
|
207 | 242 |
jsonObject.put("databaseaccessrestriction",repository.getDatabaseAccessRestriction()); |
208 | 243 |
jsonObject.put("databaseaccesstype",repository.getDatabaseAccessType()); |
209 | 244 |
jsonObject.put("datauploadrestriction",repository.getDataUploadRestriction()); |
210 | 245 |
jsonObject.put("datauploadtype",repository.getDataUploadType()); |
211 |
jsonObject.put("dateofcollection",convertDateToString(repository.getDateOfCollection())); |
|
212 |
jsonObject.put("dateofvalidation",convertDateToString(repository.getDateOfValidation())); |
|
213 |
jsonObject.put("description",repository.getDescription()); |
|
214 |
jsonObject.put("eissn",repository.getEissn()); |
|
215 |
jsonObject.put("englishname",repository.getEnglishName()); |
|
216 |
jsonObject.put("id",repository.getId()); |
|
217 |
jsonObject.put("issn",repository.getIssn()); |
|
218 |
jsonObject.put("languages",repository.getOdLanguages()); |
|
219 |
jsonObject.put("latitude",repository.getLatitude().toString()); |
|
220 |
jsonObject.put("lissn",repository.getLissn()); |
|
221 |
jsonObject.put("logourl",repository.getLogoUrl()); |
|
222 |
jsonObject.put("longitude",repository.getLongitude().toString()); |
|
223 | 246 |
jsonObject.put("missionstatementurl",repository.getMissionStatementUrl()); |
224 |
jsonObject.put("namespaceprefix",repository.getNamespacePrefix()); |
|
225 | 247 |
jsonObject.put("od_contenttypes",repository.getOdContentTypes()); |
226 | 248 |
jsonObject.put("officialname",repository.getOfficialName()); |
227 | 249 |
jsonObject.put("pidsystems",repository.getPidSystems()); |
228 | 250 |
jsonObject.put("provenanceaction",repository.getProvenanceActionClass()); |
229 | 251 |
jsonObject.put("qualitymanagementkind",repository.getQualityManagementKind()); |
230 |
jsonObject.put("registeredby",repository.getRegisteredBy()); |
|
231 | 252 |
jsonObject.put("releaseenddate",convertDateToString(repository.getReleaseEndDate())); |
232 | 253 |
jsonObject.put("releasestartdate",convertDateToString(repository.getReleaseStartDate())); |
233 | 254 |
jsonObject.put("serviceprovider",repository.getServiceProvider()); |
234 |
jsonObject.put("timezone",repository.getTimezone()); |
|
235 |
jsonObject.put("typology",repository.getTypology()); |
|
236 | 255 |
jsonObject.put("versioning",repository.getVersioning()); |
237 |
jsonObject.put("websiteurl",repository.getWebsiteUrl()); |
|
238 |
|
|
239 |
//datasource.get("managed"); |
|
240 | 256 |
//datasource.get("platform"); |
241 |
//datasource.get("subjects"); |
|
257 |
//datasource.get("subjects");*/
|
|
242 | 258 |
return jsonObject.toString(); |
243 | 259 |
} |
244 | 260 |
|
... | ... | |
352 | 368 |
} |
353 | 369 |
return tmz; |
354 | 370 |
} |
371 |
|
|
372 |
public static String getOpenaireId(String repositoryId) { |
|
373 |
if (repositoryId != null && repositoryId.contains("::")) |
|
374 |
return repositoryId.split("::")[0] + "::" + DigestUtils.md5Hex(repositoryId.split("::")[1]); |
|
375 |
return null; |
|
376 |
} |
|
355 | 377 |
} |
modules/uoa-repository-manager-service/branches/dev-api/src/main/java/eu/dnetlib/repo/manager/service/config/FrontEndLinkURIAuthenticationSuccessHandler.java | ||
---|---|---|
35 | 35 |
int expireSec = -1; |
36 | 36 |
sessionCookie.setMaxAge(expireSec); |
37 | 37 |
sessionCookie.setPath("/"); |
38 |
// sessionCookie.setDomain(); |
|
38 | 39 |
response.addCookie(sessionCookie); |
39 | 40 |
response.sendRedirect(frontEndURI); |
40 | 41 |
} |
modules/uoa-repository-manager-service/branches/dev-api/src/main/java/eu/dnetlib/repo/manager/service/config/Config.java | ||
---|---|---|
28 | 28 |
@Value("${redis.port:6379}") |
29 | 29 |
private String port; |
30 | 30 |
|
31 |
@Value("${redis.password:#{null}}")
|
|
31 |
@Value("${redis.password}") |
|
32 | 32 |
private String password; |
33 | 33 |
|
34 | 34 |
@PostConstruct |
modules/uoa-repository-manager-service/branches/dev-api/src/main/java/eu/dnetlib/repo/manager/service/controllers/MonitorApiImpl.java | ||
---|---|---|
44 | 44 |
@RequestParam(value = "limit", required = false,defaultValue = "10") @ApiParam(value = "Null value") String limit, |
45 | 45 |
@RequestParam(value = "dateFrom", required = false) @ApiParam(value = "Null value") String dateFrom, |
46 | 46 |
@RequestParam(value = "dateTo", required = false) @ApiParam(value = "Null value") String dateTo, |
47 |
@RequestParam("validationStatus") @ApiParam(value = "Equals to filter validation jobs", required = true) String validationStatus,
|
|
47 |
@RequestParam("validationStatus") @ApiParam(value = "Equals to filter validation jobs", required = false) String validationStatus,
|
|
48 | 48 |
@RequestParam("includeJobsTotal") @ApiParam(value = "Always true", required = true) String includeJobsTotal) throws JSONException, ValidatorServiceException { |
49 | 49 |
|
50 | 50 |
LOGGER.debug("Getting jobs of user : " + user); |
51 | 51 |
LOGGER.debug(user + "/" + jobType + "/" + offset + "/" + dateFrom + "/" + dateTo + "/" + validationStatus + "/" + includeJobsTotal); |
52 | 52 |
JobsOfUser retJobs = new JobsOfUser(); |
53 |
LOGGER.debug("Size fo jobs list -> " + getValidationService().getStoredJobsNew(user, jobType, Integer.parseInt(offset),
|
|
54 |
Integer.parseInt(limit), dateFrom, dateTo, validationStatus)); |
|
53 |
LOGGER.debug("Size of jobs list -> " + getValidationService().getStoredJobsNew(user, jobType, Integer.parseInt(offset),
|
|
54 |
Integer.parseInt(limit), dateFrom, dateTo, validationStatus).size());
|
|
55 | 55 |
retJobs.setJobs(getValidationService().getStoredJobsNew(user, jobType, Integer.parseInt(offset), |
56 | 56 |
Integer.parseInt(limit), dateFrom, dateTo, validationStatus)); |
57 | 57 |
if (Boolean.parseBoolean(includeJobsTotal)) { |
... | ... | |
60 | 60 |
retJobs.setTotalJobsFailed(this.getJobsTotalNumberOfUser(user, jobType, Constants.VALIDATION_JOB_STATUS_FAILED)); |
61 | 61 |
retJobs.setTotalJobsOngoing(this.getJobsTotalNumberOfUser(user, jobType,Constants.VALIDATION_JOB_STATUS_ONGOING)); |
62 | 62 |
} |
63 |
|
|
64 |
//TODO fix status with new validator version |
|
65 |
for(StoredJob job :retJobs.getJobs()){ |
|
66 |
if (job.getContentJobStatus().equals("ongoing") || job.getUsageJobStatus().equals("ongoing")) { |
|
67 |
job.setValidationStatus("ongoing"); |
|
68 |
} else if ((job.getValidationType().equals("CU") && job.getContentJobStatus().equals("finished") && job.getUsageJobStatus().equals("finished") && job.getContentJobScore() > 50 && job.getUsageJobScore() > 50) |
|
69 |
|| (job.getValidationType().equals("C") && job.getContentJobStatus().equals("finished") && job.getUsageJobStatus().equals("none") && job.getContentJobScore() > 50) |
|
70 |
|| (job.getValidationType().equals("U") && job.getContentJobStatus().equals("none") && job.getUsageJobStatus().equals("finished") && job.getUsageJobScore() > 50)) { |
|
71 |
job.setValidationStatus("successful"); |
|
72 |
} else if ((job.getValidationType().equals("CU") && job.getContentJobStatus().equals("finished") && job.getUsageJobStatus().equals("finished") && (job.getContentJobScore() <= 50 || job.getUsageJobScore() <= 50)) |
|
73 |
|| (job.getValidationType().equals("C") && job.getContentJobStatus().equals("finished") && job.getUsageJobStatus().equals("none") && job.getContentJobScore() <= 50) |
|
74 |
|| (job.getValidationType().equals("U") && job.getContentJobStatus().equals("none") && job.getUsageJobStatus().equals("finished") && job.getUsageJobScore() <= 50) ) { |
|
75 |
job.setValidationStatus("failed"); |
|
76 |
} |
|
77 |
|
|
78 |
} |
|
79 |
|
|
63 | 80 |
return retJobs; |
64 | 81 |
|
65 | 82 |
} |
modules/uoa-repository-manager-service/branches/dev-api/src/main/java/eu/dnetlib/repo/manager/service/controllers/RepositoryApi.java | ||
---|---|---|
95 | 95 |
List<Timezone> getTimezones(); |
96 | 96 |
|
97 | 97 |
@RequestMapping(value = "/updateRepository", method = RequestMethod.POST, |
98 |
produces = MediaType.APPLICATION_JSON_VALUE)
|
|
98 |
consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
99 | 99 |
@ResponseBody |
100 |
Repository updateRepository(Repository repository); |
|
101 |
|
|
102 |
@RequestMapping(value = "/updateManagedStatus", method = RequestMethod.POST, |
|
103 |
produces = MediaType.APPLICATION_JSON_VALUE) |
|
104 |
@ResponseBody |
|
105 |
String updateManagedStatus(String id, String managed); |
|
106 |
|
|
107 |
@RequestMapping(value = "/updateEnglishName", method = RequestMethod.POST, |
|
108 |
produces = MediaType.APPLICATION_JSON_VALUE) |
|
109 |
@ResponseBody |
|
110 |
String updateEnglishName(String id,String officialName, String englishName); |
|
111 |
|
|
112 |
@RequestMapping(value = "/updateLatitude", method = RequestMethod.POST, |
|
113 |
produces = MediaType.APPLICATION_JSON_VALUE) |
|
114 |
@ResponseBody |
|
115 |
String updateLatitude(String id, String latitude); |
|
116 |
|
|
117 |
@RequestMapping(value = "/updateLongitude", method = RequestMethod.POST, |
|
118 |
produces = MediaType.APPLICATION_JSON_VALUE) |
|
119 |
@ResponseBody |
|
120 |
String updateLongitude(String id, String longitude); |
|
121 |
|
|
122 |
@RequestMapping(value = "/updateOfficialName", method = RequestMethod.POST, |
|
123 |
produces = MediaType.APPLICATION_JSON_VALUE) |
|
124 |
@ResponseBody |
|
125 |
String updateOfficialName(String id, String officialName); |
|
126 |
|
|
127 |
@RequestMapping(value = "/updateTimezone", method = RequestMethod.POST, |
|
128 |
produces = MediaType.APPLICATION_JSON_VALUE) |
|
129 |
@ResponseBody |
|
130 |
String updateTimezone(String id, String timezone); |
|
131 |
|
|
132 |
@RequestMapping(value = "/updateTypology", method = RequestMethod.POST, |
|
133 |
produces = MediaType.APPLICATION_JSON_VALUE) |
|
134 |
@ResponseBody |
|
135 |
String updateTypology(String id, String typology); |
|
136 |
|
|
137 |
@RequestMapping(value = "/updateLogoUrl", method = RequestMethod.POST, |
|
138 |
produces = MediaType.APPLICATION_JSON_VALUE) |
|
139 |
@ResponseBody |
|
140 |
String updateLogoUrl(String id, String logoUrl); |
|
141 |
|
|
142 |
@RequestMapping(value = "/updatePlatform", method = RequestMethod.POST, |
|
143 |
produces = MediaType.APPLICATION_JSON_VALUE) |
|
144 |
@ResponseBody |
|
145 |
String updatePlatform(String id, String platform); |
|
146 |
|
|
147 |
|
|
100 |
Repository updateRepository(Repository repository) throws JSONException; |
|
101 |
|
|
148 | 102 |
@RequestMapping(value = "/getUrlsOfUserRepos/{user_email}/{page}/{size}/",method = RequestMethod.GET, |
149 | 103 |
produces = MediaType.APPLICATION_JSON_VALUE) |
150 | 104 |
@ResponseBody |
... | ... | |
174 | 128 |
produces = MediaType.APPLICATION_JSON_VALUE) |
175 | 129 |
@ResponseBody |
176 | 130 |
MetricsInfo getMetricsInfoForRepository(String repoId) throws RepositoryServiceException; |
131 |
|
|
132 |
@RequestMapping(value = "/getListLatestUpdate/{mode}",method = RequestMethod.GET, |
|
133 |
produces = MediaType.APPLICATION_JSON_VALUE) |
|
134 |
@ResponseBody |
|
135 |
Map<String, String> getListLatestUpdate(String mode) throws RepositoryServiceException, JSONException; |
|
136 |
|
|
137 |
|
|
138 |
|
|
177 | 139 |
} |
modules/uoa-repository-manager-service/branches/dev-api/src/main/java/eu/dnetlib/repo/manager/service/controllers/RepositoryApiImpl.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.repo.manager.service.controllers; |
2 | 2 |
|
3 |
import com.fasterxml.jackson.core.JsonProcessingException; |
|
4 |
import com.fasterxml.jackson.databind.DeserializationFeature; |
|
5 |
import com.fasterxml.jackson.databind.ObjectMapper; |
|
6 | 3 |
import eu.dnetlib.domain.data.Repository; |
7 | 4 |
import eu.dnetlib.domain.data.RepositoryInterface; |
8 | 5 |
import eu.dnetlib.domain.enabling.Vocabulary; |
9 | 6 |
import eu.dnetlib.repo.manager.service.utils.Converter; |
10 |
import eu.dnetlib.repo.manager.service.utils.RequestFilter;
|
|
7 |
import eu.dnetlib.repo.manager.service.domain.RequestFilter;
|
|
11 | 8 |
import eu.dnetlib.repo.manager.shared.*; |
12 | 9 |
import gr.uoa.di.driver.enabling.vocabulary.VocabularyLoader; |
13 | 10 |
import org.apache.commons.codec.digest.DigestUtils; |
... | ... | |
288 | 285 |
|
289 | 286 |
UriComponents uriComponents = UriComponentsBuilder |
290 | 287 |
.fromHttpUrl(baseAddress + "/ds/api/") |
291 |
.path("/{id}/")
|
|
288 |
.path("/{id}") |
|
292 | 289 |
.build().expand(id).encode(); |
293 | 290 |
|
294 | 291 |
String rs = restTemplate.getForObject(uriComponents.toUri(), String.class); |
... | ... | |
300 | 297 |
@RequestBody Repository repository) throws Exception { |
301 | 298 |
|
302 | 299 |
repository = this.setRepositoryFeatures(datatype,repository); |
303 |
|
|
304 | 300 |
LOGGER.debug("storing " + datatype + " repository with id: " + repository.getId()); |
305 | 301 |
if (!datatype.equalsIgnoreCase("opendoar") && !datatype.equalsIgnoreCase("re3data")) { |
306 | 302 |
if (datatype.equalsIgnoreCase("journal") || datatype.equalsIgnoreCase("aggregator")) { |
... | ... | |
338 | 334 |
} |
339 | 335 |
|
340 | 336 |
@Override |
341 |
public Repository updateRepository(@RequestBody Repository repository) { |
|
342 |
/*UriComponents uriComponents = UriComponentsBuilder
|
|
337 |
public Repository updateRepository(@RequestBody Repository repository) throws JSONException {
|
|
338 |
UriComponents uriComponents = UriComponentsBuilder |
|
343 | 339 |
.fromHttpUrl(baseAddress + "/ds/update/") |
344 | 340 |
.build() |
345 |
.encode();*/ |
|
346 |
return null; |
|
347 |
|
|
348 |
|
|
341 |
.encode(); |
|
342 |
String json_repository = Converter.repositoryObjectToJson(repository); |
|
343 |
HttpEntity<String> httpEntity = new HttpEntity <String> (json_repository,httpHeaders); |
|
344 |
restTemplate.postForObject(uriComponents.toUri(),httpEntity,String.class); |
|
345 |
return repository; |
|
349 | 346 |
} |
350 | 347 |
|
351 | 348 |
private void updateRegisteredByValue(String id, String registeredBy) { |
... | ... | |
525 | 522 |
} |
526 | 523 |
|
527 | 524 |
@Override |
528 |
public String updateManagedStatus(@RequestParam(value = "id") String id, |
|
529 |
@RequestParam(value = "managed") String managed) { |
|
530 |
|
|
531 |
UriComponents uriComponents = UriComponentsBuilder |
|
532 |
.fromHttpUrl(baseAddress + "/ds/manage/") |
|
533 |
.queryParam("id",id) |
|
534 |
.queryParam("managed",managed) |
|
535 |
.build().encode(); |
|
536 |
|
|
537 |
return restTemplate.postForObject(uriComponents.toUri(), null,String.class); |
|
538 |
} |
|
539 |
|
|
540 |
@Override |
|
541 |
public String updateEnglishName(@RequestParam(value = "id") String id, |
|
542 |
@RequestParam(value = "officialName") String officialName, |
|
543 |
@RequestParam(value = "englishname") String englishName) { |
|
544 |
|
|
545 |
UriComponents uriComponents = UriComponentsBuilder |
|
546 |
.fromHttpUrl(baseAddress + "/ds/name/") |
|
547 |
.queryParam("dsId",id) |
|
548 |
.queryParam("officialname",officialName) |
|
549 |
.queryParam("englishname",englishName) |
|
550 |
.build().encode(); |
|
551 |
return restTemplate.postForObject(uriComponents.toUri(), null,String.class); |
|
552 |
|
|
553 |
|
|
554 |
} |
|
555 |
|
|
556 |
@Override |
|
557 |
public String updateLatitude(@RequestParam(value = "id") String id, |
|
558 |
@RequestParam(value = "latitude") String latitude) { |
|
559 |
|
|
560 |
UriComponents uriComponents = UriComponentsBuilder |
|
561 |
.fromHttpUrl(baseAddress + "/ds/latitude/") |
|
562 |
.queryParam("dsId",id) |
|
563 |
.queryParam("latitude",latitude) |
|
564 |
.build().encode(); |
|
565 |
return restTemplate.postForObject(uriComponents.toUri(), null,String.class); |
|
566 |
} |
|
567 |
|
|
568 |
@Override |
|
569 |
public String updateLongitude(@RequestParam(value = "id") String id, |
|
570 |
@RequestParam(value = "longitude") String longitude) { |
|
571 |
|
|
572 |
UriComponents uriComponents = UriComponentsBuilder |
|
573 |
.fromHttpUrl(baseAddress + "/ds/longitude/") |
|
574 |
.queryParam("dsId",id) |
|
575 |
.queryParam("longitude",longitude) |
|
576 |
.build().encode(); |
|
577 |
return restTemplate.postForObject(uriComponents.toUri(), null,String.class); |
|
578 |
} |
|
579 |
|
|
580 |
@Override |
|
581 |
public String updateOfficialName(@RequestParam(value = "id") String id, |
|
582 |
@RequestParam(value = "officialname") String officialname) { |
|
583 |
|
|
584 |
UriComponents uriComponents = UriComponentsBuilder |
|
585 |
.fromHttpUrl(baseAddress + "/ds/officialname/") |
|
586 |
.queryParam("dsId",id) |
|
587 |
.queryParam("officialname",officialname) |
|
588 |
.build().encode(); |
|
589 |
return restTemplate.postForObject(uriComponents.toUri(), null,String.class); |
|
590 |
} |
|
591 |
|
|
592 |
@Override |
|
593 |
public String updateTimezone(@RequestParam(value = "id") String id, |
|
594 |
@RequestParam(value = "timezone") String timezone) { |
|
595 |
UriComponents uriComponents = UriComponentsBuilder |
|
596 |
.fromHttpUrl(baseAddress + "/ds/timezone") |
|
597 |
.queryParam("dsId",id) |
|
598 |
.queryParam("timezone",timezone) |
|
599 |
.build().encode(); |
|
600 |
return restTemplate.postForObject(uriComponents.toUri(), null,String.class); |
|
601 |
} |
|
602 |
|
|
603 |
@Override |
|
604 |
public String updateTypology(@RequestParam(value = "id") String id, |
|
605 |
@RequestParam(value = "typology") String typology) { |
|
606 |
UriComponents uriComponents = UriComponentsBuilder |
|
607 |
.fromHttpUrl(baseAddress + "/ds/typology") |
|
608 |
.queryParam("dsId",id) |
|
609 |
.queryParam("typology",typology) |
|
610 |
.build().encode(); |
|
611 |
return restTemplate.postForObject(uriComponents.toUri(), null,String.class); |
|
612 |
} |
|
613 |
|
|
614 |
@Override |
|
615 |
public String updateLogoUrl(@RequestParam(value = "id") String id, |
|
616 |
@RequestParam(value = "logoUrl") String logoUrl) { |
|
617 |
UriComponents uriComponents = UriComponentsBuilder |
|
618 |
.fromHttpUrl(baseAddress + "/ds/logourl") |
|
619 |
.queryParam("dsId",id) |
|
620 |
.queryParam("logourl",logoUrl) |
|
621 |
.build().encode(); |
|
622 |
return restTemplate.postForObject(uriComponents.toUri(), null,String.class); |
|
623 |
} |
|
624 |
|
|
625 |
@Override |
|
626 |
public String updatePlatform(String id, String platform) { |
|
627 |
UriComponents uriComponents = UriComponentsBuilder |
|
628 |
.fromHttpUrl(baseAddress + "/ds/platform") |
|
629 |
.queryParam("dsId",id) |
|
630 |
.queryParam("platform",platform) |
|
631 |
.build().encode(); |
|
632 |
return restTemplate.postForObject(uriComponents.toUri(), null,String.class); |
|
633 |
} |
|
634 |
|
|
635 |
@Override |
|
636 | 525 |
public List<String> getUrlsOfUserRepos(@PathVariable("user_email") String userEmail, |
637 | 526 |
@PathVariable("page") String page, |
638 | 527 |
@PathVariable("size") String size) throws JSONException { |
... | ... | |
756 | 645 |
} |
757 | 646 |
} |
758 | 647 |
|
648 |
@Override |
|
649 |
public Map<String, String> getListLatestUpdate(@PathVariable("mode") String mode) throws JSONException { |
|
650 |
if(mode.equals("opendoar")) |
|
651 |
return Collections.singletonMap("lastCollectionDate", getRepositoryInterface("openaire____::"+mode).get(0).getLastCollectionDate()); |
|
652 |
else |
|
653 |
/* |
|
654 |
* first api of re3data has null value on collection date |
|
655 |
* */ |
|
656 |
return Collections.singletonMap("lastCollectionDate", getRepositoryInterface("openaire____::"+mode).get(1).getLastCollectionDate()); |
|
657 |
} |
|
658 |
|
|
759 | 659 |
private MetricsNumbers getMetricsNumbers(String openAIREID) throws BrokerException { |
760 | 660 |
|
761 | 661 |
//build the uri params |
modules/uoa-repository-manager-service/branches/dev-api/src/main/java/eu/dnetlib/repo/manager/service/domain/RequestFilter.java | ||
---|---|---|
1 |
package eu.dnetlib.repo.manager.service.domain; |
|
2 |
|
|
3 |
import com.fasterxml.jackson.annotation.JsonInclude; |
|
4 |
|
|
5 |
@JsonInclude(JsonInclude.Include.NON_NULL) |
|
6 |
public class RequestFilter{ |
|
7 |
|
|
8 |
private String registeredby = null; |
|
9 |
private String typology = null; |
|
10 |
private String country = null; |
|
11 |
private String id = null; |
|
12 |
private String officialname = null; |
|
13 |
|
|
14 |
|
|
15 |
public RequestFilter() { |
|
16 |
|
|
17 |
} |
|
18 |
|
|
19 |
public String getTypology() { |
|
20 |
return typology; |
|
21 |
} |
|
22 |
|
|
23 |
public void setTypology(String typology) { |
|
24 |
this.typology = typology; |
|
25 |
} |
|
26 |
|
|
27 |
public String getRegisteredby() { |
|
28 |
return registeredby; |
|
29 |
} |
|
30 |
|
|
31 |
public void setRegisteredby(String registeredby) { |
|
32 |
this.registeredby = registeredby; |
|
33 |
} |
|
34 |
|
|
35 |
public String getCountry() { |
|
36 |
return country; |
|
37 |
} |
|
38 |
|
|
39 |
public void setCountry(String country) { |
|
40 |
this.country = country; |
|
41 |
} |
|
42 |
|
|
43 |
public String getId() { |
|
44 |
return id; |
|
45 |
} |
|
46 |
|
|
47 |
public void setId(String id) { |
|
48 |
this.id = id; |
|
49 |
} |
|
50 |
|
|
51 |
public String getOfficialname() { |
|
52 |
return officialname; |
|
53 |
} |
|
54 |
|
|
55 |
public void setOfficialname(String officialname) { |
|
56 |
this.officialname = officialname; |
|
57 |
} |
|
58 |
} |
modules/uoa-repository-manager-service/branches/dev-api/src/main/resources/application-context.xml | ||
---|---|---|
10 | 10 |
http://www.springframework.org/schema/tx |
11 | 11 |
http://www.springframework.org/schema/tx/spring-tx.xsd"> |
12 | 12 |
|
13 |
<!--<import resource="classpath:META-INF/cxf/cxf.xml"/> |
|
14 |
<import resource="classpath:META-INF/cxf/cxf-extension-jaxws.xml"/> |
|
15 |
<import resource="classpath:META-INF/cxf/cxf-servlet.xml"/> |
|
16 |
<import resource="classpath*:/cxf.xml"/> |
|
17 |
<import resource="classpath*:/eu/dnetlib/repos/ehcacher/springContext-repos-ehcacher.xml"/> |
|
18 |
<import resource="classpath*:/eu/dnetlib/soap/cxf/applicationContext-eprbuilders.xml"/> |
|
19 |
<import resource="classpath*:/eu/dnetlib/clients/ws/springContext-locatorFactory.xml"/> |
|
20 |
<import resource="classpath*:/eu/dnetlib/users/springContext-users-ldap.xml"/> |
|
21 |
<import resource="classpath*:/gr/uoa/di/driver/util/springContext-locators.xml"/> |
|
22 |
<import resource="classpath*:/gr/uoa/di/driver/app/springContext-lookupFactory.xml"/> |
|
23 |
<import resource="classpath*:/gr/uoa/di/driver/app/springContext-lookupClients.xml"/> |
|
24 |
<import resource="classpath*:/eu/dnetlib/enabling/hcm/springContext-hcmService.xml"/> |
|
25 |
<import resource="classpath*:/gr/uoa/di/driver/app/springContext-commons.xml"/> |
|
26 |
<import resource="classpath*:/gr/uoa/di/driver/app/springContext-registrator.xml"/> |
|
27 |
<import resource="classpath*:/eu/dnetlib/repos/springContext-repos-dms-cached.xml"/>--> |
|
28 | 13 |
|
29 | 14 |
<context:property-placeholder location="classpath*:/eu/**/application.properties" /> |
30 | 15 |
<context:annotation-config/> |
31 | 16 |
<context:component-scan base-package="eu.dnetlib.repo.manager.service.config"/> |
32 | 17 |
<tx:annotation-driven transaction-manager="txManager"/> |
33 | 18 |
|
34 |
<bean class="eu.dnetlib.repo.manager.service.config.CascadingPropertyLoader" id="propertyLoader"> |
|
35 |
<property name="order" value="2" /> |
|
19 |
<bean class="eu.dnetlib.repo.manager.service.config.CascadingPropertyLoader" |
|
20 |
id="propertyLoader"> |
|
21 |
<property name="order" value="2"/> |
|
36 | 22 |
<property name="properties"> |
37 | 23 |
<bean class="eu.dnetlib.conf.WebappContextProperyFactory"> |
38 | 24 |
<property name="propertyFetcher"> |
39 |
<bean class="eu.dnetlib.conf.PropertyFetcher" />
|
|
25 |
<bean class="eu.dnetlib.conf.PropertyFetcher"/> |
|
40 | 26 |
</property> |
41 | 27 |
</bean> |
42 | 28 |
</property> |
43 |
<property name="ignoreUnresolvablePlaceholders" value="true" />
|
|
29 |
<property name="ignoreUnresolvablePlaceholders" value="true"/> |
|
44 | 30 |
<property name="locations"> |
45 | 31 |
<list> |
46 | 32 |
<value>classpath*:/gr/**/springContext-*.properties</value> |
modules/uoa-repository-manager-service/branches/dev-api/src/main/resources/eu/dnetlib/repo/manager/service/application.properties | ||
---|---|---|
101 | 101 |
oidc.issuer = https://aai.openminted.eu/oidc/ |
102 | 102 |
oidc.id = 24e83176-1312-4ba3-bc0b-ffeebea1603e |
103 | 103 |
oidc.secret = U_gLOupYu2trYIOwfxGgZkkZoOHG_zGfaViOUsXcZ7qVQuF1rcJeQYKIDX1TY3z27CIoHaqq9ht2rmAiUmBRYQ |
104 |
oidc.home = http://194.177.192.121:8380/repomanager-service-dev/openid_connect_login |
|
105 |
webapp.home = http://194.177.192.121:8380/repomanager-service-dev/openid_connect_login |
|
106 |
webapp.dev.front = http://195.134.66.230:3000 |
|
104 |
oidc.dev.home = http://194.177.192.121:8380/repomanager-service-dev/openid_connect_login |
|
105 |
webapp.dev.front = http://194.177.192.121:3000 |
|
107 | 106 |
|
108 | 107 |
|
109 | 108 |
redis.host = 194.177.192.121 |
modules/uoa-repository-manager-service/branches/dev-api/src/main/webapp/WEB-INF/applicationContext.xml | ||
---|---|---|
1 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 | 2 |
<beans xmlns="http://www.springframework.org/schema/beans" |
3 | 3 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
4 |
xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
|
|
4 |
xmlns:tx="http://www.springframework.org/schema/tx" |
|
5 | 5 |
xmlns:mvc="http://www.springframework.org/schema/mvc" |
6 | 6 |
xsi:schemaLocation="http://www.springframework.org/schema/beans |
7 | 7 |
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd |
8 |
http://www.springframework.org/schema/context |
|
9 |
http://www.springframework.org/schema/context/spring-context-4.0.xsd |
|
10 | 8 |
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd |
11 | 9 |
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd"> |
12 | 10 |
|
13 | 11 |
<import resource="classpath*:/application-context.xml"/> |
14 | 12 |
|
15 |
<!-- <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>--> |
|
16 |
|
|
17 |
<import resource="classpath:META-INF/cxf/cxf.xml"/> |
|
18 |
|
|
19 |
<import resource="classpath:META-INF/cxf/cxf-extension-jaxws.xml"/> |
|
20 |
<import resource="classpath:META-INF/cxf/cxf-servlet.xml"/> |
|
21 |
<import resource="classpath*:/cxf.xml"/> |
|
22 |
<import resource="classpath*:/eu/dnetlib/repos/ehcacher/springContext-repos-ehcacher.xml"/> |
|
23 | 13 |
<import resource="classpath*:/eu/dnetlib/soap/cxf/applicationContext-eprbuilders.xml"/> |
24 | 14 |
<import resource="classpath*:/eu/dnetlib/clients/ws/springContext-locatorFactory.xml"/> |
25 |
<import resource="classpath*:/eu/dnetlib/users/springContext-users-ldap.xml"/> |
|
26 | 15 |
<import resource="classpath*:/gr/uoa/di/driver/util/springContext-locators.xml"/> |
27 | 16 |
<import resource="classpath*:/gr/uoa/di/driver/app/springContext-lookupFactory.xml"/> |
28 | 17 |
<import resource="classpath*:/gr/uoa/di/driver/app/springContext-lookupClients.xml"/> |
29 | 18 |
<import resource="classpath*:/eu/dnetlib/enabling/hcm/springContext-hcmService.xml"/> |
30 | 19 |
<import resource="classpath*:/gr/uoa/di/driver/app/springContext-commons.xml"/> |
31 |
<import resource="classpath*:/gr/uoa/di/driver/app/springContext-registrator.xml"/> |
|
32 | 20 |
|
33 |
<!--<import resource="classpath*:/eu/dnetlib/repos/springContext-repos-dms-cached.xml"/>--> |
|
34 |
<context:property-placeholder location="classpath*:/eu/**/application.properties" /> |
|
35 | 21 |
|
36 |
<bean class="eu.dnetlib.repo.manager.service.config.CascadingPropertyLoader" id="propertyLoader"> |
|
37 |
<property name="order" value="2" /> |
|
22 |
<bean class="eu.dnetlib.repo.manager.service.config.CascadingPropertyLoader" |
|
23 |
id="propertyLoader"> |
|
24 |
<property name="order" value="2"/> |
|
38 | 25 |
<property name="properties"> |
39 | 26 |
<bean class="eu.dnetlib.conf.WebappContextProperyFactory"> |
40 | 27 |
<property name="propertyFetcher"> |
41 |
<bean class="eu.dnetlib.conf.PropertyFetcher" />
|
|
28 |
<bean class="eu.dnetlib.conf.PropertyFetcher"/> |
|
42 | 29 |
</property> |
43 | 30 |
</bean> |
44 | 31 |
</property> |
45 |
<property name="ignoreUnresolvablePlaceholders" value="true" />
|
|
32 |
<property name="ignoreUnresolvablePlaceholders" value="true"/> |
|
46 | 33 |
<property name="locations"> |
47 | 34 |
<list> |
48 | 35 |
<value>classpath*:/gr/**/springContext-*.properties</value> |
modules/uoa-repository-manager-service/branches/dev-api/src/main/webapp/WEB-INF/aai-security.xml | ||
---|---|---|
123 | 123 |
<property name="tokenEndpointAuthMethod" value="SECRET_BASIC" /> |
124 | 124 |
<property name="redirectUris"> |
125 | 125 |
<set> |
126 |
<value>${oidc.home}</value> |
|
126 |
<value>${oidc.dev.home}</value>
|
|
127 | 127 |
</set> |
128 | 128 |
</property> |
129 | 129 |
</bean> |
modules/uoa-repository-manager-service/branches/dev-api/pom.xml | ||
---|---|---|
220 | 220 |
</dependencies> |
221 | 221 |
|
222 | 222 |
<build> |
223 |
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory> |
|
223 | 224 |
<plugins> |
224 |
<plugin>
|
|
225 |
<plugin> |
|
225 | 226 |
<groupId>org.apache.maven.plugins</groupId> |
226 | 227 |
<artifactId>maven-compiler-plugin</artifactId> |
227 | 228 |
<version>3.1</version> |
... | ... | |
240 | 241 |
</configuration> |
241 | 242 |
</plugin> |
242 | 243 |
|
244 |
|
|
243 | 245 |
<plugin> |
244 | 246 |
<groupId>com.googlecode.maven-download-plugin</groupId> |
245 | 247 |
<artifactId>download-maven-plugin</artifactId> |
... | ... | |
261 | 263 |
</executions> |
262 | 264 |
</plugin> |
263 | 265 |
|
266 |
<!-- |
|
264 | 267 |
<plugin> |
265 | 268 |
<groupId>org.apache.maven.plugins</groupId> |
266 | 269 |
<artifactId>maven-antrun-plugin</artifactId> |
... | ... | |
268 | 271 |
<executions> |
269 | 272 |
<execution> |
270 | 273 |
<phase>prepare-package</phase> |
271 |
<!--<goals>
|
|
274 |
<goals> |
|
272 | 275 |
<goal>run</goal> |
273 |
</goals>-->
|
|
276 |
</goals> |
|
274 | 277 |
<configuration> |
275 | 278 |
<tasks> |
276 | 279 |
<sequential> |
277 | 280 |
<echo>Add theme</echo> |
278 | 281 |
<replace token="</head>" |
279 | 282 |
value="<link href='webjars/springfox-swagger-ui/themes/2.x/theme-feeling-blue.css' rel="stylesheet"/></head>" |
280 |
dir="${project.build.directory}/classes/META-INF/resources">
|
|
283 |
dir="${settings.localRepository}/io/springfox/springfox-swagger-ui/2.7.0/META-INF/resources">
|
|
281 | 284 |
<include name="swagger-ui.html"/> |
282 | 285 |
</replace> |
283 | 286 |
</sequential> |
... | ... | |
286 | 289 |
</execution> |
287 | 290 |
</executions> |
288 | 291 |
</plugin> |
292 |
--> |
|
289 | 293 |
|
290 | 294 |
<!--<plugin> |
291 | 295 |
<groupId>cz.habarta.typescript-generator</groupId> |
Also available in: Unified diff
1. Create domain package. Add RequestFilter class.
2. Update converter class with new domain object
3. Update properties file and xml configuration
4. Bug fix on jobs' validation status