mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-14 21:43:11 +00:00
CST-5249 rename OpenAIRE to Openaire, other minor issues
This commit is contained in:
@@ -77,7 +77,7 @@ import org.dspace.orcid.service.OrcidQueueService;
|
||||
import org.dspace.orcid.service.OrcidSynchronizationService;
|
||||
import org.dspace.orcid.service.OrcidTokenService;
|
||||
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.versioning.service.VersioningService;
|
||||
import org.dspace.workflow.WorkflowItemService;
|
||||
@@ -172,7 +172,7 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
|
||||
protected SubscribeService subscribeService;
|
||||
|
||||
@Autowired
|
||||
private QAEventsDao qaEventsDao;
|
||||
private QAEventsDAO qaEventsDao;
|
||||
|
||||
protected ItemServiceImpl() {
|
||||
super();
|
||||
|
@@ -48,7 +48,7 @@ import org.dspace.eperson.service.GroupService;
|
||||
import org.dspace.eperson.service.SubscribeService;
|
||||
import org.dspace.event.Event;
|
||||
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.util.UUIDUtils;
|
||||
import org.dspace.versioning.Version;
|
||||
@@ -109,7 +109,7 @@ public class EPersonServiceImpl extends DSpaceObjectServiceImpl<EPerson> impleme
|
||||
@Autowired
|
||||
protected OrcidTokenService orcidTokenService;
|
||||
@Autowired
|
||||
protected QAEventsDao qaEventsDao;
|
||||
protected QAEventsDAO qaEventsDao;
|
||||
|
||||
protected EPersonServiceImpl() {
|
||||
super();
|
||||
|
@@ -40,20 +40,20 @@ import org.json.JSONObject;
|
||||
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
|
||||
*
|
||||
* @author paulo-graca
|
||||
*
|
||||
*/
|
||||
public class OpenAIRERestConnector {
|
||||
public class OpenaireRestConnector {
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
private String url = "https://api.openaire.eu";
|
||||
@@ -65,30 +65,30 @@ public class OpenAIRERestConnector {
|
||||
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
|
||||
*/
|
||||
private String tokenServiceUrl;
|
||||
|
||||
/**
|
||||
* OpenAIRE clientId
|
||||
* Openaire clientId
|
||||
* and can be configured with: openaire.token.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
|
||||
*/
|
||||
private String clientSecret;
|
||||
|
||||
|
||||
public OpenAIRERestConnector(String url) {
|
||||
public OpenaireRestConnector(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
@@ -99,11 +99,11 @@ public class OpenAIRERestConnector {
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
public OpenAIRERestToken grabNewAccessToken() throws IOException {
|
||||
public OpenaireRestToken grabNewAccessToken() throws IOException {
|
||||
|
||||
if (StringUtils.isBlank(tokenServiceUrl) || StringUtils.isBlank(clientId)
|
||||
|| StringUtils.isBlank(clientSecret)) {
|
||||
throw new IOException("Cannot grab OpenAIRE token with nulls service url, client id or secret");
|
||||
throw new IOException("Cannot grab Openaire token with nulls service url, client id or secret");
|
||||
}
|
||||
|
||||
String auth = clientId + ":" + 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");
|
||||
}
|
||||
|
||||
return new OpenAIRERestToken(responseObject.get("access_token").toString(),
|
||||
return new OpenaireRestToken(responseObject.get("access_token").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 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 size
|
||||
* @param keywords
|
||||
* @return OpenAIRE Response
|
||||
* @return Openaire Response
|
||||
*/
|
||||
public Response searchProjectByKeywords(int page, int size, String... 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 projectFunder
|
||||
* @param page
|
||||
* @param size
|
||||
* @return OpenAIRE Response
|
||||
* @return Openaire Response
|
||||
*/
|
||||
public Response searchProjectByIDAndFunder(String projectID, String projectFunder, int page, int size) {
|
||||
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 page
|
||||
* @param size
|
||||
* @return OpenAIRE Response
|
||||
* @return Openaire Response
|
||||
*/
|
||||
public Response search(String path, int page, int size) {
|
||||
String[] queryStringPagination = { "page=" + page, "size=" + size };
|
@@ -8,13 +8,13 @@
|
||||
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
|
||||
*
|
||||
* @author paulo-graca
|
||||
*
|
||||
*/
|
||||
public class OpenAIRERestToken {
|
||||
public class OpenaireRestToken {
|
||||
|
||||
/**
|
||||
* Stored access token
|
||||
@@ -32,7 +32,7 @@ public class OpenAIRERestToken {
|
||||
* @param accessToken
|
||||
* @param expiresIn
|
||||
*/
|
||||
public OpenAIRERestToken(String accessToken, Long expiresIn) {
|
||||
public OpenaireRestToken(String accessToken, Long expiresIn) {
|
||||
this.accessToken = accessToken;
|
||||
this.setExpirationDate(expiresIn);
|
||||
}
|
@@ -31,7 +31,7 @@ import eu.openaire.oaf.model.base.Project;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
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.provider.AbstractExternalDataProvider;
|
||||
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
|
||||
* will deal with the OpenAIRE External Data lookup
|
||||
* will deal with the Openaire External Data lookup
|
||||
*
|
||||
* @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
|
||||
@@ -75,7 +75,7 @@ public class OpenAIREFundingDataProvider extends AbstractExternalDataProvider {
|
||||
/**
|
||||
* Connector to handle token and requests
|
||||
*/
|
||||
protected OpenAIRERestConnector connector;
|
||||
protected OpenaireRestConnector connector;
|
||||
|
||||
protected Map<String, MetadataFieldConfig> metadataFields;
|
||||
|
||||
@@ -93,7 +93,7 @@ public class OpenAIREFundingDataProvider extends AbstractExternalDataProvider {
|
||||
// characters that must be escaped for the <:entry-id>
|
||||
String decodedId = new String(Base64.getDecoder().decode(id));
|
||||
if (!isValidProjectURI(decodedId)) {
|
||||
log.error("Invalid ID for OpenAIREFunding - " + id);
|
||||
log.error("Invalid ID for OpenaireFunding - " + id);
|
||||
return Optional.empty();
|
||||
}
|
||||
Response response = searchByProjectURI(decodedId);
|
||||
@@ -101,7 +101,7 @@ public class OpenAIREFundingDataProvider extends AbstractExternalDataProvider {
|
||||
try {
|
||||
if (response.getHeader() != null && Integer.parseInt(response.getHeader().getTotal()) > 0) {
|
||||
Project project = response.getResults().getResult().get(0).getMetadata().getEntity().getProject();
|
||||
ExternalDataObject externalDataObject = new OpenAIREFundingDataProvider
|
||||
ExternalDataObject externalDataObject = new OpenaireFundingDataProvider
|
||||
.ExternalDataObjectBuilder(project)
|
||||
.setId(generateProjectURI(project))
|
||||
.setSource(sourceIdentifier)
|
||||
@@ -123,7 +123,7 @@ public class OpenAIREFundingDataProvider extends AbstractExternalDataProvider {
|
||||
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;
|
||||
|
||||
// escaping query
|
||||
@@ -148,7 +148,7 @@ public class OpenAIREFundingDataProvider extends AbstractExternalDataProvider {
|
||||
|
||||
if (projects.size() > 0) {
|
||||
return projects.stream()
|
||||
.map(project -> new OpenAIREFundingDataProvider
|
||||
.map(project -> new OpenaireFundingDataProvider
|
||||
.ExternalDataObjectBuilder(project)
|
||||
.setId(generateProjectURI(project))
|
||||
.setSource(sourceIdentifier)
|
||||
@@ -176,24 +176,24 @@ public class OpenAIREFundingDataProvider extends AbstractExternalDataProvider {
|
||||
* Generic setter for the sourceIdentifier
|
||||
*
|
||||
* @param sourceIdentifier The sourceIdentifier to be set on this
|
||||
* OpenAIREFunderDataProvider
|
||||
* OpenaireFunderDataProvider
|
||||
*/
|
||||
@Autowired(required = true)
|
||||
public void setSourceIdentifier(String sourceIdentifier) {
|
||||
this.sourceIdentifier = sourceIdentifier;
|
||||
}
|
||||
|
||||
public OpenAIRERestConnector getConnector() {
|
||||
public OpenaireRestConnector getConnector() {
|
||||
return connector;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic setter for OpenAIRERestConnector
|
||||
* Generic setter for OpenaireRestConnector
|
||||
*
|
||||
* @param connector
|
||||
*/
|
||||
@Autowired(required = true)
|
||||
public void setConnector(OpenAIRERestConnector connector) {
|
||||
public void setConnector(OpenaireRestConnector 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
|
||||
* can be used as an ID if is there any missing part, that part it will be
|
||||
* 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
|
||||
*/
|
@@ -16,7 +16,7 @@ import org.dspace.qaevent.service.QAEventService;
|
||||
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)
|
||||
*
|
||||
|
@@ -10,7 +10,7 @@ package org.dspace.qaevent;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 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)
|
||||
*
|
||||
|
@@ -22,7 +22,7 @@ import org.dspace.eperson.EPerson;
|
||||
* @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.
|
@@ -17,16 +17,16 @@ import org.dspace.content.QAEventProcessed;
|
||||
import org.dspace.core.AbstractHibernateDAO;
|
||||
import org.dspace.core.Context;
|
||||
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.
|
||||
*
|
||||
* @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
|
||||
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)
|
||||
throws SQLException {
|
||||
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.setMaxResults(size);
|
||||
query.setParameter("event_id", eventId);
|
@@ -42,7 +42,9 @@ import org.dspace.utils.DSpace;
|
||||
/**
|
||||
* 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
|
||||
* 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/>
|
||||
* { <br/>
|
||||
|
@@ -54,12 +54,12 @@ public class OpenaireEventsImportScriptConfiguration<T extends OpenaireEventsImp
|
||||
if (options == null) {
|
||||
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.");
|
||||
options.getOption("f").setType(InputStream.class);
|
||||
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.");
|
||||
options.getOption("e").setType(String.class);
|
||||
options.getOption("e").setRequired(false);
|
||||
|
@@ -11,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* 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)
|
||||
*
|
||||
*/
|
||||
|
@@ -43,8 +43,8 @@ import org.dspace.core.Context;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.qaevent.QASource;
|
||||
import org.dspace.qaevent.QATopic;
|
||||
import org.dspace.qaevent.dao.QAEventsDao;
|
||||
import org.dspace.qaevent.dao.impl.QAEventsDaoImpl;
|
||||
import org.dspace.qaevent.dao.QAEventsDAO;
|
||||
import org.dspace.qaevent.dao.impl.QAEventsDAOImpl;
|
||||
import org.dspace.qaevent.service.QAEventService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
@@ -54,7 +54,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
* 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
|
||||
* 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)
|
||||
*
|
||||
@@ -71,7 +71,7 @@ public class QAEventServiceImpl implements QAEventService {
|
||||
private HandleService handleService;
|
||||
|
||||
@Autowired
|
||||
private QAEventsDaoImpl qaEventsDao;
|
||||
private QAEventsDAOImpl qaEventsDao;
|
||||
|
||||
private ObjectMapper jsonMapper;
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
http://www.springframework.org/schema/util/spring-util.xsd"
|
||||
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}"/>
|
||||
<property name="tokenEnabled" value="${openaire.token.enabled:false}"/>
|
||||
<property name="tokenServiceUrl" value="${openaire.token.url:https://aai.openaire.eu/oidc/token}"/>
|
||||
@@ -15,10 +15,10 @@
|
||||
<property name="clientSecret" value="${openaire.token.clientSecret}"/>
|
||||
</bean>
|
||||
<bean
|
||||
class="org.dspace.external.provider.impl.OpenAIREFundingDataProvider"
|
||||
class="org.dspace.external.provider.impl.OpenaireFundingDataProvider"
|
||||
init-method="init">
|
||||
<property name="sourceIdentifier" value="openAIREFunding" />
|
||||
<property name="connector" ref="mockOpenAIRERestConnector" />
|
||||
<property name="sourceIdentifier" value="openaireFunding" />
|
||||
<property name="connector" ref="mockOpenaireRestConnector" />
|
||||
<property name="metadataFields" ref="mapOfmetadata"/>
|
||||
<property name="supportedEntityTypes">
|
||||
<list>
|
||||
|
@@ -286,7 +286,7 @@
|
||||
</property>
|
||||
</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
|
||||
-->
|
||||
<bean id="openaire_filter" class="org.dspace.content.logic.DefaultFilter">
|
||||
@@ -329,7 +329,7 @@
|
||||
</list>
|
||||
</property>
|
||||
</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/") -->
|
||||
<bean id="has-openaire-relation_condition"
|
||||
class="org.dspace.content.logic.condition.MetadataValueMatchCondition">
|
||||
|
@@ -66,7 +66,7 @@
|
||||
</bean>
|
||||
|
||||
<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"/>
|
||||
</bean>
|
||||
|
||||
|
@@ -1200,4 +1200,71 @@ public class CollectionTest extends AbstractDSpaceObjectTest {
|
||||
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;
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @author pgraca
|
||||
*
|
||||
*/
|
||||
public class MockOpenAIRERestConnector extends OpenAIRERestConnector {
|
||||
public class MockOpenaireRestConnector extends OpenaireRestConnector {
|
||||
|
||||
public MockOpenAIRERestConnector(String url) {
|
||||
public MockOpenaireRestConnector(String url) {
|
||||
super(url);
|
||||
}
|
||||
|
@@ -23,15 +23,15 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Unit tests for OpenAIREFundingDataProvider
|
||||
* Unit tests for OpenaireFundingDataProvider
|
||||
*
|
||||
* @author pgraca
|
||||
*
|
||||
*/
|
||||
public class OpenAIREFundingDataProviderTest extends AbstractDSpaceTest {
|
||||
public class OpenaireFundingDataProviderTest extends AbstractDSpaceTest {
|
||||
|
||||
ExternalDataService externalDataService;
|
||||
ExternalDataProvider openAIREFundingDataProvider;
|
||||
ExternalDataProvider openaireFundingDataProvider;
|
||||
|
||||
/**
|
||||
* 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() {
|
||||
// Set up External Service Factory and set data providers
|
||||
externalDataService = ExternalServiceFactory.getInstance().getExternalDataService();
|
||||
openAIREFundingDataProvider = externalDataService.getExternalDataProvider("openAIREFunding");
|
||||
openaireFundingDataProvider = externalDataService.getExternalDataProvider("openaireFunding");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNumberOfResultsWSingleKeyword() {
|
||||
assertNotNull("openAIREFundingDataProvider is not null", openAIREFundingDataProvider);
|
||||
assertEquals("openAIREFunding.numberOfResults.query:mock", 77,
|
||||
openAIREFundingDataProvider.getNumberOfResults("mock"));
|
||||
assertNotNull("openaireFundingDataProvider is not null", openaireFundingDataProvider);
|
||||
assertEquals("openaireFunding.numberOfResults.query:mock", 77,
|
||||
openaireFundingDataProvider.getNumberOfResults("mock"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNumberOfResultsWKeywords() {
|
||||
assertNotNull("openAIREFundingDataProvider is not null", openAIREFundingDataProvider);
|
||||
assertEquals("openAIREFunding.numberOfResults.query:mock+test", 77,
|
||||
openAIREFundingDataProvider.getNumberOfResults("mock+test"));
|
||||
assertNotNull("openaireFundingDataProvider is not null", openaireFundingDataProvider);
|
||||
assertEquals("openaireFunding.numberOfResults.query:mock+test", 77,
|
||||
openaireFundingDataProvider.getNumberOfResults("mock+test"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testQueryResultsWSingleKeyword() {
|
||||
assertNotNull("openAIREFundingDataProvider is not null", openAIREFundingDataProvider);
|
||||
List<ExternalDataObject> results = openAIREFundingDataProvider.searchExternalDataObjects("mock", 0, 10);
|
||||
assertEquals("openAIREFunding.searchExternalDataObjects.size", 10, results.size());
|
||||
assertNotNull("openaireFundingDataProvider is not null", openaireFundingDataProvider);
|
||||
List<ExternalDataObject> results = openaireFundingDataProvider.searchExternalDataObjects("mock", 0, 10);
|
||||
assertEquals("openaireFunding.searchExternalDataObjects.size", 10, results.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testQueryResultsWKeywords() {
|
||||
String value = "Mushroom Robo-Pic - Development of an autonomous robotic mushroom picking system";
|
||||
|
||||
assertNotNull("openAIREFundingDataProvider is not null", openAIREFundingDataProvider);
|
||||
List<ExternalDataObject> results = openAIREFundingDataProvider.searchExternalDataObjects("mock+test", 0, 10);
|
||||
assertEquals("openAIREFunding.searchExternalDataObjects.size", 10, results.size());
|
||||
assertTrue("openAIREFunding.searchExternalDataObjects.first.value", value.equals(results.get(0).getValue()));
|
||||
assertNotNull("openaireFundingDataProvider is not null", openaireFundingDataProvider);
|
||||
List<ExternalDataObject> results = openaireFundingDataProvider.searchExternalDataObjects("mock+test", 0, 10);
|
||||
assertEquals("openaireFunding.searchExternalDataObjects.size", 10, results.size());
|
||||
assertTrue("openaireFunding.searchExternalDataObjects.first.value", value.equals(results.get(0).getValue()));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -84,22 +84,22 @@ public class OpenAIREFundingDataProviderTest extends AbstractDSpaceTest {
|
||||
String value = "Portuguese Wild Mushrooms: Chemical characterization and functional study"
|
||||
+ " 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.value", value.equals(result.get().getValue()));
|
||||
assertTrue("openaireFunding.getExternalDataObject.exists", result.isPresent());
|
||||
assertTrue("openaireFunding.getExternalDataObject.value", value.equals(result.get().getValue()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetDataObjectWInvalidId() {
|
||||
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());
|
||||
}
|
||||
}
|
@@ -1093,6 +1093,17 @@ public class RestResourceController implements InitializingBean {
|
||||
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)
|
||||
public ResponseEntity<RepresentationModel<?>> delete(HttpServletRequest request, @PathVariable String apiCategory,
|
||||
@PathVariable String model, @PathVariable Integer id)
|
||||
|
@@ -23,7 +23,7 @@ import org.dspace.content.QAEvent;
|
||||
import org.dspace.content.service.ItemService;
|
||||
import org.dspace.core.Context;
|
||||
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.util.UUIDUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -48,7 +48,7 @@ public class QAEventRestRepository extends DSpaceRestRepository<QAEventRest, Str
|
||||
private QAEventService qaEventService;
|
||||
|
||||
@Autowired
|
||||
private QAEventsDao qaEventDao;
|
||||
private QAEventsDAO qaEventDao;
|
||||
|
||||
@Autowired
|
||||
private ItemService itemService;
|
||||
@@ -92,6 +92,7 @@ public class QAEventRestRepository extends DSpaceRestRepository<QAEventRest, Str
|
||||
}
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('ADMIN')")
|
||||
protected void delete(Context context, String eventId) throws AuthorizeException {
|
||||
Item item = findTargetItem(context, eventId);
|
||||
EPerson eperson = context.getCurrentUser();
|
||||
|
@@ -135,28 +135,28 @@
|
||||
<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> -->
|
||||
|
||||
<!-- OpenAIRE submission steps/forms -->
|
||||
<step-definition id="openAIREProjectForm" mandatory="true">
|
||||
<!-- Openaire submission steps/forms -->
|
||||
<step-definition id="openaireProjectForm" mandatory="true">
|
||||
<heading>submit.progressbar.describe.stepone</heading>
|
||||
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
||||
<type>submission-form</type>
|
||||
</step-definition>
|
||||
<step-definition id="openAIREPersonForm" mandatory="true">
|
||||
<step-definition id="openairePersonForm" mandatory="true">
|
||||
<heading>submit.progressbar.describe.stepone</heading>
|
||||
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
||||
<type>submission-form</type>
|
||||
</step-definition>
|
||||
<step-definition id="openAIREOrganizationForm" mandatory="true">
|
||||
<step-definition id="openaireOrganizationForm" mandatory="true">
|
||||
<heading>submit.progressbar.describe.stepone</heading>
|
||||
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
||||
<type>submission-form</type>
|
||||
</step-definition>
|
||||
<step-definition id="openAIREPublicationPageoneForm" mandatory="true">
|
||||
<step-definition id="openairePublicationPageoneForm" mandatory="true">
|
||||
<heading>submit.progressbar.describe.stepone</heading>
|
||||
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
||||
<type>submission-form</type>
|
||||
</step-definition>
|
||||
<step-definition id="openAIREPublicationPagetwoForm" mandatory="true">
|
||||
<step-definition id="openairePublicationPagetwoForm" mandatory="true">
|
||||
<heading>submit.progressbar.describe.stepone</heading>
|
||||
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
||||
<type>submission-form</type>
|
||||
@@ -259,13 +259,13 @@
|
||||
<step id="license"/>
|
||||
</submission-process>
|
||||
|
||||
<!-- OpenAIRE submission processes -->
|
||||
<submission-process name="openAIREPublicationSubmission">
|
||||
<!-- Openaire submission processes -->
|
||||
<submission-process name="openairePublicationSubmission">
|
||||
<step id="collection"/>
|
||||
|
||||
<!--Step will be to Describe the item. -->
|
||||
<step id="openAIREPublicationPageoneForm"/>
|
||||
<step id="openAIREPublicationPagetwoForm"/>
|
||||
<step id="openairePublicationPageoneForm"/>
|
||||
<step id="openairePublicationPagetwoForm"/>
|
||||
|
||||
<!--Step will be to Upload the item -->
|
||||
<!-- step id="upload-with-embargo"/-->
|
||||
@@ -274,17 +274,17 @@
|
||||
<!--Step will be to Sign off on the License -->
|
||||
<step id="license"/>
|
||||
</submission-process>
|
||||
<submission-process name="openAIREPersonSubmission">
|
||||
<submission-process name="openairePersonSubmission">
|
||||
<step id="collection"/>
|
||||
<step id="openAIREPersonForm"/>
|
||||
<step id="openairePersonForm"/>
|
||||
</submission-process>
|
||||
<submission-process name="openAIREProjectSubmission">
|
||||
<submission-process name="openaireProjectSubmission">
|
||||
<step id="collection"/>
|
||||
<step id="openAIREProjectForm"/>
|
||||
<step id="openaireProjectForm"/>
|
||||
</submission-process>
|
||||
<submission-process name="openAIREOrganizationSubmission">
|
||||
<submission-process name="openaireOrganizationSubmission">
|
||||
<step id="collection"/>
|
||||
<step id="openAIREOrganizationForm"/>
|
||||
<step id="openaireOrganizationForm"/>
|
||||
</submission-process>
|
||||
</submission-definitions>
|
||||
|
||||
|
@@ -4,8 +4,8 @@
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"
|
||||
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}" />
|
||||
<property name="tokenEnabled"
|
||||
@@ -18,10 +18,10 @@
|
||||
value="${openaire.token.clientSecret}" />
|
||||
</bean>
|
||||
<bean
|
||||
class="org.dspace.external.provider.impl.MockOpenAIREFundingDataProvider"
|
||||
class="org.dspace.external.provider.impl.MockOpenaireFundingDataProvider"
|
||||
init-method="init">
|
||||
<property name="sourceIdentifier" value="openAIREFunding" />
|
||||
<property name="connector" ref="openAIRERestConnector" />
|
||||
<property name="sourceIdentifier" value="openaireFunding" />
|
||||
<property name="connector" ref="openaireRestConnector" />
|
||||
<property name="supportedEntityTypes">
|
||||
<list>
|
||||
<value>Project</value>
|
||||
|
@@ -86,8 +86,8 @@
|
||||
|
||||
<!-- search for an entity that can be a Person or an OrgUnit -->
|
||||
<entry key="personOrOrgunit" value-ref="personOrOrgunit"/>
|
||||
<!-- OpenAIRE4 guidelines - search for an OrgUnit that have a specific dc.type=FundingOrganization -->
|
||||
<entry key="openAIREFundingAgency" value-ref="openAIREFundingAgency"/>
|
||||
<!-- Openaire4 guidelines - search for an OrgUnit that have a specific dc.type=FundingOrganization -->
|
||||
<entry key="openaireFundingAgency" value-ref="openaireFundingAgency"/>
|
||||
<entry key="eperson_claims" value-ref="eperson_claims"/>
|
||||
|
||||
|
||||
|
@@ -1057,8 +1057,8 @@ public class DiscoveryVersioningIT extends AbstractControllerIntegrationTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_discoveryXml_openAIREFundingAgency_expectLatestVersionsOnly() throws Exception {
|
||||
final String configuration = "openAIREFundingAgency";
|
||||
public void test_discoveryXml_openaireFundingAgency_expectLatestVersionsOnly() throws Exception {
|
||||
final String configuration = "openaireFundingAgency";
|
||||
|
||||
|
||||
Collection collection = createCollection("OrgUnit");
|
||||
|
@@ -51,7 +51,7 @@ public class ExternalSourcesRestControllerIT extends AbstractControllerIntegrati
|
||||
ExternalSourceMatcher.matchExternalSource(
|
||||
"pubmed", "pubmed", false),
|
||||
ExternalSourceMatcher.matchExternalSource(
|
||||
"openAIREFunding", "openAIREFunding", false)
|
||||
"openaireFunding", "openaireFunding", false)
|
||||
)))
|
||||
.andExpect(jsonPath("$.page.totalElements", Matchers.is(10)));
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ import org.dspace.app.rest.test.AbstractControllerIntegrationTest;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Test;
|
||||
|
||||
public class OpenAIREFundingExternalSourcesIT extends AbstractControllerIntegrationTest {
|
||||
public class OpenaireFundingExternalSourcesIT extends AbstractControllerIntegrationTest {
|
||||
|
||||
/**
|
||||
* Test openaire funding external source
|
||||
@@ -27,10 +27,10 @@ public class OpenAIREFundingExternalSourcesIT extends AbstractControllerIntegrat
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
public void findOneOpenAIREFundingExternalSourceTest() throws Exception {
|
||||
public void findOneOpenaireFundingExternalSourceTest() throws Exception {
|
||||
getClient().perform(get("/api/integration/externalsources")).andExpect(status().isOk())
|
||||
.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
|
||||
*/
|
||||
@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)));
|
||||
}
|
||||
|
||||
@@ -52,11 +52,11 @@ public class OpenAIREFundingExternalSourcesIT extends AbstractControllerIntegrat
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
public void findOneOpenAIREFundingExternalSourceEntriesWithQueryMultipleKeywordsTest() throws Exception {
|
||||
public void findOneOpenaireFundingExternalSourceEntriesWithQueryMultipleKeywordsTest() throws Exception {
|
||||
|
||||
getClient()
|
||||
.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)));
|
||||
}
|
||||
|
||||
@@ -66,14 +66,14 @@ public class OpenAIREFundingExternalSourcesIT extends AbstractControllerIntegrat
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
public void findOneOpenAIREFundingExternalSourceEntriesWithQueryTest() throws Exception {
|
||||
getClient().perform(get("/api/integration/externalsources/openAIREFunding/entries").param("query", "mushroom"))
|
||||
public void findOneOpenaireFundingExternalSourceEntriesWithQueryTest() throws Exception {
|
||||
getClient().perform(get("/api/integration/externalsources/openaireFunding/entries").param("query", "mushroom"))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$._embedded.externalSourceEntries",
|
||||
Matchers.hasItem(ExternalSourceEntryMatcher.matchExternalSourceEntry(
|
||||
"aW5mbzpldS1yZXBvL2dyYW50QWdyZWVtZW50L05XTy8rLzIzMDAxNDc3MjgvTkw=",
|
||||
"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
|
||||
*/
|
||||
@Test
|
||||
public void findOneOpenAIREFundingExternalSourceEntryValueTest() throws Exception {
|
||||
public void findOneOpenaireFundingExternalSourceEntryValueTest() throws Exception {
|
||||
|
||||
// "info:eu-repo/grantAgreement/mock/mock/mock/mock" base64 encoded
|
||||
String projectID = "aW5mbzpldS1yZXBvL2dyYW50QWdyZWVtZW50L0ZDVC81ODc2LVBQQ0RUSS8xMTAwNjIvUFQ=";
|
||||
String projectName = "Portuguese Wild Mushrooms: Chemical characterization and functional study"
|
||||
+ " 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(jsonPath("$",
|
||||
Matchers.allOf(hasJsonPath("$.id", is(projectID)), hasJsonPath("$.display", is(projectName)),
|
||||
hasJsonPath("$.value", is(projectName)),
|
||||
hasJsonPath("$.externalSource", is("openAIREFunding")),
|
||||
hasJsonPath("$.externalSource", is("openaireFunding")),
|
||||
hasJsonPath("$.type", is("externalSourceEntry")))));
|
||||
|
||||
}
|
@@ -44,7 +44,7 @@ import org.dspace.content.EntityType;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.content.QAEvent;
|
||||
import org.dspace.content.QAEventProcessed;
|
||||
import org.dspace.qaevent.dao.QAEventsDao;
|
||||
import org.dspace.qaevent.dao.QAEventsDAO;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -58,7 +58,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
private QAEventsDao qaEventsDao;
|
||||
private QAEventsDAO qaEventsDao;
|
||||
|
||||
@Test
|
||||
public void findAllNotImplementedTest() throws Exception {
|
||||
@@ -759,6 +759,11 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
.withMessage("{\"pids[0].type\":\"doi\",\"pids[0].value\":\"10.2307/2144300\"}")
|
||||
.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();
|
||||
|
||||
String authToken = getAuthToken(admin.getEmail(), password);
|
||||
@@ -786,5 +791,11 @@ public class QAEventRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
assertThat(processedEvent.getEventTimestamp(), notNullValue());
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ import javax.xml.bind.JAXBException;
|
||||
|
||||
import eu.openaire.jaxb.helper.OpenAIREHandler;
|
||||
import eu.openaire.jaxb.model.Response;
|
||||
import org.dspace.external.OpenAIRERestConnector;
|
||||
import org.dspace.external.OpenaireRestConnector;
|
||||
import org.mockito.AdditionalMatchers;
|
||||
import org.mockito.ArgumentMatchers;
|
||||
import org.mockito.Mockito;
|
||||
@@ -22,14 +22,14 @@ import org.mockito.invocation.InvocationOnMock;
|
||||
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
|
||||
*
|
||||
*/
|
||||
public class MockOpenAIREFundingDataProvider extends OpenAIREFundingDataProvider {
|
||||
public class MockOpenaireFundingDataProvider extends OpenaireFundingDataProvider {
|
||||
@Override
|
||||
public void init() throws IOException {
|
||||
OpenAIRERestConnector restConnector = Mockito.mock(OpenAIRERestConnector.class);
|
||||
OpenaireRestConnector restConnector = Mockito.mock(OpenaireRestConnector.class);
|
||||
|
||||
when(restConnector.searchProjectByKeywords(ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt(),
|
||||
ArgumentMatchers.startsWith("mushroom"))).thenAnswer(new Answer<Response>() {
|
@@ -1,5 +1,5 @@
|
||||
<?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"
|
||||
xmlns:doc="http://www.lyncode.com/xoai">
|
||||
<xsl:output indent="yes" method="xml" omit-xml-declaration="yes"/>
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<!--
|
||||
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
|
||||
-->
|
||||
<xsl:template
|
||||
|
@@ -47,7 +47,7 @@
|
||||
</Context>
|
||||
|
||||
<!--
|
||||
OpenAIRE Guidelines 3.0:
|
||||
Openaire Guidelines 3.0:
|
||||
|
||||
- https://guidelines.openaire.eu/
|
||||
|
||||
@@ -55,10 +55,10 @@
|
||||
|
||||
- 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 -->
|
||||
<Transformer ref="openaireTransformer"/>
|
||||
<!-- OpenAIRE filter -->
|
||||
<!-- Openaire filter -->
|
||||
<Filter ref="openAireFilter"/>
|
||||
<!-- Just an alias, in fact it returns all items within the driver context -->
|
||||
<Set ref="openaireSet"/>
|
||||
@@ -66,12 +66,12 @@
|
||||
<Format ref="oaidc"/>
|
||||
<Format ref="mets"/>
|
||||
<Description>
|
||||
This contexts complies with OpenAIRE Guidelines for Literature Repositories v3.0.
|
||||
This contexts complies with Openaire Guidelines for Literature Repositories v3.0.
|
||||
</Description>
|
||||
</Context>
|
||||
|
||||
<!--
|
||||
OpenAIRE Guidelines 4.0:
|
||||
Openaire Guidelines 4.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.
|
||||
-->
|
||||
<Context baseurl="openaire4" name="OpenAIRE 4 Context">
|
||||
<Context baseurl="openaire4" name="Openaire 4 Context">
|
||||
<!-- Date format, field prefixes, etc are ensured by the transformer -->
|
||||
<Transformer ref="openaire4Transformer"/>
|
||||
<!-- OpenAIRE filter -->
|
||||
<Filter ref="openAIRE4Filter"/>
|
||||
<!-- Openaire filter -->
|
||||
<Filter ref="openaire4Filter"/>
|
||||
<!-- Metadata Formats -->
|
||||
<Format ref="oaiopenaire"/>
|
||||
<Description>
|
||||
This contexts complies with OpenAIRE Guidelines for Literature Repositories v4.0.
|
||||
This contexts complies with Openaire Guidelines for Literature Repositories v4.0.
|
||||
</Description>
|
||||
</Context>
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
<Namespace>http://irdb.nii.ac.jp/oai</Namespace>
|
||||
<SchemaLocation>http://irdb.nii.ac.jp/oai/junii2-3-1.xsd</SchemaLocation>
|
||||
</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
|
||||
-->
|
||||
<Format id="oaiopenaire">
|
||||
@@ -250,13 +250,13 @@
|
||||
</Definition>
|
||||
</Filter>
|
||||
|
||||
<!-- OpenAIRE filter for records returned by OAI-PMH.
|
||||
<!-- Openaire filter for records returned by OAI-PMH.
|
||||
By default, return an Item record:
|
||||
* If a Title & Author field both exist
|
||||
* AND a valid DRIVER Document Type exists
|
||||
* AND Item is either publicly accessible OR Withdrawn (for tombstones)
|
||||
* AND the OpenAIRE "dc.relation" is specified
|
||||
This filter is only used in the OpenAIRE context ([oai]/openaire).
|
||||
* AND the Openaire "dc.relation" is specified
|
||||
This filter is only used in the Openaire context ([oai]/openaire).
|
||||
-->
|
||||
<Filter id="openAireFilter">
|
||||
<Definition>
|
||||
@@ -319,7 +319,7 @@
|
||||
</Definition>
|
||||
</Filter>
|
||||
|
||||
<!-- OpenAIRE4 filter for records returned by OAI-PMH.
|
||||
<!-- Openaire4 filter for records returned by OAI-PMH.
|
||||
By default, return an Item record:
|
||||
* If it is publicly accessible
|
||||
* * OR it has been withdrawn (in order to display a tombstone record).
|
||||
@@ -328,7 +328,7 @@
|
||||
* limiting the results only to Publications as expected
|
||||
This filter is used by the default context ([oai]/request).
|
||||
-->
|
||||
<Filter id="openAIRE4Filter">
|
||||
<Filter id="openaire4Filter">
|
||||
<Definition>
|
||||
<And>
|
||||
<LeftCondition>
|
||||
@@ -457,7 +457,7 @@
|
||||
|
||||
<!-- This condition determines if an Item has a "dc.rights" field
|
||||
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">
|
||||
<Class>org.dspace.xoai.filter.DSpaceAtLeastOneMetadataFilter</Class>
|
||||
<Configuration>
|
||||
@@ -483,7 +483,7 @@
|
||||
</CustomCondition>
|
||||
|
||||
<!-- 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">
|
||||
<Class>org.dspace.xoai.filter.DSpaceAtLeastOneMetadataFilter</Class>
|
||||
<Configuration>
|
||||
@@ -526,7 +526,7 @@
|
||||
</Set>
|
||||
<Set id="openaireSet">
|
||||
<Spec>openaire</Spec>
|
||||
<Name>OpenAIRE</Name>
|
||||
<Name>Openaire</Name>
|
||||
<!-- Just an alias -->
|
||||
</Set>
|
||||
</Sets>
|
||||
|
@@ -185,28 +185,28 @@
|
||||
<type>extract</type>
|
||||
</step-definition>
|
||||
|
||||
<!-- OpenAIRE submission steps/forms -->
|
||||
<step-definition id="openAIREProjectForm" mandatory="true">
|
||||
<!-- Openaire submission steps/forms -->
|
||||
<step-definition id="openaireProjectForm" mandatory="true">
|
||||
<heading>submit.progressbar.describe.stepone</heading>
|
||||
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
||||
<type>submission-form</type>
|
||||
</step-definition>
|
||||
<step-definition id="openAIREPersonForm" mandatory="true">
|
||||
<step-definition id="openairePersonForm" mandatory="true">
|
||||
<heading>submit.progressbar.describe.stepone</heading>
|
||||
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
||||
<type>submission-form</type>
|
||||
</step-definition>
|
||||
<step-definition id="openAIREOrganizationForm" mandatory="true">
|
||||
<step-definition id="openaireOrganizationForm" mandatory="true">
|
||||
<heading>submit.progressbar.describe.stepone</heading>
|
||||
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
||||
<type>submission-form</type>
|
||||
</step-definition>
|
||||
<step-definition id="openAIREPublicationPageoneForm" mandatory="true">
|
||||
<step-definition id="openairePublicationPageoneForm" mandatory="true">
|
||||
<heading>submit.progressbar.describe.stepone</heading>
|
||||
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
||||
<type>submission-form</type>
|
||||
</step-definition>
|
||||
<step-definition id="openAIREPublicationPagetwoForm" mandatory="true">
|
||||
<step-definition id="openairePublicationPagetwoForm" mandatory="true">
|
||||
<heading>submit.progressbar.describe.stepone</heading>
|
||||
<processing-class>org.dspace.app.rest.submit.step.DescribeStep</processing-class>
|
||||
<type>submission-form</type>
|
||||
@@ -361,13 +361,13 @@
|
||||
<step id="license"/>
|
||||
</submission-process>
|
||||
|
||||
<!-- OpenAIRE submission processes -->
|
||||
<submission-process name="openAIREPublicationSubmission">
|
||||
<!-- Openaire submission processes -->
|
||||
<submission-process name="openairePublicationSubmission">
|
||||
<step id="collection"/>
|
||||
|
||||
<!--Step will be to Describe the item. -->
|
||||
<step id="openAIREPublicationPageoneForm"/>
|
||||
<step id="openAIREPublicationPagetwoForm"/>
|
||||
<step id="openairePublicationPageoneForm"/>
|
||||
<step id="openairePublicationPagetwoForm"/>
|
||||
|
||||
<!--Step will be to Upload the item -->
|
||||
<!-- step id="upload-with-embargo"/-->
|
||||
@@ -376,17 +376,17 @@
|
||||
<!--Step will be to Sign off on the License -->
|
||||
<step id="license"/>
|
||||
</submission-process>
|
||||
<submission-process name="openAIREPersonSubmission">
|
||||
<submission-process name="openairePersonSubmission">
|
||||
<step id="collection"/>
|
||||
<step id="openAIREPersonForm"/>
|
||||
<step id="openairePersonForm"/>
|
||||
</submission-process>
|
||||
<submission-process name="openAIREProjectSubmission">
|
||||
<submission-process name="openaireProjectSubmission">
|
||||
<step id="collection"/>
|
||||
<step id="openAIREProjectForm"/>
|
||||
<step id="openaireProjectForm"/>
|
||||
</submission-process>
|
||||
<submission-process name="openAIREOrganizationSubmission">
|
||||
<submission-process name="openaireOrganizationSubmission">
|
||||
<step id="collection"/>
|
||||
<step id="openAIREOrganizationForm"/>
|
||||
<step id="openaireOrganizationForm"/>
|
||||
</submission-process>
|
||||
</submission-definitions>
|
||||
|
||||
|
@@ -16,20 +16,20 @@
|
||||
# The accessToken it only has a validity of one hour
|
||||
# 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
|
||||
#
|
||||
# ---- Token usage required definitions ----
|
||||
# you can override this settings in your local.cfg file - can be true/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
|
||||
|
||||
# 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:
|
||||
openaire.token.clientId = CLIENT_ID_HERE
|
||||
openaire.token.clientSecret = CLIENT_SECRET_HERE
|
||||
|
||||
# URL of OpenAIRE Rest API
|
||||
# URL of Openaire Rest API
|
||||
openaire.api.url = https://api.openaire.eu
|
@@ -2,13 +2,13 @@
|
||||
<!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
|
||||
-->
|
||||
|
||||
<dspace-dc-types>
|
||||
<dspace-header>
|
||||
<title>OpenAIRE4 fields definition</title>
|
||||
<title>Openaire4 fields definition</title>
|
||||
</dspace-header>
|
||||
|
||||
<dc-schema>
|
||||
@@ -108,7 +108,7 @@
|
||||
</dc-type>
|
||||
|
||||
<!--
|
||||
OpenAIRE4 Guidelines
|
||||
Openaire4 Guidelines
|
||||
21 - Geolocation -->
|
||||
<dc-type>
|
||||
<schema>datacite</schema>
|
||||
@@ -116,7 +116,7 @@
|
||||
<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 -->
|
||||
<!-- specific type required by Openaire4 Guidelines -->
|
||||
<dc-type>
|
||||
<schema>datacite</schema>
|
||||
<element>subject</element>
|
||||
|
@@ -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>
|
||||
</dc-type>
|
||||
|
||||
<!-- OpenAIRE4 Guidelines - required relationships -->
|
||||
<!-- Openaire4 Guidelines - required relationships -->
|
||||
|
||||
<dc-type>
|
||||
<schema>relation</schema>
|
||||
|
@@ -42,10 +42,10 @@
|
||||
</scope_note>
|
||||
</dc-type>
|
||||
|
||||
<!-- OpenAIRE4 Guidelines -->
|
||||
<!-- Openaire4 Guidelines -->
|
||||
<!-- 2.2.2.1. Attribute nameType (R) -->
|
||||
<!-- and 3.2.6. Subproperty nameIdentifier (R) -->
|
||||
<!-- specific type required by OpenAIRE4 Guidelines -->
|
||||
<!-- specific type required by Openaire4 Guidelines -->
|
||||
|
||||
<dc-type>
|
||||
<schema>organization</schema>
|
||||
|
@@ -17,7 +17,7 @@
|
||||
-->
|
||||
|
||||
<!--
|
||||
OpenAIRE4 Guidelines
|
||||
Openaire4 Guidelines
|
||||
2.2.3. Subproperty givenName (R)
|
||||
The personal or first name of the author. -->
|
||||
<dc-type>
|
||||
@@ -29,7 +29,7 @@
|
||||
</dc-type>
|
||||
|
||||
<!--
|
||||
OpenAIRE4 Guidelines
|
||||
Openaire4 Guidelines
|
||||
2.2.4. Subproperty familyName (R)
|
||||
The surname or last name of the author. -->
|
||||
<dc-type>
|
||||
@@ -74,7 +74,7 @@
|
||||
</dc-type>
|
||||
|
||||
<!--
|
||||
OpenAIRE4 Guidelines
|
||||
Openaire4 Guidelines
|
||||
2.2.6. Subproperty affiliation (R)
|
||||
The organizational or institutional affiliation of the creator (occurrence: 0-n). -->
|
||||
<dc-type>
|
||||
@@ -84,10 +84,10 @@
|
||||
<scope_note>The organizational or institutional affiliation of the creator</scope_note>
|
||||
</dc-type>
|
||||
|
||||
<!-- OpenAIRE4 Guidelines -->
|
||||
<!-- Openaire4 Guidelines -->
|
||||
<!-- 2.2.2.1. Attribute nameType (R) -->
|
||||
<!-- and 3.2.6. Subproperty nameIdentifier (R) -->
|
||||
<!-- specific type required by OpenAIRE4 Guidelines -->
|
||||
<!-- specific type required by Openaire4 Guidelines -->
|
||||
<dc-type>
|
||||
<schema>person</schema>
|
||||
<element>identifier</element>
|
||||
|
@@ -18,7 +18,7 @@
|
||||
-->
|
||||
|
||||
<!--
|
||||
OpenAIRE4 Guidelines
|
||||
Openaire4 Guidelines
|
||||
4.2.2. Subproperty funderName (M)
|
||||
Name of the funding provider (occurrence: 1). Mandatory if FundingReference is used. -->
|
||||
<dc-type>
|
||||
@@ -29,7 +29,7 @@
|
||||
</dc-type>
|
||||
|
||||
<!--
|
||||
OpenAIRE4 Guidelines
|
||||
Openaire4 Guidelines
|
||||
4.2.3. Subproperty funderIdentifier (R)
|
||||
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 -->
|
||||
<entry key="personOrOrgunit" value-ref="personOrOrgunit"/>
|
||||
<!-- OpenAIRE4 guidelines - search for an OrgUnit that have a specific dc.type=FundingOrganization -->
|
||||
<entry key="openAIREFundingAgency" value-ref="openAIREFundingAgency"/>
|
||||
<!-- Openaire4 guidelines - search for an OrgUnit that have a specific dc.type=FundingOrganization -->
|
||||
<entry key="openaireFundingAgency" value-ref="openaireFundingAgency"/>
|
||||
<entry key="eperson_claims" value-ref="eperson_claims"/>
|
||||
</map>
|
||||
</property>
|
||||
@@ -2027,7 +2027,7 @@
|
||||
<property name="spellCheckEnabled" value="true"/>
|
||||
</bean>
|
||||
|
||||
<bean id="openAIREFundingAgency" class="org.dspace.discovery.configuration.DiscoveryConfiguration"
|
||||
<bean id="openaireFundingAgency" class="org.dspace.discovery.configuration.DiscoveryConfiguration"
|
||||
scope="prototype">
|
||||
<property name="id" value="fundingAgency"/>
|
||||
<property name="indexAlways" value="true"/>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
http://www.springframework.org/schema/util/spring-util.xsd"
|
||||
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}"/>
|
||||
<property name="tokenEnabled" value="${openaire.token.enabled:false}"/>
|
||||
<property name="tokenServiceUrl" value="${openaire.token.url:https://aai.openaire.eu/oidc/token}"/>
|
||||
@@ -15,9 +15,9 @@
|
||||
<property name="clientSecret" value="${openaire.token.clientSecret}"/>
|
||||
</bean>
|
||||
|
||||
<bean class="org.dspace.external.provider.impl.OpenAIREFundingDataProvider" init-method="init">
|
||||
<property name="sourceIdentifier" value="openAIREFunding" />
|
||||
<property name="connector" ref="openAIRERestConnector" />
|
||||
<bean class="org.dspace.external.provider.impl.OpenaireFundingDataProvider" init-method="init">
|
||||
<property name="sourceIdentifier" value="openaireFunding" />
|
||||
<property name="connector" ref="openaireRestConnector" />
|
||||
<property name="metadataFields" ref="mapOfmetadata"/>
|
||||
<property name="supportedEntityTypes">
|
||||
<list>
|
||||
|
@@ -286,7 +286,7 @@
|
||||
</property>
|
||||
</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
|
||||
-->
|
||||
<bean id="openaire_filter" class="org.dspace.content.logic.DefaultFilter">
|
||||
@@ -329,7 +329,7 @@
|
||||
</list>
|
||||
</property>
|
||||
</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/") -->
|
||||
<bean id="has-openaire-relation_condition"
|
||||
class="org.dspace.content.logic.condition.MetadataValueMatchCondition">
|
||||
|
@@ -9,7 +9,7 @@
|
||||
|
||||
<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" />
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
|
||||
|
||||
<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"/>
|
||||
</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
|
||||
bean if it is present-->
|
||||
<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"/>
|
||||
</bean>
|
||||
|
||||
|
@@ -819,9 +819,9 @@
|
||||
|
||||
</form>
|
||||
|
||||
<!-- OpenAIRE specific forms -->
|
||||
<!-- Openaire specific forms -->
|
||||
|
||||
<form name="openAIREPublicationPageoneForm">
|
||||
<form name="openairePublicationPageoneForm">
|
||||
<row>
|
||||
<field>
|
||||
<dc-schema>dc</dc-schema>
|
||||
@@ -1071,7 +1071,7 @@
|
||||
</row>
|
||||
</form>
|
||||
|
||||
<form name="openAIREPublicationPagetwoForm">
|
||||
<form name="openairePublicationPagetwoForm">
|
||||
<row>
|
||||
<field>
|
||||
<dc-schema>dc</dc-schema>
|
||||
@@ -1129,7 +1129,7 @@
|
||||
<dc-element>relation</dc-element>
|
||||
<input-type>onebox</input-type>
|
||||
</linked-metadata-field>
|
||||
<externalsources>openAIREFunding</externalsources>
|
||||
<externalsources>openaireFunding</externalsources>
|
||||
<required></required>
|
||||
</relation-field>
|
||||
</row>
|
||||
@@ -1182,7 +1182,7 @@
|
||||
</row>
|
||||
</form>
|
||||
|
||||
<form name="openAIREPersonForm">
|
||||
<form name="openairePersonForm">
|
||||
<row>
|
||||
<field>
|
||||
<dc-schema>person</dc-schema>
|
||||
@@ -1246,7 +1246,7 @@
|
||||
</row>
|
||||
</form>
|
||||
|
||||
<form name="openAIREProjectForm">
|
||||
<form name="openaireProjectForm">
|
||||
<row>
|
||||
<field>
|
||||
<dc-schema>dc</dc-schema>
|
||||
@@ -1269,7 +1269,7 @@
|
||||
<row>
|
||||
<relation-field>
|
||||
<relationship-type>isFundingAgencyOfProject</relationship-type>
|
||||
<search-configuration>openAIREFundingAgency</search-configuration>
|
||||
<search-configuration>openaireFundingAgency</search-configuration>
|
||||
<repeatable>false</repeatable>
|
||||
<name-variants>false</name-variants>
|
||||
<label>Funding Agency</label>
|
||||
@@ -1302,7 +1302,7 @@
|
||||
</row>
|
||||
</form>
|
||||
|
||||
<form name="openAIREOrganizationForm">
|
||||
<form name="openaireOrganizationForm">
|
||||
<row>
|
||||
<field>
|
||||
<dc-schema>organization</dc-schema>
|
||||
@@ -1537,7 +1537,7 @@
|
||||
</pair>
|
||||
</value-pairs>
|
||||
|
||||
<!-- OpenAIRE specific value pairs -->
|
||||
<!-- Openaire specific value pairs -->
|
||||
|
||||
<value-pairs value-pairs-name="openaire_license_types" dc-term="license">
|
||||
|
||||
@@ -1579,7 +1579,7 @@
|
||||
|
||||
</value-pairs>
|
||||
|
||||
<!-- OpenAIRE document types
|
||||
<!-- Openaire document types
|
||||
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):
|
||||
http://vocabularies.coar-repositories.org/documentation/resource_types/
|
||||
|
@@ -160,29 +160,6 @@
|
||||
<filter class="solr.TrimFilterFactory" />
|
||||
</analyzer>
|
||||
</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">
|
||||
<analyzer>
|
||||
|
Reference in New Issue
Block a user