fixed some problem with EOSC model

This commit is contained in:
Michele Artini 2022-03-22 08:58:20 +01:00
parent 41d4846027
commit 3b898f6a3e
6 changed files with 12 additions and 4 deletions

View File

@ -123,7 +123,7 @@
<dependency>
<groupId>eu.dnetlib</groupId>
<artifactId>dnet-datasource-manager-common</artifactId>
<version>[1.1.0,2.0.0)</version>
<version>1.2.0-EOSC-SNAPSHOT</version>
</dependency>
<dependency>

View File

@ -111,6 +111,11 @@ public class DatasourceDaoImpl implements DatasourceDao<DatasourceDbEntry, ApiDb
return dsRepository.findById(dsId).orElseThrow(() -> new DsmException("Datasource not found. ID: " + dsId));
}
@Override
public DatasourceDbEntry getDsByNsPrefix(final String prefix) throws DsmException {
return dsRepository.findByNamespaceprefix(prefix).orElseThrow(() -> new DsmException("Datasource not found. NS Prefix: " + prefix));
}
@Override
public void setManaged(final String id, final boolean managed) {
log.info(String.format("setting managed = '%s' for ds '%s'", managed, id));
@ -163,7 +168,6 @@ public class DatasourceDaoImpl implements DatasourceDao<DatasourceDbEntry, ApiDb
final DatasourceDbEntry datasource = dsRepository.save(d);
log.info(String.format("saved datasource '%s'", datasource.getId()));
ensureRegistrationDate(d.getId());
}

View File

@ -1,6 +1,7 @@
package eu.dnetlib.openaire.dsm.dao;
import java.sql.Date;
import java.util.Optional;
import javax.transaction.Transactional;
@ -20,6 +21,8 @@ import eu.dnetlib.openaire.dsm.domain.db.DatasourceDbEntry;
@ConditionalOnProperty(value = "openaire.exporter.enable.dsm", havingValue = "true")
public interface DatasourceDbEntryRepository extends JpaRepository<DatasourceDbEntry, String>, JpaSpecificationExecutor<DatasourceDbEntry> {
Optional<DatasourceDbEntry> findByNamespaceprefix(String namespaceprefix);
@Query("select d.managed from #{#entityName} d where d.id = ?1")
boolean isManaged(String id);

View File

@ -11,7 +11,7 @@ import io.swagger.annotations.ApiModel;
@Entity
@JsonAutoDetect
@Table(name = "dsm_service_api")
@Table(name = "dsm_datasource_api")
@ApiModel(value = "DatasourceApi model", description = "describes a joint view between datasources and their API (1:N)")
public class DatasourceApiDbEntry {

View File

@ -31,4 +31,5 @@ openaire.exporter.enable.info = true
# CACHE TTL, 12h
openaire.exporter.cache.ttl = 43200000
maven.pom.path = /META-INF/maven/eu.dnetlib.dhp/dnet-exporter-api/effective-pom.xml

View File

@ -15,7 +15,7 @@ openaire.exporter.cxfClientConnectTimeout = 60000
openaire.exporter.cxfClientReceiveTimeout = 120000
# JDBC
openaire.exporter.jdbc.url = jdbc:postgresql://localhost:5432/dnet_openaire
openaire.exporter.jdbc.url = jdbc:postgresql://localhost:5432/dnet_openaireplus
openaire.exporter.jdbc.user = dnetapi
openaire.exporter.jdbc.pwd = dnetPwd
openaire.exporter.jdbc.minIdle = 1