Revision 49900
Added by Claudio Atzori over 6 years ago
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/model/datasource/db/ActivationTerm.java | ||
---|---|---|
1 |
package eu.dnetlib.openaire.exporter.model.datasource.db; |
|
2 |
|
|
3 |
import javax.persistence.Entity; |
|
4 |
import javax.persistence.Id; |
|
5 |
import javax.persistence.Table; |
|
6 |
|
|
7 |
import com.fasterxml.jackson.annotation.JsonAutoDetect; |
|
8 |
|
|
9 |
import eu.dnetlib.enabling.datasources.common.BrowseTerm; |
|
10 |
import io.swagger.annotations.ApiModel; |
|
11 |
|
|
12 |
/** |
|
13 |
* Created by claudio on 20/04/2017. |
|
14 |
*/ |
|
15 |
@Entity |
|
16 |
@Table(name = "browse_activation") |
|
17 |
@ApiModel |
|
18 |
@JsonAutoDetect |
|
19 |
public class ActivationTerm implements Comparable<ActivationTerm>, BrowseTerm { |
|
20 |
|
|
21 |
@Id |
|
22 |
private String term; |
|
23 |
private long total; |
|
24 |
|
|
25 |
@Override |
|
26 |
public String getTerm() { |
|
27 |
return term; |
|
28 |
} |
|
29 |
|
|
30 |
public void setTerm(final String term) { |
|
31 |
this.term = term; |
|
32 |
} |
|
33 |
|
|
34 |
@Override |
|
35 |
public long getTotal() { |
|
36 |
return total; |
|
37 |
} |
|
38 |
|
|
39 |
public void setTotal(final long total) { |
|
40 |
this.total = total; |
|
41 |
} |
|
42 |
|
|
43 |
@Override |
|
44 |
public int compareTo(final ActivationTerm o) { |
|
45 |
return getTerm().compareTo(o.getTerm()); |
|
46 |
} |
|
47 |
|
|
48 |
} |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/model/datasource/db/SearchApisDbEntry.java | ||
---|---|---|
1 |
package eu.dnetlib.openaire.exporter.model.datasource.db; |
|
2 |
|
|
3 |
import javax.persistence.Column; |
|
4 |
import javax.persistence.Entity; |
|
5 |
import javax.persistence.Id; |
|
6 |
import javax.persistence.Table; |
|
7 |
|
|
8 |
import com.fasterxml.jackson.annotation.JsonAutoDetect; |
|
9 |
|
|
10 |
import eu.dnetlib.enabling.datasources.common.SearchApisEntry; |
|
11 |
import io.swagger.annotations.ApiModel; |
|
12 |
|
|
13 |
/** |
|
14 |
* Created by claudio on 13/04/2017. |
|
15 |
*/ |
|
16 |
@Entity |
|
17 |
@Table(name = "search_api") |
|
18 |
@ApiModel |
|
19 |
@JsonAutoDetect |
|
20 |
public class SearchApisDbEntry extends SearchApisEntry { |
|
21 |
|
|
22 |
@Id |
|
23 |
public String getId() { |
|
24 |
return super.getId(); |
|
25 |
} |
|
26 |
|
|
27 |
@Column(name = "compatibility") |
|
28 |
public String getCompliance() { |
|
29 |
return super.getCompliance(); |
|
30 |
} |
|
31 |
|
|
32 |
@Column(name = "protocol") |
|
33 |
public String getProtocol() { |
|
34 |
return super.getProtocol(); |
|
35 |
} |
|
36 |
|
|
37 |
@Column(name = "active") |
|
38 |
public boolean isActive() { |
|
39 |
return super.isActive(); |
|
40 |
} |
|
41 |
|
|
42 |
@Column(name = "repoid") |
|
43 |
public String getRepoid() { |
|
44 |
return super.getRepoId(); |
|
45 |
} |
|
46 |
|
|
47 |
@Column(name = "officialname") |
|
48 |
public String getRepoName() { |
|
49 |
return super.getRepoName(); |
|
50 |
} |
|
51 |
|
|
52 |
@Column(name = "englishname") |
|
53 |
public String getAlternativeName() { |
|
54 |
return super.getAlternativeName(); |
|
55 |
} |
|
56 |
|
|
57 |
@Column(name = "country") |
|
58 |
public String getRepoCountry() { |
|
59 |
return super.getRepoCountry(); |
|
60 |
} |
|
61 |
|
|
62 |
@Column(name = "organization") |
|
63 |
public String getRepoOrganization() { |
|
64 |
return super.getRepoOrganization(); |
|
65 |
} |
|
66 |
|
|
67 |
@Column(name = "namespaceprefix", columnDefinition = "bpchar(12)") |
|
68 |
public String getRepoPrefix() { |
|
69 |
return super.getRepoPrefix(); |
|
70 |
} |
|
71 |
|
|
72 |
@Column(name = "last_aggregation_date") |
|
73 |
public String getAggrDate() { |
|
74 |
return super.getAggrDate(); |
|
75 |
} |
|
76 |
|
|
77 |
@Column(name = "last_aggregation_total") |
|
78 |
public int getAggrTotal() { |
|
79 |
return super.getAggrTotal(); |
|
80 |
} |
|
81 |
|
|
82 |
} |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/model/datasource/db/TypologyTerm.java | ||
---|---|---|
1 |
package eu.dnetlib.openaire.exporter.model.datasource.db; |
|
2 |
|
|
3 |
import javax.persistence.Entity; |
|
4 |
import javax.persistence.Id; |
|
5 |
import javax.persistence.Table; |
|
6 |
|
|
7 |
import com.fasterxml.jackson.annotation.JsonAutoDetect; |
|
8 |
|
|
9 |
import eu.dnetlib.enabling.datasources.common.BrowseTerm; |
|
10 |
import io.swagger.annotations.ApiModel; |
|
11 |
|
|
12 |
/** |
|
13 |
* Created by claudio on 20/04/2017. |
|
14 |
*/ |
|
15 |
@Entity |
|
16 |
@Table(name = "browse_typologies") |
|
17 |
@ApiModel |
|
18 |
@JsonAutoDetect |
|
19 |
public class TypologyTerm implements Comparable<TypologyTerm>, BrowseTerm { |
|
20 |
|
|
21 |
@Id |
|
22 |
private String term; |
|
23 |
private long total; |
|
24 |
|
|
25 |
@Override |
|
26 |
public String getTerm() { |
|
27 |
return term; |
|
28 |
} |
|
29 |
|
|
30 |
public void setTerm(final String term) { |
|
31 |
this.term = term; |
|
32 |
} |
|
33 |
|
|
34 |
@Override |
|
35 |
public long getTotal() { |
|
36 |
return total; |
|
37 |
} |
|
38 |
|
|
39 |
public void setTotal(final long total) { |
|
40 |
this.total = total; |
|
41 |
} |
|
42 |
|
|
43 |
@Override |
|
44 |
public int compareTo(final TypologyTerm o) { |
|
45 |
return getTerm().compareTo(o.getTerm()); |
|
46 |
} |
|
47 |
|
|
48 |
} |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/model/datasource/db/ProtocolTerm.java | ||
---|---|---|
1 |
package eu.dnetlib.openaire.exporter.model.datasource.db; |
|
2 |
|
|
3 |
import javax.persistence.Entity; |
|
4 |
import javax.persistence.Id; |
|
5 |
import javax.persistence.Table; |
|
6 |
|
|
7 |
import com.fasterxml.jackson.annotation.JsonAutoDetect; |
|
8 |
|
|
9 |
import eu.dnetlib.enabling.datasources.common.BrowseTerm; |
|
10 |
import io.swagger.annotations.ApiModel; |
|
11 |
|
|
12 |
/** |
|
13 |
* Created by claudio on 20/04/2017. |
|
14 |
*/ |
|
15 |
@Entity |
|
16 |
@Table(name = "browse_protocols") |
|
17 |
@ApiModel |
|
18 |
@JsonAutoDetect |
|
19 |
public class ProtocolTerm implements Comparable<ProtocolTerm>, BrowseTerm { |
|
20 |
|
|
21 |
@Id |
|
22 |
private String term; |
|
23 |
private long total; |
|
24 |
|
|
25 |
@Override |
|
26 |
public String getTerm() { |
|
27 |
return term; |
|
28 |
} |
|
29 |
|
|
30 |
public void setTerm(final String term) { |
|
31 |
this.term = term; |
|
32 |
} |
|
33 |
|
|
34 |
@Override |
|
35 |
public long getTotal() { |
|
36 |
return total; |
|
37 |
} |
|
38 |
|
|
39 |
public void setTotal(final long total) { |
|
40 |
this.total = total; |
|
41 |
} |
|
42 |
|
|
43 |
@Override |
|
44 |
public int compareTo(final ProtocolTerm o) { |
|
45 |
return getTerm().compareTo(o.getTerm()); |
|
46 |
} |
|
47 |
|
|
48 |
} |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/model/datasource/db/CompatibilityTerm.java | ||
---|---|---|
1 |
package eu.dnetlib.openaire.exporter.model.datasource.db; |
|
2 |
|
|
3 |
import javax.persistence.Entity; |
|
4 |
import javax.persistence.Id; |
|
5 |
import javax.persistence.Table; |
|
6 |
|
|
7 |
import com.fasterxml.jackson.annotation.JsonAutoDetect; |
|
8 |
|
|
9 |
import eu.dnetlib.enabling.datasources.common.BrowseTerm; |
|
10 |
import io.swagger.annotations.ApiModel; |
|
11 |
|
|
12 |
/** |
|
13 |
* Created by claudio on 20/04/2017. |
|
14 |
*/ |
|
15 |
@Entity |
|
16 |
@Table(name = "browse_compatibility") |
|
17 |
@ApiModel |
|
18 |
@JsonAutoDetect |
|
19 |
public class CompatibilityTerm implements Comparable<CompatibilityTerm>, BrowseTerm { |
|
20 |
|
|
21 |
@Id |
|
22 |
private String term; |
|
23 |
private long total; |
|
24 |
|
|
25 |
@Override |
|
26 |
public String getTerm() { |
|
27 |
return term; |
|
28 |
} |
|
29 |
|
|
30 |
public void setTerm(final String term) { |
|
31 |
this.term = term; |
|
32 |
} |
|
33 |
|
|
34 |
@Override |
|
35 |
public long getTotal() { |
|
36 |
return total; |
|
37 |
} |
|
38 |
|
|
39 |
public void setTotal(final long total) { |
|
40 |
this.total = total; |
|
41 |
} |
|
42 |
|
|
43 |
@Override |
|
44 |
public int compareTo(final CompatibilityTerm o) { |
|
45 |
return getTerm().compareTo(o.getTerm()); |
|
46 |
} |
|
47 |
|
|
48 |
} |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/datasource/repository/TypologyTermRepository.java | ||
---|---|---|
1 |
package eu.dnetlib.openaire.exporter.datasource.repository; |
|
2 |
|
|
3 |
import eu.dnetlib.openaire.exporter.model.datasource.db.TypologyTerm; |
|
4 |
import org.springframework.data.jpa.repository.JpaRepository; |
|
5 |
import org.springframework.stereotype.Repository; |
|
6 |
|
|
7 |
/** |
|
8 |
* Created by claudio on 19/04/2017. |
|
9 |
*/ |
|
10 |
@Repository |
|
11 |
public interface TypologyTermRepository extends JpaRepository<TypologyTerm, String> { |
|
12 |
|
|
13 |
} |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/datasource/repository/ProtocolTermRepository.java | ||
---|---|---|
1 |
package eu.dnetlib.openaire.exporter.datasource.repository; |
|
2 |
|
|
3 |
import eu.dnetlib.openaire.exporter.model.datasource.db.ProtocolTerm; |
|
4 |
import org.springframework.data.jpa.repository.JpaRepository; |
|
5 |
import org.springframework.stereotype.Repository; |
|
6 |
|
|
7 |
/** |
|
8 |
* Created by claudio on 19/04/2017. |
|
9 |
*/ |
|
10 |
@Repository |
|
11 |
public interface ProtocolTermRepository extends JpaRepository<ProtocolTerm, String> { |
|
12 |
|
|
13 |
} |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/datasource/repository/ActivationTermRepository.java | ||
---|---|---|
1 |
package eu.dnetlib.openaire.exporter.datasource.repository; |
|
2 |
|
|
3 |
import eu.dnetlib.openaire.exporter.model.datasource.db.ActivationTerm; |
|
4 |
import org.springframework.data.jpa.repository.JpaRepository; |
|
5 |
import org.springframework.stereotype.Repository; |
|
6 |
|
|
7 |
/** |
|
8 |
* Created by claudio on 19/04/2017. |
|
9 |
*/ |
|
10 |
@Repository |
|
11 |
public interface ActivationTermRepository extends JpaRepository<ActivationTerm, String> { |
|
12 |
|
|
13 |
} |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/datasource/repository/CompatibilityTermRepository.java | ||
---|---|---|
1 |
package eu.dnetlib.openaire.exporter.datasource.repository; |
|
2 |
|
|
3 |
import eu.dnetlib.openaire.exporter.model.datasource.db.CompatibilityTerm; |
|
4 |
import org.springframework.data.jpa.repository.JpaRepository; |
|
5 |
import org.springframework.stereotype.Repository; |
|
6 |
|
|
7 |
/** |
|
8 |
* Created by claudio on 19/04/2017. |
|
9 |
*/ |
|
10 |
@Repository |
|
11 |
public interface CompatibilityTermRepository extends JpaRepository<CompatibilityTerm, String> { |
|
12 |
|
|
13 |
} |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/datasource/repository/SearchApisDbEntryRepository.java | ||
---|---|---|
1 |
package eu.dnetlib.openaire.exporter.datasource.repository; |
|
2 |
|
|
3 |
import java.util.List; |
|
4 |
|
|
5 |
import org.springframework.data.jpa.repository.JpaRepository; |
|
6 |
import org.springframework.stereotype.Repository; |
|
7 |
|
|
8 |
import eu.dnetlib.openaire.exporter.model.datasource.db.SearchApisDbEntry; |
|
9 |
|
|
10 |
/** |
|
11 |
* Created by claudio on 12/04/2017. |
|
12 |
*/ |
|
13 |
@Repository |
|
14 |
public interface SearchApisDbEntryRepository extends JpaRepository<SearchApisDbEntry, String> { |
|
15 |
|
|
16 |
SearchApisDbEntry findOneById(String id); |
|
17 |
|
|
18 |
List<SearchApisDbEntry> findByRepoidContainingOrRepoNameContainingOrAlternativeNameContainingOrRepoPrefixContainingOrRepoOrganizationContainingAllIgnoreCase( |
|
19 |
String repoId, |
|
20 |
String repoName, |
|
21 |
String alternativeName, |
|
22 |
String repoPrefix, |
|
23 |
String repoOrganization); |
|
24 |
|
|
25 |
} |
modules/dnet-openaire-exporter/branches/dsm/dnet-openaire-exporter.iml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> |
|
3 |
<component name="FacetManager"> |
|
4 |
<facet type="Spring" name="Spring"> |
|
5 |
<configuration /> |
|
6 |
</facet> |
|
7 |
</component> |
|
8 |
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8"> |
|
9 |
<output url="file://$MODULE_DIR$/target/classes" /> |
|
10 |
<output-test url="file://$MODULE_DIR$/target/test-classes" /> |
|
11 |
<content url="file://$MODULE_DIR$"> |
|
12 |
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> |
|
13 |
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> |
|
14 |
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" /> |
|
15 |
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> |
|
16 |
<excludeFolder url="file://$MODULE_DIR$/target" /> |
|
17 |
</content> |
|
18 |
<orderEntry type="inheritedJdk" /> |
|
19 |
<orderEntry type="sourceFolder" forTests="false" /> |
|
20 |
<orderEntry type="library" name="Maven: eu.dnetlib:cnr-rmi-api:2.6.2-SNAPSHOT" level="project" /> |
|
21 |
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-core:3.1.5" level="project" /> |
|
22 |
<orderEntry type="library" name="Maven: org.apache.ws.xmlschema:xmlschema-core:2.2.1" level="project" /> |
|
23 |
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-jaxws:3.1.5" level="project" /> |
|
24 |
<orderEntry type="library" name="Maven: xml-resolver:xml-resolver:1.2" level="project" /> |
|
25 |
<orderEntry type="library" name="Maven: org.ow2.asm:asm:5.0.4" level="project" /> |
|
26 |
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-soap:3.1.5" level="project" /> |
|
27 |
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-wsdl:3.1.5" level="project" /> |
|
28 |
<orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.3" level="project" /> |
|
29 |
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-databinding-jaxb:3.1.5" level="project" /> |
|
30 |
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.11" level="project" /> |
|
31 |
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.2.11" level="project" /> |
|
32 |
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-xml:3.1.5" level="project" /> |
|
33 |
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-simple:3.1.5" level="project" /> |
|
34 |
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-addr:3.1.5" level="project" /> |
|
35 |
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-policy:3.1.5" level="project" /> |
|
36 |
<orderEntry type="library" name="Maven: org.apache.neethi:neethi:3.0.3" level="project" /> |
|
37 |
<orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" /> |
|
38 |
<orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-transports-http:3.1.5" level="project" /> |
|
39 |
<orderEntry type="library" name="Maven: eu.dnetlib:cnr-service-common:2.1.7-SNAPSHOT" level="project" /> |
|
40 |
<orderEntry type="library" name="Maven: org.quartz-scheduler:quartz:2.2.2" level="project" /> |
|
41 |
<orderEntry type="library" name="Maven: c3p0:c3p0:0.9.1.1" level="project" /> |
|
42 |
<orderEntry type="library" name="Maven: org.springframework:spring-tx:4.3.7.RELEASE" level="project" /> |
|
43 |
<orderEntry type="library" name="Maven: org.springframework:spring-beans:4.3.7.RELEASE" level="project" /> |
|
44 |
<orderEntry type="library" name="Maven: eu.dnetlib:cnr-misc-utils:1.0.5-SNAPSHOT" level="project" /> |
|
45 |
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" /> |
|
46 |
<orderEntry type="library" name="Maven: jaxen:jaxen:1.1.6" level="project" /> |
|
47 |
<orderEntry type="library" name="Maven: saxonica:saxon:9.1.0.8" level="project" /> |
|
48 |
<orderEntry type="library" name="Maven: saxonica:saxon-dom:9.1.0.8" level="project" /> |
|
49 |
<orderEntry type="library" name="Maven: jgrapht:jgrapht:0.7.2" level="project" /> |
|
50 |
<orderEntry type="library" name="Maven: net.sf.ehcache:ehcache:2.10.3" level="project" /> |
|
51 |
<orderEntry type="library" name="Maven: eu.dnetlib:cnr-service-utils:1.0.3-SNAPSHOT" level="project" /> |
|
52 |
<orderEntry type="library" name="Maven: apache:oro:2.0.8" level="project" /> |
|
53 |
<orderEntry type="library" name="Maven: org.springframework:spring-context:4.3.7.RELEASE" level="project" /> |
|
54 |
<orderEntry type="library" name="Maven: eu.dnetlib:cnr-spring-utils:1.0.2-SNAPSHOT" level="project" /> |
|
55 |
<orderEntry type="library" name="Maven: org.springframework:spring-aop:4.3.7.RELEASE" level="project" /> |
|
56 |
<orderEntry type="library" name="Maven: jparsec:jparsec:2.0" level="project" /> |
|
57 |
<orderEntry type="library" name="Maven: runcc:runcc:0.7" level="project" /> |
|
58 |
<orderEntry type="library" name="Maven: eu.dnetlib:dnet-openaireplus-mapping-utils:6.1.5-SNAPSHOT" level="project" /> |
|
59 |
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" /> |
|
60 |
<orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" /> |
|
61 |
<orderEntry type="library" name="Maven: eu.dnetlib:dnet-openaire-data-protos:3.8.10" level="project" /> |
|
62 |
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:2.4.1" level="project" /> |
|
63 |
<orderEntry type="library" name="Maven: eu.dnetlib:dnet-pace-core:2.5.3-SNAPSHOT" level="project" /> |
|
64 |
<orderEntry type="library" name="Maven: edu.cmu:secondstring:1.0.0" level="project" /> |
|
65 |
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.2" level="project" /> |
|
66 |
<orderEntry type="library" name="Maven: eu.dnetlib:dnet-index-solr-common:1.3.1" level="project" /> |
|
67 |
<orderEntry type="library" name="Maven: com.googlecode.protobuf-java-format:protobuf-java-format:1.2" level="project" /> |
|
68 |
<orderEntry type="library" name="Maven: org.apache.solr:solr-solrj:6.6.0" level="project" /> |
|
69 |
<orderEntry type="library" name="Maven: org.apache.commons:commons-math3:3.4.1" level="project" /> |
|
70 |
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.3" level="project" /> |
|
71 |
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.6" level="project" /> |
|
72 |
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.5.3" level="project" /> |
|
73 |
<orderEntry type="library" name="Maven: org.apache.zookeeper:zookeeper:3.4.10" level="project" /> |
|
74 |
<orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:3.1.4" level="project" /> |
|
75 |
<orderEntry type="library" name="Maven: org.codehaus.woodstox:woodstox-core-asl:4.4.1" level="project" /> |
|
76 |
<orderEntry type="library" name="Maven: org.noggit:noggit:0.6" level="project" /> |
|
77 |
<orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.24" level="project" /> |
|
78 |
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.24" level="project" /> |
|
79 |
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:1.5.2.RELEASE" level="project" /> |
|
80 |
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:1.5.2.RELEASE" level="project" /> |
|
81 |
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:1.5.2.RELEASE" level="project" /> |
|
82 |
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:1.5.2.RELEASE" level="project" /> |
|
83 |
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:1.5.2.RELEASE" level="project" /> |
|
84 |
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.1.11" level="project" /> |
|
85 |
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.1.11" level="project" /> |
|
86 |
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.24" level="project" /> |
|
87 |
<orderEntry type="library" name="Maven: org.slf4j:log4j-over-slf4j:1.7.24" level="project" /> |
|
88 |
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.17" level="project" /> |
|
89 |
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:1.5.2.RELEASE" level="project" /> |
|
90 |
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:8.5.11" level="project" /> |
|
91 |
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:8.5.11" level="project" /> |
|
92 |
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.11" level="project" /> |
|
93 |
<orderEntry type="library" name="Maven: org.hibernate:hibernate-validator:5.3.4.Final" level="project" /> |
|
94 |
<orderEntry type="library" name="Maven: javax.validation:validation-api:1.1.0.Final" level="project" /> |
|
95 |
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.0.Final" level="project" /> |
|
96 |
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.8.7" level="project" /> |
|
97 |
<orderEntry type="library" name="Maven: org.springframework:spring-web:4.3.7.RELEASE" level="project" /> |
|
98 |
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.3.7.RELEASE" level="project" /> |
|
99 |
<orderEntry type="library" name="Maven: org.springframework:spring-expression:4.3.7.RELEASE" level="project" /> |
|
100 |
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:1.5.2.RELEASE" level="project" /> |
|
101 |
<orderEntry type="library" name="Maven: org.apache.tomcat:tomcat-jdbc:8.5.11" level="project" /> |
|
102 |
<orderEntry type="library" name="Maven: org.apache.tomcat:tomcat-juli:8.5.11" level="project" /> |
|
103 |
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:4.3.7.RELEASE" level="project" /> |
|
104 |
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-jpa:1.5.2.RELEASE" level="project" /> |
|
105 |
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:1.5.2.RELEASE" level="project" /> |
|
106 |
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.8.9" level="project" /> |
|
107 |
<orderEntry type="library" name="Maven: org.hibernate:hibernate-core:5.0.12.Final" level="project" /> |
|
108 |
<orderEntry type="library" name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final" level="project" /> |
|
109 |
<orderEntry type="library" name="Maven: org.javassist:javassist:3.21.0-GA" level="project" /> |
|
110 |
<orderEntry type="library" name="Maven: org.jboss:jandex:2.0.0.Final" level="project" /> |
|
111 |
<orderEntry type="library" name="Maven: org.hibernate.common:hibernate-commons-annotations:5.0.1.Final" level="project" /> |
|
112 |
<orderEntry type="library" name="Maven: org.hibernate:hibernate-entitymanager:5.0.12.Final" level="project" /> |
|
113 |
<orderEntry type="library" name="Maven: javax.transaction:javax.transaction-api:1.2" level="project" /> |
|
114 |
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-jpa:1.11.1.RELEASE" level="project" /> |
|
115 |
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:1.13.1.RELEASE" level="project" /> |
|
116 |
<orderEntry type="library" name="Maven: org.springframework:spring-orm:4.3.7.RELEASE" level="project" /> |
|
117 |
<orderEntry type="library" name="Maven: org.springframework:spring-aspects:4.3.7.RELEASE" level="project" /> |
|
118 |
<orderEntry type="library" name="Maven: org.postgresql:postgresql:42.0.0" level="project" /> |
|
119 |
<orderEntry type="library" name="Maven: org.apache.commons:commons-dbcp2:2.1" level="project" /> |
|
120 |
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.4.2" level="project" /> |
|
121 |
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" /> |
|
122 |
<orderEntry type="library" name="Maven: org.antlr:stringtemplate:3.2.1" level="project" /> |
|
123 |
<orderEntry type="library" name="Maven: antlr:antlr:2.7.7" level="project" /> |
|
124 |
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.5" level="project" /> |
|
125 |
<orderEntry type="library" name="Maven: commons-io:commons-io:2.5" level="project" /> |
|
126 |
<orderEntry type="library" name="Maven: com.google.guava:guava:23.3-jre" level="project" /> |
|
127 |
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" /> |
|
128 |
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.0.18" level="project" /> |
|
129 |
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.1" level="project" /> |
|
130 |
<orderEntry type="library" name="Maven: org.codehaus.mojo:animal-sniffer-annotations:1.14" level="project" /> |
|
131 |
<orderEntry type="library" name="Maven: net.sf.supercsv:super-csv:2.4.0" level="project" /> |
|
132 |
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.0" level="project" /> |
|
133 |
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-joda:2.6.6" level="project" /> |
|
134 |
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.8.0" level="project" /> |
|
135 |
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.8.7" level="project" /> |
|
136 |
<orderEntry type="library" name="Maven: joda-time:joda-time:2.8.2" level="project" /> |
|
137 |
<orderEntry type="library" name="Maven: org.mongodb:mongo-java-driver:3.4.2" level="project" /> |
|
138 |
<orderEntry type="module" module-name="dnet-datasource-manager-common" /> |
|
139 |
<orderEntry type="library" name="Maven: javax.persistence:persistence-api:1.0" level="project" /> |
|
140 |
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.7.0" level="project" /> |
|
141 |
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.13" level="project" /> |
|
142 |
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.13" level="project" /> |
|
143 |
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.7.0" level="project" /> |
|
144 |
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.7.0" level="project" /> |
|
145 |
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.6.14" level="project" /> |
|
146 |
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.7.0" level="project" /> |
|
147 |
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.7.0" level="project" /> |
|
148 |
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.7.0" level="project" /> |
|
149 |
<orderEntry type="library" name="Maven: org.reflections:reflections:0.9.11" level="project" /> |
|
150 |
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.3.3" level="project" /> |
|
151 |
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" /> |
|
152 |
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" /> |
|
153 |
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.1.0.Final" level="project" /> |
|
154 |
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-ui:2.7.0" level="project" /> |
|
155 |
<orderEntry type="library" name="Maven: io.prometheus:simpleclient_spring_boot:0.0.25" level="project" /> |
|
156 |
<orderEntry type="library" name="Maven: io.prometheus:simpleclient:0.0.25" level="project" /> |
|
157 |
<orderEntry type="library" name="Maven: io.prometheus:simpleclient_common:0.0.25" level="project" /> |
|
158 |
<orderEntry type="library" name="Maven: io.prometheus:simpleclient_spring_web:0.0.25" level="project" /> |
|
159 |
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator:1.5.2.RELEASE" level="project" /> |
|
160 |
<orderEntry type="library" name="Maven: io.prometheus:simpleclient_hotspot:0.0.25" level="project" /> |
|
161 |
<orderEntry type="library" name="Maven: io.prometheus:simpleclient_servlet:0.0.25" level="project" /> |
|
162 |
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:1.5.2.RELEASE" level="project" /> |
|
163 |
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:1.5.2.RELEASE" level="project" /> |
|
164 |
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:1.5.2.RELEASE" level="project" /> |
|
165 |
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.2.0" level="project" /> |
|
166 |
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.2.1" level="project" /> |
|
167 |
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.1" level="project" /> |
|
168 |
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" /> |
|
169 |
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:2.6.0" level="project" /> |
|
170 |
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:1.10.19" level="project" /> |
|
171 |
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.1" level="project" /> |
|
172 |
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" /> |
|
173 |
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" /> |
|
174 |
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.4.0" level="project" /> |
|
175 |
<orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" /> |
|
176 |
<orderEntry type="library" name="Maven: org.springframework:spring-core:4.3.7.RELEASE" level="project" /> |
|
177 |
<orderEntry type="library" name="Maven: org.springframework:spring-test:4.3.7.RELEASE" level="project" /> |
|
178 |
</component> |
|
179 |
</module> |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/OpenaireExporterConfig.java | ||
---|---|---|
18 | 18 |
// ISLOOKUP |
19 | 19 |
private ClassPathResource findSolrIndexUrl; |
20 | 20 |
private ClassPathResource findIndexDsInfo; |
21 |
private ClassPathResource findObjectStore; |
|
22 |
|
|
21 | 23 |
private String isLookupUrl; |
24 |
private String objectStoreServiceUrl; |
|
25 |
|
|
22 | 26 |
private int requestWorkers = 100; |
23 | 27 |
private int requestTimeout = 10; |
24 | 28 |
|
... | ... | |
286 | 290 |
} |
287 | 291 |
|
288 | 292 |
public static class Vocabularies { |
293 |
|
|
294 |
private String baseUrl; |
|
295 |
|
|
289 | 296 |
private String countriesEndpoint; |
290 | 297 |
|
298 |
private String datasourceTypologiesEndpoint; |
|
299 |
|
|
291 | 300 |
public String getCountriesEndpoint() { |
292 | 301 |
return countriesEndpoint; |
293 | 302 |
} |
... | ... | |
295 | 304 |
public void setCountriesEndpoint(final String countriesEndpoint) { |
296 | 305 |
this.countriesEndpoint = countriesEndpoint; |
297 | 306 |
} |
307 |
|
|
308 |
public String getBaseUrl() { |
|
309 |
return baseUrl; |
|
310 |
} |
|
311 |
|
|
312 |
public void setBaseUrl(final String baseUrl) { |
|
313 |
this.baseUrl = baseUrl; |
|
314 |
} |
|
315 |
|
|
316 |
public String getDatasourceTypologiesEndpoint() { |
|
317 |
return datasourceTypologiesEndpoint; |
|
318 |
} |
|
319 |
|
|
320 |
public void setDatasourceTypologiesEndpoint(final String datasourceTypologiesEndpoint) { |
|
321 |
this.datasourceTypologiesEndpoint = datasourceTypologiesEndpoint; |
|
322 |
} |
|
298 | 323 |
} |
299 | 324 |
|
300 | 325 |
public ClassPathResource getFindSolrIndexUrl() { |
... | ... | |
309 | 334 |
return findIndexDsInfo; |
310 | 335 |
} |
311 | 336 |
|
337 |
public ClassPathResource getFindObjectStore() { |
|
338 |
return findObjectStore; |
|
339 |
} |
|
340 |
|
|
341 |
public void setFindObjectStore(final ClassPathResource findObjectStore) { |
|
342 |
this.findObjectStore = findObjectStore; |
|
343 |
} |
|
344 |
|
|
312 | 345 |
public void setFindIndexDsInfo(final ClassPathResource findIndexDsInfo) { |
313 | 346 |
this.findIndexDsInfo = findIndexDsInfo; |
314 | 347 |
} |
... | ... | |
321 | 354 |
this.isLookupUrl = isLookupUrl; |
322 | 355 |
} |
323 | 356 |
|
357 |
public String getObjectStoreServiceUrl() { |
|
358 |
return objectStoreServiceUrl; |
|
359 |
} |
|
360 |
|
|
361 |
public void setObjectStoreServiceUrl(final String objectStoreServiceUrl) { |
|
362 |
this.objectStoreServiceUrl = objectStoreServiceUrl; |
|
363 |
} |
|
364 |
|
|
324 | 365 |
public int getRequestWorkers() { |
325 | 366 |
return requestWorkers; |
326 | 367 |
} |
... | ... | |
376 | 417 |
public void setVocabularies(final Vocabularies vocabularies) { |
377 | 418 |
this.vocabularies = vocabularies; |
378 | 419 |
} |
379 |
|
|
380 | 420 |
} |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/vocabularies/Country.java | ||
---|---|---|
1 |
package eu.dnetlib.openaire.exporter.vocabularies; |
|
2 |
|
|
3 |
/** |
|
4 |
* Created by claudio on 15/09/2017. |
|
5 |
*/ |
|
6 |
public class Country { |
|
7 |
|
|
8 |
private String code; |
|
9 |
|
|
10 |
private String name; |
|
11 |
|
|
12 |
public Country() { |
|
13 |
} |
|
14 |
|
|
15 |
public Country(final String code, final String name) { |
|
16 |
this.code = code; |
|
17 |
this.name = name; |
|
18 |
} |
|
19 |
|
|
20 |
public String getCode() { |
|
21 |
return code; |
|
22 |
} |
|
23 |
|
|
24 |
public void setCode(final String code) { |
|
25 |
this.code = code; |
|
26 |
} |
|
27 |
|
|
28 |
public String getName() { |
|
29 |
return name; |
|
30 |
} |
|
31 |
|
|
32 |
public void setName(final String name) { |
|
33 |
this.name = name; |
|
34 |
} |
|
35 |
} |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/vocabularies/Vocabulary.java | ||
---|---|---|
29 | 29 |
return term != null ? term.getEnglishName() : null; |
30 | 30 |
} |
31 | 31 |
|
32 |
public boolean hasCode(final String code) { |
|
33 |
return getEnglishName(code) != null; |
|
34 |
} |
|
35 |
|
|
32 | 36 |
private void hashByCode() { |
33 | 37 |
log.info("hashing vocabulary by code ..."); |
34 | 38 |
getTerms().forEach(term -> { |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/model/project/ProjectTsv.java | ||
---|---|---|
22 | 22 |
|
23 | 23 |
@Id |
24 | 24 |
@JsonIgnore |
25 |
private String id;
|
|
25 |
private long rowid;
|
|
26 | 26 |
private String code; |
27 | 27 |
private String acronym; |
28 | 28 |
private String title; |
... | ... | |
45 | 45 |
private String orgCountry; |
46 | 46 |
@Column(name = "role") |
47 | 47 |
private String orgRole; |
48 |
private String firstname; |
|
49 |
private String secondnames; |
|
50 |
private String email; |
|
48 |
private String contactfullname; |
|
49 |
private String contactemail; |
|
51 | 50 |
|
52 | 51 |
public ProjectTsv() {} |
53 | 52 |
|
... | ... | |
65 | 64 |
clean(getOrgLegalname()), |
66 | 65 |
clean(getOrgCountry()), |
67 | 66 |
clean(getOrgRole()), |
68 |
clean(getFirstname()), |
|
69 |
clean(getSecondnames()), |
|
70 |
clean(getEmail())); |
|
67 |
clean(getContactfullname()), |
|
68 |
clean(getContactemail())); |
|
71 | 69 |
} |
72 | 70 |
|
73 | 71 |
private String clean(final String s) { |
74 | 72 |
return StringUtils.isNotBlank(s) ? "\"" + s.replaceAll("\\n|\\t|\\s+", " ").replace("\"","\"\"").trim() + "\"" : ""; |
75 | 73 |
} |
76 | 74 |
|
77 |
public String getId() {
|
|
78 |
return id; |
|
75 |
public long getRowid() {
|
|
76 |
return rowid;
|
|
79 | 77 |
} |
80 | 78 |
|
81 |
public void setId(final String id) {
|
|
82 |
this.id = id;
|
|
79 |
public void setRowid(final long rowid) {
|
|
80 |
this.rowid = rowid;
|
|
83 | 81 |
} |
84 | 82 |
|
85 | 83 |
public String getCode() { |
... | ... | |
194 | 192 |
this.orgRole = orgRole; |
195 | 193 |
} |
196 | 194 |
|
197 |
public String getFirstname() {
|
|
198 |
return firstname;
|
|
195 |
public String getContactfullname() {
|
|
196 |
return contactfullname;
|
|
199 | 197 |
} |
200 | 198 |
|
201 |
public void setFirstname(final String firstname) {
|
|
202 |
this.firstname = firstname;
|
|
199 |
public void setContactfullname(final String contactfullname) {
|
|
200 |
this.contactfullname = contactfullname;
|
|
203 | 201 |
} |
204 | 202 |
|
205 |
public String getSecondnames() {
|
|
206 |
return secondnames;
|
|
203 |
public String getContactemail() {
|
|
204 |
return contactemail;
|
|
207 | 205 |
} |
208 | 206 |
|
209 |
public void setSecondnames(final String secondnames) {
|
|
210 |
this.secondnames = secondnames;
|
|
207 |
public void setContactemail(final String contactemail) {
|
|
208 |
this.contactemail = contactemail;
|
|
211 | 209 |
} |
212 |
|
|
213 |
public String getEmail() { |
|
214 |
return email; |
|
215 |
} |
|
216 |
|
|
217 |
public void setEmail(final String email) { |
|
218 |
this.email = email; |
|
219 |
} |
|
220 | 210 |
} |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/model/datasource/db/ApiDbEntry.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.openaire.exporter.model.datasource.db; |
2 | 2 |
|
3 |
import java.sql.Date; |
|
4 |
import java.util.Set; |
|
5 |
|
|
6 |
import javax.persistence.CascadeType; |
|
7 |
import javax.persistence.Column; |
|
8 | 3 |
import javax.persistence.Entity; |
9 |
import javax.persistence.FetchType; |
|
10 |
import javax.persistence.Id; |
|
11 |
import javax.persistence.OneToMany; |
|
12 | 4 |
import javax.persistence.Table; |
13 | 5 |
|
14 | 6 |
import eu.dnetlib.enabling.datasources.common.Api; |
15 |
import eu.dnetlib.enabling.datasources.common.ApiParam; |
|
16 | 7 |
import io.swagger.annotations.ApiModel; |
17 | 8 |
|
18 | 9 |
/** |
... | ... | |
21 | 12 |
@Entity |
22 | 13 |
@Table(name = "dsm_api") |
23 | 14 |
@ApiModel(value = "Datasource Api model", description = "describes the datasource api") |
24 |
public class ApiDbEntry extends Api { |
|
15 |
public class ApiDbEntry extends Api<ApiParamDbEntry> {
|
|
25 | 16 |
|
26 |
@Override |
|
27 |
@Id |
|
28 |
public String getId() { |
|
29 |
return super.getId(); |
|
30 |
} |
|
31 |
|
|
32 |
@Override |
|
33 |
@Column(name = "metadata_identifier_path") |
|
34 |
public String getMetadataIdentifierPath() { |
|
35 |
return super.getMetadataIdentifierPath(); |
|
36 |
} |
|
37 |
|
|
38 |
@Override |
|
39 |
@Column(name = "last_collection_total") |
|
40 |
public Integer getLastCollectionTotal() { |
|
41 |
return super.getLastCollectionTotal(); |
|
42 |
} |
|
43 |
|
|
44 |
@Override |
|
45 |
@Column(name = "last_collection_date") |
|
46 |
public Date getLastCollectionDate() { |
|
47 |
return super.getLastCollectionDate(); |
|
48 |
} |
|
49 |
|
|
50 |
@Override |
|
51 |
@Column(name = "last_collection_mdid") |
|
52 |
public String getLastCollectionMdid() { |
|
53 |
return super.getLastCollectionMdid(); |
|
54 |
} |
|
55 |
|
|
56 |
@Override |
|
57 |
@Column(name = "last_aggregation_total") |
|
58 |
public Integer getLastAggregationTotal() { |
|
59 |
return super.getLastAggregationTotal(); |
|
60 |
} |
|
61 |
|
|
62 |
@Override |
|
63 |
@Column(name = "last_aggregation_date") |
|
64 |
public Date getLastAggregationDate() { |
|
65 |
return super.getLastAggregationDate(); |
|
66 |
} |
|
67 |
|
|
68 |
@Override |
|
69 |
@Column(name = "last_aggregation_mdid") |
|
70 |
public String getLastAggregationMdid() { |
|
71 |
return super.getLastAggregationMdid(); |
|
72 |
} |
|
73 |
|
|
74 |
@Override |
|
75 |
@Column(name = "last_download_total") |
|
76 |
public Integer getLastDownloadTotal() { |
|
77 |
return super.getLastDownloadTotal(); |
|
78 |
} |
|
79 |
|
|
80 |
@Override |
|
81 |
@Column(name = "last_download_date") |
|
82 |
public Date getLastDownloadDate() { |
|
83 |
return super.getLastDownloadDate(); |
|
84 |
} |
|
85 |
|
|
86 |
@Override |
|
87 |
@Column(name = "last_download_objid") |
|
88 |
public String getLastDownloadMdid() { |
|
89 |
return super.getLastDownloadMdid(); |
|
90 |
} |
|
91 |
|
|
92 |
@Override |
|
93 |
@Column(name = "last_validation_job") |
|
94 |
public String getLastValidationJob() { |
|
95 |
return super.getLastValidationJob(); |
|
96 |
} |
|
97 |
|
|
98 |
@Override |
|
99 |
@OneToMany(mappedBy = "id.api", cascade = CascadeType.ALL, fetch = FetchType.EAGER) |
|
100 |
public Set<ApiParam> getApiParams() { |
|
101 |
return super.getApiParams(); |
|
102 |
} |
|
103 |
|
|
104 | 17 |
} |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/model/datasource/db/IdentityDbEntry.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.openaire.exporter.model.datasource.db; |
2 | 2 |
|
3 | 3 |
import javax.persistence.Entity; |
4 |
import javax.persistence.Id; |
|
5 | 4 |
import javax.persistence.Table; |
6 | 5 |
|
7 | 6 |
import eu.dnetlib.enabling.datasources.common.Identity; |
... | ... | |
17 | 16 |
@ApiModel(value = "Identities model", description = "provides identity details") |
18 | 17 |
public class IdentityDbEntry extends Identity { |
19 | 18 |
|
20 |
@Id |
|
21 |
public String getPid() { |
|
22 |
return super.getPid(); |
|
23 |
} |
|
24 |
|
|
25 | 19 |
} |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/model/datasource/db/ApiParamDbEntry.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.openaire.exporter.model.datasource.db; |
2 | 2 |
|
3 |
import javax.persistence.EmbeddedId; |
|
4 | 3 |
import javax.persistence.Entity; |
5 | 4 |
import javax.persistence.Table; |
6 | 5 |
|
7 | 6 |
import com.fasterxml.jackson.annotation.JsonIgnore; |
8 | 7 |
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
9 |
|
|
10 | 8 |
import eu.dnetlib.enabling.datasources.common.ApiParam; |
11 |
import eu.dnetlib.enabling.datasources.common.ApiParamKey; |
|
12 | 9 |
import io.swagger.annotations.ApiModel; |
13 | 10 |
|
14 | 11 |
/** |
... | ... | |
18 | 15 |
@Table(name = "dsm_apiparams") |
19 | 16 |
@JsonIgnoreProperties(ignoreUnknown = true) |
20 | 17 |
@ApiModel(value = "Datasource Api params model", description = "describes the datasource api params") |
21 |
public class ApiParamDbEntry extends ApiParam { |
|
18 |
public class ApiParamDbEntry extends ApiParam<ApiParamKeyDbEntry> {
|
|
22 | 19 |
|
23 | 20 |
@Override |
24 | 21 |
@JsonIgnore |
25 |
@EmbeddedId |
|
26 |
public ApiParamKey getId() { |
|
22 |
public ApiParamKeyDbEntry getId() { |
|
27 | 23 |
return super.getId(); |
28 | 24 |
} |
29 | 25 |
|
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/model/datasource/db/DatasourceDbEntry.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.openaire.exporter.model.datasource.db; |
2 | 2 |
|
3 |
import java.util.Set; |
|
4 |
|
|
5 |
import javax.persistence.CascadeType; |
|
6 |
import javax.persistence.Column; |
|
7 | 3 |
import javax.persistence.Entity; |
8 |
import javax.persistence.FetchType; |
|
9 |
import javax.persistence.Id; |
|
10 |
import javax.persistence.JoinColumn; |
|
11 |
import javax.persistence.JoinTable; |
|
12 |
import javax.persistence.ManyToMany; |
|
13 | 4 |
import javax.persistence.Table; |
14 | 5 |
|
15 | 6 |
import eu.dnetlib.enabling.datasources.common.Datasource; |
... | ... | |
23 | 14 |
@ApiModel(value = "Datasource model", description = "provides datasource details") |
24 | 15 |
public class DatasourceDbEntry extends Datasource<OrganizationDbEntry, IdentityDbEntry> { |
25 | 16 |
|
26 |
@Override |
|
27 |
@Id |
|
28 |
public String getId() { |
|
29 |
return super.getId(); |
|
30 |
} |
|
31 |
|
|
32 |
@Override |
|
33 |
@Column(name = "namespaceprefix", columnDefinition = "bpchar(12)") |
|
34 |
public String getNamespaceprefix() { |
|
35 |
return super.getNamespaceprefix(); |
|
36 |
} |
|
37 |
|
|
38 |
@Override |
|
39 |
@Column(name = "activationid") |
|
40 |
public String getActivationId() { |
|
41 |
return super.getActivationId(); |
|
42 |
} |
|
43 |
|
|
44 |
@Override |
|
45 |
@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY) |
|
46 |
@JoinTable(name = "dsm_datasource_organization", joinColumns = @JoinColumn(name = "datasource"), inverseJoinColumns = @JoinColumn(name = "organization")) |
|
47 |
public Set<OrganizationDbEntry> getOrganizations() { |
|
48 |
return super.getOrganizations(); |
|
49 |
} |
|
50 |
|
|
51 |
@Override |
|
52 |
@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY) |
|
53 |
@JoinTable(name = "dsm_datasourcepids", joinColumns = @JoinColumn(name = "datasource"), inverseJoinColumns = @JoinColumn(name = "pid")) |
|
54 |
public Set<IdentityDbEntry> getIdentities() { |
|
55 |
return super.getIdentities(); |
|
56 |
} |
|
57 |
|
|
58 | 17 |
} |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/model/datasource/db/ApiParamKeyDbEntry.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.openaire.exporter.model.datasource.db; |
2 | 2 |
|
3 | 3 |
import javax.persistence.Embeddable; |
4 |
import javax.persistence.JoinColumn; |
|
5 |
import javax.persistence.ManyToOne; |
|
6 | 4 |
|
7 | 5 |
import com.fasterxml.jackson.annotation.JsonIgnore; |
8 | 6 |
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
9 |
|
|
10 |
import eu.dnetlib.enabling.datasources.common.Api; |
|
11 | 7 |
import eu.dnetlib.enabling.datasources.common.ApiParamKey; |
12 | 8 |
|
13 | 9 |
/** |
... | ... | |
15 | 11 |
*/ |
16 | 12 |
@Embeddable |
17 | 13 |
@JsonIgnoreProperties(ignoreUnknown = true) |
18 |
public class ApiParamKeyDbEntry extends ApiParamKey { |
|
14 |
public class ApiParamKeyDbEntry extends ApiParamKey<ApiDbEntry> {
|
|
19 | 15 |
|
20 |
/** |
|
21 |
* |
|
22 |
*/ |
|
23 |
private static final long serialVersionUID = -5742637266760723249L; |
|
24 |
|
|
25 | 16 |
@Override |
26 | 17 |
@JsonIgnore |
27 |
@ManyToOne |
|
28 |
@JoinColumn(name = "api") |
|
29 |
public Api getApi() { |
|
18 |
public ApiDbEntry getApi() { |
|
30 | 19 |
return super.getApi(); |
31 | 20 |
} |
32 | 21 |
|
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/model/datasource/db/OrganizationDbEntry.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.openaire.exporter.model.datasource.db; |
2 | 2 |
|
3 | 3 |
import java.util.Set; |
4 |
import javax.persistence.*; |
|
4 | 5 |
|
5 |
import javax.persistence.CascadeType; |
|
6 |
import javax.persistence.Column; |
|
7 |
import javax.persistence.Entity; |
|
8 |
import javax.persistence.FetchType; |
|
9 |
import javax.persistence.Id; |
|
10 |
import javax.persistence.ManyToMany; |
|
11 |
import javax.persistence.Table; |
|
12 |
|
|
13 | 6 |
import com.fasterxml.jackson.annotation.JsonIgnore; |
14 |
|
|
15 | 7 |
import eu.dnetlib.enabling.datasources.common.Organization; |
16 | 8 |
import io.swagger.annotations.ApiModel; |
17 | 9 |
|
... | ... | |
24 | 16 |
@ApiModel(value = "Organization model", description = "provides organization details") |
25 | 17 |
public class OrganizationDbEntry extends Organization<DatasourceDbEntry> { |
26 | 18 |
|
27 |
@Id |
|
28 |
public String getId() { |
|
29 |
return super.getId(); |
|
30 |
} |
|
31 |
|
|
32 |
@Column(name = "ec_legalbody") |
|
33 |
public Boolean isEclegalbody() { |
|
34 |
return super.isEclegalbody(); |
|
35 |
} |
|
36 |
|
|
37 |
@Column(name = "ec_legalperson") |
|
38 |
public Boolean isEclegalperson() { |
|
39 |
return super.isEclegalperson(); |
|
40 |
} |
|
41 |
|
|
42 |
@Column(name = "ec_nonprofit") |
|
43 |
public Boolean isEcnonprofit() { |
|
44 |
return super.isEcnonprofit(); |
|
45 |
} |
|
46 |
|
|
47 |
@Column(name = "ec_researchorganization") |
|
48 |
public Boolean isEcresearchorganization() { |
|
49 |
return super.isEcresearchorganization(); |
|
50 |
} |
|
51 |
|
|
52 |
@Column(name = "ec_highereducation") |
|
53 |
public Boolean isEchighereducation() { |
|
54 |
return super.isEchighereducation(); |
|
55 |
} |
|
56 |
|
|
57 |
@Column(name = "ec_internationalorganizationeurinterests") |
|
58 |
public Boolean isEcinternationalorganizationeurinterests() { |
|
59 |
return super.isEcinternationalorganizationeurinterests(); |
|
60 |
} |
|
61 |
|
|
62 |
@Column(name = "ec_internationalorganization") |
|
63 |
public Boolean isEcinternationalorganization() { |
|
64 |
return super.isEcinternationalorganization(); |
|
65 |
} |
|
66 |
|
|
67 |
@Column(name = "ec_enterprise") |
|
68 |
public Boolean isEcenterprise() { |
|
69 |
return super.isEcenterprise(); |
|
70 |
} |
|
71 |
|
|
72 |
@Column(name = "ec_smevalidated") |
|
73 |
public Boolean isEcsmevalidated() { |
|
74 |
return super.isEcsmevalidated(); |
|
75 |
} |
|
76 |
|
|
77 |
@Column(name = "ec_nutscode") |
|
78 |
public Boolean isEcnutscode() { |
|
79 |
return super.isEcnutscode(); |
|
80 |
} |
|
81 |
|
|
19 |
@Override |
|
82 | 20 |
@JsonIgnore |
83 |
@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.EAGER, mappedBy = "organizations") |
|
84 | 21 |
public Set<DatasourceDbEntry> getDatasources() { |
85 | 22 |
return super.getDatasources(); |
86 | 23 |
} |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/datasource/repository/ApiDbEntryRepository.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.openaire.exporter.datasource.repository; |
2 | 2 |
|
3 | 3 |
import java.util.List; |
4 |
import javax.transaction.Transactional; |
|
4 | 5 |
|
6 |
import eu.dnetlib.openaire.exporter.model.datasource.db.ApiDbEntry; |
|
5 | 7 |
import org.apache.commons.lang3.RandomStringUtils; |
6 | 8 |
import org.springframework.data.jpa.repository.JpaRepository; |
9 |
import org.springframework.data.jpa.repository.Modifying; |
|
7 | 10 |
import org.springframework.data.jpa.repository.Query; |
8 | 11 |
import org.springframework.stereotype.Repository; |
9 | 12 |
|
10 |
import eu.dnetlib.openaire.exporter.model.datasource.db.ApiDbEntry; |
|
11 |
|
|
12 | 13 |
/** |
13 | 14 |
* Created by claudio on 15/06/2017. |
14 | 15 |
*/ |
15 | 16 |
@Repository |
16 | 17 |
public interface ApiDbEntryRepository extends JpaRepository<ApiDbEntry, String> { |
17 | 18 |
|
18 |
static String ID_PREFIX = "api_________::";
|
|
19 |
String ID_PREFIX = "api_________::"; |
|
19 | 20 |
|
20 | 21 |
static String createId(ApiDbEntry api) { |
21 | 22 |
return ID_PREFIX + api.getDatasource() + "::" + RandomStringUtils.randomAlphanumeric(8); |
22 | 23 |
} |
23 | 24 |
|
24 |
@Query("select a from Api a where a.datasource = ?1")
|
|
25 |
@Query("select a from #{#entityName} a where a.datasource = ?1")
|
|
25 | 26 |
List<ApiDbEntry> findByDatasource(String dsId); |
26 | 27 |
|
28 |
@Modifying |
|
29 |
@Transactional |
|
30 |
@Query("update #{#entityName} a set a.baseurl = ?2 where a.id = ?1") |
|
31 |
void setBaseurl(String id, String baseurl); |
|
32 |
|
|
33 |
@Modifying |
|
34 |
@Transactional |
|
35 |
@Query("update #{#entityName} a set a.compatibility = ?2 where a.id = ?1") |
|
36 |
void updateCompatibility(String apiId, String compliance); |
|
37 |
|
|
27 | 38 |
} |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/datasource/repository/DatasourceDbEntryRepository.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import javax.transaction.Transactional; |
4 | 4 |
|
5 |
import eu.dnetlib.openaire.exporter.model.datasource.db.DatasourceDbEntry; |
|
5 | 6 |
import org.springframework.data.domain.Pageable; |
6 | 7 |
import org.springframework.data.domain.Slice; |
7 | 8 |
import org.springframework.data.jpa.repository.JpaRepository; |
... | ... | |
11 | 12 |
import org.springframework.stereotype.Repository; |
12 | 13 |
import org.springframework.util.concurrent.ListenableFuture; |
13 | 14 |
|
14 |
import eu.dnetlib.openaire.exporter.model.datasource.db.DatasourceDbEntry; |
|
15 |
|
|
16 | 15 |
/** |
17 | 16 |
* Created by claudio on 12/04/2017. |
18 | 17 |
*/ |
... | ... | |
33 | 32 |
@Async |
34 | 33 |
ListenableFuture<Slice<DatasourceDbEntry>> findByOrganizationsCountryIgnoreCase(String country, Pageable pageable); |
35 | 34 |
|
35 |
@Query("select d.managed from #{#entityName} d where d.id = ?1") |
|
36 |
boolean isManaged(String id); |
|
37 |
|
|
36 | 38 |
@Modifying |
37 | 39 |
@Transactional |
38 |
@Query("update Datasource d set d.managed = ?2 where d.id = ?1")
|
|
40 |
@Query("update #{#entityName} d set d.managed = ?2 where d.id = ?1")
|
|
39 | 41 |
void setManaged(String id, boolean managed); |
40 | 42 |
|
41 | 43 |
@Modifying |
42 | 44 |
@Transactional |
43 |
@Query("update Datasource d set d.officialname = ?2 where d.id = ?1")
|
|
44 |
void setOfficialname(String id, String officialname);
|
|
45 |
@Query("update #{#entityName} d set d.officialname = ?2, d.englishname = ?3 where d.id = ?1")
|
|
46 |
void setDatasourcename(String id, String officialname, String englishname);
|
|
45 | 47 |
|
46 | 48 |
@Modifying |
47 | 49 |
@Transactional |
48 |
@Query("update Datasource d set d.englishname = ?2 where d.id = ?1")
|
|
49 |
void setEnglishname(String id, String englishname);
|
|
50 |
@Query("update #{#entityName} d set d.latitude = ?2, d.longitude = ?3 where d.id = ?1")
|
|
51 |
void setCoordinates(String dsId, Double latitude, Double longitude);
|
|
50 | 52 |
|
51 | 53 |
@Modifying |
52 | 54 |
@Transactional |
53 |
@Query("update Datasource d set d.latitude = ?2 where d.id = ?1")
|
|
54 |
void setLatitude(String id, Double latitude);
|
|
55 |
@Query("update #{#entityName} d set d.timezone = ?2 where d.id = ?1")
|
|
56 |
void setTimezone(String dsId, String timezone);
|
|
55 | 57 |
|
56 | 58 |
@Modifying |
57 | 59 |
@Transactional |
58 |
@Query("update Datasource d set d.longitude = ?2 where d.id = ?1")
|
|
59 |
void setLongitude(String id, Double longitude);
|
|
60 |
@Query("update #{#entityName} d set d.typology = ?2 where d.id = ?1")
|
|
61 |
void setTypology(String dsId, String typology);
|
|
60 | 62 |
|
63 |
|
|
61 | 64 |
} |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/datasource/clients/DatasourceIndexClient.java | ||
---|---|---|
63 | 63 |
@PostConstruct |
64 | 64 |
public void init() { |
65 | 65 |
executor = MoreExecutors.listeningDecorator( |
66 |
new ScheduledThreadPoolExecutor(2,
|
|
66 |
new ScheduledThreadPoolExecutor(5,
|
|
67 | 67 |
new ThreadFactoryBuilder().setNameFormat("datasource-index-client-%d").build())); |
68 | 68 |
} |
69 | 69 |
|
... | ... | |
76 | 76 |
log.warn(String.format("unable to gracefully shutdown client for index %s", name)); |
77 | 77 |
} |
78 | 78 |
}); |
79 |
|
|
80 | 79 |
} |
81 | 80 |
|
82 | 81 |
public IndexRecordsInfo getIndexInfo(final String dsId, final IndexDsInfo info, final Queue<Throwable> errors) throws DatasourceManagerException { |
... | ... | |
104 | 103 |
errors.offer(e); |
105 | 104 |
latch.countDown(); |
106 | 105 |
} |
107 |
}); |
|
106 |
}, executor);
|
|
108 | 107 |
|
109 | 108 |
Futures.addCallback( |
110 | 109 |
executor.submit(() -> setFunded(collectedFrom, indexClient)), |
... | ... | |
122 | 121 |
errors.offer(e); |
123 | 122 |
latch.countDown(); |
124 | 123 |
} |
125 |
}); |
|
124 |
}, executor);
|
|
126 | 125 |
|
127 | 126 |
waitLatch(latch, errors, config.getRequestTimeout()); |
128 | 127 |
return indexRecordInfo; |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/datasource/clients/VocabularyClient.java | ||
---|---|---|
5 | 5 |
import org.apache.commons.logging.Log; |
6 | 6 |
import org.apache.commons.logging.LogFactory; |
7 | 7 |
import org.springframework.beans.factory.annotation.Autowired; |
8 |
import org.springframework.cache.annotation.CacheEvict; |
|
8 | 9 |
import org.springframework.cache.annotation.Cacheable; |
9 | 10 |
import org.springframework.http.ResponseEntity; |
10 | 11 |
import org.springframework.stereotype.Component; |
... | ... | |
23 | 24 |
|
24 | 25 |
@Cacheable("vocabularies-cache") |
25 | 26 |
public Vocabulary getCountries() { |
27 |
return _getVocabulary(config.getVocabularies().getCountriesEndpoint(), Vocabulary.class); |
|
28 |
} |
|
26 | 29 |
|
30 |
@Cacheable("vocabularies-cache") |
|
31 |
public Vocabulary getDatasourceTypologies() { |
|
32 |
return _getVocabulary(config.getVocabularies().getDatasourceTypologiesEndpoint(), Vocabulary.class); |
|
33 |
} |
|
34 |
|
|
35 |
private <T> T _getVocabulary(final String endpoint, Class<T> clazz) { |
|
27 | 36 |
final RestTemplate rt = new RestTemplate(); |
28 |
final String endpoint = config.getVocabularies().getCountriesEndpoint(); |
|
29 |
log.info("get countries vocabulary from " + endpoint); |
|
30 |
final ResponseEntity<Vocabulary> rsp = rt.getForEntity(endpoint, Vocabulary.class); |
|
31 |
|
|
37 |
log.info("get vocabulary from " + endpoint); |
|
38 |
final ResponseEntity<T> rsp = rt.getForEntity(endpoint, clazz); |
|
32 | 39 |
return rsp.getBody(); |
33 | 40 |
} |
34 | 41 |
|
42 |
@CacheEvict(cacheNames = "vocabularies-cache", allEntries = true) |
|
43 |
public void dropCache() { |
|
44 |
log.info("dropped dsManager vocabulary cache"); |
|
45 |
} |
|
46 |
|
|
35 | 47 |
} |
modules/dnet-openaire-exporter/branches/dsm/src/main/java/eu/dnetlib/openaire/exporter/datasource/clients/DatasourceDao.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.openaire.exporter.datasource.clients; |
2 | 2 |
|
3 | 3 |
import java.util.List; |
4 |
import java.util.Objects; |
|
4 | 5 |
import java.util.Queue; |
5 |
import java.util.concurrent.ConcurrentLinkedQueue; |
|
6 |
import java.util.concurrent.CountDownLatch; |
|
7 |
import java.util.concurrent.ScheduledThreadPoolExecutor; |
|
8 |
import java.util.concurrent.TimeUnit; |
|
9 |
import java.util.concurrent.TimeoutException; |
|
10 |
|
|
6 |
import java.util.concurrent.*; |
|
7 |
import java.util.stream.Collectors; |
|
11 | 8 |
import javax.annotation.PostConstruct; |
12 | 9 |
|
13 |
import org.apache.commons.lang.StringUtils; |
|
14 |
import org.apache.commons.lang3.exception.ExceptionUtils; |
|
15 |
import org.apache.commons.logging.Log; |
|
16 |
import org.apache.commons.logging.LogFactory; |
|
17 |
import org.apache.http.HttpStatus; |
|
18 |
import org.springframework.beans.factory.annotation.Autowired; |
|
19 |
import org.springframework.data.domain.Pageable; |
|
20 |
import org.springframework.data.domain.Slice; |
|
21 |
import org.springframework.stereotype.Component; |
|
22 |
import org.springframework.util.concurrent.ListenableFuture; |
|
23 |
import org.springframework.util.concurrent.ListenableFutureCallback; |
|
24 |
|
|
25 | 10 |
import com.google.common.collect.Lists; |
26 |
import com.google.common.util.concurrent.FutureCallback; |
|
27 |
import com.google.common.util.concurrent.Futures; |
|
28 |
import com.google.common.util.concurrent.ListeningExecutorService; |
|
29 |
import com.google.common.util.concurrent.MoreExecutors; |
|
30 |
import com.google.common.util.concurrent.ThreadFactoryBuilder; |
|
31 |
|
|
11 |
import com.google.common.util.concurrent.*; |
|
32 | 12 |
import eu.dnetlib.OpenaireExporterConfig; |
33 | 13 |
import eu.dnetlib.enabling.datasources.common.AggregationInfo; |
34 | 14 |
import eu.dnetlib.enabling.datasources.common.AggregationStage; |
35 |
import eu.dnetlib.enabling.datasources.common.BrowseTerm; |
|
36 | 15 |
import eu.dnetlib.enabling.datasources.common.DatasourceManagerException; |
37 | 16 |
import eu.dnetlib.openaire.exporter.datasource.clients.utils.IndexDsInfo; |
38 | 17 |
import eu.dnetlib.openaire.exporter.datasource.clients.utils.IndexRecordsInfo; |
39 |
import eu.dnetlib.openaire.exporter.datasource.repository.ActivationTermRepository; |
|
40 | 18 |
import eu.dnetlib.openaire.exporter.datasource.repository.ApiDbEntryRepository; |
41 |
import eu.dnetlib.openaire.exporter.datasource.repository.CompatibilityTermRepository; |
|
42 | 19 |
import eu.dnetlib.openaire.exporter.datasource.repository.CountryTermRepository; |
43 | 20 |
import eu.dnetlib.openaire.exporter.datasource.repository.DatasourceDbEntryRepository; |
44 |
import eu.dnetlib.openaire.exporter.datasource.repository.ProtocolTermRepository; |
|
45 |
import eu.dnetlib.openaire.exporter.datasource.repository.SearchApisDbEntryRepository; |
|
46 |
import eu.dnetlib.openaire.exporter.datasource.repository.TypologyTermRepository; |
|
47 | 21 |
import eu.dnetlib.openaire.exporter.model.datasource.DatasourceResponseDbVersion; |
48 | 22 |
import eu.dnetlib.openaire.exporter.model.datasource.db.ApiDbEntry; |
49 | 23 |
import eu.dnetlib.openaire.exporter.model.datasource.db.DatasourceDbEntry; |
50 |
import eu.dnetlib.openaire.exporter.model.datasource.db.SearchApisDbEntry; |
|
24 |
import eu.dnetlib.openaire.exporter.vocabularies.Country; |
|
25 |
import eu.dnetlib.openaire.exporter.vocabularies.Vocabulary; |
|
26 |
import org.apache.commons.lang.StringUtils; |
|
27 |
import org.apache.commons.lang3.exception.ExceptionUtils; |
|
28 |
import org.apache.commons.logging.Log; |
|
29 |
import org.apache.commons.logging.LogFactory; |
|
30 |
import org.apache.http.HttpStatus; |
|
31 |
import org.springframework.beans.factory.annotation.Autowired; |
|
32 |
import org.springframework.data.domain.Pageable; |
|
33 |
import org.springframework.data.domain.Slice; |
|
34 |
import org.springframework.stereotype.Component; |
|
35 |
import org.springframework.util.concurrent.ListenableFuture; |
|
36 |
import org.springframework.util.concurrent.ListenableFutureCallback; |
|
51 | 37 |
|
52 | 38 |
/** |
53 | 39 |
* Created by claudio on 20/10/2016. |
... | ... | |
67 | 53 |
private DatasourceIndexClient datasourceIndexClient; |
68 | 54 |
|
69 | 55 |
@Autowired |
70 |
private DatasourceDbEntryRepository dsRepository; |
|
71 |
|
|
72 |
@Autowired |
|
73 |
private SearchApisDbEntryRepository searchApisRepository; |
|
74 |
|
|
75 |
@Autowired |
|
76 | 56 |
private CountryTermRepository countryTermRepository; |
77 | 57 |
|
78 | 58 |
@Autowired |
79 |
private TypologyTermRepository typologyTermRepository;
|
|
59 |
private DatasourceDbEntryRepository dsRepository;
|
|
80 | 60 |
|
81 | 61 |
@Autowired |
82 |
private ProtocolTermRepository protocolTermRepository; |
|
83 |
|
|
84 |
@Autowired |
|
85 |
private CompatibilityTermRepository compatibilityTermRepository; |
|
86 |
|
|
87 |
@Autowired |
|
88 |
private ActivationTermRepository activationTermRepository; |
|
89 |
|
|
90 |
@Autowired |
|
91 | 62 |
private ApiDbEntryRepository apiRepository; |
92 | 63 |
|
93 | 64 |
@Autowired |
94 | 65 |
private ISLookupClient isLookupClient; |
95 | 66 |
|
96 |
/* |
|
97 |
* @Autowired private VocabularyClient vocabularyClient; |
|
98 |
*/ |
|
67 |
@Autowired |
|
68 |
private VocabularyClient vocabularyClient; |
|
99 | 69 |
|
100 |
private ListeningExecutorService service;
|
|
70 |
private ListeningExecutorService executor;
|
|
101 | 71 |
|
102 | 72 |
@PostConstruct |
103 | 73 |
public void init() { |
104 |
service = MoreExecutors.listeningDecorator(
|
|
74 |
executor = MoreExecutors.listeningDecorator(
|
|
105 | 75 |
new ScheduledThreadPoolExecutor(config.getRequestWorkers(), |
106 | 76 |
new ThreadFactoryBuilder().setNameFormat("datasource-info-retriever-%d").build())); |
107 | 77 |
} |
108 | 78 |
|
79 |
public List<Country> listCountries() { |
|
80 |
final Vocabulary v = vocabularyClient.getCountries(); |
|
81 |
return countryTermRepository.findAll().stream() |
|
82 |
.filter(Objects::nonNull) |
|
83 |
.map(t -> new Country(t.getTerm(), v.getEnglishName(t.getTerm()))) |
|
84 |
.collect(Collectors.toList()); |
|
85 |
} |
|
86 |
|
|
109 | 87 |
public List<String> listIds(final Pageable pageable) throws DatasourceManagerException { |
110 | 88 |
return dsRepository.findAll(pageable) |
111 | 89 |
.map(d -> d.getId()) |
... | ... | |
230 | 208 |
dsRepository.setManaged(id, managed); |
231 | 209 |
} |
232 | 210 |
|
233 |
public List<SearchApisDbEntry> searchInterface(final String field, final String value) { |
|
234 |
switch (field) { |
Also available in: Unified diff
work in progress, the application starts