mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 14:33:09 +00:00
Fix Merge conflicts with main
This commit is contained in:
@@ -121,6 +121,8 @@ services:
|
|||||||
cp -r /opt/solr/server/solr/configsets/search/* search
|
cp -r /opt/solr/server/solr/configsets/search/* search
|
||||||
precreate-core statistics /opt/solr/server/solr/configsets/statistics
|
precreate-core statistics /opt/solr/server/solr/configsets/statistics
|
||||||
cp -r /opt/solr/server/solr/configsets/statistics/* statistics
|
cp -r /opt/solr/server/solr/configsets/statistics/* statistics
|
||||||
|
precreate-core qaevent /opt/solr/server/solr/configsets/qaevent
|
||||||
|
cp -r /opt/solr/server/solr/configsets/qaevent/* qaevent
|
||||||
exec solr -f
|
exec solr -f
|
||||||
volumes:
|
volumes:
|
||||||
assetstore:
|
assetstore:
|
||||||
|
@@ -77,7 +77,7 @@ import org.dspace.orcid.service.OrcidQueueService;
|
|||||||
import org.dspace.orcid.service.OrcidSynchronizationService;
|
import org.dspace.orcid.service.OrcidSynchronizationService;
|
||||||
import org.dspace.orcid.service.OrcidTokenService;
|
import org.dspace.orcid.service.OrcidTokenService;
|
||||||
import org.dspace.profile.service.ResearcherProfileService;
|
import org.dspace.profile.service.ResearcherProfileService;
|
||||||
import org.dspace.qaevent.dao.QAEventsDao;
|
import org.dspace.qaevent.dao.QAEventsDAO;
|
||||||
import org.dspace.services.ConfigurationService;
|
import org.dspace.services.ConfigurationService;
|
||||||
import org.dspace.versioning.service.VersioningService;
|
import org.dspace.versioning.service.VersioningService;
|
||||||
import org.dspace.workflow.WorkflowItemService;
|
import org.dspace.workflow.WorkflowItemService;
|
||||||
@@ -172,7 +172,7 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
|
|||||||
protected SubscribeService subscribeService;
|
protected SubscribeService subscribeService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private QAEventsDao qaEventsDao;
|
private QAEventsDAO qaEventsDao;
|
||||||
|
|
||||||
protected ItemServiceImpl() {
|
protected ItemServiceImpl() {
|
||||||
super();
|
super();
|
||||||
|
@@ -37,9 +37,17 @@ public class QAEvent {
|
|||||||
private String source;
|
private String source;
|
||||||
|
|
||||||
private String eventId;
|
private String eventId;
|
||||||
|
/**
|
||||||
|
* contains the targeted dspace object,
|
||||||
|
* ie: oai:www.openstarts.units.it:123456789/1120 contains the handle
|
||||||
|
* of the DSpace pbject in its final part 123456789/1120
|
||||||
|
* */
|
||||||
private String originalId;
|
private String originalId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* evaluated with the targeted dspace object id
|
||||||
|
*
|
||||||
|
* */
|
||||||
private String target;
|
private String target;
|
||||||
|
|
||||||
private String related;
|
private String related;
|
||||||
|
@@ -48,7 +48,7 @@ import org.dspace.eperson.service.GroupService;
|
|||||||
import org.dspace.eperson.service.SubscribeService;
|
import org.dspace.eperson.service.SubscribeService;
|
||||||
import org.dspace.event.Event;
|
import org.dspace.event.Event;
|
||||||
import org.dspace.orcid.service.OrcidTokenService;
|
import org.dspace.orcid.service.OrcidTokenService;
|
||||||
import org.dspace.qaevent.dao.QAEventsDao;
|
import org.dspace.qaevent.dao.QAEventsDAO;
|
||||||
import org.dspace.services.ConfigurationService;
|
import org.dspace.services.ConfigurationService;
|
||||||
import org.dspace.util.UUIDUtils;
|
import org.dspace.util.UUIDUtils;
|
||||||
import org.dspace.versioning.Version;
|
import org.dspace.versioning.Version;
|
||||||
@@ -109,7 +109,7 @@ public class EPersonServiceImpl extends DSpaceObjectServiceImpl<EPerson> impleme
|
|||||||
@Autowired
|
@Autowired
|
||||||
protected OrcidTokenService orcidTokenService;
|
protected OrcidTokenService orcidTokenService;
|
||||||
@Autowired
|
@Autowired
|
||||||
protected QAEventsDao qaEventsDao;
|
protected QAEventsDAO qaEventsDao;
|
||||||
|
|
||||||
protected EPersonServiceImpl() {
|
protected EPersonServiceImpl() {
|
||||||
super();
|
super();
|
||||||
|
@@ -40,20 +40,20 @@ import org.json.JSONObject;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* based on OrcidRestConnector it's a rest connector for OpenAIRE API providing
|
* based on OrcidRestConnector it's a rest connector for Openaire API providing
|
||||||
* ways to perform searches and token grabbing
|
* ways to perform searches and token grabbing
|
||||||
*
|
*
|
||||||
* @author paulo-graca
|
* @author paulo-graca
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class OpenAIRERestConnector {
|
public class OpenaireRestConnector {
|
||||||
/**
|
/**
|
||||||
* log4j logger
|
* log4j logger
|
||||||
*/
|
*/
|
||||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(OpenAIRERestConnector.class);
|
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(OpenaireRestConnector.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OpenAIRE API Url
|
* Openaire API Url
|
||||||
* and can be configured with: openaire.api.url
|
* and can be configured with: openaire.api.url
|
||||||
*/
|
*/
|
||||||
private String url = "https://api.openaire.eu";
|
private String url = "https://api.openaire.eu";
|
||||||
@@ -65,30 +65,30 @@ public class OpenAIRERestConnector {
|
|||||||
boolean tokenEnabled = false;
|
boolean tokenEnabled = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OpenAIRE Authorization and Authentication Token Service URL
|
* Openaire Authorization and Authentication Token Service URL
|
||||||
* and can be configured with: openaire.token.url
|
* and can be configured with: openaire.token.url
|
||||||
*/
|
*/
|
||||||
private String tokenServiceUrl;
|
private String tokenServiceUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OpenAIRE clientId
|
* Openaire clientId
|
||||||
* and can be configured with: openaire.token.clientId
|
* and can be configured with: openaire.token.clientId
|
||||||
*/
|
*/
|
||||||
private String clientId;
|
private String clientId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OpenAIRERest access token
|
* OpenaireRest access token
|
||||||
*/
|
*/
|
||||||
private OpenAIRERestToken accessToken;
|
private OpenaireRestToken accessToken;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OpenAIRE clientSecret
|
* Openaire clientSecret
|
||||||
* and can be configured with: openaire.token.clientSecret
|
* and can be configured with: openaire.token.clientSecret
|
||||||
*/
|
*/
|
||||||
private String clientSecret;
|
private String clientSecret;
|
||||||
|
|
||||||
|
|
||||||
public OpenAIRERestConnector(String url) {
|
public OpenaireRestConnector(String url) {
|
||||||
this.url = url;
|
this.url = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ public class OpenAIRERestConnector {
|
|||||||
*
|
*
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public OpenAIRERestToken grabNewAccessToken() throws IOException {
|
public OpenaireRestToken grabNewAccessToken() throws IOException {
|
||||||
|
|
||||||
if (StringUtils.isBlank(tokenServiceUrl) || StringUtils.isBlank(clientId)
|
if (StringUtils.isBlank(tokenServiceUrl) || StringUtils.isBlank(clientId)
|
||||||
|| StringUtils.isBlank(clientSecret)) {
|
|| StringUtils.isBlank(clientSecret)) {
|
||||||
@@ -145,13 +145,13 @@ public class OpenAIRERestConnector {
|
|||||||
throw new IOException("Unable to grab the access token using provided service url, client id and secret");
|
throw new IOException("Unable to grab the access token using provided service url, client id and secret");
|
||||||
}
|
}
|
||||||
|
|
||||||
return new OpenAIRERestToken(responseObject.get("access_token").toString(),
|
return new OpenaireRestToken(responseObject.get("access_token").toString(),
|
||||||
Long.valueOf(responseObject.get("expires_in").toString()));
|
Long.valueOf(responseObject.get("expires_in").toString()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform a GET request to the OpenAIRE API
|
* Perform a GET request to the Openaire API
|
||||||
*
|
*
|
||||||
* @param file
|
* @param file
|
||||||
* @param accessToken
|
* @param accessToken
|
||||||
@@ -218,12 +218,12 @@ public class OpenAIRERestConnector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform an OpenAIRE Project Search By Keywords
|
* Perform an Openaire Project Search By Keywords
|
||||||
*
|
*
|
||||||
* @param page
|
* @param page
|
||||||
* @param size
|
* @param size
|
||||||
* @param keywords
|
* @param keywords
|
||||||
* @return OpenAIRE Response
|
* @return Openaire Response
|
||||||
*/
|
*/
|
||||||
public Response searchProjectByKeywords(int page, int size, String... keywords) {
|
public Response searchProjectByKeywords(int page, int size, String... keywords) {
|
||||||
String path = "search/projects?keywords=" + String.join("+", keywords);
|
String path = "search/projects?keywords=" + String.join("+", keywords);
|
||||||
@@ -231,13 +231,13 @@ public class OpenAIRERestConnector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform an OpenAIRE Project Search By ID and by Funder
|
* Perform an Openaire Project Search By ID and by Funder
|
||||||
*
|
*
|
||||||
* @param projectID
|
* @param projectID
|
||||||
* @param projectFunder
|
* @param projectFunder
|
||||||
* @param page
|
* @param page
|
||||||
* @param size
|
* @param size
|
||||||
* @return OpenAIRE Response
|
* @return Openaire Response
|
||||||
*/
|
*/
|
||||||
public Response searchProjectByIDAndFunder(String projectID, String projectFunder, int page, int size) {
|
public Response searchProjectByIDAndFunder(String projectID, String projectFunder, int page, int size) {
|
||||||
String path = "search/projects?grantID=" + projectID + "&funder=" + projectFunder;
|
String path = "search/projects?grantID=" + projectID + "&funder=" + projectFunder;
|
||||||
@@ -245,12 +245,12 @@ public class OpenAIRERestConnector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform an OpenAIRE Search request
|
* Perform an Openaire Search request
|
||||||
*
|
*
|
||||||
* @param path
|
* @param path
|
||||||
* @param page
|
* @param page
|
||||||
* @param size
|
* @param size
|
||||||
* @return OpenAIRE Response
|
* @return Openaire Response
|
||||||
*/
|
*/
|
||||||
public Response search(String path, int page, int size) {
|
public Response search(String path, int page, int size) {
|
||||||
String[] queryStringPagination = { "page=" + page, "size=" + size };
|
String[] queryStringPagination = { "page=" + page, "size=" + size };
|
@@ -8,13 +8,13 @@
|
|||||||
package org.dspace.external;
|
package org.dspace.external;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OpenAIRE rest API token to be used when grabbing an accessToken.<br/>
|
* Openaire rest API token to be used when grabbing an accessToken.<br/>
|
||||||
* Based on https://develop.openaire.eu/basic.html
|
* Based on https://develop.openaire.eu/basic.html
|
||||||
*
|
*
|
||||||
* @author paulo-graca
|
* @author paulo-graca
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class OpenAIRERestToken {
|
public class OpenaireRestToken {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stored access token
|
* Stored access token
|
||||||
@@ -32,7 +32,7 @@ public class OpenAIRERestToken {
|
|||||||
* @param accessToken
|
* @param accessToken
|
||||||
* @param expiresIn
|
* @param expiresIn
|
||||||
*/
|
*/
|
||||||
public OpenAIRERestToken(String accessToken, Long expiresIn) {
|
public OpenaireRestToken(String accessToken, Long expiresIn) {
|
||||||
this.accessToken = accessToken;
|
this.accessToken = accessToken;
|
||||||
this.setExpirationDate(expiresIn);
|
this.setExpirationDate(expiresIn);
|
||||||
}
|
}
|
@@ -31,7 +31,7 @@ import eu.openaire.oaf.model.base.Project;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.dspace.content.dto.MetadataValueDTO;
|
import org.dspace.content.dto.MetadataValueDTO;
|
||||||
import org.dspace.external.OpenAIRERestConnector;
|
import org.dspace.external.OpenaireRestConnector;
|
||||||
import org.dspace.external.model.ExternalDataObject;
|
import org.dspace.external.model.ExternalDataObject;
|
||||||
import org.dspace.external.provider.AbstractExternalDataProvider;
|
import org.dspace.external.provider.AbstractExternalDataProvider;
|
||||||
import org.dspace.importer.external.metadatamapping.MetadataFieldConfig;
|
import org.dspace.importer.external.metadatamapping.MetadataFieldConfig;
|
||||||
@@ -39,13 +39,13 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is the implementation of the ExternalDataProvider interface that
|
* This class is the implementation of the ExternalDataProvider interface that
|
||||||
* will deal with the OpenAIRE External Data lookup
|
* will deal with the Openaire External Data lookup
|
||||||
*
|
*
|
||||||
* @author paulo-graca
|
* @author paulo-graca
|
||||||
*/
|
*/
|
||||||
public class OpenAIREFundingDataProvider extends AbstractExternalDataProvider {
|
public class OpenaireFundingDataProvider extends AbstractExternalDataProvider {
|
||||||
|
|
||||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(OpenAIREFundingDataProvider.class);
|
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(OpenaireFundingDataProvider.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GrantAgreement prefix
|
* GrantAgreement prefix
|
||||||
@@ -75,7 +75,7 @@ public class OpenAIREFundingDataProvider extends AbstractExternalDataProvider {
|
|||||||
/**
|
/**
|
||||||
* Connector to handle token and requests
|
* Connector to handle token and requests
|
||||||
*/
|
*/
|
||||||
protected OpenAIRERestConnector connector;
|
protected OpenaireRestConnector connector;
|
||||||
|
|
||||||
protected Map<String, MetadataFieldConfig> metadataFields;
|
protected Map<String, MetadataFieldConfig> metadataFields;
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ public class OpenAIREFundingDataProvider extends AbstractExternalDataProvider {
|
|||||||
// characters that must be escaped for the <:entry-id>
|
// characters that must be escaped for the <:entry-id>
|
||||||
String decodedId = new String(Base64.getDecoder().decode(id));
|
String decodedId = new String(Base64.getDecoder().decode(id));
|
||||||
if (!isValidProjectURI(decodedId)) {
|
if (!isValidProjectURI(decodedId)) {
|
||||||
log.error("Invalid ID for OpenAIREFunding - " + id);
|
log.error("Invalid ID for OpenaireFunding - " + id);
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
Response response = searchByProjectURI(decodedId);
|
Response response = searchByProjectURI(decodedId);
|
||||||
@@ -101,7 +101,7 @@ public class OpenAIREFundingDataProvider extends AbstractExternalDataProvider {
|
|||||||
try {
|
try {
|
||||||
if (response.getHeader() != null && Integer.parseInt(response.getHeader().getTotal()) > 0) {
|
if (response.getHeader() != null && Integer.parseInt(response.getHeader().getTotal()) > 0) {
|
||||||
Project project = response.getResults().getResult().get(0).getMetadata().getEntity().getProject();
|
Project project = response.getResults().getResult().get(0).getMetadata().getEntity().getProject();
|
||||||
ExternalDataObject externalDataObject = new OpenAIREFundingDataProvider
|
ExternalDataObject externalDataObject = new OpenaireFundingDataProvider
|
||||||
.ExternalDataObjectBuilder(project)
|
.ExternalDataObjectBuilder(project)
|
||||||
.setId(generateProjectURI(project))
|
.setId(generateProjectURI(project))
|
||||||
.setSource(sourceIdentifier)
|
.setSource(sourceIdentifier)
|
||||||
@@ -123,7 +123,7 @@ public class OpenAIREFundingDataProvider extends AbstractExternalDataProvider {
|
|||||||
limit = LIMIT_DEFAULT;
|
limit = LIMIT_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
// OpenAIRE uses pages and first page starts with 1
|
// Openaire uses pages and first page starts with 1
|
||||||
int page = (start / limit) + 1;
|
int page = (start / limit) + 1;
|
||||||
|
|
||||||
// escaping query
|
// escaping query
|
||||||
@@ -148,7 +148,7 @@ public class OpenAIREFundingDataProvider extends AbstractExternalDataProvider {
|
|||||||
|
|
||||||
if (projects.size() > 0) {
|
if (projects.size() > 0) {
|
||||||
return projects.stream()
|
return projects.stream()
|
||||||
.map(project -> new OpenAIREFundingDataProvider
|
.map(project -> new OpenaireFundingDataProvider
|
||||||
.ExternalDataObjectBuilder(project)
|
.ExternalDataObjectBuilder(project)
|
||||||
.setId(generateProjectURI(project))
|
.setId(generateProjectURI(project))
|
||||||
.setSource(sourceIdentifier)
|
.setSource(sourceIdentifier)
|
||||||
@@ -176,24 +176,24 @@ public class OpenAIREFundingDataProvider extends AbstractExternalDataProvider {
|
|||||||
* Generic setter for the sourceIdentifier
|
* Generic setter for the sourceIdentifier
|
||||||
*
|
*
|
||||||
* @param sourceIdentifier The sourceIdentifier to be set on this
|
* @param sourceIdentifier The sourceIdentifier to be set on this
|
||||||
* OpenAIREFunderDataProvider
|
* OpenaireFunderDataProvider
|
||||||
*/
|
*/
|
||||||
@Autowired(required = true)
|
@Autowired(required = true)
|
||||||
public void setSourceIdentifier(String sourceIdentifier) {
|
public void setSourceIdentifier(String sourceIdentifier) {
|
||||||
this.sourceIdentifier = sourceIdentifier;
|
this.sourceIdentifier = sourceIdentifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OpenAIRERestConnector getConnector() {
|
public OpenaireRestConnector getConnector() {
|
||||||
return connector;
|
return connector;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic setter for OpenAIRERestConnector
|
* Generic setter for OpenaireRestConnector
|
||||||
*
|
*
|
||||||
* @param connector
|
* @param connector
|
||||||
*/
|
*/
|
||||||
@Autowired(required = true)
|
@Autowired(required = true)
|
||||||
public void setConnector(OpenAIRERestConnector connector) {
|
public void setConnector(OpenaireRestConnector connector) {
|
||||||
this.connector = connector;
|
this.connector = connector;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,7 +219,7 @@ public class OpenAIREFundingDataProvider extends AbstractExternalDataProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns an URI based on OpenAIRE 3.0 guidelines
|
* This method returns an URI based on Openaire 3.0 guidelines
|
||||||
* https://guidelines.openaire.eu/en/latest/literature/field_projectid.html that
|
* https://guidelines.openaire.eu/en/latest/literature/field_projectid.html that
|
||||||
* can be used as an ID if is there any missing part, that part it will be
|
* can be used as an ID if is there any missing part, that part it will be
|
||||||
* replaced by the character '+'
|
* replaced by the character '+'
|
||||||
@@ -281,7 +281,7 @@ public class OpenAIREFundingDataProvider extends AbstractExternalDataProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OpenAIRE Funding External Data Builder Class
|
* Openaire Funding External Data Builder Class
|
||||||
*
|
*
|
||||||
* @author pgraca
|
* @author pgraca
|
||||||
*/
|
*/
|
@@ -16,7 +16,7 @@ import org.dspace.qaevent.service.QAEventService;
|
|||||||
import org.dspace.utils.DSpace;
|
import org.dspace.utils.DSpace;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Consumer to delete qaevents once the target item is deleted
|
* Consumer to delete qaevents from solr due to the target item deletion
|
||||||
*
|
*
|
||||||
* @author Andrea Bollini (andrea.bollini at 4science.it)
|
* @author Andrea Bollini (andrea.bollini at 4science.it)
|
||||||
*
|
*
|
||||||
|
@@ -11,7 +11,7 @@ import java.util.Date;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This model class represent the source/provider of the QA events (as OpenAIRE).
|
* This model class represent the source/provider of the QA events (as Openaire).
|
||||||
*
|
*
|
||||||
* @author Luca Giamminonni (luca.giamminonni at 4Science)
|
* @author Luca Giamminonni (luca.giamminonni at 4Science)
|
||||||
*
|
*
|
||||||
|
@@ -22,7 +22,7 @@ import org.dspace.eperson.EPerson;
|
|||||||
* @author Andrea Bollini (andrea.bollini at 4science.it)
|
* @author Andrea Bollini (andrea.bollini at 4science.it)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface QAEventsDao extends GenericDAO<QAEventProcessed> {
|
public interface QAEventsDAO extends GenericDAO<QAEventProcessed> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all the stored QAEventProcessed entities.
|
* Returns all the stored QAEventProcessed entities.
|
@@ -17,16 +17,16 @@ import org.dspace.content.QAEventProcessed;
|
|||||||
import org.dspace.core.AbstractHibernateDAO;
|
import org.dspace.core.AbstractHibernateDAO;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.dspace.eperson.EPerson;
|
import org.dspace.eperson.EPerson;
|
||||||
import org.dspace.qaevent.dao.QAEventsDao;
|
import org.dspace.qaevent.dao.QAEventsDAO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of {@link QAEventsDao} that store processed events using an
|
* Implementation of {@link QAEventsDAO} that store processed events using an
|
||||||
* SQL DBMS.
|
* SQL DBMS.
|
||||||
*
|
*
|
||||||
* @author Andrea Bollini (andrea.bollini at 4science.it)
|
* @author Andrea Bollini (andrea.bollini at 4science.it)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class QAEventsDaoImpl extends AbstractHibernateDAO<QAEventProcessed> implements QAEventsDao {
|
public class QAEventsDAOImpl extends AbstractHibernateDAO<QAEventProcessed> implements QAEventsDAO {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<QAEventProcessed> findAll(Context context) throws SQLException {
|
public List<QAEventProcessed> findAll(Context context) throws SQLException {
|
||||||
@@ -60,7 +60,7 @@ public class QAEventsDaoImpl extends AbstractHibernateDAO<QAEventProcessed> impl
|
|||||||
public List<QAEventProcessed> searchByEventId(Context context, String eventId, Integer start, Integer size)
|
public List<QAEventProcessed> searchByEventId(Context context, String eventId, Integer start, Integer size)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
Query query = createQuery(context,
|
Query query = createQuery(context,
|
||||||
"SELECT * " + "FROM QAEventProcessed qaevent WHERE qaevent.qaevent_id = :event_id ");
|
"SELECT * FROM QAEventProcessed qaevent WHERE qaevent.qaevent_id = :event_id ");
|
||||||
query.setFirstResult(start);
|
query.setFirstResult(start);
|
||||||
query.setMaxResults(size);
|
query.setMaxResults(size);
|
||||||
query.setParameter("event_id", eventId);
|
query.setParameter("event_id", eventId);
|
@@ -32,7 +32,7 @@ import org.dspace.content.QAEvent;
|
|||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.dspace.eperson.EPerson;
|
import org.dspace.eperson.EPerson;
|
||||||
import org.dspace.eperson.factory.EPersonServiceFactory;
|
import org.dspace.eperson.factory.EPersonServiceFactory;
|
||||||
import org.dspace.qaevent.service.BrokerClientFactory;
|
import org.dspace.qaevent.service.OpenaireClientFactory;
|
||||||
import org.dspace.qaevent.service.QAEventService;
|
import org.dspace.qaevent.service.QAEventService;
|
||||||
import org.dspace.scripts.DSpaceRunnable;
|
import org.dspace.scripts.DSpaceRunnable;
|
||||||
import org.dspace.services.ConfigurationService;
|
import org.dspace.services.ConfigurationService;
|
||||||
@@ -42,7 +42,9 @@ import org.dspace.utils.DSpace;
|
|||||||
/**
|
/**
|
||||||
* Implementation of {@link DSpaceRunnable} to perfom a QAEvents import from a
|
* Implementation of {@link DSpaceRunnable} to perfom a QAEvents import from a
|
||||||
* json file. The JSON file contains an array of JSON Events, where each event
|
* json file. The JSON file contains an array of JSON Events, where each event
|
||||||
* has the following structure
|
* has the following structure. The message attribute follows the structure
|
||||||
|
* documented at
|
||||||
|
* @see <a href="https://graph.openaire.eu/docs/category/entities" target="_blank"> see </a>
|
||||||
*
|
*
|
||||||
* <code> <br/>
|
* <code> <br/>
|
||||||
* { <br/>
|
* { <br/>
|
||||||
@@ -103,7 +105,7 @@ public class OpenaireEventsImport
|
|||||||
|
|
||||||
qaEventService = new DSpace().getSingletonService(QAEventService.class);
|
qaEventService = new DSpace().getSingletonService(QAEventService.class);
|
||||||
configurationService = DSpaceServicesFactory.getInstance().getConfigurationService();
|
configurationService = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||||
brokerClient = BrokerClientFactory.getInstance().getBrokerClient();
|
brokerClient = OpenaireClientFactory.getInstance().getBrokerClient();
|
||||||
|
|
||||||
topicsToImport = configurationService.getArrayProperty("qaevents.openaire.import.topic");
|
topicsToImport = configurationService.getArrayProperty("qaevents.openaire.import.topic");
|
||||||
openaireBrokerURL = getOpenaireBrokerUri();
|
openaireBrokerURL = getOpenaireBrokerUri();
|
||||||
|
@@ -54,12 +54,12 @@ public class OpenaireEventsImportScriptConfiguration<T extends OpenaireEventsImp
|
|||||||
if (options == null) {
|
if (options == null) {
|
||||||
Options options = new Options();
|
Options options = new Options();
|
||||||
|
|
||||||
options.addOption("f", "file", true, "Import data from OpenAIRE quality assurance broker JSON file."
|
options.addOption("f", "file", true, "Import data from Openaire quality assurance broker JSON file."
|
||||||
+ " This parameter is mutually exclusive to the email parameter.");
|
+ " This parameter is mutually exclusive to the email parameter.");
|
||||||
options.getOption("f").setType(InputStream.class);
|
options.getOption("f").setType(InputStream.class);
|
||||||
options.getOption("f").setRequired(false);
|
options.getOption("f").setRequired(false);
|
||||||
|
|
||||||
options.addOption("e", "email", true, "Email related to the subscriptions to import data from OpenAIRE "
|
options.addOption("e", "email", true, "Email related to the subscriptions to import data from Openaire "
|
||||||
+ "broker. This parameter is mutually exclusive to the file parameter.");
|
+ "broker. This parameter is mutually exclusive to the file parameter.");
|
||||||
options.getOption("e").setType(String.class);
|
options.getOption("e").setType(String.class);
|
||||||
options.getOption("e").setRequired(false);
|
options.getOption("e").setRequired(false);
|
||||||
|
@@ -16,7 +16,7 @@ import org.dspace.utils.DSpace;
|
|||||||
* @author Luca Giamminonni (luca.giamminonni at 4science.it)
|
* @author Luca Giamminonni (luca.giamminonni at 4science.it)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface BrokerClientFactory {
|
public interface OpenaireClientFactory {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an instance of the {@link BrokerClient}.
|
* Returns an instance of the {@link BrokerClient}.
|
||||||
@@ -25,7 +25,7 @@ public interface BrokerClientFactory {
|
|||||||
*/
|
*/
|
||||||
public BrokerClient getBrokerClient();
|
public BrokerClient getBrokerClient();
|
||||||
|
|
||||||
public static BrokerClientFactory getInstance() {
|
public static OpenaireClientFactory getInstance() {
|
||||||
return new DSpace().getServiceManager().getServiceByName("brokerClientFactory", BrokerClientFactory.class);
|
return new DSpace().getServiceManager().getServiceByName("openaireClientFactory", OpenaireClientFactory.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -24,6 +24,14 @@ import org.dspace.qaevent.QATopic;
|
|||||||
*/
|
*/
|
||||||
public interface QAEventService {
|
public interface QAEventService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find all the event's topics.
|
||||||
|
*
|
||||||
|
* @param offset the offset to apply
|
||||||
|
* @return the topics list
|
||||||
|
*/
|
||||||
|
public List<QATopic> findAllTopics(Context context, long offset, long count, String orderField, boolean ascending);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find all the event's topics related to the given source.
|
* Find all the event's topics related to the given source.
|
||||||
*
|
*
|
||||||
@@ -33,7 +41,8 @@ public interface QAEventService {
|
|||||||
* @param count the page size
|
* @param count the page size
|
||||||
* @return the topics list
|
* @return the topics list
|
||||||
*/
|
*/
|
||||||
public List<QATopic> findAllTopicsBySource(Context context, String source, long offset, int count);
|
public List<QATopic> findAllTopicsBySource(Context context, String source, long offset, long count,
|
||||||
|
String orderField, boolean ascending);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find a specific topic by its name, source and optionally a target.
|
* Find a specific topic by its name, source and optionally a target.
|
||||||
@@ -186,11 +195,13 @@ public interface QAEventService {
|
|||||||
* @param source (not null) the source to search for
|
* @param source (not null) the source to search for
|
||||||
* @param target the item referring to
|
* @param target the item referring to
|
||||||
* @param offset the offset to apply
|
* @param offset the offset to apply
|
||||||
* @param pageSize the page size
|
* @param count result count
|
||||||
|
* @param orderField field name for sorting
|
||||||
|
* @param ascending activate ascending sort
|
||||||
* @return the topics list
|
* @return the topics list
|
||||||
*/
|
*/
|
||||||
public List<QATopic> findAllTopicsBySourceAndTarget(Context context, String source, UUID target, long offset,
|
public List<QATopic> findAllTopicsBySourceAndTarget(Context context, String source, UUID target, long offset,
|
||||||
int pageSize);
|
long count, String orderField, boolean ascending);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Count all the event's topics related to the given source referring to a specific item
|
* Count all the event's topics related to the given source referring to a specific item
|
||||||
|
@@ -12,7 +12,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of {@link QAMessageDTO} that model message coming from OPENAIRE.
|
* Implementation of {@link QAMessageDTO} that model message coming from OPENAIRE.
|
||||||
*
|
* @see <a href="https://graph.openaire.eu/docs/category/entities" target="_blank"> see </a>
|
||||||
* @author Luca Giamminonni (luca.giamminonni at 4science.it)
|
* @author Luca Giamminonni (luca.giamminonni at 4science.it)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@@ -8,17 +8,17 @@
|
|||||||
package org.dspace.qaevent.service.impl;
|
package org.dspace.qaevent.service.impl;
|
||||||
|
|
||||||
import eu.dnetlib.broker.BrokerClient;
|
import eu.dnetlib.broker.BrokerClient;
|
||||||
import org.dspace.qaevent.service.BrokerClientFactory;
|
import org.dspace.qaevent.service.OpenaireClientFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of {@link BrokerClientFactory} that returns the instance of
|
* Implementation of {@link OpenaireClientFactory} that returns the instance of
|
||||||
* {@link BrokerClient} managed by the Spring context.
|
* {@link BrokerClient} managed by the Spring context.
|
||||||
*
|
*
|
||||||
* @author Luca Giamminonni (luca.giamminonni at 4science.it)
|
* @author Luca Giamminonni (luca.giamminonni at 4science.it)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class BrokerClientFactoryImpl implements BrokerClientFactory {
|
public class OpenaireClientFactoryImpl implements OpenaireClientFactory {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private BrokerClient brokerClient;
|
private BrokerClient brokerClient;
|
@@ -40,6 +40,7 @@ import org.apache.solr.client.solrj.response.QueryResponse;
|
|||||||
import org.apache.solr.common.SolrDocument;
|
import org.apache.solr.common.SolrDocument;
|
||||||
import org.apache.solr.common.SolrDocumentList;
|
import org.apache.solr.common.SolrDocumentList;
|
||||||
import org.apache.solr.common.SolrInputDocument;
|
import org.apache.solr.common.SolrInputDocument;
|
||||||
|
import org.apache.solr.common.params.FacetParams;
|
||||||
import org.dspace.content.Item;
|
import org.dspace.content.Item;
|
||||||
import org.dspace.content.QAEvent;
|
import org.dspace.content.QAEvent;
|
||||||
import org.dspace.content.service.ItemService;
|
import org.dspace.content.service.ItemService;
|
||||||
@@ -50,8 +51,8 @@ import org.dspace.qaevent.AutomaticProcessingAction;
|
|||||||
import org.dspace.qaevent.QAEventAutomaticProcessingEvaluation;
|
import org.dspace.qaevent.QAEventAutomaticProcessingEvaluation;
|
||||||
import org.dspace.qaevent.QASource;
|
import org.dspace.qaevent.QASource;
|
||||||
import org.dspace.qaevent.QATopic;
|
import org.dspace.qaevent.QATopic;
|
||||||
import org.dspace.qaevent.dao.QAEventsDao;
|
import org.dspace.qaevent.dao.QAEventsDAO;
|
||||||
import org.dspace.qaevent.dao.impl.QAEventsDaoImpl;
|
import org.dspace.qaevent.dao.impl.QAEventsDAOImpl;
|
||||||
import org.dspace.qaevent.service.QAEventActionService;
|
import org.dspace.qaevent.service.QAEventActionService;
|
||||||
import org.dspace.qaevent.service.QAEventSecurityService;
|
import org.dspace.qaevent.service.QAEventSecurityService;
|
||||||
import org.dspace.qaevent.service.QAEventService;
|
import org.dspace.qaevent.service.QAEventService;
|
||||||
@@ -60,11 +61,12 @@ import org.dspace.services.factory.DSpaceServicesFactory;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of {@link QAEventService} that use Solr to store events. When
|
* Implementation of {@link QAEventService} that use Solr to store events. When
|
||||||
* the user performs an action on the event (such as accepting the suggestion or
|
* the user performs an action on the event (such as accepting the suggestion or
|
||||||
* rejecting it) then the event is removed from solr and saved in the database
|
* rejecting it) then the event is removed from solr and saved in the database
|
||||||
* (see {@link QAEventsDao}) so that it is no longer proposed.
|
* (see {@link QAEventsDAO}) so that it is no longer proposed.
|
||||||
*
|
*
|
||||||
* @author Andrea Bollini (andrea.bollini at 4science.it)
|
* @author Andrea Bollini (andrea.bollini at 4science.it)
|
||||||
*
|
*
|
||||||
@@ -86,7 +88,7 @@ public class QAEventServiceImpl implements QAEventService {
|
|||||||
private HandleService handleService;
|
private HandleService handleService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private QAEventsDaoImpl qaEventsDao;
|
private QAEventsDAOImpl qaEventsDao;
|
||||||
|
|
||||||
@Autowired(required = false)
|
@Autowired(required = false)
|
||||||
@Qualifier("qaAutomaticProcessingMap")
|
@Qualifier("qaAutomaticProcessingMap")
|
||||||
@@ -240,19 +242,29 @@ public class QAEventServiceImpl implements QAEventService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<QATopic> findAllTopicsBySource(Context context, String source, long offset, int count) {
|
public List<QATopic> findAllTopics(Context context, long offset, long count, String orderField, boolean ascending) {
|
||||||
return findAllTopicsBySourceAndTarget(context, source, null, offset, count);
|
return findAllTopicsBySource(context, null, offset, count, orderField, ascending);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<QATopic> findAllTopicsBySource(Context context, String source, long offset,
|
||||||
|
long count, String orderField, boolean ascending) {
|
||||||
|
return findAllTopicsBySourceAndTarget(context, source, null, offset, count, orderField, ascending);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<QATopic> findAllTopicsBySourceAndTarget(Context context, String source, UUID target, long offset,
|
public List<QATopic> findAllTopicsBySourceAndTarget(Context context, String source, UUID target, long offset,
|
||||||
int count) {
|
long count, String orderField, boolean ascending) {
|
||||||
if (isNotSupportedSource(source)
|
if (isNotSupportedSource(source)
|
||||||
|| !qaSecurityService.canSeeSource(context, context.getCurrentUser(), source)) {
|
|| !qaSecurityService.canSeeSource(context, context.getCurrentUser(), source)) {
|
||||||
return List.of();
|
return List.of();
|
||||||
}
|
}
|
||||||
SolrQuery solrQuery = new SolrQuery();
|
SolrQuery solrQuery = new SolrQuery();
|
||||||
solrQuery.setRows(0);
|
solrQuery.setRows(0);
|
||||||
|
if (orderField != null) {
|
||||||
|
solrQuery.setSort(orderField, ascending ? ORDER.asc : ORDER.desc);
|
||||||
|
solrQuery.setFacetSort(FacetParams.FACET_SORT_INDEX);
|
||||||
|
}
|
||||||
Optional<String> securityQuery = qaSecurityService.generateQAEventFilterQuery(context,
|
Optional<String> securityQuery = qaSecurityService.generateQAEventFilterQuery(context,
|
||||||
context.getCurrentUser(), source);
|
context.getCurrentUser(), source);
|
||||||
solrQuery.setQuery(securityQuery.orElse("*:*"));
|
solrQuery.setQuery(securityQuery.orElse("*:*"));
|
||||||
|
@@ -1,19 +0,0 @@
|
|||||||
--
|
|
||||||
-- The contents of this file are subject to the license and copyright
|
|
||||||
-- detailed in the LICENSE and NOTICE files at the root of the source
|
|
||||||
-- tree and available online at
|
|
||||||
--
|
|
||||||
-- http://www.dspace.org/license/
|
|
||||||
--
|
|
||||||
|
|
||||||
CREATE TABLE qaevent_processed (
|
|
||||||
qaevent_id VARCHAR(255) NOT NULL,
|
|
||||||
qaevent_timestamp TIMESTAMP NULL,
|
|
||||||
eperson_uuid UUID NULL,
|
|
||||||
item_uuid UUID NULL,
|
|
||||||
CONSTRAINT qaevent_pk PRIMARY KEY (qaevent_id),
|
|
||||||
CONSTRAINT eperson_uuid_fkey FOREIGN KEY (eperson_uuid) REFERENCES eperson (uuid),
|
|
||||||
CONSTRAINT item_uuid_fkey FOREIGN KEY (item_uuid) REFERENCES item (uuid)
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE INDEX item_uuid_idx ON qaevent_processed(item_uuid);
|
|
@@ -7,7 +7,7 @@
|
|||||||
http://www.springframework.org/schema/util/spring-util.xsd"
|
http://www.springframework.org/schema/util/spring-util.xsd"
|
||||||
default-lazy-init="true">
|
default-lazy-init="true">
|
||||||
|
|
||||||
<bean id="mockOpenAIRERestConnector" class="org.dspace.external.MockOpenAIRERestConnector">
|
<bean id="mockOpenaireRestConnector" class="org.dspace.external.MockOpenaireRestConnector">
|
||||||
<constructor-arg value="${openaire.api.url:https://api.openaire.eu}"/>
|
<constructor-arg value="${openaire.api.url:https://api.openaire.eu}"/>
|
||||||
<property name="tokenEnabled" value="${openaire.token.enabled:false}"/>
|
<property name="tokenEnabled" value="${openaire.token.enabled:false}"/>
|
||||||
<property name="tokenServiceUrl" value="${openaire.token.url:https://aai.openaire.eu/oidc/token}"/>
|
<property name="tokenServiceUrl" value="${openaire.token.url:https://aai.openaire.eu/oidc/token}"/>
|
||||||
@@ -15,10 +15,10 @@
|
|||||||
<property name="clientSecret" value="${openaire.token.clientSecret}"/>
|
<property name="clientSecret" value="${openaire.token.clientSecret}"/>
|
||||||
</bean>
|
</bean>
|
||||||
<bean
|
<bean
|
||||||
class="org.dspace.external.provider.impl.OpenAIREFundingDataProvider"
|
class="org.dspace.external.provider.impl.OpenaireFundingDataProvider"
|
||||||
init-method="init">
|
init-method="init">
|
||||||
<property name="sourceIdentifier" value="openAIREFunding" />
|
<property name="sourceIdentifier" value="openaireFunding" />
|
||||||
<property name="connector" ref="mockOpenAIRERestConnector" />
|
<property name="connector" ref="mockOpenaireRestConnector" />
|
||||||
<property name="metadataFields" ref="mapOfmetadata"/>
|
<property name="metadataFields" ref="mapOfmetadata"/>
|
||||||
<property name="supportedEntityTypes">
|
<property name="supportedEntityTypes">
|
||||||
<list>
|
<list>
|
||||||
|
@@ -286,7 +286,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<!-- An example of an OpenAIRE compliance filter based on the same rules in xoai.xml
|
<!-- An example of an Openaire compliance filter based on the same rules in xoai.xml
|
||||||
some sub-statements are defined within this bean, and some are referenced from earlier definitions
|
some sub-statements are defined within this bean, and some are referenced from earlier definitions
|
||||||
-->
|
-->
|
||||||
<bean id="openaire_filter" class="org.dspace.content.logic.DefaultFilter">
|
<bean id="openaire_filter" class="org.dspace.content.logic.DefaultFilter">
|
||||||
@@ -329,7 +329,7 @@
|
|||||||
</list>
|
</list>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
<!-- AND the dc.relation is a valid OpenAIRE identifier
|
<!-- AND the dc.relation is a valid Openaire identifier
|
||||||
(starts with "info:eu-repo/grantAgreement/") -->
|
(starts with "info:eu-repo/grantAgreement/") -->
|
||||||
<bean id="has-openaire-relation_condition"
|
<bean id="has-openaire-relation_condition"
|
||||||
class="org.dspace.content.logic.condition.MetadataValueMatchCondition">
|
class="org.dspace.content.logic.condition.MetadataValueMatchCondition">
|
||||||
|
@@ -66,7 +66,7 @@
|
|||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="import-openaire-events" class="org.dspace.qaevent.script.OpenaireEventsImportCliScriptConfiguration" primary="true">
|
<bean id="import-openaire-events" class="org.dspace.qaevent.script.OpenaireEventsImportCliScriptConfiguration" primary="true">
|
||||||
<property name="description" value="Import new openAIRE quality assurance broker events"/>
|
<property name="description" value="Import new openaire quality assurance broker events"/>
|
||||||
<property name="dspaceRunnableClass" value="org.dspace.qaevent.script.OpenaireEventsImportCli"/>
|
<property name="dspaceRunnableClass" value="org.dspace.qaevent.script.OpenaireEventsImportCli"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
@@ -25,9 +25,21 @@ public class QAEventBuilder extends AbstractBuilder<QAEvent, QAEventService> {
|
|||||||
private Item item;
|
private Item item;
|
||||||
private QAEvent target;
|
private QAEvent target;
|
||||||
private String source = QAEvent.OPENAIRE_SOURCE;
|
private String source = QAEvent.OPENAIRE_SOURCE;
|
||||||
|
/**
|
||||||
|
* the title of the DSpace object
|
||||||
|
* */
|
||||||
private String title;
|
private String title;
|
||||||
|
/**
|
||||||
|
* the name of the Quality Assurance Event Topic
|
||||||
|
* */
|
||||||
private String topic;
|
private String topic;
|
||||||
|
/**
|
||||||
|
* thr original QA Event imported
|
||||||
|
* */
|
||||||
private String message;
|
private String message;
|
||||||
|
/**
|
||||||
|
* uuid of the targeted DSpace object
|
||||||
|
* */
|
||||||
private String relatedItem;
|
private String relatedItem;
|
||||||
private double trust = 0.5;
|
private double trust = 0.5;
|
||||||
private Date lastUpdate = new Date();
|
private Date lastUpdate = new Date();
|
||||||
|
@@ -1200,4 +1200,71 @@ public class CollectionTest extends AbstractDSpaceObjectTest {
|
|||||||
equalTo(owningCommunity));
|
equalTo(owningCommunity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test of retrieveCollectionWithSubmitByEntityType method getting the closest
|
||||||
|
* collection of non-item type starting from an item
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testRetrieveCollectionWithSubmitByEntityType() throws SQLException, AuthorizeException {
|
||||||
|
context.setDispatcher("default");
|
||||||
|
context.turnOffAuthorisationSystem();
|
||||||
|
Community com = communityService.create(null, context);
|
||||||
|
Group submitters = groupService.create(context);
|
||||||
|
Collection collection = collectionService.create(context, com);
|
||||||
|
collectionService.addMetadata(context, collection, "dspace", "entity", "type",
|
||||||
|
null, "Publication");
|
||||||
|
com.addCollection(collection);
|
||||||
|
WorkspaceItem workspaceItem = workspaceItemService.create(context, collection, false);
|
||||||
|
Item item = installItemService.installItem(context, workspaceItem);
|
||||||
|
EPerson epersonA = ePersonService.create(context);
|
||||||
|
Collection collectionPerson = collectionService.create(context, com);
|
||||||
|
collectionService.addMetadata(context, collectionPerson, "dspace", "entity", "type",
|
||||||
|
null, "Person");
|
||||||
|
collectionPerson.setSubmitters(submitters);
|
||||||
|
groupService.addMember(context, submitters, epersonA);
|
||||||
|
context.setCurrentUser(epersonA);
|
||||||
|
context.commit();
|
||||||
|
context.restoreAuthSystemState();
|
||||||
|
Collection resultCollection = collectionService.retrieveCollectionWithSubmitByEntityType
|
||||||
|
(context, item, "Person");
|
||||||
|
|
||||||
|
assertThat("testRetrieveCollectionWithSubmitByEntityType 0", resultCollection, notNullValue());
|
||||||
|
assertThat("testRetrieveCollectionWithSubmitByEntityType 1", resultCollection, equalTo(collectionPerson));
|
||||||
|
|
||||||
|
context.setDispatcher("exclude-discovery");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test of rretrieveCollectionWithSubmitByCommunityAndEntityType method getting the closest
|
||||||
|
* collection of non-community type starting from an community
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testRetrieveCollectionWithSubmitByCommunityAndEntityType() throws SQLException, AuthorizeException {
|
||||||
|
context.setDispatcher("default");
|
||||||
|
context.turnOffAuthorisationSystem();
|
||||||
|
Community com = communityService.create(null, context);
|
||||||
|
Group submitters = groupService.create(context);
|
||||||
|
Collection collection = collectionService.create(context, com);
|
||||||
|
collectionService.addMetadata(context, collection, "dspace", "entity", "type",
|
||||||
|
null, "Publication");
|
||||||
|
com.addCollection(collection);
|
||||||
|
WorkspaceItem workspaceItem = workspaceItemService.create(context, collection, false);
|
||||||
|
Item item = installItemService.installItem(context, workspaceItem);
|
||||||
|
EPerson epersonA = ePersonService.create(context);
|
||||||
|
Collection collectionPerson = collectionService.create(context, com);
|
||||||
|
collectionService.addMetadata(context, collectionPerson, "dspace", "entity", "type",
|
||||||
|
null, "Person");
|
||||||
|
collectionPerson.setSubmitters(submitters);
|
||||||
|
groupService.addMember(context, submitters, epersonA);
|
||||||
|
context.setCurrentUser(epersonA);
|
||||||
|
context.commit();
|
||||||
|
context.restoreAuthSystemState();
|
||||||
|
Collection resultCollection = collectionService.retrieveCollectionWithSubmitByCommunityAndEntityType
|
||||||
|
(context, com, "Person");
|
||||||
|
|
||||||
|
assertThat("testRetrieveCollectionWithSubmitByEntityType 0", resultCollection, notNullValue());
|
||||||
|
assertThat("testRetrieveCollectionWithSubmitByEntityType 1", resultCollection, equalTo(collectionPerson));
|
||||||
|
|
||||||
|
context.setDispatcher("exclude-discovery");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -14,15 +14,15 @@ import eu.openaire.jaxb.helper.OpenAIREHandler;
|
|||||||
import eu.openaire.jaxb.model.Response;
|
import eu.openaire.jaxb.model.Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mock the OpenAIRE rest connector for unit testing<br>
|
* Mock the Openaire rest connector for unit testing<br>
|
||||||
* will be resolved against static test xml files
|
* will be resolved against static test xml files
|
||||||
*
|
*
|
||||||
* @author pgraca
|
* @author pgraca
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class MockOpenAIRERestConnector extends OpenAIRERestConnector {
|
public class MockOpenaireRestConnector extends OpenaireRestConnector {
|
||||||
|
|
||||||
public MockOpenAIRERestConnector(String url) {
|
public MockOpenaireRestConnector(String url) {
|
||||||
super(url);
|
super(url);
|
||||||
}
|
}
|
||||||
|
|
@@ -23,15 +23,15 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit tests for OpenAIREFundingDataProvider
|
* Unit tests for OpenaireFundingDataProvider
|
||||||
*
|
*
|
||||||
* @author pgraca
|
* @author pgraca
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class OpenAIREFundingDataProviderTest extends AbstractDSpaceTest {
|
public class OpenaireFundingDataProviderTest extends AbstractDSpaceTest {
|
||||||
|
|
||||||
ExternalDataService externalDataService;
|
ExternalDataService externalDataService;
|
||||||
ExternalDataProvider openAIREFundingDataProvider;
|
ExternalDataProvider openaireFundingDataProvider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method will be run before every test as per @Before. It will initialize
|
* This method will be run before every test as per @Before. It will initialize
|
||||||
@@ -44,38 +44,38 @@ public class OpenAIREFundingDataProviderTest extends AbstractDSpaceTest {
|
|||||||
public void init() {
|
public void init() {
|
||||||
// Set up External Service Factory and set data providers
|
// Set up External Service Factory and set data providers
|
||||||
externalDataService = ExternalServiceFactory.getInstance().getExternalDataService();
|
externalDataService = ExternalServiceFactory.getInstance().getExternalDataService();
|
||||||
openAIREFundingDataProvider = externalDataService.getExternalDataProvider("openAIREFunding");
|
openaireFundingDataProvider = externalDataService.getExternalDataProvider("openaireFunding");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNumberOfResultsWSingleKeyword() {
|
public void testNumberOfResultsWSingleKeyword() {
|
||||||
assertNotNull("openAIREFundingDataProvider is not null", openAIREFundingDataProvider);
|
assertNotNull("openaireFundingDataProvider is not null", openaireFundingDataProvider);
|
||||||
assertEquals("openAIREFunding.numberOfResults.query:mock", 77,
|
assertEquals("openaireFunding.numberOfResults.query:mock", 77,
|
||||||
openAIREFundingDataProvider.getNumberOfResults("mock"));
|
openaireFundingDataProvider.getNumberOfResults("mock"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNumberOfResultsWKeywords() {
|
public void testNumberOfResultsWKeywords() {
|
||||||
assertNotNull("openAIREFundingDataProvider is not null", openAIREFundingDataProvider);
|
assertNotNull("openaireFundingDataProvider is not null", openaireFundingDataProvider);
|
||||||
assertEquals("openAIREFunding.numberOfResults.query:mock+test", 77,
|
assertEquals("openaireFunding.numberOfResults.query:mock+test", 77,
|
||||||
openAIREFundingDataProvider.getNumberOfResults("mock+test"));
|
openaireFundingDataProvider.getNumberOfResults("mock+test"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testQueryResultsWSingleKeyword() {
|
public void testQueryResultsWSingleKeyword() {
|
||||||
assertNotNull("openAIREFundingDataProvider is not null", openAIREFundingDataProvider);
|
assertNotNull("openaireFundingDataProvider is not null", openaireFundingDataProvider);
|
||||||
List<ExternalDataObject> results = openAIREFundingDataProvider.searchExternalDataObjects("mock", 0, 10);
|
List<ExternalDataObject> results = openaireFundingDataProvider.searchExternalDataObjects("mock", 0, 10);
|
||||||
assertEquals("openAIREFunding.searchExternalDataObjects.size", 10, results.size());
|
assertEquals("openaireFunding.searchExternalDataObjects.size", 10, results.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testQueryResultsWKeywords() {
|
public void testQueryResultsWKeywords() {
|
||||||
String value = "Mushroom Robo-Pic - Development of an autonomous robotic mushroom picking system";
|
String value = "Mushroom Robo-Pic - Development of an autonomous robotic mushroom picking system";
|
||||||
|
|
||||||
assertNotNull("openAIREFundingDataProvider is not null", openAIREFundingDataProvider);
|
assertNotNull("openaireFundingDataProvider is not null", openaireFundingDataProvider);
|
||||||
List<ExternalDataObject> results = openAIREFundingDataProvider.searchExternalDataObjects("mock+test", 0, 10);
|
List<ExternalDataObject> results = openaireFundingDataProvider.searchExternalDataObjects("mock+test", 0, 10);
|
||||||
assertEquals("openAIREFunding.searchExternalDataObjects.size", 10, results.size());
|
assertEquals("openaireFunding.searchExternalDataObjects.size", 10, results.size());
|
||||||
assertTrue("openAIREFunding.searchExternalDataObjects.first.value", value.equals(results.get(0).getValue()));
|
assertTrue("openaireFunding.searchExternalDataObjects.first.value", value.equals(results.get(0).getValue()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -84,22 +84,22 @@ public class OpenAIREFundingDataProviderTest extends AbstractDSpaceTest {
|
|||||||
String value = "Portuguese Wild Mushrooms: Chemical characterization and functional study"
|
String value = "Portuguese Wild Mushrooms: Chemical characterization and functional study"
|
||||||
+ " of antiproliferative and proapoptotic properties in cancer cell lines";
|
+ " of antiproliferative and proapoptotic properties in cancer cell lines";
|
||||||
|
|
||||||
assertNotNull("openAIREFundingDataProvider is not null", openAIREFundingDataProvider);
|
assertNotNull("openaireFundingDataProvider is not null", openaireFundingDataProvider);
|
||||||
|
|
||||||
Optional<ExternalDataObject> result = openAIREFundingDataProvider.getExternalDataObject(id);
|
Optional<ExternalDataObject> result = openaireFundingDataProvider.getExternalDataObject(id);
|
||||||
|
|
||||||
assertTrue("openAIREFunding.getExternalDataObject.exists", result.isPresent());
|
assertTrue("openaireFunding.getExternalDataObject.exists", result.isPresent());
|
||||||
assertTrue("openAIREFunding.getExternalDataObject.value", value.equals(result.get().getValue()));
|
assertTrue("openaireFunding.getExternalDataObject.value", value.equals(result.get().getValue()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetDataObjectWInvalidId() {
|
public void testGetDataObjectWInvalidId() {
|
||||||
String id = "WRONGID";
|
String id = "WRONGID";
|
||||||
|
|
||||||
assertNotNull("openAIREFundingDataProvider is not null", openAIREFundingDataProvider);
|
assertNotNull("openaireFundingDataProvider is not null", openaireFundingDataProvider);
|
||||||
|
|
||||||
Optional<ExternalDataObject> result = openAIREFundingDataProvider.getExternalDataObject(id);
|
Optional<ExternalDataObject> result = openaireFundingDataProvider.getExternalDataObject(id);
|
||||||
|
|
||||||
assertTrue("openAIREFunding.getExternalDataObject.notExists:WRONGID", result.isEmpty());
|
assertTrue("openaireFunding.getExternalDataObject.notExists:WRONGID", result.isEmpty());
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -50,9 +50,9 @@ import org.dspace.matcher.QASourceMatcher;
|
|||||||
import org.dspace.matcher.QATopicMatcher;
|
import org.dspace.matcher.QATopicMatcher;
|
||||||
import org.dspace.qaevent.QANotifyPatterns;
|
import org.dspace.qaevent.QANotifyPatterns;
|
||||||
import org.dspace.qaevent.QATopic;
|
import org.dspace.qaevent.QATopic;
|
||||||
import org.dspace.qaevent.service.BrokerClientFactory;
|
import org.dspace.qaevent.service.OpenaireClientFactory;
|
||||||
import org.dspace.qaevent.service.QAEventService;
|
import org.dspace.qaevent.service.QAEventService;
|
||||||
import org.dspace.qaevent.service.impl.BrokerClientFactoryImpl;
|
import org.dspace.qaevent.service.impl.OpenaireClientFactoryImpl;
|
||||||
import org.dspace.services.ConfigurationService;
|
import org.dspace.services.ConfigurationService;
|
||||||
import org.dspace.utils.DSpace;
|
import org.dspace.utils.DSpace;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
@@ -71,11 +71,13 @@ public class OpenaireEventsImportIT extends AbstractIntegrationTestWithDatabase
|
|||||||
|
|
||||||
private static final String BASE_JSON_DIR_PATH = "org/dspace/app/openaire-events/";
|
private static final String BASE_JSON_DIR_PATH = "org/dspace/app/openaire-events/";
|
||||||
|
|
||||||
|
private static final String ORDER_FIELD = "topic";
|
||||||
|
|
||||||
private QAEventService qaEventService = new DSpace().getSingletonService(QAEventService.class);
|
private QAEventService qaEventService = new DSpace().getSingletonService(QAEventService.class);
|
||||||
|
|
||||||
private Collection collection;
|
private Collection collection;
|
||||||
|
|
||||||
private BrokerClient brokerClient = BrokerClientFactory.getInstance().getBrokerClient();
|
private BrokerClient brokerClient = OpenaireClientFactory.getInstance().getBrokerClient();
|
||||||
|
|
||||||
private BrokerClient mockBrokerClient = mock(BrokerClient.class);
|
private BrokerClient mockBrokerClient = mock(BrokerClient.class);
|
||||||
|
|
||||||
@@ -101,12 +103,12 @@ public class OpenaireEventsImportIT extends AbstractIntegrationTestWithDatabase
|
|||||||
context.restoreAuthSystemState();
|
context.restoreAuthSystemState();
|
||||||
configurationService.setProperty("qaevent.sources", new String[]
|
configurationService.setProperty("qaevent.sources", new String[]
|
||||||
{ QAEvent.OPENAIRE_SOURCE });
|
{ QAEvent.OPENAIRE_SOURCE });
|
||||||
((BrokerClientFactoryImpl) BrokerClientFactory.getInstance()).setBrokerClient(mockBrokerClient);
|
((OpenaireClientFactoryImpl) OpenaireClientFactory.getInstance()).setBrokerClient(mockBrokerClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
public void after() {
|
public void after() {
|
||||||
((BrokerClientFactoryImpl) BrokerClientFactory.getInstance()).setBrokerClient(brokerClient);
|
((OpenaireClientFactoryImpl) OpenaireClientFactory.getInstance()).setBrokerClient(brokerClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -174,7 +176,8 @@ public class OpenaireEventsImportIT extends AbstractIntegrationTestWithDatabase
|
|||||||
hasItem(QASourceMatcher.with(OPENAIRE_SOURCE, 5L))
|
hasItem(QASourceMatcher.with(OPENAIRE_SOURCE, 5L))
|
||||||
);
|
);
|
||||||
|
|
||||||
List<QATopic> topicList = qaEventService.findAllTopicsBySource(context, OPENAIRE_SOURCE, 0, 20);
|
List<QATopic> topicList = qaEventService.findAllTopicsBySource(context, OPENAIRE_SOURCE, 0, 20,
|
||||||
|
ORDER_FIELD, false);
|
||||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PROJECT, 1L)));
|
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PROJECT, 1L)));
|
||||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PID, 1L)));
|
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PID, 1L)));
|
||||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID, 1L)));
|
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID, 1L)));
|
||||||
@@ -235,7 +238,8 @@ public class OpenaireEventsImportIT extends AbstractIntegrationTestWithDatabase
|
|||||||
|
|
||||||
assertThat(qaEventService.findAllSources(context, 0, 20), hasItem(QASourceMatcher.with(OPENAIRE_SOURCE, 3L)));
|
assertThat(qaEventService.findAllSources(context, 0, 20), hasItem(QASourceMatcher.with(OPENAIRE_SOURCE, 3L)));
|
||||||
|
|
||||||
List<QATopic> topicList = qaEventService.findAllTopicsBySource(context, OPENAIRE_SOURCE, 0, 20);
|
List<QATopic> topicList = qaEventService.findAllTopicsBySource(context, OPENAIRE_SOURCE, 0, 20,
|
||||||
|
ORDER_FIELD, false);
|
||||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 1L)));
|
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 1L)));
|
||||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_PROJECT, 1L)));
|
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_PROJECT, 1L)));
|
||||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PID, 1L)));
|
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PID, 1L)));
|
||||||
@@ -276,7 +280,7 @@ public class OpenaireEventsImportIT extends AbstractIntegrationTestWithDatabase
|
|||||||
|
|
||||||
assertThat(qaEventService.findAllSources(context, 0, 20), hasItem(QASourceMatcher.with(OPENAIRE_SOURCE, 1L)));
|
assertThat(qaEventService.findAllSources(context, 0, 20), hasItem(QASourceMatcher.with(OPENAIRE_SOURCE, 1L)));
|
||||||
|
|
||||||
assertThat(qaEventService.findAllTopicsBySource(context, OPENAIRE_SOURCE, 0, 20),
|
assertThat(qaEventService.findAllTopicsBySource(context, OPENAIRE_SOURCE, 0, 20, ORDER_FIELD, false),
|
||||||
contains(QATopicMatcher.with(org.dspace.qaevent.QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 1L)));
|
contains(QATopicMatcher.with(org.dspace.qaevent.QANotifyPatterns.TOPIC_ENRICH_MISSING_ABSTRACT, 1L)));
|
||||||
|
|
||||||
String abstractMessage = "{\"abstracts[0]\":\"Missing Abstract\"}";
|
String abstractMessage = "{\"abstracts[0]\":\"Missing Abstract\"}";
|
||||||
@@ -306,7 +310,7 @@ public class OpenaireEventsImportIT extends AbstractIntegrationTestWithDatabase
|
|||||||
|
|
||||||
assertThat(qaEventService.findAllSources(context, 0, 20), hasItem(QASourceMatcher.with(OPENAIRE_SOURCE, 0L)));
|
assertThat(qaEventService.findAllSources(context, 0, 20), hasItem(QASourceMatcher.with(OPENAIRE_SOURCE, 0L)));
|
||||||
|
|
||||||
assertThat(qaEventService.findAllTopicsBySource(context, OPENAIRE_SOURCE, 0, 20), empty());
|
assertThat(qaEventService.findAllTopicsBySource(context, OPENAIRE_SOURCE, 0, 20, ORDER_FIELD, false), empty());
|
||||||
|
|
||||||
verifyNoInteractions(mockBrokerClient);
|
verifyNoInteractions(mockBrokerClient);
|
||||||
}
|
}
|
||||||
@@ -353,7 +357,8 @@ public class OpenaireEventsImportIT extends AbstractIntegrationTestWithDatabase
|
|||||||
|
|
||||||
assertThat(qaEventService.findAllSources(context, 0, 20), hasItem(QASourceMatcher.with(OPENAIRE_SOURCE, 6L)));
|
assertThat(qaEventService.findAllSources(context, 0, 20), hasItem(QASourceMatcher.with(OPENAIRE_SOURCE, 6L)));
|
||||||
|
|
||||||
List<QATopic> topicList = qaEventService.findAllTopicsBySource(context, OPENAIRE_SOURCE, 0, 20);
|
List<QATopic> topicList = qaEventService.findAllTopicsBySource(context, OPENAIRE_SOURCE, 0, 20,
|
||||||
|
ORDER_FIELD, false);
|
||||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PROJECT, 1L)));
|
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PROJECT, 1L)));
|
||||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PID, 1L)));
|
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PID, 1L)));
|
||||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID, 1L)));
|
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID, 1L)));
|
||||||
@@ -412,7 +417,7 @@ public class OpenaireEventsImportIT extends AbstractIntegrationTestWithDatabase
|
|||||||
|
|
||||||
assertThat(qaEventService.findAllSources(context, 0, 20), hasItem(QASourceMatcher.with(OPENAIRE_SOURCE, 0L)));
|
assertThat(qaEventService.findAllSources(context, 0, 20), hasItem(QASourceMatcher.with(OPENAIRE_SOURCE, 0L)));
|
||||||
|
|
||||||
assertThat(qaEventService.findAllTopicsBySource(context, OPENAIRE_SOURCE, 0, 20), empty());
|
assertThat(qaEventService.findAllTopicsBySource(context, OPENAIRE_SOURCE, 0, 20, ORDER_FIELD, false), empty());
|
||||||
|
|
||||||
verify(mockBrokerClient).listSubscriptions(openaireURL, "user@test.com");
|
verify(mockBrokerClient).listSubscriptions(openaireURL, "user@test.com");
|
||||||
|
|
||||||
@@ -463,7 +468,8 @@ public class OpenaireEventsImportIT extends AbstractIntegrationTestWithDatabase
|
|||||||
|
|
||||||
assertThat(qaEventService.findAllSources(context, 0, 20), hasItem(QASourceMatcher.with(OPENAIRE_SOURCE, 6L)));
|
assertThat(qaEventService.findAllSources(context, 0, 20), hasItem(QASourceMatcher.with(OPENAIRE_SOURCE, 6L)));
|
||||||
|
|
||||||
List<QATopic> topicList = qaEventService.findAllTopicsBySource(context, OPENAIRE_SOURCE, 0, 20);
|
List<QATopic> topicList = qaEventService.findAllTopicsBySource(context, OPENAIRE_SOURCE, 0, 20,
|
||||||
|
ORDER_FIELD, false);
|
||||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PROJECT, 1L)));
|
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PROJECT, 1L)));
|
||||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID, 1L)));
|
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MISSING_PID, 1L)));
|
||||||
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PID, 1L)));
|
assertThat(topicList, hasItem(QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_PID, 1L)));
|
||||||
@@ -505,7 +511,8 @@ public class OpenaireEventsImportIT extends AbstractIntegrationTestWithDatabase
|
|||||||
String[] args = new String[] { "import-openaire-events", "-f", getFileLocation("event-more-review.json") };
|
String[] args = new String[] { "import-openaire-events", "-f", getFileLocation("event-more-review.json") };
|
||||||
ScriptLauncher.handleScript(args, ScriptLauncher.getConfig(kernelImpl), handler, kernelImpl);
|
ScriptLauncher.handleScript(args, ScriptLauncher.getConfig(kernelImpl), handler, kernelImpl);
|
||||||
|
|
||||||
assertThat(qaEventService.findAllTopicsBySource(context, COAR_NOTIFY_SOURCE, 0, 20), contains(
|
assertThat(qaEventService.findAllTopicsBySource(context, COAR_NOTIFY_SOURCE, 0, 20,
|
||||||
|
ORDER_FIELD, false), contains(
|
||||||
QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_REVIEW, 1L)));
|
QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_REVIEW, 1L)));
|
||||||
|
|
||||||
assertThat(qaEventService.findAllSources(context, 0, 20),
|
assertThat(qaEventService.findAllSources(context, 0, 20),
|
||||||
|
@@ -1093,6 +1093,17 @@ public class RestResourceController implements InitializingBean {
|
|||||||
return uriComponentsBuilder.encode().build().toString();
|
return uriComponentsBuilder.encode().build().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method to delete an entity by ID
|
||||||
|
* Note that the regular expression in the request mapping accept a number as identifier;
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param apiCategory
|
||||||
|
* @param model
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
* @throws HttpRequestMethodNotSupportedException
|
||||||
|
*/
|
||||||
@RequestMapping(method = RequestMethod.DELETE, value = REGEX_REQUESTMAPPING_IDENTIFIER_AS_DIGIT)
|
@RequestMapping(method = RequestMethod.DELETE, value = REGEX_REQUESTMAPPING_IDENTIFIER_AS_DIGIT)
|
||||||
public ResponseEntity<RepresentationModel<?>> delete(HttpServletRequest request, @PathVariable String apiCategory,
|
public ResponseEntity<RepresentationModel<?>> delete(HttpServletRequest request, @PathVariable String apiCategory,
|
||||||
@PathVariable String model, @PathVariable Integer id)
|
@PathVariable String model, @PathVariable Integer id)
|
||||||
|
@@ -0,0 +1,46 @@
|
|||||||
|
/**
|
||||||
|
* The contents of this file are subject to the license and copyright
|
||||||
|
* detailed in the LICENSE and NOTICE files at the root of the source
|
||||||
|
* tree and available online at
|
||||||
|
*
|
||||||
|
* http://www.dspace.org/license/
|
||||||
|
*/
|
||||||
|
package org.dspace.app.rest.authorization.impl;
|
||||||
|
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
import org.dspace.app.rest.authorization.AuthorizationFeature;
|
||||||
|
import org.dspace.app.rest.authorization.AuthorizationFeatureDocumentation;
|
||||||
|
import org.dspace.app.rest.model.BaseObjectRest;
|
||||||
|
import org.dspace.app.rest.model.SiteRest;
|
||||||
|
import org.dspace.core.Context;
|
||||||
|
import org.dspace.services.ConfigurationService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The QA Event feature. It can be used to verify if Quality Assurance can be seen.
|
||||||
|
*
|
||||||
|
* Authorization is granted if the current user has READ permissions on the given bitstream.
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AuthorizationFeatureDocumentation(name = QAAuthorizationFeature.NAME,
|
||||||
|
description = "It can be used to verify if the user can manage Quality Assurance events")
|
||||||
|
public class QAAuthorizationFeature implements AuthorizationFeature {
|
||||||
|
public final static String NAME = "canSeeQA";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ConfigurationService configurationService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAuthorized(Context context, BaseObjectRest object) throws SQLException {
|
||||||
|
return configurationService.getBooleanProperty("qaevents.enabled", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getSupportedTypes() {
|
||||||
|
return new String[]{
|
||||||
|
SiteRest.CATEGORY + "." + SiteRest.NAME
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
@@ -24,7 +24,7 @@ import org.dspace.content.QAEvent;
|
|||||||
import org.dspace.content.service.ItemService;
|
import org.dspace.content.service.ItemService;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.dspace.eperson.EPerson;
|
import org.dspace.eperson.EPerson;
|
||||||
import org.dspace.qaevent.dao.QAEventsDao;
|
import org.dspace.qaevent.dao.QAEventsDAO;
|
||||||
import org.dspace.qaevent.service.QAEventService;
|
import org.dspace.qaevent.service.QAEventService;
|
||||||
import org.dspace.util.UUIDUtils;
|
import org.dspace.util.UUIDUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -48,7 +48,7 @@ public class QAEventRestRepository extends DSpaceRestRepository<QAEventRest, Str
|
|||||||
private QAEventService qaEventService;
|
private QAEventService qaEventService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private QAEventsDao qaEventDao;
|
private QAEventsDAO qaEventDao;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ItemService itemService;
|
private ItemService itemService;
|
||||||
|
@@ -22,6 +22,7 @@ import org.dspace.qaevent.service.QAEventService;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.data.domain.Sort.Direction;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@@ -34,6 +35,8 @@ import org.springframework.stereotype.Component;
|
|||||||
@Component(QATopicRest.CATEGORY + "." + QATopicRest.NAME)
|
@Component(QATopicRest.CATEGORY + "." + QATopicRest.NAME)
|
||||||
public class QATopicRestRepository extends DSpaceRestRepository<QATopicRest, String> {
|
public class QATopicRestRepository extends DSpaceRestRepository<QATopicRest, String> {
|
||||||
|
|
||||||
|
final static String ORDER_FIELD = "topic";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private QAEventService qaEventService;
|
private QAEventService qaEventService;
|
||||||
|
|
||||||
@@ -66,9 +69,14 @@ public class QATopicRestRepository extends DSpaceRestRepository<QATopicRest, Str
|
|||||||
public Page<QATopicRest> findBySource(@Parameter(value = "source", required = true) String source,
|
public Page<QATopicRest> findBySource(@Parameter(value = "source", required = true) String source,
|
||||||
Pageable pageable) {
|
Pageable pageable) {
|
||||||
Context context = obtainContext();
|
Context context = obtainContext();
|
||||||
List<QATopic> topics = qaEventService.findAllTopicsBySource(context, source,
|
|
||||||
pageable.getOffset(), pageable.getPageSize());
|
|
||||||
long count = qaEventService.countTopicsBySource(context, source);
|
long count = qaEventService.countTopicsBySource(context, source);
|
||||||
|
boolean ascending = false;
|
||||||
|
if (pageable.getSort() != null && pageable.getSort().getOrderFor(ORDER_FIELD) != null) {
|
||||||
|
ascending = pageable.getSort()
|
||||||
|
.getOrderFor(ORDER_FIELD).getDirection() == Direction.ASC;
|
||||||
|
}
|
||||||
|
List<QATopic> topics = qaEventService.findAllTopics(context, pageable.getOffset(), pageable.getPageSize(),
|
||||||
|
ORDER_FIELD, ascending);
|
||||||
if (topics == null) {
|
if (topics == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -82,8 +90,10 @@ public class QATopicRestRepository extends DSpaceRestRepository<QATopicRest, Str
|
|||||||
Pageable pageable) {
|
Pageable pageable) {
|
||||||
Context context = obtainContext();
|
Context context = obtainContext();
|
||||||
List<QATopic> topics = qaEventService
|
List<QATopic> topics = qaEventService
|
||||||
.findAllTopicsBySourceAndTarget(context, source, target, pageable.getOffset(), pageable.getPageSize());
|
.findAllTopicsBySourceAndTarget(context, source, target, pageable.getOffset(),
|
||||||
|
pageable.getPageSize(), null, true);
|
||||||
long count = qaEventService.countTopicsBySourceAndTarget(context, source, target);
|
long count = qaEventService.countTopicsBySourceAndTarget(context, source, target);
|
||||||
|
|
||||||
if (topics == null) {
|
if (topics == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@@ -135,28 +135,28 @@
|
|||||||
<heading>fake.workflow.readonly</heading> <processing-class>org.dspace.submit.step.SampleStep</processing-class>
|
<heading>fake.workflow.readonly</heading> <processing-class>org.dspace.submit.step.SampleStep</processing-class>
|
||||||
<type>sample</type> <scope visibility="read-only">workflow</scope> </step-definition> -->
|
<type>sample</type> <scope visibility="read-only">workflow</scope> </step-definition> -->
|
||||||
|
|
||||||
<!-- OpenAIRE submission steps/forms -->
|
<!-- Openaire submission steps/forms -->
|
||||||
<step-definition id="openAIREProjectForm" mandatory="true">
|
<step-definition id="openaireProjectForm" mandatory="true">
|
||||||
<heading>submit.progressbar.describe.stepone</heading>
|
<heading>submit.progressbar.describe.stepone</heading>
|
||||||
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
||||||
<type>submission-form</type>
|
<type>submission-form</type>
|
||||||
</step-definition>
|
</step-definition>
|
||||||
<step-definition id="openAIREPersonForm" mandatory="true">
|
<step-definition id="openairePersonForm" mandatory="true">
|
||||||
<heading>submit.progressbar.describe.stepone</heading>
|
<heading>submit.progressbar.describe.stepone</heading>
|
||||||
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
||||||
<type>submission-form</type>
|
<type>submission-form</type>
|
||||||
</step-definition>
|
</step-definition>
|
||||||
<step-definition id="openAIREOrganizationForm" mandatory="true">
|
<step-definition id="openaireOrganizationForm" mandatory="true">
|
||||||
<heading>submit.progressbar.describe.stepone</heading>
|
<heading>submit.progressbar.describe.stepone</heading>
|
||||||
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
||||||
<type>submission-form</type>
|
<type>submission-form</type>
|
||||||
</step-definition>
|
</step-definition>
|
||||||
<step-definition id="openAIREPublicationPageoneForm" mandatory="true">
|
<step-definition id="openairePublicationPageoneForm" mandatory="true">
|
||||||
<heading>submit.progressbar.describe.stepone</heading>
|
<heading>submit.progressbar.describe.stepone</heading>
|
||||||
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
||||||
<type>submission-form</type>
|
<type>submission-form</type>
|
||||||
</step-definition>
|
</step-definition>
|
||||||
<step-definition id="openAIREPublicationPagetwoForm" mandatory="true">
|
<step-definition id="openairePublicationPagetwoForm" mandatory="true">
|
||||||
<heading>submit.progressbar.describe.stepone</heading>
|
<heading>submit.progressbar.describe.stepone</heading>
|
||||||
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
||||||
<type>submission-form</type>
|
<type>submission-form</type>
|
||||||
@@ -259,13 +259,13 @@
|
|||||||
<step id="license"/>
|
<step id="license"/>
|
||||||
</submission-process>
|
</submission-process>
|
||||||
|
|
||||||
<!-- OpenAIRE submission processes -->
|
<!-- Openaire submission processes -->
|
||||||
<submission-process name="openAIREPublicationSubmission">
|
<submission-process name="openairePublicationSubmission">
|
||||||
<step id="collection"/>
|
<step id="collection"/>
|
||||||
|
|
||||||
<!--Step will be to Describe the item. -->
|
<!--Step will be to Describe the item. -->
|
||||||
<step id="openAIREPublicationPageoneForm"/>
|
<step id="openairePublicationPageoneForm"/>
|
||||||
<step id="openAIREPublicationPagetwoForm"/>
|
<step id="openairePublicationPagetwoForm"/>
|
||||||
|
|
||||||
<!--Step will be to Upload the item -->
|
<!--Step will be to Upload the item -->
|
||||||
<!-- step id="upload-with-embargo"/-->
|
<!-- step id="upload-with-embargo"/-->
|
||||||
@@ -274,17 +274,17 @@
|
|||||||
<!--Step will be to Sign off on the License -->
|
<!--Step will be to Sign off on the License -->
|
||||||
<step id="license"/>
|
<step id="license"/>
|
||||||
</submission-process>
|
</submission-process>
|
||||||
<submission-process name="openAIREPersonSubmission">
|
<submission-process name="openairePersonSubmission">
|
||||||
<step id="collection"/>
|
<step id="collection"/>
|
||||||
<step id="openAIREPersonForm"/>
|
<step id="openairePersonForm"/>
|
||||||
</submission-process>
|
</submission-process>
|
||||||
<submission-process name="openAIREProjectSubmission">
|
<submission-process name="openaireProjectSubmission">
|
||||||
<step id="collection"/>
|
<step id="collection"/>
|
||||||
<step id="openAIREProjectForm"/>
|
<step id="openaireProjectForm"/>
|
||||||
</submission-process>
|
</submission-process>
|
||||||
<submission-process name="openAIREOrganizationSubmission">
|
<submission-process name="openaireOrganizationSubmission">
|
||||||
<step id="collection"/>
|
<step id="collection"/>
|
||||||
<step id="openAIREOrganizationForm"/>
|
<step id="openaireOrganizationForm"/>
|
||||||
</submission-process>
|
</submission-process>
|
||||||
</submission-definitions>
|
</submission-definitions>
|
||||||
|
|
||||||
|
@@ -4,8 +4,8 @@
|
|||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"
|
||||||
default-lazy-init="true">
|
default-lazy-init="true">
|
||||||
|
|
||||||
<bean id="openAIRERestConnector"
|
<bean id="openaireRestConnector"
|
||||||
class="org.dspace.external.OpenAIRERestConnector">
|
class="org.dspace.external.OpenaireRestConnector">
|
||||||
<constructor-arg
|
<constructor-arg
|
||||||
value="${openaire.api.url:https://api.openaire.eu}" />
|
value="${openaire.api.url:https://api.openaire.eu}" />
|
||||||
<property name="tokenEnabled"
|
<property name="tokenEnabled"
|
||||||
@@ -18,10 +18,10 @@
|
|||||||
value="${openaire.token.clientSecret}" />
|
value="${openaire.token.clientSecret}" />
|
||||||
</bean>
|
</bean>
|
||||||
<bean
|
<bean
|
||||||
class="org.dspace.external.provider.impl.MockOpenAIREFundingDataProvider"
|
class="org.dspace.external.provider.impl.MockOpenaireFundingDataProvider"
|
||||||
init-method="init">
|
init-method="init">
|
||||||
<property name="sourceIdentifier" value="openAIREFunding" />
|
<property name="sourceIdentifier" value="openaireFunding" />
|
||||||
<property name="connector" ref="openAIRERestConnector" />
|
<property name="connector" ref="openaireRestConnector" />
|
||||||
<property name="supportedEntityTypes">
|
<property name="supportedEntityTypes">
|
||||||
<list>
|
<list>
|
||||||
<value>Project</value>
|
<value>Project</value>
|
||||||
|
@@ -86,8 +86,8 @@
|
|||||||
|
|
||||||
<!-- search for an entity that can be a Person or an OrgUnit -->
|
<!-- search for an entity that can be a Person or an OrgUnit -->
|
||||||
<entry key="personOrOrgunit" value-ref="personOrOrgunit"/>
|
<entry key="personOrOrgunit" value-ref="personOrOrgunit"/>
|
||||||
<!-- OpenAIRE4 guidelines - search for an OrgUnit that have a specific dc.type=FundingOrganization -->
|
<!-- Openaire4 guidelines - search for an OrgUnit that have a specific dc.type=FundingOrganization -->
|
||||||
<entry key="openAIREFundingAgency" value-ref="openAIREFundingAgency"/>
|
<entry key="openaireFundingAgency" value-ref="openaireFundingAgency"/>
|
||||||
<entry key="eperson_claims" value-ref="eperson_claims"/>
|
<entry key="eperson_claims" value-ref="eperson_claims"/>
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1057,8 +1057,8 @@ public class DiscoveryVersioningIT extends AbstractControllerIntegrationTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test_discoveryXml_openAIREFundingAgency_expectLatestVersionsOnly() throws Exception {
|
public void test_discoveryXml_openaireFundingAgency_expectLatestVersionsOnly() throws Exception {
|
||||||
final String configuration = "openAIREFundingAgency";
|
final String configuration = "openaireFundingAgency";
|
||||||
|
|
||||||
|
|
||||||
Collection collection = createCollection("OrgUnit");
|
Collection collection = createCollection("OrgUnit");
|
||||||
|
@@ -52,7 +52,7 @@ public class ExternalSourcesRestControllerIT extends AbstractControllerIntegrati
|
|||||||
ExternalSourceMatcher.matchExternalSource(
|
ExternalSourceMatcher.matchExternalSource(
|
||||||
"pubmed", "pubmed", false),
|
"pubmed", "pubmed", false),
|
||||||
ExternalSourceMatcher.matchExternalSource(
|
ExternalSourceMatcher.matchExternalSource(
|
||||||
"openAIREFunding", "openAIREFunding", false)
|
"openaireFunding", "openaireFunding", false)
|
||||||
)))
|
)))
|
||||||
.andExpect(jsonPath("$.page.totalElements", Matchers.is(11)));
|
.andExpect(jsonPath("$.page.totalElements", Matchers.is(11)));
|
||||||
}
|
}
|
||||||
|
@@ -130,7 +130,7 @@ public class LDNInboxControllerIT extends AbstractControllerIntegrationTest {
|
|||||||
assertThat(qaEventService.findAllSources(context, 0, 20),
|
assertThat(qaEventService.findAllSources(context, 0, 20),
|
||||||
hasItem(QASourceMatcher.with(COAR_NOTIFY_SOURCE, 1L)));
|
hasItem(QASourceMatcher.with(COAR_NOTIFY_SOURCE, 1L)));
|
||||||
|
|
||||||
assertThat(qaEventService.findAllTopicsBySource(context, COAR_NOTIFY_SOURCE, 0, 20), hasItem(
|
assertThat(qaEventService.findAllTopicsBySource(context, COAR_NOTIFY_SOURCE, 0, 20, "topic", true), hasItem(
|
||||||
QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_REVIEW, 1L)));
|
QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_REVIEW, 1L)));
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -237,7 +237,7 @@ public class LDNInboxControllerIT extends AbstractControllerIntegrationTest {
|
|||||||
assertThat(qaEventService.findAllSources(context, 0, 20),
|
assertThat(qaEventService.findAllSources(context, 0, 20),
|
||||||
hasItem(QASourceMatcher.with(COAR_NOTIFY_SOURCE, 1L)));
|
hasItem(QASourceMatcher.with(COAR_NOTIFY_SOURCE, 1L)));
|
||||||
|
|
||||||
assertThat(qaEventService.findAllTopicsBySource(context, COAR_NOTIFY_SOURCE, 0, 20), hasItem(
|
assertThat(qaEventService.findAllTopicsBySource(context, COAR_NOTIFY_SOURCE, 0, 20, "topic", true), hasItem(
|
||||||
QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_LINK, 1L)));
|
QATopicMatcher.with(QANotifyPatterns.TOPIC_ENRICH_MORE_LINK, 1L)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -19,7 +19,7 @@ import org.dspace.app.rest.test.AbstractControllerIntegrationTest;
|
|||||||
import org.hamcrest.Matchers;
|
import org.hamcrest.Matchers;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
public class OpenAIREFundingExternalSourcesIT extends AbstractControllerIntegrationTest {
|
public class OpenaireFundingExternalSourcesIT extends AbstractControllerIntegrationTest {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test openaire funding external source
|
* Test openaire funding external source
|
||||||
@@ -27,10 +27,10 @@ public class OpenAIREFundingExternalSourcesIT extends AbstractControllerIntegrat
|
|||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void findOneOpenAIREFundingExternalSourceTest() throws Exception {
|
public void findOneOpenaireFundingExternalSourceTest() throws Exception {
|
||||||
getClient().perform(get("/api/integration/externalsources")).andExpect(status().isOk())
|
getClient().perform(get("/api/integration/externalsources")).andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$._embedded.externalsources", Matchers.hasItem(
|
.andExpect(jsonPath("$._embedded.externalsources", Matchers.hasItem(
|
||||||
ExternalSourceMatcher.matchExternalSource("openAIREFunding", "openAIREFunding", false))));
|
ExternalSourceMatcher.matchExternalSource("openaireFunding", "openaireFunding", false))));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -39,9 +39,9 @@ public class OpenAIREFundingExternalSourcesIT extends AbstractControllerIntegrat
|
|||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void findOneOpenAIREFundingExternalSourceEntriesEmptyWithQueryTest() throws Exception {
|
public void findOneOpenaireFundingExternalSourceEntriesEmptyWithQueryTest() throws Exception {
|
||||||
|
|
||||||
getClient().perform(get("/api/integration/externalsources/openAIREFunding/entries").param("query", "empty"))
|
getClient().perform(get("/api/integration/externalsources/openaireFunding/entries").param("query", "empty"))
|
||||||
.andExpect(status().isOk()).andExpect(jsonPath("$.page.number", is(0)));
|
.andExpect(status().isOk()).andExpect(jsonPath("$.page.number", is(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,11 +52,11 @@ public class OpenAIREFundingExternalSourcesIT extends AbstractControllerIntegrat
|
|||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void findOneOpenAIREFundingExternalSourceEntriesWithQueryMultipleKeywordsTest() throws Exception {
|
public void findOneOpenaireFundingExternalSourceEntriesWithQueryMultipleKeywordsTest() throws Exception {
|
||||||
|
|
||||||
getClient()
|
getClient()
|
||||||
.perform(
|
.perform(
|
||||||
get("/api/integration/externalsources/openAIREFunding/entries").param("query", "empty+results"))
|
get("/api/integration/externalsources/openaireFunding/entries").param("query", "empty+results"))
|
||||||
.andExpect(status().isOk()).andExpect(jsonPath("$.page.number", is(0)));
|
.andExpect(status().isOk()).andExpect(jsonPath("$.page.number", is(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,14 +66,14 @@ public class OpenAIREFundingExternalSourcesIT extends AbstractControllerIntegrat
|
|||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void findOneOpenAIREFundingExternalSourceEntriesWithQueryTest() throws Exception {
|
public void findOneOpenaireFundingExternalSourceEntriesWithQueryTest() throws Exception {
|
||||||
getClient().perform(get("/api/integration/externalsources/openAIREFunding/entries").param("query", "mushroom"))
|
getClient().perform(get("/api/integration/externalsources/openaireFunding/entries").param("query", "mushroom"))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$._embedded.externalSourceEntries",
|
.andExpect(jsonPath("$._embedded.externalSourceEntries",
|
||||||
Matchers.hasItem(ExternalSourceEntryMatcher.matchExternalSourceEntry(
|
Matchers.hasItem(ExternalSourceEntryMatcher.matchExternalSourceEntry(
|
||||||
"aW5mbzpldS1yZXBvL2dyYW50QWdyZWVtZW50L05XTy8rLzIzMDAxNDc3MjgvTkw=",
|
"aW5mbzpldS1yZXBvL2dyYW50QWdyZWVtZW50L05XTy8rLzIzMDAxNDc3MjgvTkw=",
|
||||||
"Master switches of initiation of mushroom formation",
|
"Master switches of initiation of mushroom formation",
|
||||||
"Master switches of initiation of mushroom formation", "openAIREFunding"))));
|
"Master switches of initiation of mushroom formation", "openaireFunding"))));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,19 +83,19 @@ public class OpenAIREFundingExternalSourcesIT extends AbstractControllerIntegrat
|
|||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void findOneOpenAIREFundingExternalSourceEntryValueTest() throws Exception {
|
public void findOneOpenaireFundingExternalSourceEntryValueTest() throws Exception {
|
||||||
|
|
||||||
// "info:eu-repo/grantAgreement/mock/mock/mock/mock" base64 encoded
|
// "info:eu-repo/grantAgreement/mock/mock/mock/mock" base64 encoded
|
||||||
String projectID = "aW5mbzpldS1yZXBvL2dyYW50QWdyZWVtZW50L0ZDVC81ODc2LVBQQ0RUSS8xMTAwNjIvUFQ=";
|
String projectID = "aW5mbzpldS1yZXBvL2dyYW50QWdyZWVtZW50L0ZDVC81ODc2LVBQQ0RUSS8xMTAwNjIvUFQ=";
|
||||||
String projectName = "Portuguese Wild Mushrooms: Chemical characterization and functional study"
|
String projectName = "Portuguese Wild Mushrooms: Chemical characterization and functional study"
|
||||||
+ " of antiproliferative and proapoptotic properties in cancer cell lines";
|
+ " of antiproliferative and proapoptotic properties in cancer cell lines";
|
||||||
|
|
||||||
getClient().perform(get("/api/integration/externalsources/openAIREFunding/entryValues/" + projectID))
|
getClient().perform(get("/api/integration/externalsources/openaireFunding/entryValues/" + projectID))
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
.andExpect(jsonPath("$",
|
.andExpect(jsonPath("$",
|
||||||
Matchers.allOf(hasJsonPath("$.id", is(projectID)), hasJsonPath("$.display", is(projectName)),
|
Matchers.allOf(hasJsonPath("$.id", is(projectID)), hasJsonPath("$.display", is(projectName)),
|
||||||
hasJsonPath("$.value", is(projectName)),
|
hasJsonPath("$.value", is(projectName)),
|
||||||
hasJsonPath("$.externalSource", is("openAIREFunding")),
|
hasJsonPath("$.externalSource", is("openaireFunding")),
|
||||||
hasJsonPath("$.type", is("externalSourceEntry")))));
|
hasJsonPath("$.type", is("externalSourceEntry")))));
|
||||||
|
|
||||||
}
|
}
|
@@ -56,7 +56,7 @@ import org.dspace.content.service.ItemService;
|
|||||||
import org.dspace.eperson.EPerson;
|
import org.dspace.eperson.EPerson;
|
||||||
import org.dspace.qaevent.QANotifyPatterns;
|
import org.dspace.qaevent.QANotifyPatterns;
|
||||||
import org.dspace.qaevent.action.ASimpleMetadataAction;
|
import org.dspace.qaevent.action.ASimpleMetadataAction;
|
||||||
import org.dspace.qaevent.dao.QAEventsDao;
|
import org.dspace.qaevent.dao.QAEventsDAO;
|
||||||
import org.hamcrest.Matchers;
|
import org.hamcrest.Matchers;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -70,7 +70,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private QAEventsDao qaEventsDao;
|
private QAEventsDAO qaEventsDao;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ItemService itemService;
|
private ItemService itemService;
|
||||||
@@ -1002,6 +1002,11 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
|||||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}")
|
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
QAEvent event2 = QAEventBuilder.createTarget(context, col1, "Science and Freedom")
|
||||||
|
.withTopic("ENRICH/MISSING/PID")
|
||||||
|
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}")
|
||||||
|
.build();
|
||||||
|
|
||||||
context.restoreAuthSystemState();
|
context.restoreAuthSystemState();
|
||||||
|
|
||||||
String authToken = getAuthToken(admin.getEmail(), password);
|
String authToken = getAuthToken(admin.getEmail(), password);
|
||||||
@@ -1029,6 +1034,12 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
|||||||
assertThat(processedEvent.getEventTimestamp(), notNullValue());
|
assertThat(processedEvent.getEventTimestamp(), notNullValue());
|
||||||
assertThat(processedEvent.getEperson().getID(), is(admin.getID()));
|
assertThat(processedEvent.getEperson().getID(), is(admin.getID()));
|
||||||
|
|
||||||
|
getClient(authToken).perform(delete("/api/integration/qualityassuranceevents/" + event.getEventId()))
|
||||||
|
.andExpect(status().isInternalServerError());
|
||||||
|
|
||||||
|
authToken = getAuthToken(eperson.getEmail(), password);
|
||||||
|
getClient(authToken).perform(delete("/api/integration/qualityassuranceevents/" + event2.getEventId()))
|
||||||
|
.andExpect(status().isForbidden());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@@ -216,7 +216,12 @@ public class SitemapRestControllerIT extends AbstractControllerIntegrationTest {
|
|||||||
//** THEN **
|
//** THEN **
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
//We expect the content type to match
|
//We expect the content type to match
|
||||||
.andExpect(content().contentType("application/xml;charset=UTF-8"))
|
.andExpect(res -> {
|
||||||
|
String actual = res.getResponse().getContentType();
|
||||||
|
assertTrue("Content Type",
|
||||||
|
"text/xml;charset=UTF-8".equals(actual) ||
|
||||||
|
"application/xml;charset=UTF-8".equals(actual));
|
||||||
|
})
|
||||||
.andReturn();
|
.andReturn();
|
||||||
|
|
||||||
String response = result.getResponse().getContentAsString();
|
String response = result.getResponse().getContentAsString();
|
||||||
@@ -232,7 +237,12 @@ public class SitemapRestControllerIT extends AbstractControllerIntegrationTest {
|
|||||||
//** THEN **
|
//** THEN **
|
||||||
.andExpect(status().isOk())
|
.andExpect(status().isOk())
|
||||||
//We expect the content type to match
|
//We expect the content type to match
|
||||||
.andExpect(content().contentType("application/xml;charset=UTF-8"))
|
.andExpect(res -> {
|
||||||
|
String actual = res.getResponse().getContentType();
|
||||||
|
assertTrue("Content Type",
|
||||||
|
"text/xml;charset=UTF-8".equals(actual) ||
|
||||||
|
"application/xml;charset=UTF-8".equals(actual));
|
||||||
|
})
|
||||||
.andReturn();
|
.andReturn();
|
||||||
|
|
||||||
String response = result.getResponse().getContentAsString();
|
String response = result.getResponse().getContentAsString();
|
||||||
|
@@ -0,0 +1,84 @@
|
|||||||
|
/**
|
||||||
|
* The contents of this file are subject to the license and copyright
|
||||||
|
* detailed in the LICENSE and NOTICE files at the root of the source
|
||||||
|
* tree and available online at
|
||||||
|
*
|
||||||
|
* http://www.dspace.org/license/
|
||||||
|
*/
|
||||||
|
package org.dspace.app.rest.authorization;
|
||||||
|
|
||||||
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||||
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
|
||||||
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||||
|
|
||||||
|
import org.dspace.app.rest.authorization.impl.QAAuthorizationFeature;
|
||||||
|
import org.dspace.app.rest.converter.SiteConverter;
|
||||||
|
import org.dspace.app.rest.matcher.AuthorizationMatcher;
|
||||||
|
import org.dspace.app.rest.model.SiteRest;
|
||||||
|
import org.dspace.app.rest.projection.DefaultProjection;
|
||||||
|
import org.dspace.app.rest.test.AbstractControllerIntegrationTest;
|
||||||
|
import org.dspace.content.Site;
|
||||||
|
import org.dspace.content.service.SiteService;
|
||||||
|
import org.dspace.services.ConfigurationService;
|
||||||
|
import org.hamcrest.Matchers;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test suite for the Quality Assurance Authorization feature
|
||||||
|
*
|
||||||
|
* @author Francesco Bacchelli (francesco.bacchelli at 4science.it)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class QAAuthorizationFeatureIT extends AbstractControllerIntegrationTest {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AuthorizationFeatureService authorizationFeatureService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SiteService siteService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SiteConverter siteConverter;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ConfigurationService configurationService;
|
||||||
|
|
||||||
|
|
||||||
|
private AuthorizationFeature qaAuthorizationFeature;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Before
|
||||||
|
public void setUp() throws Exception {
|
||||||
|
super.setUp();
|
||||||
|
context.turnOffAuthorisationSystem();
|
||||||
|
qaAuthorizationFeature = authorizationFeatureService.find(QAAuthorizationFeature.NAME);
|
||||||
|
context.restoreAuthSystemState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testQAAuthorizationSuccess() throws Exception {
|
||||||
|
configurationService.setProperty("qaevents.enabled", true);
|
||||||
|
Site site = siteService.findSite(context);
|
||||||
|
SiteRest siteRest = siteConverter.convert(site, DefaultProjection.DEFAULT);
|
||||||
|
String tokenAdmin = getAuthToken(admin.getEmail(), password);
|
||||||
|
Authorization authAdminSite = new Authorization(admin, qaAuthorizationFeature, siteRest);
|
||||||
|
|
||||||
|
getClient(tokenAdmin).perform(get("/api/authz/authorizations/" + authAdminSite.getID()))
|
||||||
|
.andExpect(jsonPath("$", Matchers.is(
|
||||||
|
AuthorizationMatcher.matchAuthorization(authAdminSite))));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testQAAuthorizationFail() throws Exception {
|
||||||
|
configurationService.setProperty("qaevents.enabled", false);
|
||||||
|
Site site = siteService.findSite(context);
|
||||||
|
SiteRest siteRest = siteConverter.convert(site, DefaultProjection.DEFAULT);
|
||||||
|
String tokenAdmin = getAuthToken(admin.getEmail(), password);
|
||||||
|
Authorization authAdminSite = new Authorization(admin, qaAuthorizationFeature, siteRest);
|
||||||
|
|
||||||
|
getClient(tokenAdmin).perform(get("/api/authz/authorizations/" + authAdminSite.getID()))
|
||||||
|
.andExpect(status().isNotFound());
|
||||||
|
}
|
||||||
|
}
|
@@ -143,7 +143,7 @@ public class QAEventMatcher {
|
|||||||
hrefPrefix = "https://arxiv.org/abs/";
|
hrefPrefix = "https://arxiv.org/abs/";
|
||||||
break;
|
break;
|
||||||
case "handle":
|
case "handle":
|
||||||
hrefPrefix = "https://arxiv.org/abs/";
|
hrefPrefix = "https://hdl.handle.net/";
|
||||||
break;
|
break;
|
||||||
case "urn":
|
case "urn":
|
||||||
hrefPrefix = "";
|
hrefPrefix = "";
|
||||||
|
@@ -14,7 +14,7 @@ import javax.xml.bind.JAXBException;
|
|||||||
|
|
||||||
import eu.openaire.jaxb.helper.OpenAIREHandler;
|
import eu.openaire.jaxb.helper.OpenAIREHandler;
|
||||||
import eu.openaire.jaxb.model.Response;
|
import eu.openaire.jaxb.model.Response;
|
||||||
import org.dspace.external.OpenAIRERestConnector;
|
import org.dspace.external.OpenaireRestConnector;
|
||||||
import org.mockito.AdditionalMatchers;
|
import org.mockito.AdditionalMatchers;
|
||||||
import org.mockito.ArgumentMatchers;
|
import org.mockito.ArgumentMatchers;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
@@ -22,14 +22,14 @@ import org.mockito.invocation.InvocationOnMock;
|
|||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mock the OpenAIRE external source using a mock rest connector so that query
|
* Mock the Openaire external source using a mock rest connector so that query
|
||||||
* will be resolved against static test files
|
* will be resolved against static test files
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class MockOpenAIREFundingDataProvider extends OpenAIREFundingDataProvider {
|
public class MockOpenaireFundingDataProvider extends OpenaireFundingDataProvider {
|
||||||
@Override
|
@Override
|
||||||
public void init() throws IOException {
|
public void init() throws IOException {
|
||||||
OpenAIRERestConnector restConnector = Mockito.mock(OpenAIRERestConnector.class);
|
OpenaireRestConnector restConnector = Mockito.mock(OpenaireRestConnector.class);
|
||||||
|
|
||||||
when(restConnector.searchProjectByKeywords(ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt(),
|
when(restConnector.searchProjectByKeywords(ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt(),
|
||||||
ArgumentMatchers.startsWith("mushroom"))).thenAnswer(new Answer<Response>() {
|
ArgumentMatchers.startsWith("mushroom"))).thenAnswer(new Answer<Response>() {
|
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- Following OpenAIRE Guidelines 4 -->
|
<!-- Following Openaire Guidelines 4 -->
|
||||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
xmlns:doc="http://www.lyncode.com/xoai">
|
xmlns:doc="http://www.lyncode.com/xoai">
|
||||||
<xsl:output indent="yes" method="xml" omit-xml-declaration="yes"/>
|
<xsl:output indent="yes" method="xml" omit-xml-declaration="yes"/>
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
Formatting dc.date.issued
|
Formatting dc.date.issued
|
||||||
based on what OpenAIRE4 specifies for issued dates
|
based on what Openaire4 specifies for issued dates
|
||||||
https://openaire-guidelines-for-literature-repository-managers.readthedocs.io/en/v4.0.0/field_publicationdate.html
|
https://openaire-guidelines-for-literature-repository-managers.readthedocs.io/en/v4.0.0/field_publicationdate.html
|
||||||
-->
|
-->
|
||||||
<xsl:template
|
<xsl:template
|
||||||
|
@@ -47,7 +47,7 @@
|
|||||||
</Context>
|
</Context>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
OpenAIRE Guidelines 3.0:
|
Openaire Guidelines 3.0:
|
||||||
|
|
||||||
- https://guidelines.openaire.eu/
|
- https://guidelines.openaire.eu/
|
||||||
|
|
||||||
@@ -55,10 +55,10 @@
|
|||||||
|
|
||||||
- Predefined DSpace fields don't allow to set this up with a default.
|
- Predefined DSpace fields don't allow to set this up with a default.
|
||||||
-->
|
-->
|
||||||
<Context baseurl="openaire" name="OpenAIRE Context">
|
<Context baseurl="openaire" name="Openaire Context">
|
||||||
<!-- Date format, field prefixes, etc are ensured by the transformer -->
|
<!-- Date format, field prefixes, etc are ensured by the transformer -->
|
||||||
<Transformer ref="openaireTransformer"/>
|
<Transformer ref="openaireTransformer"/>
|
||||||
<!-- OpenAIRE filter -->
|
<!-- Openaire filter -->
|
||||||
<Filter ref="openAireFilter"/>
|
<Filter ref="openAireFilter"/>
|
||||||
<!-- Just an alias, in fact it returns all items within the driver context -->
|
<!-- Just an alias, in fact it returns all items within the driver context -->
|
||||||
<Set ref="openaireSet"/>
|
<Set ref="openaireSet"/>
|
||||||
@@ -66,12 +66,12 @@
|
|||||||
<Format ref="oaidc"/>
|
<Format ref="oaidc"/>
|
||||||
<Format ref="mets"/>
|
<Format ref="mets"/>
|
||||||
<Description>
|
<Description>
|
||||||
This contexts complies with OpenAIRE Guidelines for Literature Repositories v3.0.
|
This contexts complies with Openaire Guidelines for Literature Repositories v3.0.
|
||||||
</Description>
|
</Description>
|
||||||
</Context>
|
</Context>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
OpenAIRE Guidelines 4.0:
|
Openaire Guidelines 4.0:
|
||||||
|
|
||||||
- https://openaire-guidelines-for-literature-repository-managers.readthedocs.io/en/v4.0.0/
|
- https://openaire-guidelines-for-literature-repository-managers.readthedocs.io/en/v4.0.0/
|
||||||
|
|
||||||
@@ -79,15 +79,15 @@
|
|||||||
|
|
||||||
- Predefined DSpace fields don't allow to set this up with a default.
|
- Predefined DSpace fields don't allow to set this up with a default.
|
||||||
-->
|
-->
|
||||||
<Context baseurl="openaire4" name="OpenAIRE 4 Context">
|
<Context baseurl="openaire4" name="Openaire 4 Context">
|
||||||
<!-- Date format, field prefixes, etc are ensured by the transformer -->
|
<!-- Date format, field prefixes, etc are ensured by the transformer -->
|
||||||
<Transformer ref="openaire4Transformer"/>
|
<Transformer ref="openaire4Transformer"/>
|
||||||
<!-- OpenAIRE filter -->
|
<!-- Openaire filter -->
|
||||||
<Filter ref="openAIRE4Filter"/>
|
<Filter ref="openaire4Filter"/>
|
||||||
<!-- Metadata Formats -->
|
<!-- Metadata Formats -->
|
||||||
<Format ref="oaiopenaire"/>
|
<Format ref="oaiopenaire"/>
|
||||||
<Description>
|
<Description>
|
||||||
This contexts complies with OpenAIRE Guidelines for Literature Repositories v4.0.
|
This contexts complies with Openaire Guidelines for Literature Repositories v4.0.
|
||||||
</Description>
|
</Description>
|
||||||
</Context>
|
</Context>
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@
|
|||||||
<Namespace>http://irdb.nii.ac.jp/oai</Namespace>
|
<Namespace>http://irdb.nii.ac.jp/oai</Namespace>
|
||||||
<SchemaLocation>http://irdb.nii.ac.jp/oai/junii2-3-1.xsd</SchemaLocation>
|
<SchemaLocation>http://irdb.nii.ac.jp/oai/junii2-3-1.xsd</SchemaLocation>
|
||||||
</Format>
|
</Format>
|
||||||
<!-- Metadata format based on the OpenAIRE 4.0 guidelines
|
<!-- Metadata format based on the Openaire 4.0 guidelines
|
||||||
https://openaire-guidelines-for-literature-repository-managers.readthedocs.io/en/v4.0.0/use_of_oai_pmh.html
|
https://openaire-guidelines-for-literature-repository-managers.readthedocs.io/en/v4.0.0/use_of_oai_pmh.html
|
||||||
-->
|
-->
|
||||||
<Format id="oaiopenaire">
|
<Format id="oaiopenaire">
|
||||||
@@ -250,13 +250,13 @@
|
|||||||
</Definition>
|
</Definition>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
|
||||||
<!-- OpenAIRE filter for records returned by OAI-PMH.
|
<!-- Openaire filter for records returned by OAI-PMH.
|
||||||
By default, return an Item record:
|
By default, return an Item record:
|
||||||
* If a Title & Author field both exist
|
* If a Title & Author field both exist
|
||||||
* AND a valid DRIVER Document Type exists
|
* AND a valid DRIVER Document Type exists
|
||||||
* AND Item is either publicly accessible OR Withdrawn (for tombstones)
|
* AND Item is either publicly accessible OR Withdrawn (for tombstones)
|
||||||
* AND the OpenAIRE "dc.relation" is specified
|
* AND the Openaire "dc.relation" is specified
|
||||||
This filter is only used in the OpenAIRE context ([oai]/openaire).
|
This filter is only used in the Openaire context ([oai]/openaire).
|
||||||
-->
|
-->
|
||||||
<Filter id="openAireFilter">
|
<Filter id="openAireFilter">
|
||||||
<Definition>
|
<Definition>
|
||||||
@@ -319,7 +319,7 @@
|
|||||||
</Definition>
|
</Definition>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
|
||||||
<!-- OpenAIRE4 filter for records returned by OAI-PMH.
|
<!-- Openaire4 filter for records returned by OAI-PMH.
|
||||||
By default, return an Item record:
|
By default, return an Item record:
|
||||||
* If it is publicly accessible
|
* If it is publicly accessible
|
||||||
* * OR it has been withdrawn (in order to display a tombstone record).
|
* * OR it has been withdrawn (in order to display a tombstone record).
|
||||||
@@ -328,7 +328,7 @@
|
|||||||
* limiting the results only to Publications as expected
|
* limiting the results only to Publications as expected
|
||||||
This filter is used by the default context ([oai]/request).
|
This filter is used by the default context ([oai]/request).
|
||||||
-->
|
-->
|
||||||
<Filter id="openAIRE4Filter">
|
<Filter id="openaire4Filter">
|
||||||
<Definition>
|
<Definition>
|
||||||
<And>
|
<And>
|
||||||
<LeftCondition>
|
<LeftCondition>
|
||||||
@@ -457,7 +457,7 @@
|
|||||||
|
|
||||||
<!-- This condition determines if an Item has a "dc.rights" field
|
<!-- This condition determines if an Item has a "dc.rights" field
|
||||||
specifying "open access", which is required for DRIVER
|
specifying "open access", which is required for DRIVER
|
||||||
OR "openAccess", which is required by OpenAIRE. -->
|
OR "openAccess", which is required by Openaire. -->
|
||||||
<CustomCondition id="driverAccessCondition">
|
<CustomCondition id="driverAccessCondition">
|
||||||
<Class>org.dspace.xoai.filter.DSpaceAtLeastOneMetadataFilter</Class>
|
<Class>org.dspace.xoai.filter.DSpaceAtLeastOneMetadataFilter</Class>
|
||||||
<Configuration>
|
<Configuration>
|
||||||
@@ -483,7 +483,7 @@
|
|||||||
</CustomCondition>
|
</CustomCondition>
|
||||||
|
|
||||||
<!-- This condition determines if an Item has a "dc.relation" field
|
<!-- This condition determines if an Item has a "dc.relation" field
|
||||||
which specifies the openAIRE project ID. -->
|
which specifies the openaire project ID. -->
|
||||||
<CustomCondition id="openaireRelationCondition">
|
<CustomCondition id="openaireRelationCondition">
|
||||||
<Class>org.dspace.xoai.filter.DSpaceAtLeastOneMetadataFilter</Class>
|
<Class>org.dspace.xoai.filter.DSpaceAtLeastOneMetadataFilter</Class>
|
||||||
<Configuration>
|
<Configuration>
|
||||||
|
@@ -185,28 +185,28 @@
|
|||||||
<type>extract</type>
|
<type>extract</type>
|
||||||
</step-definition>
|
</step-definition>
|
||||||
|
|
||||||
<!-- OpenAIRE submission steps/forms -->
|
<!-- Openaire submission steps/forms -->
|
||||||
<step-definition id="openAIREProjectForm" mandatory="true">
|
<step-definition id="openaireProjectForm" mandatory="true">
|
||||||
<heading>submit.progressbar.describe.stepone</heading>
|
<heading>submit.progressbar.describe.stepone</heading>
|
||||||
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
||||||
<type>submission-form</type>
|
<type>submission-form</type>
|
||||||
</step-definition>
|
</step-definition>
|
||||||
<step-definition id="openAIREPersonForm" mandatory="true">
|
<step-definition id="openairePersonForm" mandatory="true">
|
||||||
<heading>submit.progressbar.describe.stepone</heading>
|
<heading>submit.progressbar.describe.stepone</heading>
|
||||||
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
||||||
<type>submission-form</type>
|
<type>submission-form</type>
|
||||||
</step-definition>
|
</step-definition>
|
||||||
<step-definition id="openAIREOrganizationForm" mandatory="true">
|
<step-definition id="openaireOrganizationForm" mandatory="true">
|
||||||
<heading>submit.progressbar.describe.stepone</heading>
|
<heading>submit.progressbar.describe.stepone</heading>
|
||||||
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
||||||
<type>submission-form</type>
|
<type>submission-form</type>
|
||||||
</step-definition>
|
</step-definition>
|
||||||
<step-definition id="openAIREPublicationPageoneForm" mandatory="true">
|
<step-definition id="openairePublicationPageoneForm" mandatory="true">
|
||||||
<heading>submit.progressbar.describe.stepone</heading>
|
<heading>submit.progressbar.describe.stepone</heading>
|
||||||
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
||||||
<type>submission-form</type>
|
<type>submission-form</type>
|
||||||
</step-definition>
|
</step-definition>
|
||||||
<step-definition id="openAIREPublicationPagetwoForm" mandatory="true">
|
<step-definition id="openairePublicationPagetwoForm" mandatory="true">
|
||||||
<heading>submit.progressbar.describe.stepone</heading>
|
<heading>submit.progressbar.describe.stepone</heading>
|
||||||
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
||||||
<type>submission-form</type>
|
<type>submission-form</type>
|
||||||
@@ -371,13 +371,13 @@
|
|||||||
<step id="license"/>
|
<step id="license"/>
|
||||||
</submission-process>
|
</submission-process>
|
||||||
|
|
||||||
<!-- OpenAIRE submission processes -->
|
<!-- Openaire submission processes -->
|
||||||
<submission-process name="openAIREPublicationSubmission">
|
<submission-process name="openairePublicationSubmission">
|
||||||
<step id="collection"/>
|
<step id="collection"/>
|
||||||
|
|
||||||
<!--Step will be to Describe the item. -->
|
<!--Step will be to Describe the item. -->
|
||||||
<step id="openAIREPublicationPageoneForm"/>
|
<step id="openairePublicationPageoneForm"/>
|
||||||
<step id="openAIREPublicationPagetwoForm"/>
|
<step id="openairePublicationPagetwoForm"/>
|
||||||
|
|
||||||
<!--Step will be to Upload the item -->
|
<!--Step will be to Upload the item -->
|
||||||
<!-- step id="upload-with-embargo"/-->
|
<!-- step id="upload-with-embargo"/-->
|
||||||
@@ -386,17 +386,17 @@
|
|||||||
<!--Step will be to Sign off on the License -->
|
<!--Step will be to Sign off on the License -->
|
||||||
<step id="license"/>
|
<step id="license"/>
|
||||||
</submission-process>
|
</submission-process>
|
||||||
<submission-process name="openAIREPersonSubmission">
|
<submission-process name="openairePersonSubmission">
|
||||||
<step id="collection"/>
|
<step id="collection"/>
|
||||||
<step id="openAIREPersonForm"/>
|
<step id="openairePersonForm"/>
|
||||||
</submission-process>
|
</submission-process>
|
||||||
<submission-process name="openAIREProjectSubmission">
|
<submission-process name="openaireProjectSubmission">
|
||||||
<step id="collection"/>
|
<step id="collection"/>
|
||||||
<step id="openAIREProjectForm"/>
|
<step id="openaireProjectForm"/>
|
||||||
</submission-process>
|
</submission-process>
|
||||||
<submission-process name="openAIREOrganizationSubmission">
|
<submission-process name="openaireOrganizationSubmission">
|
||||||
<step id="collection"/>
|
<step id="collection"/>
|
||||||
<step id="openAIREOrganizationForm"/>
|
<step id="openaireOrganizationForm"/>
|
||||||
</submission-process>
|
</submission-process>
|
||||||
</submission-definitions>
|
</submission-definitions>
|
||||||
|
|
||||||
|
@@ -16,20 +16,20 @@
|
|||||||
# The accessToken it only has a validity of one hour
|
# The accessToken it only has a validity of one hour
|
||||||
# For more details about the token, please check: https://develop.openaire.eu/personalToken.html
|
# For more details about the token, please check: https://develop.openaire.eu/personalToken.html
|
||||||
#
|
#
|
||||||
# the current OpenAIRE Rest client implementation uses basic authentication
|
# the current Openaire Rest client implementation uses basic authentication
|
||||||
# Described here: https://develop.openaire.eu/basic.html
|
# Described here: https://develop.openaire.eu/basic.html
|
||||||
#
|
#
|
||||||
# ---- Token usage required definitions ----
|
# ---- Token usage required definitions ----
|
||||||
# you can override this settings in your local.cfg file - can be true/false
|
# you can override this settings in your local.cfg file - can be true/false
|
||||||
openaire.token.enabled = false
|
openaire.token.enabled = false
|
||||||
|
|
||||||
# URL of the OpenAIRE authentication and authorization service
|
# URL of the Openaire authentication and authorization service
|
||||||
openaire.token.url = https://aai.openaire.eu/oidc/token
|
openaire.token.url = https://aai.openaire.eu/oidc/token
|
||||||
|
|
||||||
# you will be required to register at OpenAIRE (https://services.openaire.eu/uoa-user-management/registeredServices)
|
# you will be required to register at Openaire (https://services.openaire.eu/uoa-user-management/registeredServices)
|
||||||
# and create your service in order to get the following data:
|
# and create your service in order to get the following data:
|
||||||
openaire.token.clientId = CLIENT_ID_HERE
|
openaire.token.clientId = CLIENT_ID_HERE
|
||||||
openaire.token.clientSecret = CLIENT_SECRET_HERE
|
openaire.token.clientSecret = CLIENT_SECRET_HERE
|
||||||
|
|
||||||
# URL of OpenAIRE Rest API
|
# URL of Openaire Rest API
|
||||||
openaire.api.url = https://api.openaire.eu
|
openaire.api.url = https://api.openaire.eu
|
@@ -3,10 +3,11 @@
|
|||||||
#---------------------------------------------------------------#
|
#---------------------------------------------------------------#
|
||||||
# Configuration properties used by data correction service #
|
# Configuration properties used by data correction service #
|
||||||
#---------------------------------------------------------------#
|
#---------------------------------------------------------------#
|
||||||
|
# Quality Assurance enable property, false by default
|
||||||
|
qaevents.enabled = false
|
||||||
qaevents.solr.server = ${solr.server}/${solr.multicorePrefix}qaevent
|
qaevents.solr.server = ${solr.server}/${solr.multicorePrefix}qaevent
|
||||||
# A POST to these url(s) will be done to notify oaire of decision taken for each qaevents
|
# A POST to these url(s) will be done to notify oaire of decision taken for each qaevents
|
||||||
qaevents.openaire.acknowledge-url = https://beta.api-broker.openaire.eu/feedback/events
|
# qaevents.openaire.acknowledge-url = https://beta.api-broker.openaire.eu/feedback/events
|
||||||
#qaevents.openaire.acknowledge-url
|
|
||||||
|
|
||||||
# The list of the supported events incoming from openaire (see also dspace/config/spring/api/qaevents.xml)
|
# The list of the supported events incoming from openaire (see also dspace/config/spring/api/qaevents.xml)
|
||||||
# add missing abstract suggestion
|
# add missing abstract suggestion
|
||||||
|
@@ -2,13 +2,13 @@
|
|||||||
<!DOCTYPE dspace-dc-types SYSTEM "dspace-dc-types.dtd">
|
<!DOCTYPE dspace-dc-types SYSTEM "dspace-dc-types.dtd">
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
This document was based on the OpenAIRE4 Guidelines for Literature Repositories
|
This document was based on the Openaire4 Guidelines for Literature Repositories
|
||||||
https://openaire-guidelines-for-literature-repository-managers.readthedocs.io/en/v4.0.0/index.html
|
https://openaire-guidelines-for-literature-repository-managers.readthedocs.io/en/v4.0.0/index.html
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<dspace-dc-types>
|
<dspace-dc-types>
|
||||||
<dspace-header>
|
<dspace-header>
|
||||||
<title>OpenAIRE4 fields definition</title>
|
<title>Openaire4 fields definition</title>
|
||||||
</dspace-header>
|
</dspace-header>
|
||||||
|
|
||||||
<dc-schema>
|
<dc-schema>
|
||||||
@@ -102,4 +102,21 @@
|
|||||||
<scope_note>The date when the conference took place. This property is considered to be part of the bibliographic citation. Recommended best practice for encoding the date value is defined in a profile of ISO 8601 [W3CDTF] and follows the YYYY-MM-DD format.</scope_note>
|
<scope_note>The date when the conference took place. This property is considered to be part of the bibliographic citation. Recommended best practice for encoding the date value is defined in a profile of ISO 8601 [W3CDTF] and follows the YYYY-MM-DD format.</scope_note>
|
||||||
</dc-type>
|
</dc-type>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Openaire4 Guidelines
|
||||||
|
21 - Geolocation -->
|
||||||
|
<dc-type>
|
||||||
|
<schema>datacite</schema>
|
||||||
|
<element>geoLocation</element>
|
||||||
|
<scope_note>Spatial region or named place where the data was gathered or about which the data is focused.</scope_note>
|
||||||
|
</dc-type>
|
||||||
|
|
||||||
|
<!-- specific type required by Openaire4 Guidelines -->
|
||||||
|
<dc-type>
|
||||||
|
<schema>datacite</schema>
|
||||||
|
<element>subject</element>
|
||||||
|
<qualifier>fos</qualifier>
|
||||||
|
<scope_note>Fields of Science and Technology - OECD</scope_note>
|
||||||
|
</dc-type>
|
||||||
|
|
||||||
</dspace-dc-types>
|
</dspace-dc-types>
|
||||||
|
@@ -237,7 +237,7 @@
|
|||||||
<scope_note>Contains all uuids of PUBLICATIONS which link to the current ISSUE via a "latest" relationship. In other words, this stores all relationships pointing to the current ISSUE from any PUBLICATION, implying that the ISSUE is marked as "latest". Internally used by DSpace to support versioning. Do not manually add, remove or edit values.</scope_note>
|
<scope_note>Contains all uuids of PUBLICATIONS which link to the current ISSUE via a "latest" relationship. In other words, this stores all relationships pointing to the current ISSUE from any PUBLICATION, implying that the ISSUE is marked as "latest". Internally used by DSpace to support versioning. Do not manually add, remove or edit values.</scope_note>
|
||||||
</dc-type>
|
</dc-type>
|
||||||
|
|
||||||
<!-- OpenAIRE4 Guidelines - required relationships -->
|
<!-- Openaire4 Guidelines - required relationships -->
|
||||||
|
|
||||||
<dc-type>
|
<dc-type>
|
||||||
<schema>relation</schema>
|
<schema>relation</schema>
|
||||||
|
@@ -42,10 +42,10 @@
|
|||||||
</scope_note>
|
</scope_note>
|
||||||
</dc-type>
|
</dc-type>
|
||||||
|
|
||||||
<!-- OpenAIRE4 Guidelines -->
|
<!-- Openaire4 Guidelines -->
|
||||||
<!-- 2.2.2.1. Attribute nameType (R) -->
|
<!-- 2.2.2.1. Attribute nameType (R) -->
|
||||||
<!-- and 3.2.6. Subproperty nameIdentifier (R) -->
|
<!-- and 3.2.6. Subproperty nameIdentifier (R) -->
|
||||||
<!-- specific type required by OpenAIRE4 Guidelines -->
|
<!-- specific type required by Openaire4 Guidelines -->
|
||||||
|
|
||||||
<dc-type>
|
<dc-type>
|
||||||
<schema>organization</schema>
|
<schema>organization</schema>
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
OpenAIRE4 Guidelines
|
Openaire4 Guidelines
|
||||||
2.2.3. Subproperty givenName (R)
|
2.2.3. Subproperty givenName (R)
|
||||||
The personal or first name of the author. -->
|
The personal or first name of the author. -->
|
||||||
<dc-type>
|
<dc-type>
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
</dc-type>
|
</dc-type>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
OpenAIRE4 Guidelines
|
Openaire4 Guidelines
|
||||||
2.2.4. Subproperty familyName (R)
|
2.2.4. Subproperty familyName (R)
|
||||||
The surname or last name of the author. -->
|
The surname or last name of the author. -->
|
||||||
<dc-type>
|
<dc-type>
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
</dc-type>
|
</dc-type>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
OpenAIRE4 Guidelines
|
Openaire4 Guidelines
|
||||||
2.2.6. Subproperty affiliation (R)
|
2.2.6. Subproperty affiliation (R)
|
||||||
The organizational or institutional affiliation of the creator (occurrence: 0-n). -->
|
The organizational or institutional affiliation of the creator (occurrence: 0-n). -->
|
||||||
<dc-type>
|
<dc-type>
|
||||||
@@ -84,10 +84,10 @@
|
|||||||
<scope_note>The organizational or institutional affiliation of the creator</scope_note>
|
<scope_note>The organizational or institutional affiliation of the creator</scope_note>
|
||||||
</dc-type>
|
</dc-type>
|
||||||
|
|
||||||
<!-- OpenAIRE4 Guidelines -->
|
<!-- Openaire4 Guidelines -->
|
||||||
<!-- 2.2.2.1. Attribute nameType (R) -->
|
<!-- 2.2.2.1. Attribute nameType (R) -->
|
||||||
<!-- and 3.2.6. Subproperty nameIdentifier (R) -->
|
<!-- and 3.2.6. Subproperty nameIdentifier (R) -->
|
||||||
<!-- specific type required by OpenAIRE4 Guidelines -->
|
<!-- specific type required by Openaire4 Guidelines -->
|
||||||
<dc-type>
|
<dc-type>
|
||||||
<schema>person</schema>
|
<schema>person</schema>
|
||||||
<element>identifier</element>
|
<element>identifier</element>
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
OpenAIRE4 Guidelines
|
Openaire4 Guidelines
|
||||||
4.2.2. Subproperty funderName (M)
|
4.2.2. Subproperty funderName (M)
|
||||||
Name of the funding provider (occurrence: 1). Mandatory if FundingReference is used. -->
|
Name of the funding provider (occurrence: 1). Mandatory if FundingReference is used. -->
|
||||||
<dc-type>
|
<dc-type>
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
</dc-type>
|
</dc-type>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
OpenAIRE4 Guidelines
|
Openaire4 Guidelines
|
||||||
4.2.3. Subproperty funderIdentifier (R)
|
4.2.3. Subproperty funderIdentifier (R)
|
||||||
Unique identifier of the funding entity (occurrence: 0-1).
|
Unique identifier of the funding entity (occurrence: 0-1).
|
||||||
-->
|
-->
|
||||||
|
@@ -110,8 +110,8 @@
|
|||||||
|
|
||||||
<!-- search for an entity that can be a Person or an OrgUnit -->
|
<!-- search for an entity that can be a Person or an OrgUnit -->
|
||||||
<entry key="personOrOrgunit" value-ref="personOrOrgunit"/>
|
<entry key="personOrOrgunit" value-ref="personOrOrgunit"/>
|
||||||
<!-- OpenAIRE4 guidelines - search for an OrgUnit that have a specific dc.type=FundingOrganization -->
|
<!-- Openaire4 guidelines - search for an OrgUnit that have a specific dc.type=FundingOrganization -->
|
||||||
<entry key="openAIREFundingAgency" value-ref="openAIREFundingAgency"/>
|
<entry key="openaireFundingAgency" value-ref="openaireFundingAgency"/>
|
||||||
<entry key="eperson_claims" value-ref="eperson_claims"/>
|
<entry key="eperson_claims" value-ref="eperson_claims"/>
|
||||||
</map>
|
</map>
|
||||||
</property>
|
</property>
|
||||||
@@ -2027,7 +2027,7 @@
|
|||||||
<property name="spellCheckEnabled" value="true"/>
|
<property name="spellCheckEnabled" value="true"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="openAIREFundingAgency" class="org.dspace.discovery.configuration.DiscoveryConfiguration"
|
<bean id="openaireFundingAgency" class="org.dspace.discovery.configuration.DiscoveryConfiguration"
|
||||||
scope="prototype">
|
scope="prototype">
|
||||||
<property name="id" value="fundingAgency"/>
|
<property name="id" value="fundingAgency"/>
|
||||||
<property name="indexAlways" value="true"/>
|
<property name="indexAlways" value="true"/>
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
http://www.springframework.org/schema/util/spring-util.xsd"
|
http://www.springframework.org/schema/util/spring-util.xsd"
|
||||||
default-lazy-init="true">
|
default-lazy-init="true">
|
||||||
|
|
||||||
<bean id="openAIRERestConnector" class="org.dspace.external.OpenAIRERestConnector">
|
<bean id="openaireRestConnector" class="org.dspace.external.OpenaireRestConnector">
|
||||||
<constructor-arg value="${openaire.api.url:https://api.openaire.eu}"/>
|
<constructor-arg value="${openaire.api.url:https://api.openaire.eu}"/>
|
||||||
<property name="tokenEnabled" value="${openaire.token.enabled:false}"/>
|
<property name="tokenEnabled" value="${openaire.token.enabled:false}"/>
|
||||||
<property name="tokenServiceUrl" value="${openaire.token.url:https://aai.openaire.eu/oidc/token}"/>
|
<property name="tokenServiceUrl" value="${openaire.token.url:https://aai.openaire.eu/oidc/token}"/>
|
||||||
@@ -15,9 +15,9 @@
|
|||||||
<property name="clientSecret" value="${openaire.token.clientSecret}"/>
|
<property name="clientSecret" value="${openaire.token.clientSecret}"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean class="org.dspace.external.provider.impl.OpenAIREFundingDataProvider" init-method="init">
|
<bean class="org.dspace.external.provider.impl.OpenaireFundingDataProvider" init-method="init">
|
||||||
<property name="sourceIdentifier" value="openAIREFunding" />
|
<property name="sourceIdentifier" value="openaireFunding" />
|
||||||
<property name="connector" ref="openAIRERestConnector" />
|
<property name="connector" ref="openaireRestConnector" />
|
||||||
<property name="metadataFields" ref="mapOfmetadata"/>
|
<property name="metadataFields" ref="mapOfmetadata"/>
|
||||||
<property name="supportedEntityTypes">
|
<property name="supportedEntityTypes">
|
||||||
<list>
|
<list>
|
||||||
|
@@ -286,7 +286,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<!-- An example of an OpenAIRE compliance filter based on the same rules in xoai.xml
|
<!-- An example of an Openaire compliance filter based on the same rules in xoai.xml
|
||||||
some sub-statements are defined within this bean, and some are referenced from earlier definitions
|
some sub-statements are defined within this bean, and some are referenced from earlier definitions
|
||||||
-->
|
-->
|
||||||
<bean id="openaire_filter" class="org.dspace.content.logic.DefaultFilter">
|
<bean id="openaire_filter" class="org.dspace.content.logic.DefaultFilter">
|
||||||
@@ -329,7 +329,7 @@
|
|||||||
</list>
|
</list>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
<!-- AND the dc.relation is a valid OpenAIRE identifier
|
<!-- AND the dc.relation is a valid Openaire identifier
|
||||||
(starts with "info:eu-repo/grantAgreement/") -->
|
(starts with "info:eu-repo/grantAgreement/") -->
|
||||||
<bean id="has-openaire-relation_condition"
|
<bean id="has-openaire-relation_condition"
|
||||||
class="org.dspace.content.logic.condition.MetadataValueMatchCondition">
|
class="org.dspace.content.logic.condition.MetadataValueMatchCondition">
|
||||||
|
@@ -12,11 +12,11 @@
|
|||||||
|
|
||||||
<context:annotation-config /> <!-- allows us to use spring annotations in beans -->
|
<context:annotation-config /> <!-- allows us to use spring annotations in beans -->
|
||||||
|
|
||||||
<bean id="qaEventsDao" class="org.dspace.qaevent.dao.impl.QAEventsDaoImpl" />
|
<bean id="qaEventsDao" class="org.dspace.qaevent.dao.impl.QAEventsDAOImpl" />
|
||||||
|
|
||||||
<bean id="openaireBrokerClient" class="eu.dnetlib.broker.BrokerClient" />
|
<bean id="openaireBrokerClient" class="eu.dnetlib.broker.BrokerClient" />
|
||||||
|
|
||||||
<bean id="brokerClientFactory" class="org.dspace.qaevent.service.impl.BrokerClientFactoryImpl" />
|
<bean id="openaireClientFactory" class="org.dspace.qaevent.service.impl.OpenaireClientFactoryImpl" />
|
||||||
|
|
||||||
<bean id="org.dspace.qaevent.service.QAEventActionService" class="org.dspace.qaevent.service.impl.QAEventActionServiceImpl">
|
<bean id="org.dspace.qaevent.service.QAEventActionService" class="org.dspace.qaevent.service.impl.QAEventActionServiceImpl">
|
||||||
<property name="topicsToActions">
|
<property name="topicsToActions">
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
|
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
|
||||||
|
|
||||||
<bean id="import-openaire-events" class="org.dspace.qaevent.script.OpenaireEventsImportCliScriptConfiguration" primary="true">
|
<bean id="import-openaire-events" class="org.dspace.qaevent.script.OpenaireEventsImportCliScriptConfiguration" primary="true">
|
||||||
<property name="description" value="Import new openAIRE quality assurance broker events"/>
|
<property name="description" value="Import new Openaire quality assurance broker events"/>
|
||||||
<property name="dspaceRunnableClass" value="org.dspace.qaevent.script.OpenaireEventsImportCli"/>
|
<property name="dspaceRunnableClass" value="org.dspace.qaevent.script.OpenaireEventsImportCli"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
<!-- This primary attribute is present so that we can assure that in the REST layer we'll always use this
|
<!-- This primary attribute is present so that we can assure that in the REST layer we'll always use this
|
||||||
bean if it is present-->
|
bean if it is present-->
|
||||||
<bean id="import-openaire-events" class="org.dspace.qaevent.script.OpenaireEventsImportScriptConfiguration" primary="true">
|
<bean id="import-openaire-events" class="org.dspace.qaevent.script.OpenaireEventsImportScriptConfiguration" primary="true">
|
||||||
<property name="description" value="Import new openAIRE quality assurance broker events"/>
|
<property name="description" value="Import new openaire quality assurance broker events"/>
|
||||||
<property name="dspaceRunnableClass" value="org.dspace.qaevent.script.OpenaireEventsImport"/>
|
<property name="dspaceRunnableClass" value="org.dspace.qaevent.script.OpenaireEventsImport"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
@@ -819,9 +819,9 @@
|
|||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<!-- OpenAIRE specific forms -->
|
<!-- Openaire specific forms -->
|
||||||
|
|
||||||
<form name="openAIREPublicationPageoneForm">
|
<form name="openairePublicationPageoneForm">
|
||||||
<row>
|
<row>
|
||||||
<field>
|
<field>
|
||||||
<dc-schema>dc</dc-schema>
|
<dc-schema>dc</dc-schema>
|
||||||
@@ -1071,7 +1071,7 @@
|
|||||||
</row>
|
</row>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form name="openAIREPublicationPagetwoForm">
|
<form name="openairePublicationPagetwoForm">
|
||||||
<row>
|
<row>
|
||||||
<field>
|
<field>
|
||||||
<dc-schema>dc</dc-schema>
|
<dc-schema>dc</dc-schema>
|
||||||
@@ -1129,7 +1129,7 @@
|
|||||||
<dc-element>relation</dc-element>
|
<dc-element>relation</dc-element>
|
||||||
<input-type>onebox</input-type>
|
<input-type>onebox</input-type>
|
||||||
</linked-metadata-field>
|
</linked-metadata-field>
|
||||||
<externalsources>openAIREFunding</externalsources>
|
<externalsources>openaireFunding</externalsources>
|
||||||
<required></required>
|
<required></required>
|
||||||
</relation-field>
|
</relation-field>
|
||||||
</row>
|
</row>
|
||||||
@@ -1182,7 +1182,7 @@
|
|||||||
</row>
|
</row>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form name="openAIREPersonForm">
|
<form name="openairePersonForm">
|
||||||
<row>
|
<row>
|
||||||
<field>
|
<field>
|
||||||
<dc-schema>person</dc-schema>
|
<dc-schema>person</dc-schema>
|
||||||
@@ -1246,7 +1246,7 @@
|
|||||||
</row>
|
</row>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form name="openAIREProjectForm">
|
<form name="openaireProjectForm">
|
||||||
<row>
|
<row>
|
||||||
<field>
|
<field>
|
||||||
<dc-schema>dc</dc-schema>
|
<dc-schema>dc</dc-schema>
|
||||||
@@ -1269,7 +1269,7 @@
|
|||||||
<row>
|
<row>
|
||||||
<relation-field>
|
<relation-field>
|
||||||
<relationship-type>isFundingAgencyOfProject</relationship-type>
|
<relationship-type>isFundingAgencyOfProject</relationship-type>
|
||||||
<search-configuration>openAIREFundingAgency</search-configuration>
|
<search-configuration>openaireFundingAgency</search-configuration>
|
||||||
<repeatable>false</repeatable>
|
<repeatable>false</repeatable>
|
||||||
<name-variants>false</name-variants>
|
<name-variants>false</name-variants>
|
||||||
<label>Funding Agency</label>
|
<label>Funding Agency</label>
|
||||||
@@ -1302,7 +1302,7 @@
|
|||||||
</row>
|
</row>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form name="openAIREOrganizationForm">
|
<form name="openaireOrganizationForm">
|
||||||
<row>
|
<row>
|
||||||
<field>
|
<field>
|
||||||
<dc-schema>organization</dc-schema>
|
<dc-schema>organization</dc-schema>
|
||||||
@@ -1537,7 +1537,7 @@
|
|||||||
</pair>
|
</pair>
|
||||||
</value-pairs>
|
</value-pairs>
|
||||||
|
|
||||||
<!-- OpenAIRE specific value pairs -->
|
<!-- Openaire specific value pairs -->
|
||||||
|
|
||||||
<value-pairs value-pairs-name="openaire_license_types" dc-term="license">
|
<value-pairs value-pairs-name="openaire_license_types" dc-term="license">
|
||||||
|
|
||||||
@@ -1579,7 +1579,7 @@
|
|||||||
|
|
||||||
</value-pairs>
|
</value-pairs>
|
||||||
|
|
||||||
<!-- OpenAIRE document types
|
<!-- Openaire document types
|
||||||
https://openaire-guidelines-for-literature-repository-managers.readthedocs.io/en/v4.0.0/field_publicationtype.html
|
https://openaire-guidelines-for-literature-repository-managers.readthedocs.io/en/v4.0.0/field_publicationtype.html
|
||||||
Based on COAR Vocabularies -> Controlled Vocabulary for Resource Type Genres (Version 2.0):
|
Based on COAR Vocabularies -> Controlled Vocabulary for Resource Type Genres (Version 2.0):
|
||||||
http://vocabularies.coar-repositories.org/documentation/resource_types/
|
http://vocabularies.coar-repositories.org/documentation/resource_types/
|
||||||
|
@@ -160,29 +160,6 @@
|
|||||||
<filter class="solr.TrimFilterFactory" />
|
<filter class="solr.TrimFilterFactory" />
|
||||||
</analyzer>
|
</analyzer>
|
||||||
</fieldType>
|
</fieldType>
|
||||||
|
|
||||||
<!-- This field is used for store metadatavalue (with authority, prefered label, variants and
|
|
||||||
language) to use in projection -->
|
|
||||||
<fieldType name="dspaceMetadataProjection" class="solr.TextField" sortMissingLast="true" omitNorms="true">
|
|
||||||
<analyzer>
|
|
||||||
<!--Treats the entire field as a single token, regardless of its content-->
|
|
||||||
<tokenizer class="solr.KeywordTokenizerFactory"/>
|
|
||||||
</analyzer>
|
|
||||||
</fieldType>
|
|
||||||
|
|
||||||
<!--This field is used for auto complete features in the discovery search-->
|
|
||||||
<fieldType name="dspaceAutoComplete" class="solr.TextField" sortMissingLast="true" omitNorms="true">
|
|
||||||
<analyzer>
|
|
||||||
<tokenizer class="solr.KeywordTokenizerFactory"/>
|
|
||||||
|
|
||||||
<!--Lower cases our values-->
|
|
||||||
<filter class="solr.LowerCaseFilterFactory" />
|
|
||||||
<!--Discards common words.-->
|
|
||||||
<filter class="solr.StopFilterFactory" />
|
|
||||||
<!-- The TrimFilter removes any leading or trailing whitespace -->
|
|
||||||
<filter class="solr.TrimFilterFactory" />
|
|
||||||
</analyzer>
|
|
||||||
</fieldType>
|
|
||||||
|
|
||||||
<fieldType name="keywordFilter" class="solr.TextField" sortMissingLast="true" omitNorms="true">
|
<fieldType name="keywordFilter" class="solr.TextField" sortMissingLast="true" omitNorms="true">
|
||||||
<analyzer>
|
<analyzer>
|
||||||
|
@@ -17,19 +17,22 @@ FROM solr:${SOLR_VERSION}-slim
|
|||||||
ENV AUTHORITY_CONFIGSET_PATH=/opt/solr/server/solr/configsets/authority/conf \
|
ENV AUTHORITY_CONFIGSET_PATH=/opt/solr/server/solr/configsets/authority/conf \
|
||||||
OAI_CONFIGSET_PATH=/opt/solr/server/solr/configsets/oai/conf \
|
OAI_CONFIGSET_PATH=/opt/solr/server/solr/configsets/oai/conf \
|
||||||
SEARCH_CONFIGSET_PATH=/opt/solr/server/solr/configsets/search/conf \
|
SEARCH_CONFIGSET_PATH=/opt/solr/server/solr/configsets/search/conf \
|
||||||
STATISTICS_CONFIGSET_PATH=/opt/solr/server/solr/configsets/statistics/conf
|
STATISTICS_CONFIGSET_PATH=/opt/solr/server/solr/configsets/statistics/conf \
|
||||||
|
QAEVENT_CONFIGSET_PATH=/opt/solr/server/solr/configsets/qaevent/conf
|
||||||
|
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
RUN mkdir -p $AUTHORITY_CONFIGSET_PATH && \
|
RUN mkdir -p $AUTHORITY_CONFIGSET_PATH && \
|
||||||
mkdir -p $OAI_CONFIGSET_PATH && \
|
mkdir -p $OAI_CONFIGSET_PATH && \
|
||||||
mkdir -p $SEARCH_CONFIGSET_PATH && \
|
mkdir -p $SEARCH_CONFIGSET_PATH && \
|
||||||
mkdir -p $STATISTICS_CONFIGSET_PATH
|
mkdir -p $STATISTICS_CONFIGSET_PATH && \
|
||||||
|
mkdir -p $QAEVENT_CONFIGSET_PATH
|
||||||
|
|
||||||
COPY dspace/solr/authority/conf/* $AUTHORITY_CONFIGSET_PATH/
|
COPY dspace/solr/authority/conf/* $AUTHORITY_CONFIGSET_PATH/
|
||||||
COPY dspace/solr/oai/conf/* $OAI_CONFIGSET_PATH/
|
COPY dspace/solr/oai/conf/* $OAI_CONFIGSET_PATH/
|
||||||
COPY dspace/solr/search/conf/* $SEARCH_CONFIGSET_PATH/
|
COPY dspace/solr/search/conf/* $SEARCH_CONFIGSET_PATH/
|
||||||
COPY dspace/solr/statistics/conf/* $STATISTICS_CONFIGSET_PATH/
|
COPY dspace/solr/statistics/conf/* $STATISTICS_CONFIGSET_PATH/
|
||||||
|
COPY dspace/solr/qaevent/conf/* $QAEVENT_CONFIGSET_PATH/
|
||||||
|
|
||||||
RUN chown -R solr:solr /opt/solr/server/solr/configsets
|
RUN chown -R solr:solr /opt/solr/server/solr/configsets
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user