diff --git a/Dockerfile b/Dockerfile index 2bc1b7d..b88fe6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,10 @@ -FROM tomcat:7.0.90-jre8 +#FROM tomcat:7.0.90-jre8 +FROM tomcat:8.5.71-jre8-openjdk-bullseye MAINTAINER "pkanakakis@di.uoa.gr" RUN ["rm", "-fr", "/usr/local/tomcat/webapps/ROOT"] COPY ./target/uoa-repository-manager-service.war /usr/local/tomcat/webapps/uoa-repository-manager-service.war #COPY src/main/resources/dnet-override-new.properties /usr/local/tomcat/lib/dnet-override.properties -COPY src/main/resources/application.properties /usr/local/tomcat/lib/dnet-override.properties +COPY validator.env /usr/local/tomcat/lib/dnet-override.properties #COPY src/main/resources/application.properties /usr/local/tomcat/lib/application.properties #COPY src/main/resources/email-texts.properties /usr/local/tomcat/lib/email-texts.properties VOLUME /var/log/uoa-repository-manager-service:/var/log/uoa-repository-manager-service/ diff --git a/pom.xml b/pom.xml index e592c52..b827685 100644 --- a/pom.xml +++ b/pom.xml @@ -20,25 +20,107 @@ + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-logging + + + + + + org.springframework.boot + spring-boot-starter-log4j2 + org.springframework.boot spring-boot-starter-web - ${spring.boot.version} org.springframework.boot spring-boot-starter-data-jdbc - ${spring.boot.version} org.springframework.boot spring-boot-actuator-autoconfigure - ${spring.boot.version} + + + org.springframework.boot + spring-boot-starter-tomcat + + + org.springframework.boot + spring-boot-starter-data-redis + + + org.springframework.boot + spring-boot-starter-validation + + + + eu.dnetlib uoa-clients [2.0.0-SNAPSHOT, 3.0.0) + + + log4j + log4j + + + + javax.servlet + javax.servlet-api + + + com.google.gwt + gwt-user + + + + + eu.dnetlib + dnet-runtime + 1.0.2-SNAPSHOT + + + log4j + log4j + + + + + eu.dnetlib + uoa-hcm + [2.0.0-SNAPSHOT, 3.0.0) + + + log4j + log4j + + @@ -64,6 +146,10 @@ cglib cglib + + log4j + log4j + @@ -99,11 +185,11 @@ oai4j [0.6b1,) - - - - - + + xalan + xalan + 2.7.2 + @@ -111,19 +197,20 @@ + @@ -204,15 +291,27 @@ org.springframework.session spring-session-data-redis - 1.3.1.RELEASE + + + redis.clients jedis - 2.9.0 - + ${jedis.version} + + + +org.apache.commons +commons-pool2 + com.google.code.gson gson @@ -224,18 +323,18 @@ cors-filter 2.5 - com.netflix.hystrix hystrix-core 1.5.18 - + + javax.xml.ws @@ -315,9 +414,23 @@ + + + + + org.springframework.session + spring-session-bom + 2021.0.2 + pom + import + + + + ${project.build.directory}/${project.build.finalName}/WEB-INF/classes + + + org.springframework.boot + spring-boot-maven-plugin + + cz.habarta.typescript-generator typescript-generator-maven-plugin @@ -396,4 +514,4 @@ - \ No newline at end of file + diff --git a/src/main/java/eu/dnetlib/repo/manager/config/Config.java b/src/main/java/eu/dnetlib/repo/manager/config/Config.java index d348ed7..b450635 100644 --- a/src/main/java/eu/dnetlib/repo/manager/config/Config.java +++ b/src/main/java/eu/dnetlib/repo/manager/config/Config.java @@ -1,16 +1,79 @@ package eu.dnetlib.repo.manager.config; -import org.bouncycastle.util.Arrays; -import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; +import eu.dnetlib.api.enabling.ISLookUpService; +import eu.dnetlib.api.functionality.ValidatorService; +import eu.dnetlib.clients.enabling.islookup.ws.ISLookUpClient; +import eu.dnetlib.clients.functionality.validator.ws.ValidatorWebService; +import eu.dnetlib.clients.functionality.validator.ws.ValidatorWebServiceClient; +import eu.dnetlib.domain.enabling.Vocabulary; +import gr.uoa.di.driver.enabling.ISLookUp; +import gr.uoa.di.driver.enabling.islookup.ISLookUpImpl; +import gr.uoa.di.driver.util.ServiceLocator; +import gr.uoa.di.driver.util.StaticServiceLocator; +import gr.uoa.di.driver.xml.VocabularyXmlConverter; +import org.apache.cxf.frontend.ClientProxyFactoryBean; +import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.*; -import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; -import org.springframework.core.io.support.PathMatchingResourcePatternResolver; - -import java.io.IOException; @Configuration -@ImportResource("classpath*:/gr/uoa/di/driver/app/springContext-commons.xml") +//@ImportResource({"classpath*:/gr/**/springContext-*.xml","/eu/dnetlib/clients/ws/springContext-locatorFactory.xml","/eu/dnetlib/soap/cxf/applicationContext-eprbuilders.xml","/eu/dnetlib/enabling/hcm/springContext-hcmService.xml"}) +@ImportResource("application-compat.xml") + @PropertySource("application-compat.properties") + public class Config { + @Value("${ISLookUpService.url}") + private String lookupURL; + + @Value("${ValidatorService.url}") + private String validatorUrl; + + private ServiceLocator createIsLookupServiceLocator() throws Exception { + JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); + + //factory.setServiceClass(eu.dnetlib.services.ISLookUpService.class); + factory.setServiceClass(eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService.class); + factory.setAddress(lookupURL); + //eu.dnetlib.services.ISLookUpService client = (eu.dnetlib.services.ISLookUpService) factory.create(); + eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService client = (eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService) factory.create(); + + ISLookUpClient service = new ISLookUpClient(); + service.setWebService(client); + + StaticServiceLocator locator = new StaticServiceLocator<>(); + locator.setService(service); + + return locator; + } + + @Bean(name="vocabularyLookUp") + public ISLookUp createVocabularyLookUp() throws Exception { + ISLookUpImpl lookUp = new ISLookUpImpl<>(); + + lookUp.setLookupLocator(createIsLookupServiceLocator()); + lookUp.setConverter(new VocabularyXmlConverter()); + + return lookUp; + } + + @Bean("validatorServiceLocator") + public ServiceLocator createValidatorServiceLocator() { + JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); + + factory.setServiceClass(ValidatorWebService.class); + factory.setAddress(validatorUrl); + + ValidatorWebService service = (ValidatorWebService) factory.create(); + + ValidatorWebServiceClient client = new ValidatorWebServiceClient(); + client.setWebService(service); + + StaticServiceLocator locator = new StaticServiceLocator<>(); + locator.setService(client); + + return locator; + } + } diff --git a/src/main/java/eu/dnetlib/repo/manager/service/RepositoryServiceImpl.java b/src/main/java/eu/dnetlib/repo/manager/service/RepositoryServiceImpl.java index 16f3772..62d7c7c 100644 --- a/src/main/java/eu/dnetlib/repo/manager/service/RepositoryServiceImpl.java +++ b/src/main/java/eu/dnetlib/repo/manager/service/RepositoryServiceImpl.java @@ -258,6 +258,9 @@ public class RepositoryServiceImpl implements RepositoryService { String rs = restTemplate.postForObject(uriComponents.toUri(), requestFilter, String.class); JSONArray jsonArray = (JSONArray) new JSONObject(rs).get("datasourceInfo"); while (jsonArray.length() > 0) { + +LOGGER.debug("json: " + jsonArray); + resultSet.addAll(mapper.readValue(String.valueOf(jsonArray), mapper.getTypeFactory().constructCollectionType(List.class, RepositorySnippet.class))); page += 1; diff --git a/src/main/java/eu/dnetlib/repo/manager/service/security/AuthoritiesUpdater.java b/src/main/java/eu/dnetlib/repo/manager/service/security/AuthoritiesUpdater.java index 94c58ca..76c0b1f 100644 --- a/src/main/java/eu/dnetlib/repo/manager/service/security/AuthoritiesUpdater.java +++ b/src/main/java/eu/dnetlib/repo/manager/service/security/AuthoritiesUpdater.java @@ -9,7 +9,8 @@ import org.springframework.security.core.context.SecurityContext; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.oauth2.common.exceptions.UnauthorizedClientException; import org.springframework.security.web.context.HttpSessionSecurityContextRepository; -import org.springframework.session.ExpiringSession; +import org.springframework.session.Session; +//import org.springframework.session.ExpiringSession; import org.springframework.session.FindByIndexNameSessionRepository; import org.springframework.stereotype.Service; @@ -28,11 +29,11 @@ public class AuthoritiesUpdater extends HttpSessionSecurityContextRepository { public void update(String email, Collection authorities) { if (sessions != null) { - Map map = sessions. + Map map = sessions. findByIndexNameAndIndexValue(FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME, email); if (map != null) { logger.debug(map.values().toArray().length); - for (ExpiringSession session : map.values()) { + for (Session session : map.values()) { logger.debug(session.getId()); if (!session.isExpired()) { SecurityContext securityContext = session.getAttribute(SPRING_SECURITY_CONTEXT_KEY); diff --git a/src/main/resources/application-compat.properties b/src/main/resources/application-compat.properties index 53e5268..1a7b5af 100644 --- a/src/main/resources/application-compat.properties +++ b/src/main/resources/application-compat.properties @@ -7,4 +7,43 @@ is.registry.creatorId = ${transport.soap.baseAddress} openaire.db.driverClassName = org.postgresql.Driver openaire.db.url = jdbc:postgresql://node1.d.openaire.research-infrastructures.eu:5432/dnet_openaire openaire.db.username = dnet -openaire.db.password = dnetPwd \ No newline at end of file +openaire.db.password = dnetPwd + + +transport.soap.baseAddress=http://${container.hostname}:${container.port}/${container.context} +container.context=/ +infrastructure.name=dev +transport.soap.force.local.address=false +services.hcm.serviceName=hcmService + +services.common.nkua.useCache = true +ISLookUpService.url= INVALID LINK!!! ISLookUpService +ISRegistryService.url= INVALID LINK!!! ISRegistryService +ResultSetService.url= INVALID LINK!!! ResultSetService +ISSNService.url= INVALID LINK!!! ISSNService +DBService.url= INVALID LINK!!! DBService +ActionManagerService.url = INALVID LINK!!! action Service +A2Service.url= INVALID LINK!!! A2Service +UserProfileService.url= INVALID LINK!!! UserProfileService +IndexService.url= INVALID LINK!!! IndexService +SearchService.url= INVALID LINK!!! SearchService +CommunityService.url= INVALID LINK!!! CommunityService +CollectionService.url= INVALID LINK!!! CollectionService +PublisherService.url= INVALID LINK!!! PublisherService +RecommendationService.url= INVALID LINK!!! RecommendationService +ValidatorService.url=http://88.197.53.69:8080/uoa-validator-service/services/validatorWebService +ForumService.url = INVALID LINK!!! ForumService +RatingService.url = INVALID LINK!!! RatingService +WebInterfaceService.url = INVALID LINK!!! WebInterfaceService +DatasourceManagerService.url = https://dev-openaire.d4science.org:443/is/services/datasourceManager +MDStoreService.url = INVALID LINK!!! MDStoreService +services.similarityService.ws.url = INVALID LINK!!! similarityService +services.alertService.ws.url = INVALID LINK!!! alertService +services.notificationService.ws.url = INVALID LINK!!! notificationService +services.conversionService.ws.url = INVALID LINK!!! conversionService + +services.registration.delay = 3600 +services.registration.default.hnmlocator = nullHNMLocator + +services.registration.default.removeRegistration=true + diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 0cd1c54..4ce18be 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -73,7 +73,7 @@ services.repomanager.mail.replyTo = test.openaire@gmail.com ISLookUpService.url = https://dev-openaire.d4science.org:443/is/services/isLookUp ISRegistryService.url = https://dev-openaire.d4science.org:443/is/services/isRegistry ISSNService.url = https://dev-openaire.d4science.org:443/is/services/isSN -ValidatorService.url=http://estella.athenarc.gr:8080/validator-service/services/validatorWebService +ValidatorService.url=http://88.197.53.69:8080/uoa-validator-service/services/validatorWebService # LDAP #services.validator.ldap.address = 88.197.53.113 @@ -100,11 +100,11 @@ redis.host = localhost redis.port = 6379 redis.password = 2106875370 -oidc.dev.home = http://localhost:8480/uoa-repository-manager-service/openid_connect_login -webapp.dev.front = http://localhost:4200/dashboard +oidc.dev.home = http://88.197.53.69/api/openid_connect_login +webapp.dev.front = http://88.197.53.69/join services.repomanager.db.driverClassName=org.postgresql.Driver -services.repomanager.db.url=jdbc:postgresql://194.177.192.119:5432/repomanager +services.repomanager.db.url=jdbc:postgresql://localhost:5432/repomanager services.repomanager.db.username=dnet services.repomanager.db.password=dnetPwd #infrastructure.name=integration @@ -155,3 +155,13 @@ services.broker.url=http://broker1-dev-dnet.d4science.org services.broker.port=8080 services.broker.api=api/ services.broker.openaire=openaireBroker + +oidc.url.base=https://aai.openaire.eu +oidc.issuer=${oidc.url.base}/oidc/ + +aai.registry.url=${oidc.url.base}/registry/ +aai.registry.coid=2 +aai.registry.production=false +aai.registry.authentication.username=provide_openaire +aai.registry.authentication.password=u8WfYv2R^f#y7G98 +