uoa-orcid-service/src/main/java/eu/dnetlib/uoaorcidservice/UoaOrcidServiceApplication....

28 lines
1.3 KiB
Java
Raw Normal View History

package eu.dnetlib.uoaorcidservice;
import eu.dnetlib.uoaauthorizationlibrary.configuration.AuthorizationConfiguration;
import eu.dnetlib.uoaorcidservice.configuration.properties.MongoConfig;
//import eu.dnetlib.uoaauthorizationlibrary.configuration.AuthorizationConfiguration;
[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 10:54:52 +01:00
import eu.dnetlib.uoaorcidservice.configuration.properties.OrcidConfig;
import eu.dnetlib.uoaorcidservice.handlers.utils.AESUtils;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;
@SpringBootApplication(scanBasePackages = {"eu.dnetlib.uoaorcidservice"})
@PropertySources({
@PropertySource("classpath:orcidservice.properties"),
@PropertySource(value = "classpath:dnet-override.properties", ignoreResourceNotFound = true)
})
[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 10:54:52 +01:00
@EnableConfigurationProperties({MongoConfig.class, AESUtils.class, OrcidConfig.class})
@Import(AuthorizationConfiguration.class)
public class UoaOrcidServiceApplication {
public static void main(String[] args) {
SpringApplication.run(UoaOrcidServiceApplication.class, args);
}
}