diff --git a/apps/dhp-broker-application/pom.xml b/apps/dhp-broker-application/pom.xml
index d16cf351..177d2e0f 100644
--- a/apps/dhp-broker-application/pom.xml
+++ b/apps/dhp-broker-application/pom.xml
@@ -4,9 +4,10 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- eu.dnetlib
+ eu.dnetlib.dhp
apps
3.0.0-SNAPSHOT
+ ../
4.0.0
@@ -77,9 +78,9 @@
- eu.dnetlib
+ eu.dnetlib.dhp
dnet-openaire-broker-common
- [3.0.4-SNAPSHOT, 4.0.0)
+ ${project.version}
diff --git a/apps/dnet-orgs-database-application/pom.xml b/apps/dnet-orgs-database-application/pom.xml
index 8a7a4d0f..ce3d8eb8 100644
--- a/apps/dnet-orgs-database-application/pom.xml
+++ b/apps/dnet-orgs-database-application/pom.xml
@@ -4,9 +4,10 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- eu.dnetlib
+ eu.dnetlib.dhp
apps
3.0.0-SNAPSHOT
+ ../
4.0.0
diff --git a/apps/pom.xml b/apps/pom.xml
index 79858602..e07756a0 100644
--- a/apps/pom.xml
+++ b/apps/pom.xml
@@ -3,13 +3,14 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- eu.dnetlib
+ eu.dnetlib.dhp
dnet-applications
3.0.0-SNAPSHOT
+ ../
4.0.0
- eu.dnetlib
+ eu.dnetlib.dhp
apps
pom
diff --git a/libs/dnet-openaire-broker-common/pom.xml b/libs/dnet-openaire-broker-common/pom.xml
new file mode 100644
index 00000000..b31045e4
--- /dev/null
+++ b/libs/dnet-openaire-broker-common/pom.xml
@@ -0,0 +1,35 @@
+
+
+
+ eu.dnetlib.dhp
+ libs
+ 3.0.0-SNAPSHOT
+ ../
+
+
+ 4.0.0
+ dnet-openaire-broker-common
+ jar
+
+
+
+
+ com.google.guava
+ guava
+ 18.0
+ compile
+
+
+
+
+ com.google.code.gson
+ gson
+ 2.6.2
+ provided
+
+
+
+
+
+
+
diff --git a/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerAuthor.java b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerAuthor.java
new file mode 100644
index 00000000..6d36ef82
--- /dev/null
+++ b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerAuthor.java
@@ -0,0 +1,38 @@
+package eu.dnetlib.broker.objects;
+
+import java.io.Serializable;
+
+public class OaBrokerAuthor implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -1295190133654199196L;
+
+ private String fullname;
+ private String orcid;
+
+ public OaBrokerAuthor() {}
+
+ public String getFullname() {
+ return fullname;
+ }
+
+ public void setFullname(final String fullname) {
+ this.fullname = fullname;
+ }
+
+ public String getOrcid() {
+ return orcid;
+ }
+
+ public void setOrcid(final String orcid) {
+ this.orcid = orcid;
+ }
+
+ public OaBrokerAuthor(final String fullname, final String orcid) {
+ this.fullname = fullname;
+ this.orcid = orcid;
+ }
+
+}
diff --git a/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerEventPayload.java b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerEventPayload.java
new file mode 100644
index 00000000..4d5c4855
--- /dev/null
+++ b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerEventPayload.java
@@ -0,0 +1,67 @@
+package eu.dnetlib.broker.objects;
+
+import java.io.Serializable;
+
+import com.google.gson.GsonBuilder;
+
+/**
+ * Created by claudio on 11/07/16.
+ */
+public class OaBrokerEventPayload implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5910606923372311229L;
+
+ private OaBrokerMainEntity result;
+
+ private OaBrokerMainEntity highlight;
+
+ private OaBrokerProvenance provenance;
+
+ private float trust;
+
+ public OaBrokerMainEntity getResult() {
+ return result;
+ }
+
+ public void setResult(final OaBrokerMainEntity result) {
+ this.result = result;
+ }
+
+ public OaBrokerMainEntity getHighlight() {
+ return highlight;
+ }
+
+ public void setHighlight(final OaBrokerMainEntity highlight) {
+ this.highlight = highlight;
+ }
+
+ public OaBrokerProvenance getProvenance() {
+ return provenance;
+ }
+
+ public void setProvenance(final OaBrokerProvenance provenance) {
+ this.provenance = provenance;
+ }
+
+ public float getTrust() {
+ return trust;
+ }
+
+ public void setTrust(final float trust) {
+ this.trust = trust;
+ }
+
+ public static OaBrokerEventPayload fromJSON(final String json) {
+ final GsonBuilder b = new GsonBuilder();
+ return b.create().fromJson(json, OaBrokerEventPayload.class);
+ }
+
+ public String toJSON() {
+ final GsonBuilder b = new GsonBuilder();
+ return b.create().toJson(this);
+ }
+
+}
diff --git a/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerExternalReference.java b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerExternalReference.java
new file mode 100644
index 00000000..792b51d5
--- /dev/null
+++ b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerExternalReference.java
@@ -0,0 +1,55 @@
+package eu.dnetlib.broker.objects;
+
+import java.io.Serializable;
+
+/**
+ * Created by claudio on 22/07/16.
+ */
+public class OaBrokerExternalReference implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5528787961232948079L;
+
+ private String url;
+
+ private String sitename;
+
+ private String type;
+
+ private String refidentifier;
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(final String url) {
+ this.url = url;
+ }
+
+ public String getSitename() {
+ return sitename;
+ }
+
+ public void setSitename(final String sitename) {
+ this.sitename = sitename;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ public String getRefidentifier() {
+ return refidentifier;
+ }
+
+ public void setRefidentifier(final String refidentifier) {
+ this.refidentifier = refidentifier;
+ }
+
+}
diff --git a/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerInstance.java b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerInstance.java
new file mode 100644
index 00000000..69cfcaea
--- /dev/null
+++ b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerInstance.java
@@ -0,0 +1,71 @@
+package eu.dnetlib.broker.objects;
+
+import java.io.Serializable;
+
+import com.google.common.base.Objects;
+
+/**
+ * Created by claudio on 22/07/16.
+ */
+public class OaBrokerInstance implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 4064188385743605220L;
+
+ private String url;
+
+ private String license;
+
+ private String hostedby;
+
+ private String instancetype;
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(final String url) {
+ this.url = url;
+ }
+
+ public String getLicense() {
+ return license;
+ }
+
+ public void setLicense(final String license) {
+ this.license = license;
+ }
+
+ public String getHostedby() {
+ return hostedby;
+ }
+
+ public void setHostedby(final String hostedby) {
+ this.hostedby = hostedby;
+ }
+
+ public String getInstancetype() {
+ return instancetype;
+ }
+
+ public void setInstancetype(final String instancetype) {
+ this.instancetype = instancetype;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(getUrl(), getLicense(), getHostedby(), getInstancetype());
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (!(obj instanceof OaBrokerInstance)) { return false; }
+ final OaBrokerInstance that = (OaBrokerInstance) obj;
+ return Objects.equal(getUrl(), that.getUrl()) &&
+ Objects.equal(getLicense(), that.getLicense()) &&
+ Objects.equal(getHostedby(), that.getHostedby()) &&
+ Objects.equal(getInstancetype(), that.getInstancetype());
+ }
+}
diff --git a/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerJournal.java b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerJournal.java
new file mode 100644
index 00000000..328cd826
--- /dev/null
+++ b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerJournal.java
@@ -0,0 +1,55 @@
+package eu.dnetlib.broker.objects;
+
+import java.io.Serializable;
+
+/**
+ * Created by claudio on 22/07/16.
+ */
+public class OaBrokerJournal implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 941929788063513440L;
+
+ private String name;
+
+ private String issn;
+
+ private String eissn;
+
+ private String lissn;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ public String getIssn() {
+ return issn;
+ }
+
+ public void setIssn(final String issn) {
+ this.issn = issn;
+ }
+
+ public String getEissn() {
+ return eissn;
+ }
+
+ public void setEissn(final String eissn) {
+ this.eissn = eissn;
+ }
+
+ public String getLissn() {
+ return lissn;
+ }
+
+ public void setLissn(final String lissn) {
+ this.lissn = lissn;
+ }
+
+}
diff --git a/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerMainEntity.java b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerMainEntity.java
new file mode 100644
index 00000000..01f3f88b
--- /dev/null
+++ b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerMainEntity.java
@@ -0,0 +1,247 @@
+package eu.dnetlib.broker.objects;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by claudio on 22/07/16.
+ */
+public class OaBrokerMainEntity implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -944960541904447441L;
+
+ private String openaireId;
+
+ private String originalId;
+
+ private String typology;
+
+ private List titles = new ArrayList<>();
+
+ private List abstracts = new ArrayList<>();
+
+ private String language;
+
+ private List subjects = new ArrayList<>();
+
+ private List creators = new ArrayList<>();
+
+ private String publicationdate;
+
+ private String publisher;
+
+ private String embargoenddate;
+
+ private List contributor = new ArrayList<>();
+
+ private OaBrokerJournal journal;
+
+ private String collectedFromId;
+
+ private String collectedFromName;
+
+ private String collectedFromType;
+
+ private List pids = new ArrayList<>();
+
+ private List instances = new ArrayList<>();
+
+ private List externalReferences = new ArrayList<>();
+
+ private List projects = new ArrayList<>();
+
+ private List datasets = new ArrayList<>();
+
+ private List publications = new ArrayList<>();
+
+ private List softwares = new ArrayList<>();
+
+ public String getOpenaireId() {
+ return openaireId;
+ }
+
+ public void setOpenaireId(final String openaireId) {
+ this.openaireId = openaireId;
+ }
+
+ public String getOriginalId() {
+ return originalId;
+ }
+
+ public void setOriginalId(final String originalId) {
+ this.originalId = originalId;
+ }
+
+ public String getTypology() {
+ return typology;
+ }
+
+ public void setTypology(final String typology) {
+ this.typology = typology;
+ }
+
+ public List getTitles() {
+ return titles;
+ }
+
+ public void setTitles(final List titles) {
+ this.titles = titles;
+ }
+
+ public List getAbstracts() {
+ return abstracts;
+ }
+
+ public void setAbstracts(final List abstracts) {
+ this.abstracts = abstracts;
+ }
+
+ public String getLanguage() {
+ return language;
+ }
+
+ public void setLanguage(final String language) {
+ this.language = language;
+ }
+
+ public List getSubjects() {
+ return subjects;
+ }
+
+ public void setSubjects(final List subjects) {
+ this.subjects = subjects;
+ }
+
+ public List getCreators() {
+ return creators;
+ }
+
+ public void setCreators(final List creators) {
+ this.creators = creators;
+ }
+
+ public String getPublicationdate() {
+ return publicationdate;
+ }
+
+ public void setPublicationdate(final String publicationdate) {
+ this.publicationdate = publicationdate;
+ }
+
+ public String getPublisher() {
+ return publisher;
+ }
+
+ public void setPublisher(final String publisher) {
+ this.publisher = publisher;
+ }
+
+ public String getEmbargoenddate() {
+ return embargoenddate;
+ }
+
+ public void setEmbargoenddate(final String embargoenddate) {
+ this.embargoenddate = embargoenddate;
+ }
+
+ public List getContributor() {
+ return contributor;
+ }
+
+ public void setContributor(final List contributor) {
+ this.contributor = contributor;
+ }
+
+ public OaBrokerJournal getJournal() {
+ return journal;
+ }
+
+ public void setJournal(final OaBrokerJournal journal) {
+ this.journal = journal;
+ }
+
+ public String getCollectedFromId() {
+ return collectedFromId;
+ }
+
+ public void setCollectedFromId(final String collectedFromId) {
+ this.collectedFromId = collectedFromId;
+ }
+
+ public String getCollectedFromName() {
+ return collectedFromName;
+ }
+
+ public void setCollectedFromName(final String collectedFromName) {
+ this.collectedFromName = collectedFromName;
+ }
+
+ public String getCollectedFromType() {
+ return collectedFromType;
+ }
+
+ public void setCollectedFromType(final String collectedFromType) {
+ this.collectedFromType = collectedFromType;
+ }
+
+ public List getPids() {
+ return pids;
+ }
+
+ public void setPids(final List pids) {
+ this.pids = pids;
+ }
+
+ public List getInstances() {
+ return instances;
+ }
+
+ public void setInstances(final List instances) {
+ this.instances = instances;
+ }
+
+ public List getExternalReferences() {
+ return externalReferences;
+ }
+
+ public void setExternalReferences(final List externalReferences) {
+ this.externalReferences = externalReferences;
+ }
+
+ public List getProjects() {
+ return projects;
+ }
+
+ public void setProjects(final List projects) {
+ this.projects = projects;
+ }
+
+ public List getDatasets() {
+ return datasets;
+ }
+
+ public void setDatasets(final List datasets) {
+ this.datasets = datasets;
+ }
+
+ public List getPublications() {
+ return publications;
+ }
+
+ public void setPublications(final List publications) {
+ this.publications = publications;
+ }
+
+ public List getSoftwares() {
+ return softwares;
+ }
+
+ public void setSoftwares(final List softwares) {
+ this.softwares = softwares;
+ }
+
+}
diff --git a/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerProject.java b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerProject.java
new file mode 100644
index 00000000..ec588fc2
--- /dev/null
+++ b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerProject.java
@@ -0,0 +1,108 @@
+package eu.dnetlib.broker.objects;
+
+import java.io.Serializable;
+
+public class OaBrokerProject implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -2080495225075576873L;
+
+ private String openaireId;
+ private String code;
+ private String acronym;
+ private String title;
+ private String funder;
+ private String fundingProgram;
+ private String jurisdiction;
+
+ public OaBrokerProject() {}
+
+ public OaBrokerProject(final String openaireId, final String code, final String acronym, final String title, final String funder,
+ final String fundingProgram, final String jurisdiction) {
+ this.openaireId = openaireId;
+ this.code = code;
+ this.acronym = acronym;
+ this.title = title;
+ this.funder = funder;
+ this.fundingProgram = fundingProgram;
+ this.jurisdiction = jurisdiction;
+ }
+
+ public String getOpenaireId() {
+ return openaireId;
+ }
+
+ public void setOpenaireId(final String openaireId) {
+ this.openaireId = openaireId;
+ }
+
+ public String getCode() {
+ return code;
+ }
+
+ public void setCode(final String code) {
+ this.code = code;
+ }
+
+ public String getAcronym() {
+ return acronym;
+ }
+
+ public void setAcronym(final String acronym) {
+ this.acronym = acronym;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(final String title) {
+ this.title = title;
+ }
+
+ public String getFunder() {
+ return funder;
+ }
+
+ public void setFunder(final String funder) {
+ this.funder = funder;
+ }
+
+ public String getFundingProgram() {
+ return fundingProgram;
+ }
+
+ public void setFundingProgram(final String fundingProgram) {
+ this.fundingProgram = fundingProgram;
+ }
+
+ public String getJurisdiction() {
+ return jurisdiction;
+ }
+
+ public void setJurisdiction(final String jurisdiction) {
+ this.jurisdiction = jurisdiction;
+ }
+
+ public String asOpenaireProjectIdentifier() {
+ if (verifyManadatoryFields()) {
+ return String.format("info:eu-repo/grantAgreement/%s/%s/%s/%s/%s/%s",
+ funder,
+ fundingProgram,
+ code,
+ jurisdiction != null ? jurisdiction : "",
+ title != null ? title : "",
+ acronym != null ? acronym : "");
+ } else {
+ return "";
+ }
+ }
+
+ public boolean verifyManadatoryFields() {
+ return funder != null && fundingProgram != null && code != null
+ && !funder.isEmpty() && !fundingProgram.isEmpty() && !code.isEmpty();
+ }
+
+}
diff --git a/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerProvenance.java b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerProvenance.java
new file mode 100644
index 00000000..f87d5b6d
--- /dev/null
+++ b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerProvenance.java
@@ -0,0 +1,64 @@
+package eu.dnetlib.broker.objects;
+
+import java.io.Serializable;
+
+/**
+ * Created by claudio on 26/07/16.
+ */
+public class OaBrokerProvenance implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -2370917119345695230L;
+
+ private String id;
+
+ private String repositoryName;
+
+ private String repositoryType;
+
+ private String url;
+
+ public OaBrokerProvenance() {}
+
+ public OaBrokerProvenance(final String id, final String repositoryName, final String repositoryType, final String url) {
+ this.id = id;
+ this.repositoryName = repositoryName;
+ this.repositoryType = repositoryType;
+ this.url = url;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(final String id) {
+ this.id = id;
+ }
+
+ public String getRepositoryName() {
+ return repositoryName;
+ }
+
+ public void setRepositoryName(final String repositoryName) {
+ this.repositoryName = repositoryName;
+ }
+
+ public String getRepositoryType() {
+ return repositoryType;
+ }
+
+ public void setRepositoryType(final String repositoryType) {
+ this.repositoryType = repositoryType;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(final String url) {
+ this.url = url;
+ }
+
+}
diff --git a/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerRelatedDataset.java b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerRelatedDataset.java
new file mode 100644
index 00000000..e62267ad
--- /dev/null
+++ b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerRelatedDataset.java
@@ -0,0 +1,83 @@
+package eu.dnetlib.broker.objects;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class OaBrokerRelatedDataset implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -1623416039557371858L;
+
+ private String openaireId;
+
+ private String originalId;
+
+ private String title;
+
+ private String collectedFrom;
+
+ private List pids;
+
+ private List instances;
+
+ private String relType;
+
+ public String getOpenaireId() {
+ return openaireId;
+ }
+
+ public void setOpenaireId(final String openaireId) {
+ this.openaireId = openaireId;
+ }
+
+ public String getOriginalId() {
+ return originalId;
+ }
+
+ public void setOriginalId(final String originalId) {
+ this.originalId = originalId;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(final String title) {
+ this.title = title;
+ }
+
+ public String getCollectedFrom() {
+ return collectedFrom;
+ }
+
+ public void setCollectedFrom(final String collectedFrom) {
+ this.collectedFrom = collectedFrom;
+ }
+
+ public List getPids() {
+ return pids;
+ }
+
+ public void setPids(final List pids) {
+ this.pids = pids;
+ }
+
+ public List getInstances() {
+ return instances;
+ }
+
+ public void setInstances(final List instances) {
+ this.instances = instances;
+ }
+
+ public String getRelType() {
+ return relType;
+ }
+
+ public void setRelType(final String relType) {
+ this.relType = relType;
+ }
+
+}
diff --git a/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerRelatedPublication.java b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerRelatedPublication.java
new file mode 100644
index 00000000..ef281256
--- /dev/null
+++ b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerRelatedPublication.java
@@ -0,0 +1,77 @@
+package eu.dnetlib.broker.objects;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class OaBrokerRelatedPublication implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -6845435777531929885L;
+
+ private String openaireId;
+ private String originalId;
+ private String title;
+ private String collectedFrom;
+ private List pids;
+ private List instances;
+ private String relType;
+
+ public String getOpenaireId() {
+ return openaireId;
+ }
+
+ public void setOpenaireId(final String openaireId) {
+ this.openaireId = openaireId;
+ }
+
+ public String getOriginalId() {
+ return originalId;
+ }
+
+ public void setOriginalId(final String originalId) {
+ this.originalId = originalId;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(final String title) {
+ this.title = title;
+ }
+
+ public String getCollectedFrom() {
+ return collectedFrom;
+ }
+
+ public void setCollectedFrom(final String collectedFrom) {
+ this.collectedFrom = collectedFrom;
+ }
+
+ public List getPids() {
+ return pids;
+ }
+
+ public void setPids(final List pids) {
+ this.pids = pids;
+ }
+
+ public List getInstances() {
+ return instances;
+ }
+
+ public void setInstances(final List instances) {
+ this.instances = instances;
+ }
+
+ public String getRelType() {
+ return relType;
+ }
+
+ public void setRelType(final String relType) {
+ this.relType = relType;
+ }
+
+}
diff --git a/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerRelatedSoftware.java b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerRelatedSoftware.java
new file mode 100644
index 00000000..341031d0
--- /dev/null
+++ b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerRelatedSoftware.java
@@ -0,0 +1,72 @@
+package eu.dnetlib.broker.objects;
+
+import java.io.Serializable;
+
+public class OaBrokerRelatedSoftware implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 176600509589408338L;
+
+ private String openaireId;
+
+ private String name;
+
+ private String description;
+
+ private String landingPage;
+
+ private String repository;
+
+ public OaBrokerRelatedSoftware() {}
+
+ public OaBrokerRelatedSoftware(final String openaireId, final String name, final String description, final String landingPage, final String repository) {
+ this.openaireId = openaireId;
+ this.name = name;
+ this.description = description;
+ this.landingPage = landingPage;
+ this.repository = repository;
+ }
+
+ public String getOpenaireId() {
+ return openaireId;
+ }
+
+ public void setOpenaireId(final String openaireId) {
+ this.openaireId = openaireId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(final String description) {
+ this.description = description;
+ }
+
+ public String getLandingPage() {
+ return landingPage;
+ }
+
+ public void setLandingPage(final String landingPage) {
+ this.landingPage = landingPage;
+ }
+
+ public String getRepository() {
+ return repository;
+ }
+
+ public void setRepository(final String repository) {
+ this.repository = repository;
+ }
+
+}
diff --git a/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerTypedValue.java b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerTypedValue.java
new file mode 100644
index 00000000..c91cd444
--- /dev/null
+++ b/libs/dnet-openaire-broker-common/src/main/java/eu/dnetlib/broker/objects/OaBrokerTypedValue.java
@@ -0,0 +1,42 @@
+package eu.dnetlib.broker.objects;
+
+import java.io.Serializable;
+
+/**
+ * Created by claudio on 22/07/16.
+ */
+public class OaBrokerTypedValue implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 4797440344311785195L;
+
+ private String type;
+
+ private String value;
+
+ public OaBrokerTypedValue() {}
+
+ public OaBrokerTypedValue(final String type, final String value) {
+ this.type = type;
+ this.value = value;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(final String type) {
+ this.type = type;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(final String value) {
+ this.value = value;
+ }
+
+}
diff --git a/libs/dnet-openaire-broker-common/src/main/resources/eu/dnetlib/broker/config/mapping.sh b/libs/dnet-openaire-broker-common/src/main/resources/eu/dnetlib/broker/config/mapping.sh
new file mode 100755
index 00000000..c5842e8e
--- /dev/null
+++ b/libs/dnet-openaire-broker-common/src/main/resources/eu/dnetlib/broker/config/mapping.sh
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+echo
+echo "Fixing events index..."
+curl -XPUT 'http://localhost:9200/events/_mapping/event' -d '
+{
+ "event" : {
+ "properties" : {
+ "map": {
+ "type": "nested",
+ "properties": {
+ "target_datasource_id": {
+ "type": "string",
+ "index": "not_analyzed"
+ },
+ "target_datasource_name": {
+ "type": "string",
+ "index": "not_analyzed"
+ }
+ }
+ }
+ }
+ }
+}
+'
+echo
+echo
+echo "Fixing notifications index..."
+curl -XPUT 'http://localhost:9200/notifications/_mapping/notification' -d '
+{
+ "notification" : {
+ "properties" : {
+ "map": {
+ "type": "nested",
+ "properties": {
+ "target_datasource_id": {
+ "type": "string",
+ "index": "not_analyzed"
+ },
+ "target_datasource_name": {
+ "type": "string",
+ "index": "not_analyzed"
+ }
+ }
+ }
+ }
+ }
+}
+'
+
+echo
+echo
+echo "Registering topic type: ENRICH//..."
+curl "http://localhost:8080/api/topic-types/add" -d "name=ENRICH&expression=ENRICH%2F%3Ccond%3E%2F%3Cfield%3E&producerId=OpenAIRE&mapKeys=target_datasource_name"
+echo
+echo
+echo "Registering topic type: ENRICH///..."
+curl "http://localhost:8080/api/topic-types/add" -d "name=ENRICH_WITH_SUBFIELD&expression=ENRICH%2F%3Ccond%3E%2F%3Cfield%3E%2F%3Csubfield%3E&producerId=OpenAIRE&mapKeys=target_datasource_name"
+echo
+echo
+echo "Registering topic type: ADD/..."
+curl "http://localhost:8080/api/topic-types/add" -d "name=ADD&expression=ADD%2F%3Cfield%3E&producerId=OpenAIRE&mapKeys=target_datasource_name"
+echo
+echo
+echo
diff --git a/libs/dnet-openaire-broker-common/src/test/resources/test-search-on-map.json b/libs/dnet-openaire-broker-common/src/test/resources/test-search-on-map.json
new file mode 100644
index 00000000..dd8eed84
--- /dev/null
+++ b/libs/dnet-openaire-broker-common/src/test/resources/test-search-on-map.json
@@ -0,0 +1,23 @@
+{
+ "query": {
+ "nested": {
+ "path": "map",
+ "query": {
+ "bool": {
+ "must": [
+ {
+ "match": {
+ "map.id": "id_1_33"
+ }
+ },
+ {
+ "match": {
+ "map.year": 2016
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/libs/pom.xml b/libs/pom.xml
index 95f15c29..609cc3db 100644
--- a/libs/pom.xml
+++ b/libs/pom.xml
@@ -4,17 +4,19 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- eu.dnetlib
+ eu.dnetlib.dhp
dnet-applications
3.0.0-SNAPSHOT
+ ../
4.0.0
- eu.dnetlib
+ eu.dnetlib.dhp
libs
pom
+ dnet-openaire-broker-common
-
\ No newline at end of file
+
diff --git a/pom.xml b/pom.xml
index 545be533..de8b7b21 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
4.0.0
- eu.dnetlib
+ eu.dnetlib.dhp
dnet-applications
3.0.0-SNAPSHOT
pom
@@ -27,8 +27,8 @@
- apps
libs
+ apps