Revision 40100
Added by Argiro Kokogiannaki almost 9 years ago
modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/TestClass.java | ||
---|---|---|
71 | 71 |
//id : 169149 type : rels2actions reltype : resultResult_datasetpublication_isRelatedTo |
72 | 72 |
// id : 169480 type : rels2actions reltype : resultProject |
73 | 73 |
// id : 169503 type : rels2actions reltype : resultResult_publicationdataset_isRelatedTo |
74 |
ResultSet rs=sqlDAO.executePreparedQuery("Select * from claims limit 1");
|
|
74 |
ResultSet rs=sqlDAO.executePreparedQuery("Select * from claims limit 5");
|
|
75 | 75 |
//ResultSet rs=sqlDAO.executePreparedQuery(sqlDAO.getQueryGenerator().selectClaimById("169480")); |
76 | 76 |
while(rs.next()){ |
77 | 77 |
String claimType=rs.getString("type"); |
modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/eu/dnetlib/data/claims/migration/Test.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.claimsDemo.eu.dnetlib.data.claims.migration; |
2 | 2 |
|
3 | 3 |
import java.util.Calendar; |
4 |
import java.util.Objects; |
|
5 | 4 |
|
6 | 5 |
public class Test { |
7 | 6 |
|
... | ... | |
20 | 19 |
result.setExternal_url("external_url"); |
21 | 20 |
result.setOpenaire_id("openaire_id"); |
22 | 21 |
result.setTitle("title"); |
23 |
result.setType("type"); |
|
22 |
result.setResultType("type");
|
|
24 | 23 |
result.setXml("xmlString"); |
25 | 24 |
claim.setBody(project); |
26 | 25 |
claim.setTarget(result); |
modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/eu/dnetlib/data/claims/migration/Context.java | ||
---|---|---|
4 | 4 |
* Created by kiatrop on 20/11/2015. |
5 | 5 |
*/ |
6 | 6 |
public class Context { |
7 |
private String id; |
|
7 | 8 |
private String title; |
8 |
private String openaire_id;
|
|
9 |
private String openaireId;
|
|
9 | 10 |
|
11 |
public String getId() { |
|
12 |
return id; |
|
13 |
} |
|
14 |
|
|
10 | 15 |
public String getTitle() { |
11 | 16 |
return title; |
12 | 17 |
} |
... | ... | |
15 | 20 |
this.title = title; |
16 | 21 |
} |
17 | 22 |
|
18 |
public String getOpenaire_id() {
|
|
19 |
return openaire_id;
|
|
23 |
public String getOpenaireId() {
|
|
24 |
return openaireId;
|
|
20 | 25 |
} |
21 | 26 |
|
22 |
public void setOpenaire_id(String openaire_id) { |
|
23 |
this.openaire_id = openaire_id; |
|
27 |
public void setOpenaireId(String openaireId) { |
|
28 |
this.openaireId = openaireId; |
|
29 |
this.id = "http://www.openaire.eu/contexts/"+ openaireId; |
|
24 | 30 |
} |
25 | 31 |
|
26 | 32 |
private String export(){ |
... | ... | |
31 | 37 |
public String toString() { |
32 | 38 |
return "Context{" + |
33 | 39 |
"title='" + title + '\'' + |
34 |
", openaire_id='" + openaire_id + '\'' +
|
|
40 |
", openaireId='" + openaireId + '\'' +
|
|
35 | 41 |
'}'; |
36 | 42 |
} |
37 | 43 |
} |
modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/eu/dnetlib/data/claims/migration/ClaimGenerics.java | ||
---|---|---|
16 | 16 |
@SerializedName("annotatedBy") |
17 | 17 |
private String userMail; |
18 | 18 |
private Date date; |
19 |
private String relationType; |
|
19 | 20 |
|
20 | 21 |
public T getTarget() { |
21 | 22 |
return target; |
modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/eu/dnetlib/data/claims/migration/Result.java | ||
---|---|---|
11 | 11 |
private String accessRights; |
12 | 12 |
private String collectedFrom; |
13 | 13 |
private String xml; |
14 |
private String type;
|
|
14 |
private String resultType;
|
|
15 | 15 |
|
16 | 16 |
public String getTitle() { |
17 | 17 |
return title; |
... | ... | |
61 | 61 |
this.xml = xml; |
62 | 62 |
} |
63 | 63 |
|
64 |
public String getType() { |
|
65 |
return type;
|
|
64 |
public String getResultType() {
|
|
65 |
return resultType;
|
|
66 | 66 |
} |
67 | 67 |
|
68 |
public void setType(String type) {
|
|
69 |
this.type = type;
|
|
68 |
public void setResultType(String resultType) {
|
|
69 |
this.resultType = resultType;
|
|
70 | 70 |
} |
71 | 71 |
|
72 | 72 |
public String getId() { |
... | ... | |
87 | 87 |
", accessRights='" + accessRights + '\'' + |
88 | 88 |
", collectedFrom='" + collectedFrom + '\'' + |
89 | 89 |
", xml='" + xml + '\'' + |
90 |
", type='" + type + '\'' +
|
|
90 |
", resultType='" + resultType + '\'' +
|
|
91 | 91 |
'}'; |
92 | 92 |
} |
93 | 93 |
//method to ask from API of search to get the xml |
modules/uoa-claims -demo/claims-demo/src/main/java/eu/dnetlib/data/claimsDemo/ParsingClaimUtils.java | ||
---|---|---|
185 | 185 |
} |
186 | 186 |
nl = (NodeList) xpath.compile("//*[local-name()='concept']/@id").evaluate(document, XPathConstants.NODESET); |
187 | 187 |
if (nl.getLength() > 0) { |
188 |
context.setOpenaire_id(nl.item(0).getNodeValue());
|
|
188 |
context.setOpenaireId(nl.item(0).getNodeValue());
|
|
189 | 189 |
} |
190 | 190 |
} catch (Exception e) { |
191 | 191 |
e.printStackTrace(); |
... | ... | |
242 | 242 |
id = id.split("\\|")[1]; |
243 | 243 |
} |
244 | 244 |
body.setOpenaire_id(id); |
245 |
body.setType(type); |
|
245 |
body.setResultType(type);
|
|
246 | 246 |
body=getResultFromSearch(body); |
247 | 247 |
return body; |
248 | 248 |
} |
... | ... | |
267 | 267 |
if(size!=null && Integer.parseInt(size)>0){ |
268 | 268 |
nl = (NodeList) xpath.compile("//field[@name='resulttypename']/@value").evaluate(document, XPathConstants.NODESET); |
269 | 269 |
if (nl.getLength() > 0) { |
270 |
r.setType(nl.item(0).getNodeValue()); |
|
270 |
r.setResultType(nl.item(0).getNodeValue());
|
|
271 | 271 |
} |
272 | 272 |
nl = (NodeList) xpath.compile("//field[@name='bestlicense']/@value").evaluate(document, XPathConstants.NODESET); |
273 | 273 |
if (nl.getLength() > 0) { |
modules/uoa-claims -demo/claims-demo/src/main/resources/eu/dnetlib/data/claimsDemo/springContext-claimsDemo.xml | ||
---|---|---|
33 | 33 |
<bean id="sqlStore" class="eu.dnetlib.data.claimsDemo.SqlStore" init-method="init" destroy-method="destroy"> |
34 | 34 |
|
35 | 35 |
<property name="dbUser" value="postgres"/> |
36 |
<property name="dbPassword" value="vereniki"/>
|
|
36 |
<property name="dbPassword" value="snowflakes"/>
|
|
37 | 37 |
<property name="dbDriver" value="org.postgresql.Driver"/> |
38 |
<property name="dbUrl" value="jdbc:postgresql://194.177.192.118:5432/stats"/>
|
|
38 |
<property name="dbUrl" value="jdbc:postgresql://scoobydoo.di.uoa.gr:5432/dnet_openaireplus"/>
|
|
39 | 39 |
|
40 | 40 |
</bean> |
41 | 41 |
|
Also available in: Unified diff