Commit Graph

9 Commits

Author SHA1 Message Date
Konstantina Galouni 56eb48686d [Trunk | Orcid Service]:
1. OrcidServiceCheckDeployController.java: [NEW] Controller added and 
	a. "hello()" method (@RequestMapping(value = {"", "/health_check"}, method = RequestMethod.GET)) which just prints and returns a greeting message.
	b. "checkEverything()" method @RequestMapping(value = "/health_check/advanced", method = RequestMethod.GET) only accessible by PORTAL ADMINS which checks connection with db and prints properties.
2. ResultIdAndWork.java & Work.java: Added field "dashboard" (in ResultInWork class, default value is "production_explpre") and its getters and setters.
3. UserTokens.java: Added field "creationDate" and its getters and setters.
4. UserTokensService.java: Call setCreationDate() method with current Date in "saveUserTokens()" method.
5. WorkController.java: Call setDashboard() method with dashboard value from parameter of type ResultIdAndWork in "saveWork()" method.
6. update_db.js: Script with methods "setUserTokenCreationDate()" (use date of first work for this orcid) and "setDashboardInWorks()" (set all to "production_explore").
2021-04-22 09:55:57 +00:00
Konstantina Galouni 69f9eb6df6 [Trunk | Orcid Service]:
1, WorkController.java: In method "updateWork()" (/orcid/work/update/{putCode}), if ORCID does not return HttpStatus.OK, 
	return AuthorizationServiceException (for HttpStatus.UNAUTHORIZED), ConflictException (for HttpStatus.CONFLICT) or Exception instead of null.
2021-03-11 02:19:36 +00:00
Konstantina Galouni ddefdc5056 [Trunk | Orcid Service]:
1. RecordController.java: Comment file RecordController.java, since it is not used by portal (to be deleted).
2. WorkController.java: Use "apiUrl" property for requests to ORCID API (not string set in the code).
2021-02-24 19:41:03 +00:00
Konstantina Galouni f72dcedbd5 [Trunk | Orcid Service]: UserTokensController.java: In "getPersonalDetailsFromOrcid()" method (/orcid/personal-details), when getting error response from ORCID API, throw Exception. 2021-02-24 10:38:44 +00:00
Konstantina Galouni 92a487e3f8 [Trunk | Orcid Service]:
1. pom.xml: Change version from 2.0.0 to 1.0.0 (not yet released and was set to 2.0.0 as a false copy-paste).
2. UserTokensController.java & WorkController.java: Added @PreAuthorize("isAuthenticated()") in class (some methods were missing that).
3. UserTokensController.java: 
	a. Change "public String saveUserTokens(...)" to "public SingleValueWrapperResponse<Boolean> saveUserTokens(...)" - Do not return access token!
	b. Comment "decryptToken()" (/local/tokens/decrypt) and "encryptToken()" (/local/tokens/encrypt) methods - used for testing.
2021-02-14 22:52:16 +00:00
Konstantina Galouni 7d6d590cb8 [Trunk | Orcid Service]: OrcidConfig.java: Missing configuration file from previous commit. 2021-02-08 09:56:00 +00:00
Konstantina Galouni d86ea2a8fa [Trunk | Orcid Service]:
1. orcidservice.properties: Added properties "apiURL", "tokenURL", "clientId", "clientSecret" for ORCID API.
2. log4j.properties: Added configuration for ORCID log file "uoa-orcid-service-orcid.log".
3. UoaOrcidServiceApplication.java: Added "OrcidConfig.class" in "@EnableConfigurationProperties".
4. SimpleErrorController.java: If body.path.contains("/uoa-orcid-service/orcid"), log error in ORCID log file too.
5. UserTokensService.java: Added method "getEncryptedUserTokensByAai()".
6. UserTokensController.java: 
	a. Added ORCID log file for responses by ORCID API.
	b. Added @Autowired OrcidConfig for getting ORICD token url, client and secret from properties.
	c. Added method "getUserOrcidId()" (/local/orcidId)
	d. Added method "getPersonalDetailsFromOrcid()" (/orcid/personal-details)
	e. Renamed "/orcid/tokens/decrypt" to "/local/tokens/decrypt" & "/orcid/tokens/encrypt" to "/local/tokens/encrypt".
7. Work.java: Added field "updateDate".
8. WorkDAO.java & MongoDBWorkDAO.java: Added methods "List<Work> findByOrcidOrderByCreationDateDesc(String Orcid);" and "Work findByPutCode(String putCode);".
9. WorkService.java: 
	a. Added method "getLocalWorkByPutCode()".
	b. Method "getLocalWorks()" returns works ordered by most recent creation date.
10. WorkController.java:
	a. Added ORCID log file for responses by ORCID API.
	b. Added @Autowired OrcidConfig for getting ORICD token url, client and secret from properties.
	c. Added "charset=UTF-8" in all Content-Type request headers.
	d. Renamed "/orcid/put-code" to "/local/put-code".
	e. Added method "List<List<Work>> getLocalWorks(@RequestBody String[][] pids)" (/local/works).
	f. Added method "List<Work> getMyLocalWorks()" (/local/works).
	g. Added method "updateWork()" (/orcid/work/update/{putCode}).
	h. Added method "getWorksByPutCodes()" (/orcid/works).
2021-02-08 09:54:52 +00:00
Konstantina Galouni 93acb15d2d [Trunk | Orcid Service]: Initial commit in trunk folder. The API is already partially implemented and running (configuration, controllers, services, DAOs, entities, handlers, responses, properties). 2021-01-14 11:31:25 +00:00
Konstantina Galouni cb05250ee5 Adding the trunk and branches folders for the project. 2021-01-14 10:54:34 +00:00