Merge branch 'master' into new-is-app

This commit is contained in:
Michele Artini 2023-05-03 09:51:52 +02:00
commit df91e8c38e
25 changed files with 155 additions and 38 deletions

View File

@ -3,7 +3,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId>
<version>3.4.1-SNAPSHOT</version>
<version>3.4.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId>
<version>3.4.1-SNAPSHOT</version>
<version>3.4.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId>
<version>3.4.1-SNAPSHOT</version>
<version>3.4.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId>
<version>3.4.1-SNAPSHOT</version>
<version>3.4.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -3,7 +3,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId>
<version>3.4.1-SNAPSHOT</version>
<version>3.4.2-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

View File

@ -73,7 +73,7 @@ public class ISClientImpl implements ISClient {
final String xqueryTemplate = _getQuery(config.getFindObjectStore());
return _isLookUp(String.format(xqueryTemplate, dsId));
} catch (IOException | ISLookUpException e) {
throw new DsmException("unble to find objectstore for ds " + dsId);
throw new DsmException("unable to find objectstore for ds " + dsId);
}
}

View File

@ -102,8 +102,8 @@ public class CommunityApiCore {// implements CommunityClient{
isClient.updateContextParam(id, CPROFILE_SDG, Joiner.on(CSV_DELIMITER).join(details.getSdg()), true);
}
if (details.getAdvancedConstraint() != null) {
isClient.updateContextParam(id, CPROFILE_ADVANCED_CONSTRAINT, "<![CDATA[" + new Gson().toJson(details.getAdvancedConstraint()) + "]]>", false);
if (details.getAdvancedConstraints() != null) {
isClient.updateContextParam(id, CPROFILE_ADVANCED_CONSTRAINT, "<![CDATA[" + new Gson().toJson(details.getAdvancedConstraints()) + "]]>", false);
}
if (details.getMainZenodoCommunity() != null) {
@ -390,7 +390,7 @@ public class CommunityApiCore {// implements CommunityClient{
final CommunityDetails cd = new CommunityDetails();
cd.setAdvancedConstraint(advancedCosntraint);
cd.setAdvancedConstraints(advancedCosntraint);
setCommunity(id, CommunityWritableProperties.fromDetails(cd));

View File

@ -13,7 +13,6 @@ import eu.dnetlib.openaire.exporter.model.community.CommunityProject;
import eu.dnetlib.openaire.exporter.model.community.CommunitySummary;
import eu.dnetlib.openaire.exporter.model.community.CommunityWritableProperties;
import eu.dnetlib.openaire.exporter.model.community.CommunityZenodoCommunity;
import eu.dnetlib.openaire.exporter.model.community.selectioncriteria.SelectionCriteria;
import eu.dnetlib.openaire.exporter.model.context.Category;
import eu.dnetlib.openaire.exporter.model.context.Concept;
import eu.dnetlib.openaire.exporter.model.context.Context;
@ -240,14 +239,14 @@ public class CommunityCommon {
.setValue(Joiner.on(CSV_DELIMITER)
.join(community.getSdg()))));
}
if (community.getAdvancedConstraint() != null) {
if (community.getAdvancedConstraints() != null) {
if(context.getParams().containsKey(CPROFILE_ADVANCED_CONSTRAINT))
context.getParams()
.replace(CPROFILE_ADVANCED_CONSTRAINT, Arrays.asList(new Param()
.setName(CPROFILE_ADVANCED_CONSTRAINT).setValue(new Gson().toJson(community.getAdvancedConstraint()))));
.setName(CPROFILE_ADVANCED_CONSTRAINT).setValue(new Gson().toJson(community.getAdvancedConstraints()))));
else
context.getParams().put(CPROFILE_ADVANCED_CONSTRAINT, Arrays.asList(new Param()
.setName(CPROFILE_ADVANCED_CONSTRAINT).setValue(new Gson().toJson(community.getAdvancedConstraint()))));
.setName(CPROFILE_ADVANCED_CONSTRAINT).setValue(new Gson().toJson(community.getAdvancedConstraints()))));
}
if(community.getMainZenodoCommunity() != null){
context.getParams()

View File

@ -34,7 +34,7 @@ public class CommunityConstants {
public final static String CPROFILE_CREATIONDATE = "creationdate";
public final static String CPROFILE_FOS = "fos";
public final static String CPROFILE_SDG = "sdg";
public final static String CPROFILE_ADVANCED_CONSTRAINT = "advancedConstraint";
public final static String CPROFILE_ADVANCED_CONSTRAINT = "advancedConstraints";
// community project
public final static String CPROJECT_FUNDER = "funder";

View File

@ -79,7 +79,7 @@ public class CommunityMappingUtils {
}
if (params.containsKey(CPROFILE_ADVANCED_CONSTRAINT)) {
//In the map the string is the serialization of the json representing the selection criteria so it is a valid json
p.setAdvancedConstraint(SelectionCriteria.fromJson(asCsv(params.get(CPROFILE_ADVANCED_CONSTRAINT))));
p.setAdvancedConstraints(SelectionCriteria.fromJson(asCsv(params.get(CPROFILE_ADVANCED_CONSTRAINT))));
}
if (params.containsKey(CPROFILE_CREATIONDATE)){

View File

@ -0,0 +1,110 @@
#services.is.host = localhost
services.is.host = dev-openaire.d4science.org
#services.is.port = 8280
services.is.port = 443
#services.is.protocol = http
services.is.protocol = https
#services.is.context = app
services.is.context = is
#services.is.baseurl = ${services.is.protocol}://${services.is.host}:${services.is.port}/${services.is.context}/services
services.is.baseurl = ${services.is.protocol}://${services.is.host}:${services.is.port}/${services.is.context}/services
openaire.exporter.isLookupUrl = ${services.is.baseurl}/isLookUp
openaire.exporter.objectStoreServiceUrl = ${services.is.baseurl}/objectStore
openaire.exporter.isRegistryServiceUrl = ${services.is.baseurl}/isRegistry
openaire.exporter.requestWorkers = 10
openaire.exporter.requestTimeout = 10
openaire.exporter.cxfClientConnectTimeout = 60000
openaire.exporter.cxfClientReceiveTimeout = 120000
# JDBC
#openaire.exporter.jdbc.url = jdbc:postgresql://localhost:5432/dnet_openaire
openaire.exporter.jdbc.url = jdbc:postgresql://localhost:5432/dev_openaire_8280
openaire.exporter.jdbc.user = dnetapi
openaire.exporter.jdbc.pwd = dnetPwd
openaire.exporter.jdbc.minIdle = 1
openaire.exporter.jdbc.maxIdle = 20
openaire.exporter.jdbc.maxRows = 100
# PROJECTS
openaire.exporter.project.dspaceHeadTemplate = classpath:/eu/dnetlib/openaire/st/projects_dspace_header.st
openaire.exporter.project.dspaceTemplate = classpath:/eu/dnetlib/openaire/st/projects_dspace_project.st
openaire.exporter.project.dspaceTailTemplate = classpath:/eu/dnetlib/openaire/st/projects_dspace_tail.st
openaire.exporter.project.eprintsTemplate = classpath:/eu/dnetlib/openaire/st/projects_eprints.st
openaire.exporter.project.tsvFields = Grant Agreement Number, Project Acronym, Project Title, Call ID, Start Date, End Date, OA Mandate on Publications, OA Mandate on Datasets, Discipline, Organization, Country, Role, Person Name, Person Second Names, Person Email
openaire.exporter.project.projectsFundingQueryTemplate=classpath:/eu/dnetlib/openaire/sql/projects_fundings.sql.st
openaire.exporter.project.flushSize = 1000
# DATSOURCES
openaire.exporter.datasource.title = Data Sources
openaire.exporter.datasource.mongoHost = localhost
openaire.exporter.datasource.mongoPort = 27017
openaire.exporter.datasource.mongoConnectionsPerHost = 10
openaire.exporter.datasource.mongoCollectionName = wf_logs
openaire.exporter.datasource.mongoDbName = dnet_logs_prod
openaire.exporter.datasource.mongoQueryLimit= 100
openaire.exporter.findSolrIndexUrl = /eu/dnetlib/openaire/xquery/findSolrIndexUrl.xquery
openaire.exporter.findIndexDsInfo = /eu/dnetlib/openaire/xquery/findIndexDsInfo.xquery
openaire.exporter.findObjectStore = /eu/dnetlib/openaire/xquery/findObjectStore.xquery
openaire.exporter.findFunderContexts = /eu/dnetlib/openaire/xquery/findFunderContexts.xquery
openaire.exporter.findCommunityContexts = /eu/dnetlib/openaire/xquery/findCommunityContexts.xquery
openaire.exporter.findContextProfiles = /eu/dnetlib/openaire/xquery/findContextProfiles.xquery
openaire.exporter.getRepoProfile = /eu/dnetlib/openaire/xquery/getRepoProfile.xquery
openaire.exporter.contentLoadQuery = { "$and" : [ { "system:profileName" : "Graph construction [PROD]" }, { "system:isCompletedSuccessfully" : "true" }, { "reuseContent" : "false" } ] }
# REST API CONFIGURATION
openaire.exporter.swaggerDsm.apiTitle = OpenAIRE aggregator REST API
openaire.exporter.swaggerDsm.apiDescription = The OpenAIRE data provision REST API allows developers to access the metadata information space of OpenAIRE programmatically.
openaire.exporter.swaggerDsm.apiLicense = LICENSED UNDER GNU AFFERO GENERAL PUBLIC LICENSE.
openaire.exporter.swaggerDsm.apiLicenseUrl = https://www.gnu.org/licenses/agpl-3.0.txt
openaire.exporter.swaggerDsm.apiContacName = D-Net team
openaire.exporter.swaggerDsm.apiContactUrl = http://www.openaire.eu
openaire.exporter.swaggerDsm.apiContactEmail = dnet-team@isti.cnr.it
openaire.exporter.swaggerProjects.apiTitle = OpenAIRE projects REST API
openaire.exporter.swaggerProjects.apiDescription = The OpenAIRE projects REST API allows programmatic access to funded research projects metadata.
openaire.exporter.swaggerProjects.apiLicense = ${openaire.exporter.swaggerDsm.apiLicense}
openaire.exporter.swaggerProjects.apiLicenseUrl = ${openaire.exporter.swaggerDsm.apiLicenseUrl}
openaire.exporter.swaggerProjects.apiContacName = ${openaire.exporter.swaggerDsm.apiContacName}
openaire.exporter.swaggerProjects.apiContactUrl = ${openaire.exporter.swaggerDsm.apiContactUrl}
openaire.exporter.swaggerProjects.apiContactEmail = ${openaire.exporter.swaggerDsm.apiContactEmail}
openaire.exporter.swaggerFunders.apiTitle = OpenAIRE funders REST API
openaire.exporter.swaggerFunders.apiDescription = The OpenAIRE funders REST API allows programmatic access to the funding agencies metadata in OpenAIRE.
openaire.exporter.swaggerFunders.apiLicense = ${openaire.exporter.swaggerDsm.apiLicense}
openaire.exporter.swaggerFunders.apiLicenseUrl = ${openaire.exporter.swaggerDsm.apiLicenseUrl}
openaire.exporter.swaggerFunders.apiContacName = ${openaire.exporter.swaggerDsm.apiContacName}
openaire.exporter.swaggerFunders.apiContactUrl = ${openaire.exporter.swaggerDsm.apiContactUrl}
openaire.exporter.swaggerFunders.apiContactEmail = ${openaire.exporter.swaggerDsm.apiContactEmail}
openaire.exporter.swaggerCommunities.apiTitle = OpenAIRE Communities REST API
openaire.exporter.swaggerCommunities.apiDescription = The OpenAIRE communities REST API allows programmatic access to the communities configurations in OpenAIRE.
openaire.exporter.swaggerCommunities.apiLicense = ${openaire.exporter.swaggerDsm.apiLicense}
openaire.exporter.swaggerCommunities.apiLicenseUrl = ${openaire.exporter.swaggerDsm.apiLicenseUrl}
openaire.exporter.swaggerCommunities.apiContacName = ${openaire.exporter.swaggerDsm.apiContacName}
openaire.exporter.swaggerCommunities.apiContactUrl = ${openaire.exporter.swaggerDsm.apiContactUrl}
openaire.exporter.swaggerCommunities.apiContactEmail = ${openaire.exporter.swaggerDsm.apiContactEmail}
openaire.exporter.swaggerContexts.apiTitle = OpenAIRE Contexts REST API
openaire.exporter.swaggerContexts.apiDescription = The OpenAIRE contexts REST API allows programmatic access to the context profiles in OpenAIRE.
openaire.exporter.swaggerContexts.apiLicense = ${openaire.exporter.swaggerDsm.apiLicense}
openaire.exporter.swaggerContexts.apiLicenseUrl = ${openaire.exporter.swaggerDsm.apiLicenseUrl}
openaire.exporter.swaggerContexts.apiContacName = ${openaire.exporter.swaggerDsm.apiContacName}
openaire.exporter.swaggerContexts.apiContactUrl = ${openaire.exporter.swaggerDsm.apiContactUrl}
openaire.exporter.swaggerContexts.apiContactEmail = ${openaire.exporter.swaggerDsm.apiContactEmail}
openaire.exporter.swaggerInfo.apiTitle = OpenAIRE Info REST API
openaire.exporter.swaggerInfo.apiDescription = The OpenAIRE Info REST API allows programmatic access to some interesting dates related to the content indexed in OpenAIRE.
openaire.exporter.swaggerInfo.apiLicense = ${openaire.exporter.swaggerDsm.apiLicense}
openaire.exporter.swaggerInfo.apiLicenseUrl = ${openaire.exporter.swaggerDsm.apiLicenseUrl}
openaire.exporter.swaggerInfo.apiContacName = ${openaire.exporter.swaggerDsm.apiContacName}
openaire.exporter.swaggerInfo.apiContactUrl = ${openaire.exporter.swaggerDsm.apiContactUrl}
openaire.exporter.swaggerInfo.apiContactEmail = ${openaire.exporter.swaggerDsm.apiContactEmail}
# VOCABULARIES
openaire.exporter.vocabularies.baseUrl = http://localhost:8980/provision/mvc/vocabularies
openaire.exporter.vocabularies.countriesEndpoint = ${openaire.exporter.vocabularies.baseUrl}/dnet:countries.json
openaire.exporter.vocabularies.datasourceTypologiesEndpoint = ${openaire.exporter.vocabularies.baseUrl}/dnet:datasource_typologies.json

View File

@ -4,7 +4,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId>
<version>3.4.1-SNAPSHOT</version>
<version>3.4.2-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

View File

@ -3,7 +3,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>dnet-applications</artifactId>
<version>3.4.1-SNAPSHOT</version>
<version>3.4.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -3,7 +3,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>apps</artifactId>
<version>3.4.1-SNAPSHOT</version>
<version>3.4.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>cmd-line-apps</artifactId>
<version>3.4.1-SNAPSHOT</version>
<version>3.4.2-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

View File

@ -3,7 +3,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>dnet-applications</artifactId>
<version>3.4.1-SNAPSHOT</version>
<version>3.4.2-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>libs</artifactId>
<version>3.4.1-SNAPSHOT</version>
<version>3.4.2-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>libs</artifactId>
<version>3.4.1-SNAPSHOT</version>
<version>3.4.2-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>libs</artifactId>
<version>3.4.1-SNAPSHOT</version>
<version>3.4.2-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

View File

@ -27,7 +27,7 @@ public class CommunityDetails extends CommunitySummary {
private List<String> sdg;
@Schema(description = "list of advanced criteria to associate results to this community")
private SelectionCriteria advancedConstraint;
private SelectionCriteria advancedConstraints;
public CommunityDetails() {}
@ -79,11 +79,11 @@ public class CommunityDetails extends CommunitySummary {
this.sdg = sdg;
}
public SelectionCriteria getAdvancedConstraint() {
return advancedConstraint;
public SelectionCriteria getAdvancedConstraints() {
return advancedConstraints;
}
public void setAdvancedConstraint(final SelectionCriteria advancedConstraint) {
this.advancedConstraint = advancedConstraint;
public void setAdvancedConstraints(final SelectionCriteria advancedConstraints) {
this.advancedConstraints = advancedConstraints;
}
}

View File

@ -32,7 +32,7 @@ public class CommunityWritableProperties {
private List<String> sdg;
@Schema(description = "Advanced constraint for the association of results to the community")
private SelectionCriteria advancedConstraint;
private SelectionCriteria advancedConstraints;
@Schema(description = "status of the community, drives its visibility")
private CommunityStatus status;
@ -51,7 +51,7 @@ public class CommunityWritableProperties {
p.setMainZenodoCommunity(details.getZenodoCommunity());
p.setFos(details.getFos());
p.setSdg(details.getSdg());
p.setAdvancedConstraint(details.getAdvancedConstraint());
p.setAdvancedConstraints(details.getAdvancedConstraints());
return p;
}
@ -71,12 +71,12 @@ public class CommunityWritableProperties {
this.sdg = sdg;
}
public SelectionCriteria getAdvancedConstraint() {
return advancedConstraint;
public SelectionCriteria getAdvancedConstraints() {
return advancedConstraints;
}
public void setAdvancedConstraint(final SelectionCriteria advancedConstraint) {
this.advancedConstraint = advancedConstraint;
public void setAdvancedConstraints(final SelectionCriteria advancedConstraints) {
this.advancedConstraints = advancedConstraints;
}
public String getName() {

View File

@ -6,6 +6,10 @@ import java.util.List;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@JsonAutoDetect
public class SelectionCriteria implements Serializable {
@ -14,7 +18,7 @@ public class SelectionCriteria implements Serializable {
*
*/
private static final long serialVersionUID = 4303936216579280542L;
private static final Log log = LogFactory.getLog(SelectionCriteria.class);
private List<Constraints> criteria;
public SelectionCriteria() {}
@ -28,9 +32,13 @@ public class SelectionCriteria implements Serializable {
}
public static SelectionCriteria fromJson(final String json) {
if(StringUtils.isEmpty(json)){
return null;
}
try {
return new ObjectMapper().readValue(json, SelectionCriteria.class);
} catch (final JsonProcessingException e) {
log.error(e.getMessage());
throw new RuntimeException(e);
}
}

View File

@ -3,7 +3,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>libs</artifactId>
<version>3.4.1-SNAPSHOT</version>
<version>3.4.2-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>dnet-applications</artifactId>
<version>3.4.1-SNAPSHOT</version>
<version>3.4.2-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>

View File

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>dnet-applications</artifactId>
<version>3.4.1-SNAPSHOT</version>
<version>3.4.2-SNAPSHOT</version>
<packaging>pom</packaging>
<licenses>