1
|
//package eu.dnetlib.data.claims.handler;
|
2
|
//
|
3
|
//import eu.dnetlib.data.claims.entity.Context;
|
4
|
//import eu.dnetlib.data.claims.utils.ContextUtils;
|
5
|
//import org.apache.log4j.Logger;
|
6
|
//
|
7
|
///**
|
8
|
// * Created by kiatrop on 5/2/2016.
|
9
|
// */
|
10
|
//public class DMFContextHandler {
|
11
|
// private static Logger log = Logger.getLogger(DMFContextHandler.class );
|
12
|
//
|
13
|
//// SqlDAO sqlDAO = null;
|
14
|
//// QueryGenerator queryGenerator = null;
|
15
|
//// DMFParser dmfParser = null;
|
16
|
//
|
17
|
//
|
18
|
//// private String fetchAllDMFContext(String id) throws Exception, SQLStoreException {
|
19
|
//// ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateSelectConceptDMFClaimsQuery(-1));
|
20
|
//// return rs.getString("xml");
|
21
|
//// }
|
22
|
////
|
23
|
//// private String fetchDMFContext(String id) throws Exception, SQLStoreException {
|
24
|
//// ResultSet rs = sqlDAO.executePreparedQuery(queryGenerator.generateSelectConceptClaimByIdQuery(id));
|
25
|
//// return rs.getString("xml");
|
26
|
//// }
|
27
|
////
|
28
|
//// public Context extractContextFromDMF(String xml, Boolean production) throws ParserConfigurationException, SAXException, XPathExpressionException, IOException {
|
29
|
//// return fetchContextById(dmfParser.getContextIdFromDMF(xml),production );
|
30
|
//// }
|
31
|
////
|
32
|
//// public Context fetchContextByIdFromDmf(String id, Boolean production) throws Exception, SQLStoreException {
|
33
|
//// return extractContextFromDMF(fetchDMFContext(id), production);
|
34
|
//// }
|
35
|
//
|
36
|
//// public static Context fetchContextById(String openaireId, Boolean production) {
|
37
|
//// Context context = new Context();
|
38
|
//// if(openaireId == null ){
|
39
|
//// return null;
|
40
|
//// }
|
41
|
//// context.setOpenaireId(openaireId);
|
42
|
//// try {
|
43
|
//// context.setTitle(ContextUtils.extractLabel(context.getOpenaireId(),production));
|
44
|
////
|
45
|
//// } catch (Exception e) {
|
46
|
//// log.error("ContextUtils: Couldn't get Egi label for id " + context.getOpenaireId(),e);
|
47
|
//// }
|
48
|
//// return context;
|
49
|
////
|
50
|
//// }
|
51
|
///* public String generateSaveQueryForContext(Context context){
|
52
|
//
|
53
|
// return queryGenerator.generateInsertContextQuery(context.getOpenaireId(),context.getTitle());
|
54
|
// }
|
55
|
//
|
56
|
// public void saveContext(Context context) throws Exception {
|
57
|
//
|
58
|
// sqlDAO.executePreparedQuery(generateSaveQueryForContext(context));
|
59
|
// }*/
|
60
|
//
|
61
|
//// public SqlDAO getSqlDAO() {
|
62
|
//// return sqlDAO;
|
63
|
//// }
|
64
|
////
|
65
|
//// public void setSqlDAO(SqlDAO sqlDAO) {
|
66
|
//// this.sqlDAO = sqlDAO;
|
67
|
//// }
|
68
|
////
|
69
|
//// public QueryGenerator getQueryGenerator() {
|
70
|
//// return queryGenerator;
|
71
|
//// }
|
72
|
////
|
73
|
//// public void setQueryGenerator(QueryGenerator queryGenerator) {
|
74
|
//// this.queryGenerator = queryGenerator;
|
75
|
//// }
|
76
|
////
|
77
|
//// public DMFParser getDmfParser() {
|
78
|
//// return dmfParser;
|
79
|
//// }
|
80
|
////
|
81
|
//// public void setDmfParser(DMFParser dmfParser) {
|
82
|
//// this.dmfParser = dmfParser;
|
83
|
//// }
|
84
|
//}
|