Project

General

Profile

« Previous | Next » 

Revision 27637

Added user info in returned claims

View differences:

modules/uoa-openaire-connector/trunk/src/main/thrift/OpenAIREConnector.thrift
24 24
}
25 25

  
26 26
struct Claim {
27
	1: string resultid,
28
	2: i64 date,
29
	3: string type,
30
	4: string xml
27
    1: string userEmail,
28
	2: string resultid,
29
	3: i64 date,
30
	4: string type,
31
	5: string xml
31 32
}
32 33

  
33 34
struct Project {
modules/uoa-openaire-connector/trunk/src/main/java/eu/dnetlib/openaire/thrift/ClaimConnector.java
48 48
		List<Claim> res = new ArrayList<Claim>();
49 49
		
50 50
		while (rs.next()) {
51
            res.add(new Claim(rs.getString(1), rs.getDate(2).getTime(), rs.getString(3), rs.getString(4)));
51
            res.add(new Claim(user, rs.getString(1), rs.getDate(2).getTime(), rs.getString(3), rs.getString(4)));
52 52
		}
53 53

  
54 54
        rs.close();
......
62 62
	logger.info("Returning all claimed publications from " + from + " to " + to);
63 63
        Connection con = DataSourceUtils.getConnection(datasource);
64 64

  
65
        PreparedStatement stmt = con.prepareStatement("select \"resultid\", \"date\" , \"type\", \"xml\" from claims where \"agent\" != 'inference' and \"date\" >= ?::date and \"date\" <= ?::date ");
65
        PreparedStatement stmt = con.prepareStatement("select \"agent\", \"resultid\", \"date\" , \"type\", \"xml\" from claims where \"agent\" != 'inference' and \"date\" >= ?::date and \"date\" <= ?::date ");
66 66

  
67 67
        stmt.setDate(1, new java.sql.Date(from.getTime()));
68 68
        stmt.setDate(2, new java.sql.Date(to.getTime()));
......
71 71
        List<Claim> res = new ArrayList<Claim>();
72 72

  
73 73
        while (rs.next()) {
74
            res.add(new Claim(rs.getString(1), rs.getDate(2).getTime(), rs.getString(3), rs.getString(4)));
74
            res.add(new Claim(rs.getString(1), rs.getString(2), rs.getDate(3).getTime(), rs.getString(4), rs.getString(5)));
75 75
        }
76 76

  
77 77
        rs.close();

Also available in: Unified diff