Revision 62526
Added by Katerina Iatropoulou over 1 year ago
modules/uoa-claims/trunk/pom.xml | ||
---|---|---|
2 | 2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
3 | 3 |
<parent> |
4 | 4 |
<groupId>eu.dnetlib</groupId> |
5 |
<artifactId>dnet45-parent</artifactId>
|
|
6 |
<version>1.0.0-SNAPSHOT</version>
|
|
5 |
<artifactId>uoa-global-parent</artifactId>
|
|
6 |
<version>1.0.1</version>
|
|
7 | 7 |
</parent> |
8 | 8 |
<modelVersion>4.0.0</modelVersion> |
9 | 9 |
<groupId>eu.dnetlib</groupId> |
... | ... | |
22 | 22 |
<dependency> |
23 | 23 |
<groupId>junit</groupId> |
24 | 24 |
<artifactId>junit</artifactId> |
25 |
<version>${junit.version}</version> |
|
25 |
<version>4.9</version> |
|
26 |
<scope>test</scope> |
|
26 | 27 |
</dependency> |
27 | 28 |
<!-- <dependency> |
28 | 29 |
<groupId>eu.dnetlib</groupId> |
... | ... | |
38 | 39 |
<dependency> |
39 | 40 |
<groupId>org.springframework</groupId> |
40 | 41 |
<artifactId>spring-web</artifactId> |
41 |
<version>${spring.version}</version>
|
|
42 |
<version>4.2.5.RELEASE</version>
|
|
42 | 43 |
</dependency> |
43 | 44 |
<dependency> |
44 | 45 |
<groupId>commons-io</groupId> |
... | ... | |
48 | 49 |
<dependency> |
49 | 50 |
<groupId>org.springframework</groupId> |
50 | 51 |
<artifactId>spring-test</artifactId> |
51 |
<version>${spring.version}</version>
|
|
52 |
<version>4.2.5.RELEASE</version>
|
|
52 | 53 |
<scope>test</scope> |
53 | 54 |
</dependency> |
54 | 55 |
<dependency> |
55 | 56 |
<groupId>org.springframework</groupId> |
56 | 57 |
<artifactId>spring-jdbc</artifactId> |
57 |
<version>${spring.version}</version>
|
|
58 |
<version>4.2.5.RELEASE</version>
|
|
58 | 59 |
</dependency> |
59 | 60 |
<dependency> |
60 | 61 |
<groupId>org.springframework</groupId> |
61 | 62 |
<artifactId>spring-tx</artifactId> |
62 |
<version>${spring.version}</version>
|
|
63 |
<version>4.2.5.RELEASE</version>
|
|
63 | 64 |
</dependency> |
64 | 65 |
<dependency> |
65 | 66 |
<groupId>org.mockito</groupId> |
... | ... | |
92 | 93 |
<artifactId>json-simple</artifactId> |
93 | 94 |
<version>1.1</version> |
94 | 95 |
</dependency> |
95 |
<dependency> |
|
96 |
<groupId>log4j</groupId> |
|
97 |
<artifactId>log4j</artifactId> |
|
98 |
<version>1.2.17</version> |
|
99 |
</dependency> |
|
100 | 96 |
</dependencies> |
101 | 97 |
|
102 | 98 |
<!--3d answer: https://stackoverflow.com/questions/23260057/the-forked-vm-terminated-without-saying-properly-goodbye-vm-crash-or-system-exi--> |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/handler/ClaimHandler.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.claims.handler; |
2 | 2 |
|
3 |
import eu.dnetlib.data.claims.utils.ClaimValidation; |
|
4 |
import eu.dnetlib.data.claims.utils.ClaimValidationException; |
|
5 | 3 |
import eu.dnetlib.data.claims.entity.Claim; |
6 | 4 |
import eu.dnetlib.data.claims.entity.OpenaireEntity; |
7 | 5 |
import eu.dnetlib.data.claims.entity.Project; |
8 | 6 |
import eu.dnetlib.data.claims.entity.Result; |
9 |
import eu.dnetlib.data.claims.utils.ClaimUtils; |
|
10 |
import eu.dnetlib.data.claims.utils.ContextUtils; |
|
11 |
import eu.dnetlib.data.claims.utils.QueryGenerator; |
|
12 | 7 |
import eu.dnetlib.data.claims.sql.SQLStoreException; |
13 | 8 |
import eu.dnetlib.data.claims.sql.SqlDAO; |
14 |
import org.apache.log4j.Logger; |
|
9 |
import eu.dnetlib.data.claims.utils.*; |
|
10 |
import org.apache.logging.log4j.LogManager; |
|
11 |
import org.apache.logging.log4j.Logger; |
|
15 | 12 |
import org.springframework.beans.factory.annotation.Autowired; |
16 | 13 |
|
17 | 14 |
import java.sql.ResultSet; |
... | ... | |
35 | 32 |
ContextUtils contextUtils; |
36 | 33 |
ExternalRecordHandler externalRecordHandler; |
37 | 34 |
|
38 |
private static final Logger logger = Logger.getLogger(ClaimHandler.class); |
|
35 |
private static final Logger logger = LogManager.getLogger(ClaimHandler.class);
|
|
39 | 36 |
|
40 | 37 |
/** |
41 | 38 |
* Saves a list of claims in DB |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/handler/DMFContextHandler.java | ||
---|---|---|
2 | 2 |
// |
3 | 3 |
//import eu.dnetlib.data.claims.entity.Context; |
4 | 4 |
//import eu.dnetlib.data.claims.utils.ContextUtils; |
5 |
//import org.apache.log4j.Logger; |
|
5 |
//import org.apache.logging.log4j.Logger;
|
|
6 | 6 |
// |
7 | 7 |
///** |
8 | 8 |
// * Created by kiatrop on 5/2/2016. |
9 | 9 |
// */ |
10 | 10 |
//public class DMFContextHandler { |
11 |
// private static Logger log = Logger.getLogger(DMFContextHandler.class ); |
|
11 |
// private static Logger log = LogManager.getLogger(DMFContextHandler.class );
|
|
12 | 12 |
// |
13 | 13 |
//// SqlDAO sqlDAO = null; |
14 | 14 |
//// QueryGenerator queryGenerator = null; |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/handler/DirectIndexHandler.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.claims.handler; |
2 | 2 |
|
3 |
import org.apache.log4j.Logger; |
|
3 |
import org.apache.logging.log4j.LogManager; |
|
4 |
import org.apache.logging.log4j.Logger; |
|
4 | 5 |
import sun.net.www.protocol.http.HttpURLConnection; |
5 | 6 |
|
6 | 7 |
import java.io.*; |
... | ... | |
14 | 15 |
public class DirectIndexHandler { |
15 | 16 |
|
16 | 17 |
private String directClaimAPIUrl; |
17 |
private static final Logger logger = Logger.getLogger(DirectIndexHandler.class); |
|
18 |
private static final Logger logger = LogManager.getLogger(DirectIndexHandler.class);
|
|
18 | 19 |
|
19 | 20 |
|
20 | 21 |
public boolean insertRecord(String record){ |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/handler/ExternalRecordHandler.java | ||
---|---|---|
3 | 3 |
import eu.dnetlib.data.claims.entity.Result; |
4 | 4 |
import eu.dnetlib.data.claims.parser.ExternalRecordParser; |
5 | 5 |
import eu.dnetlib.data.claims.utils.SearchUtils; |
6 |
import org.springframework.beans.factory.annotation.Autowired; |
|
7 | 6 |
|
8 | 7 |
/** |
9 | 8 |
* Created by kiatrop on 8/2/2016. |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/handler/FetchClaimHandler.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.claims.handler; |
2 | 2 |
|
3 |
import eu.dnetlib.data.claims.utils.JsonldBuilder; |
|
4 | 3 |
import eu.dnetlib.data.claims.entity.*; |
4 |
import eu.dnetlib.data.claims.sql.SQLStoreException; |
|
5 |
import eu.dnetlib.data.claims.sql.SqlDAO; |
|
5 | 6 |
import eu.dnetlib.data.claims.utils.ClaimUtils; |
7 |
import eu.dnetlib.data.claims.utils.JsonldBuilder; |
|
6 | 8 |
import eu.dnetlib.data.claims.utils.QueryGenerator; |
7 |
import eu.dnetlib.data.claims.sql.SQLStoreException; |
|
8 |
import eu.dnetlib.data.claims.sql.SqlDAO; |
|
9 |
import org.apache.log4j.Logger; |
|
9 |
import org.apache.logging.log4j.LogManager; |
|
10 |
import org.apache.logging.log4j.Logger; |
|
10 | 11 |
|
11 | 12 |
import java.sql.ResultSet; |
12 | 13 |
import java.sql.SQLException; |
... | ... | |
20 | 21 |
* Created by argirok on 9/3/2016. |
21 | 22 |
*/ |
22 | 23 |
public class FetchClaimHandler { |
23 |
private Logger log = Logger.getLogger(this.getClass()); |
|
24 |
private Logger log = LogManager.getLogger(this.getClass());
|
|
24 | 25 |
|
25 | 26 |
SqlDAO sqlDAO = null; |
26 | 27 |
QueryGenerator queryGenerator = null; |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/handler/FetchContextHandler.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.claims.handler; |
2 | 2 |
|
3 | 3 |
import eu.dnetlib.data.claims.entity.Context; |
4 |
import eu.dnetlib.data.claims.utils.QueryGenerator; |
|
5 | 4 |
import eu.dnetlib.data.claims.sql.SQLStoreException; |
6 | 5 |
import eu.dnetlib.data.claims.sql.SqlDAO; |
7 |
import org.apache.log4j.Logger; |
|
6 |
import eu.dnetlib.data.claims.utils.QueryGenerator; |
|
7 |
import org.apache.logging.log4j.LogManager; |
|
8 |
import org.apache.logging.log4j.Logger; |
|
8 | 9 |
|
9 | 10 |
import java.sql.ResultSet; |
10 | 11 |
import java.util.ArrayList; |
11 | 12 |
|
12 | 13 |
public class FetchContextHandler { |
13 | 14 |
|
14 |
private Logger log = Logger.getLogger(this.getClass()); |
|
15 |
private Logger log = LogManager.getLogger(this.getClass());
|
|
15 | 16 |
|
16 | 17 |
SqlDAO sqlDAO = null; |
17 | 18 |
QueryGenerator queryGenerator = null; |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/emailSender/EmailScheduler.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.emailSender; |
2 | 2 |
|
3 |
import org.apache.log4j.Logger; |
|
3 |
import org.apache.logging.log4j.LogManager; |
|
4 |
import org.apache.logging.log4j.Logger; |
|
4 | 5 |
import org.springframework.beans.factory.annotation.Autowired; |
5 | 6 |
import org.springframework.web.context.support.WebApplicationContextUtils; |
6 | 7 |
|
... | ... | |
21 | 22 |
public class EmailScheduler implements ServletContextListener { |
22 | 23 |
|
23 | 24 |
private int delay = 0; |
24 |
private final Logger logger = Logger.getLogger(EmailScheduler.class); |
|
25 |
private final Logger logger = LogManager.getLogger(EmailScheduler.class);
|
|
25 | 26 |
|
26 | 27 |
private static boolean sendEmailNotifications; |
27 | 28 |
|
modules/uoa-claims/trunk/src/test/java/eu/dnetlib/data/claims/CopyFromBetaTest.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.claims; |
2 | 2 |
|
3 | 3 |
import eu.dnetlib.data.claims.entity.Claim; |
4 |
import eu.dnetlib.data.claims.entity.Result;
|
|
5 |
import eu.dnetlib.data.claims.handler.*;
|
|
4 |
import eu.dnetlib.data.claims.handler.ClaimHandler;
|
|
5 |
import eu.dnetlib.data.claims.handler.FetchClaimHandler;
|
|
6 | 6 |
import eu.dnetlib.data.claims.sql.SQLStoreException; |
7 |
import eu.dnetlib.data.claims.utils.*; |
|
8 |
import org.apache.log4j.BasicConfigurator; |
|
9 |
import org.apache.log4j.Level; |
|
10 |
import org.apache.log4j.Logger; |
|
7 |
import org.apache.logging.log4j.Level; |
|
8 |
import org.apache.logging.log4j.LogManager; |
|
9 |
import org.apache.logging.log4j.Logger; |
|
10 |
import org.apache.logging.log4j.core.config.Configurator; |
|
11 |
import org.apache.logging.log4j.core.config.DefaultConfiguration; |
|
11 | 12 |
import org.junit.Before; |
12 | 13 |
import org.junit.Test; |
13 | 14 |
import org.junit.runner.RunWith; |
... | ... | |
17 | 18 |
import org.springframework.test.context.ContextConfiguration; |
18 | 19 |
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; |
19 | 20 |
|
20 |
import java.io.BufferedWriter; |
|
21 |
import java.io.FileWriter; |
|
22 | 21 |
import java.io.PrintWriter; |
23 | 22 |
import java.util.ArrayList; |
24 | 23 |
import java.util.List; |
25 | 24 |
|
26 |
import static junit.framework.Assert.assertNotNull; |
|
27 |
|
|
28 | 25 |
@RunWith(SpringJUnit4ClassRunner.class) |
29 | 26 |
@ContextConfiguration(locations = {"springContext-claims.xml"}) |
30 | 27 |
@PropertySource("springContext-claims.properties") |
31 | 28 |
public class CopyFromBetaTest { |
32 |
private Logger log = Logger.getLogger(this.getClass()); |
|
29 |
private Logger log = LogManager.getLogger(this.getClass());
|
|
33 | 30 |
ClaimHandler claimHandler = null; |
34 | 31 |
FetchClaimHandler fetchClaimHandler = null; |
35 | 32 |
private PrintWriter out; |
... | ... | |
37 | 34 |
|
38 | 35 |
@Before |
39 | 36 |
public void init() throws Exception { |
40 |
BasicConfigurator.configure(); |
|
37 |
Configurator.initialize(new DefaultConfiguration()); |
|
38 |
Configurator.setRootLevel(Level.INFO); |
|
41 | 39 |
ApplicationContext context = new ClassPathXmlApplicationContext("eu/dnetlib/data/claims/springContext-claims.xml"); |
42 | 40 |
claimHandler = context.getBean(ClaimHandler.class); |
43 | 41 |
fetchClaimHandler = context.getBean(FetchClaimHandler.class); |
... | ... | |
45 | 43 |
} |
46 | 44 |
@Test |
47 | 45 |
public void CopyFromBetaToProduction(){ |
48 |
log.setLevel(Level.ERROR); |
|
49 | 46 |
try { |
50 | 47 |
ArrayList<String> communities = new ArrayList<>(); |
51 | 48 |
// 5 connect communities: 793 - done |
modules/uoa-claims/trunk/src/test/java/eu/dnetlib/data/claims/parser/ContextUtilsTest.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.claims.parser; |
2 | 2 |
|
3 | 3 |
import eu.dnetlib.data.claims.utils.ContextUtils; |
4 |
import org.apache.log4j.BasicConfigurator; |
|
4 |
import org.apache.logging.log4j.Level; |
|
5 |
import org.apache.logging.log4j.core.config.Configurator; |
|
6 |
import org.apache.logging.log4j.core.config.DefaultConfiguration; |
|
5 | 7 |
import org.junit.Assert; |
6 | 8 |
import org.junit.Before; |
7 | 9 |
import org.junit.Test; |
8 |
import org.springframework.beans.factory.annotation.Autowired; |
|
9 | 10 |
import org.springframework.context.ApplicationContext; |
10 | 11 |
import org.springframework.context.support.ClassPathXmlApplicationContext; |
11 | 12 |
|
... | ... | |
17 | 18 |
|
18 | 19 |
@Before |
19 | 20 |
public void init() throws Exception { |
20 |
BasicConfigurator.configure(); |
|
21 |
Configurator.initialize(new DefaultConfiguration()); |
|
22 |
Configurator.setRootLevel(Level.INFO); |
|
21 | 23 |
ApplicationContext context = new ClassPathXmlApplicationContext("eu/dnetlib/data/claims/springContext-claims.xml"); |
22 | 24 |
|
23 | 25 |
contextUtils = context.getBean(ContextUtils.class); |
modules/uoa-claims/trunk/src/test/java/eu/dnetlib/data/claims/parser/OafParserTest.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.claims.parser; |
2 | 2 |
|
3 |
import eu.dnetlib.data.claims.entity.Project; |
|
3 | 4 |
import eu.dnetlib.data.claims.entity.Result; |
4 | 5 |
import eu.dnetlib.data.claims.utils.ClaimUtils; |
5 |
import eu.dnetlib.data.claims.entity.Project; |
|
6 |
import org.apache.log4j.BasicConfigurator; |
|
6 |
import org.apache.logging.log4j.Level; |
|
7 |
import org.apache.logging.log4j.core.config.Configurator; |
|
8 |
import org.apache.logging.log4j.core.config.DefaultConfiguration; |
|
7 | 9 |
import org.junit.Assert; |
8 | 10 |
import org.junit.Before; |
9 | 11 |
import org.junit.Test; |
... | ... | |
21 | 23 |
|
22 | 24 |
@Before() |
23 | 25 |
public void init(){ |
24 |
BasicConfigurator.configure(); |
|
26 |
Configurator.initialize(new DefaultConfiguration()); |
|
27 |
Configurator.setRootLevel(Level.INFO); |
|
25 | 28 |
} |
26 | 29 |
|
27 | 30 |
private String publicationOaf = "<response>\n" + |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/handler/FetchNotificationHandler.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.claims.handler; |
2 | 2 |
|
3 | 3 |
import eu.dnetlib.data.claims.entity.Notification; |
4 |
import eu.dnetlib.data.claims.utils.QueryGenerator; |
|
5 | 4 |
import eu.dnetlib.data.claims.sql.SQLStoreException; |
6 | 5 |
import eu.dnetlib.data.claims.sql.SqlDAO; |
7 |
import org.apache.log4j.Logger; |
|
6 |
import eu.dnetlib.data.claims.utils.QueryGenerator; |
|
7 |
import org.apache.logging.log4j.LogManager; |
|
8 |
import org.apache.logging.log4j.Logger; |
|
8 | 9 |
|
9 | 10 |
import java.sql.ResultSet; |
10 | 11 |
import java.util.ArrayList; |
11 | 12 |
import java.util.List; |
12 | 13 |
|
13 | 14 |
public class FetchNotificationHandler { |
14 |
private Logger log = Logger.getLogger(this.getClass()); |
|
15 |
private Logger log = LogManager.getLogger(this.getClass());
|
|
15 | 16 |
|
16 | 17 |
SqlDAO sqlDAO = null; |
17 | 18 |
QueryGenerator queryGenerator = null; |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/handler/FetchProjectHandler.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.claims.handler; |
2 | 2 |
|
3 | 3 |
import eu.dnetlib.data.claims.entity.Project; |
4 |
import eu.dnetlib.data.claims.utils.QueryGenerator; |
|
5 | 4 |
import eu.dnetlib.data.claims.sql.SQLStoreException; |
6 | 5 |
import eu.dnetlib.data.claims.sql.SqlDAO; |
7 |
import org.apache.log4j.Logger; |
|
6 |
import eu.dnetlib.data.claims.utils.QueryGenerator; |
|
7 |
import org.apache.logging.log4j.LogManager; |
|
8 |
import org.apache.logging.log4j.Logger; |
|
8 | 9 |
|
9 | 10 |
import java.sql.ResultSet; |
10 |
import java.util.*; |
|
11 |
import java.util.ArrayList; |
|
12 |
import java.util.HashMap; |
|
13 |
import java.util.List; |
|
14 |
import java.util.Map; |
|
11 | 15 |
|
12 | 16 |
/** |
13 | 17 |
* Created by konstantina on 10/4/2017. |
14 | 18 |
*/ |
15 | 19 |
public class FetchProjectHandler { |
16 |
private Logger log = Logger.getLogger(this.getClass()); |
|
20 |
private Logger log = LogManager.getLogger(this.getClass());
|
|
17 | 21 |
|
18 | 22 |
SqlDAO sqlDAO = null; |
19 | 23 |
QueryGenerator queryGenerator = null; |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/handler/IndexResultHandler.java | ||
---|---|---|
3 | 3 |
import eu.dnetlib.data.claims.entity.Result; |
4 | 4 |
import eu.dnetlib.data.claims.parser.OafParser; |
5 | 5 |
import eu.dnetlib.data.claims.utils.SearchUtils; |
6 |
import org.apache.log4j.Logger; |
|
6 |
import org.apache.logging.log4j.LogManager; |
|
7 |
import org.apache.logging.log4j.Logger; |
|
7 | 8 |
|
8 | 9 |
/** |
9 | 10 |
* Created by kiatrop on 8/2/2016. |
... | ... | |
11 | 12 |
public class IndexResultHandler { |
12 | 13 |
|
13 | 14 |
SearchUtils searchUtils; |
14 |
private Logger log = Logger.getLogger(this.getClass()); |
|
15 |
private Logger log = LogManager.getLogger(this.getClass());
|
|
15 | 16 |
|
16 | 17 |
private String fetchPublicationResult(String id) throws Exception { |
17 | 18 |
return searchUtils.fetchPublicationXmlFromIndex(id); |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/handler/MetricsHandler.java | ||
---|---|---|
5 | 5 |
import eu.dnetlib.data.claims.sql.SQLStoreException; |
6 | 6 |
import eu.dnetlib.data.claims.sql.SqlDAO; |
7 | 7 |
import eu.dnetlib.data.claims.utils.QueryGenerator; |
8 |
import org.apache.log4j.Logger; |
|
8 |
import org.apache.logging.log4j.LogManager; |
|
9 |
import org.apache.logging.log4j.Logger; |
|
9 | 10 |
import org.postgresql.util.PGobject; |
10 | 11 |
import org.springframework.scheduling.annotation.EnableScheduling; |
11 | 12 |
import org.springframework.scheduling.annotation.Scheduled; |
... | ... | |
13 | 14 |
|
14 | 15 |
import java.sql.ResultSet; |
15 | 16 |
import java.sql.SQLException; |
16 |
import java.util.*; |
|
17 |
import java.util.ArrayList; |
|
18 |
import java.util.Date; |
|
19 |
import java.util.List; |
|
17 | 20 |
|
18 | 21 |
@EnableScheduling |
19 | 22 |
@Service |
... | ... | |
21 | 24 |
SqlDAO sqlDAO = null; |
22 | 25 |
QueryGenerator queryGenerator = null; |
23 | 26 |
|
24 |
private static final Logger logger = Logger.getLogger(MetricsHandler.class); |
|
27 |
private static final Logger logger = LogManager.getLogger(MetricsHandler.class);
|
|
25 | 28 |
|
26 | 29 |
public int countEUProjects() throws SQLStoreException, SQLException { |
27 | 30 |
logger.info("Counting EU projects..."); |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/handler/NotificationHandler.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.claims.handler; |
2 | 2 |
|
3 | 3 |
import eu.dnetlib.data.claims.entity.Notification; |
4 |
import eu.dnetlib.data.claims.utils.QueryGenerator; |
|
5 | 4 |
import eu.dnetlib.data.claims.sql.SQLStoreException; |
6 | 5 |
import eu.dnetlib.data.claims.sql.SqlDAO; |
7 |
import org.apache.log4j.Logger; |
|
6 |
import eu.dnetlib.data.claims.utils.QueryGenerator; |
|
7 |
import org.apache.logging.log4j.LogManager; |
|
8 |
import org.apache.logging.log4j.Logger; |
|
8 | 9 |
import org.springframework.beans.factory.annotation.Autowired; |
9 | 10 |
|
10 | 11 |
import java.sql.ResultSet; |
... | ... | |
17 | 18 |
SqlDAO sqlDAO = null; |
18 | 19 |
QueryGenerator queryGenerator = null; |
19 | 20 |
|
20 |
private static final Logger logger = Logger.getLogger(NotificationHandler.class); |
|
21 |
private static final Logger logger = LogManager.getLogger(NotificationHandler.class);
|
|
21 | 22 |
|
22 | 23 |
@Autowired |
23 | 24 |
private String targetHour; |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/handler/ProjectHandler.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import eu.dnetlib.data.claims.entity.Project; |
4 | 4 |
import eu.dnetlib.data.claims.parser.OafParser; |
5 |
import eu.dnetlib.data.claims.sql.SQLStoreException; |
|
6 |
import eu.dnetlib.data.claims.sql.SqlDAO; |
|
5 | 7 |
import eu.dnetlib.data.claims.utils.QueryGenerator; |
6 |
import eu.dnetlib.data.claims.sql.SQLStoreException; |
|
7 | 8 |
import eu.dnetlib.data.claims.utils.SearchUtils; |
8 |
import eu.dnetlib.data.claims.sql.SqlDAO;
|
|
9 |
import org.apache.log4j.Logger; |
|
9 |
import org.apache.logging.log4j.LogManager;
|
|
10 |
import org.apache.logging.log4j.Logger;
|
|
10 | 11 |
|
11 | 12 |
import java.util.ArrayList; |
12 | 13 |
import java.util.List; |
... | ... | |
20 | 21 |
SqlDAO sqlDAO = null; |
21 | 22 |
QueryGenerator queryGenerator = null; |
22 | 23 |
|
23 |
private static Logger logger = Logger.getLogger(ProjectHandler.class); |
|
24 |
private static Logger logger = LogManager.getLogger(ProjectHandler.class);
|
|
24 | 25 |
|
25 | 26 |
private String fetchProjectById(String id) throws Exception { |
26 | 27 |
return searchUtils.fetchProjectXmlFromIndex(id); |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/handler/ResultHandler.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.claims.handler; |
2 | 2 |
|
3 | 3 |
import eu.dnetlib.data.claims.entity.Result; |
4 |
import eu.dnetlib.data.claims.sql.SQLStoreException; |
|
5 |
import eu.dnetlib.data.claims.sql.SqlDAO; |
|
4 | 6 |
import eu.dnetlib.data.claims.utils.ClaimUtils; |
5 | 7 |
import eu.dnetlib.data.claims.utils.QueryGenerator; |
6 |
import eu.dnetlib.data.claims.sql.SQLStoreException; |
|
7 |
import eu.dnetlib.data.claims.sql.SqlDAO; |
|
8 | 8 |
import org.apache.commons.io.FileUtils; |
9 |
import org.apache.log4j.Logger; |
|
9 |
import org.apache.logging.log4j.LogManager; |
|
10 |
import org.apache.logging.log4j.Logger; |
|
10 | 11 |
|
11 | 12 |
import java.io.File; |
12 | 13 |
import java.io.IOException; |
... | ... | |
17 | 18 |
* Created by kiatrop on 5/2/2016. |
18 | 19 |
*/ |
19 | 20 |
public class ResultHandler { |
20 |
private Logger log = Logger.getLogger(this.getClass()); |
|
21 |
private Logger log = LogManager.getLogger(this.getClass());
|
|
21 | 22 |
SqlDAO sqlDAO = null; |
22 | 23 |
QueryGenerator queryGenerator = null; |
23 | 24 |
String pathToSaveRecord = null; |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/parser/ExternalRecordParser.java | ||
---|---|---|
3 | 3 |
import com.google.gson.Gson; |
4 | 4 |
import eu.dnetlib.data.claims.entity.Result; |
5 | 5 |
import eu.dnetlib.data.claims.utils.ClaimUtils; |
6 |
import org.apache.log4j.Logger; |
|
6 |
import org.apache.logging.log4j.LogManager; |
|
7 |
import org.apache.logging.log4j.Logger; |
|
7 | 8 |
import org.w3c.dom.Document; |
8 | 9 |
import org.w3c.dom.NodeList; |
9 | 10 |
import org.xml.sax.InputSource; |
... | ... | |
42 | 43 |
* @param json |
43 | 44 |
* @return Result or null |
44 | 45 |
*/ |
45 |
private static final Logger logger = Logger.getLogger(ExternalRecordParser.class); |
|
46 |
private static final Logger logger = LogManager.getLogger(ExternalRecordParser.class);
|
|
46 | 47 |
|
47 | 48 |
public static Result crossref2Result(String json) { |
48 | 49 |
Result result = null; |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/parser/OafParser.java | ||
---|---|---|
3 | 3 |
import eu.dnetlib.data.claims.entity.Project; |
4 | 4 |
import eu.dnetlib.data.claims.entity.Result; |
5 | 5 |
import eu.dnetlib.data.claims.utils.ClaimUtils; |
6 |
import org.apache.log4j.Logger; |
|
6 |
import org.apache.logging.log4j.LogManager; |
|
7 |
import org.apache.logging.log4j.Logger; |
|
7 | 8 |
import org.w3c.dom.Document; |
8 | 9 |
import org.w3c.dom.Element; |
9 | 10 |
import org.w3c.dom.NodeList; |
... | ... | |
43 | 44 |
* @throws TransformerException |
44 | 45 |
*/ |
45 | 46 |
|
46 |
private static final Logger logger = Logger.getLogger(OafParser.class); |
|
47 |
private static final Logger logger = LogManager.getLogger(OafParser.class);
|
|
47 | 48 |
|
48 | 49 |
public static Result oaf2Result(String oaf) throws ParserConfigurationException, IOException, SAXException, XPathExpressionException, TransformerException { |
49 | 50 |
Result result = null; |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/sql/SqlDAO.java | ||
---|---|---|
5 | 5 |
*/ |
6 | 6 |
|
7 | 7 |
|
8 |
import org.apache.log4j.Logger; |
|
8 |
import org.apache.logging.log4j.LogManager; |
|
9 |
import org.apache.logging.log4j.Logger; |
|
9 | 10 |
|
10 | 11 |
import java.sql.ResultSet; |
11 | 12 |
import java.sql.SQLException; |
... | ... | |
19 | 20 |
private SqlStore sqlStore; |
20 | 21 |
//private QueryGenerator queryGenerator; |
21 | 22 |
|
22 |
private Logger log = Logger.getLogger(this.getClass()); |
|
23 |
private Logger log = LogManager.getLogger(this.getClass());
|
|
23 | 24 |
private long startTime; |
24 | 25 |
private long endtime; |
25 | 26 |
|
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/sql/SqlStore.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.claims.sql; |
2 | 2 |
|
3 | 3 |
import com.sun.rowset.CachedRowSetImpl; |
4 |
import org.apache.log4j.Logger; |
|
4 |
import org.apache.logging.log4j.LogManager; |
|
5 |
import org.apache.logging.log4j.Logger; |
|
5 | 6 |
|
6 | 7 |
import javax.sql.rowset.CachedRowSet; |
7 | 8 |
import java.sql.*; |
... | ... | |
14 | 15 |
|
15 | 16 |
public class SqlStore { |
16 | 17 |
|
17 |
private Logger log = Logger.getLogger(this.getClass()); |
|
18 |
private Logger log = LogManager.getLogger(this.getClass());
|
|
18 | 19 |
|
19 | 20 |
private String dbUrl; |
20 | 21 |
private String dbUser; |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/utils/ClaimValidation.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.claims.utils; |
2 | 2 |
|
3 | 3 |
import eu.dnetlib.data.claims.entity.*; |
4 |
import org.apache.log4j.Logger; |
|
4 |
import org.apache.logging.log4j.LogManager; |
|
5 |
import org.apache.logging.log4j.Logger; |
|
5 | 6 |
|
6 | 7 |
import java.io.BufferedWriter; |
7 | 8 |
import java.io.FileWriter; |
... | ... | |
14 | 15 |
private PrintWriter out; |
15 | 16 |
String pathToSaveReport = null; |
16 | 17 |
|
17 |
private static Logger logger = Logger.getLogger(ClaimValidation.class); |
|
18 |
private static Logger logger = LogManager.getLogger(ClaimValidation.class);
|
|
18 | 19 |
|
19 | 20 |
/* |
20 | 21 |
Claim: |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/utils/CommunityUtils.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.claims.utils; |
2 | 2 |
|
3 | 3 |
import com.google.gson.Gson; |
4 |
import org.apache.log4j.Logger; |
|
4 |
import org.apache.logging.log4j.LogManager; |
|
5 |
import org.apache.logging.log4j.Logger; |
|
5 | 6 |
|
6 | 7 |
import java.io.BufferedReader; |
7 | 8 |
import java.io.InputStreamReader; |
... | ... | |
15 | 16 |
private static String communityAPI; |
16 | 17 |
String name; |
17 | 18 |
List<String> managers = new ArrayList<String>(); |
18 |
private final static Logger log = Logger.getLogger(CommunityUtils.class); |
|
19 |
private final static Logger log = LogManager.getLogger(CommunityUtils.class);
|
|
19 | 20 |
|
20 | 21 |
public String getCommunityAPI() { return communityAPI; } |
21 | 22 |
public void setCommunityAPI(String communityAPI) { CommunityUtils.communityAPI = communityAPI; } |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/utils/ContextUtils.java | ||
---|---|---|
3 | 3 |
import com.google.gson.Gson; |
4 | 4 |
import eu.dnetlib.data.claims.entity.Context; |
5 | 5 |
import eu.dnetlib.data.claims.handler.ClaimHandler; |
6 |
import org.apache.log4j.Logger;
|
|
7 |
import org.springframework.beans.factory.annotation.Autowired;
|
|
6 |
import org.apache.logging.log4j.LogManager;
|
|
7 |
import org.apache.logging.log4j.Logger;
|
|
8 | 8 |
|
9 | 9 |
import java.util.List; |
10 | 10 |
|
... | ... | |
12 | 12 |
* Created by kiatrop on 27/1/2016. |
13 | 13 |
*/ |
14 | 14 |
public class ContextUtils { |
15 |
private static final Logger logger = Logger.getLogger(ClaimHandler.class); |
|
15 |
private static final Logger logger = LogManager.getLogger(ClaimHandler.class);
|
|
16 | 16 |
private SearchUtils searchUtils; |
17 | 17 |
|
18 | 18 |
public Context fetchContextById(String openaireId) { |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/utils/IndexUtils.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import eu.dnetlib.data.claims.entity.Project; |
4 | 4 |
import eu.dnetlib.data.claims.entity.Result; |
5 |
import org.apache.log4j.Logger; |
|
5 |
import org.apache.logging.log4j.LogManager; |
|
6 |
import org.apache.logging.log4j.Logger; |
|
6 | 7 |
import org.json.simple.JSONArray; |
7 | 8 |
import org.json.simple.JSONObject; |
8 | 9 |
import sun.net.www.protocol.http.HttpURLConnection; |
... | ... | |
17 | 18 |
*/ |
18 | 19 |
public class IndexUtils { |
19 | 20 |
|
20 |
private static final Logger logger = Logger.getLogger(IndexUtils.class); |
|
21 |
private static final Logger logger = LogManager.getLogger(IndexUtils.class);
|
|
21 | 22 |
|
22 | 23 |
public static JSONObject createJSON(Result result, List<Project> projects, List<String> concepts) throws Exception { |
23 | 24 |
//id ?????? result.getOpenaireId(); |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/utils/ManagerUtils.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.claims.utils; |
2 | 2 |
|
3 | 3 |
import com.google.gson.Gson; |
4 |
import org.apache.log4j.Logger; |
|
4 |
import org.apache.logging.log4j.LogManager; |
|
5 |
import org.apache.logging.log4j.Logger; |
|
5 | 6 |
|
6 | 7 |
import java.io.BufferedReader; |
7 | 8 |
import java.io.InputStreamReader; |
... | ... | |
18 | 19 |
private String name; |
19 | 20 |
private String memberSince; |
20 | 21 |
|
21 |
private final static Logger log = Logger.getLogger(ManagerUtils.class); |
|
22 |
private final static Logger log = LogManager.getLogger(ManagerUtils.class);
|
|
22 | 23 |
|
23 | 24 |
public String getRegistryAPIForManagerEmails() { return registryAPIForManagerEmails; } |
24 | 25 |
public void setRegistryAPIForManagerEmails(String registryAPIForManagerEmails) { ManagerUtils.registryAPIForManagerEmails = registryAPIForManagerEmails; } |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/utils/QueryGenerator.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import com.google.gson.Gson; |
4 | 4 |
import eu.dnetlib.data.claims.entity.*; |
5 |
import org.apache.logging.log4j.LogManager; |
|
6 |
import org.apache.logging.log4j.Logger; |
|
7 |
import org.postgresql.util.PGobject; |
|
5 | 8 |
|
6 | 9 |
import java.sql.SQLException; |
7 | 10 |
import java.text.SimpleDateFormat; |
8 | 11 |
import java.util.ArrayList; |
9 | 12 |
import java.util.Date; |
10 | 13 |
import java.util.List; |
11 |
import org.apache.log4j.Logger; |
|
12 |
import org.postgresql.util.PGobject; |
|
13 | 14 |
|
14 | 15 |
|
15 | 16 |
public class QueryGenerator { |
16 | 17 |
boolean updateOnInsert; |
17 | 18 |
String migrationTable ="claims"; //a table or a view containing old schema claims - But only user claims, not those where agent='inference' |
18 |
private static final Logger logger = Logger.getLogger(QueryGenerator.class); |
|
19 |
private static final Logger logger = LogManager.getLogger(QueryGenerator.class);
|
|
19 | 20 |
|
20 | 21 |
public boolean isUpdateOnInsert() { |
21 | 22 |
return updateOnInsert; |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/claims/utils/SearchUtils.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.claims.utils; |
2 | 2 |
|
3 |
import org.apache.log4j.Logger; |
|
3 |
import org.apache.logging.log4j.LogManager; |
|
4 |
import org.apache.logging.log4j.Logger; |
|
4 | 5 |
import org.w3c.dom.Document; |
5 | 6 |
import org.w3c.dom.NodeList; |
6 | 7 |
import org.xml.sax.InputSource; |
... | ... | |
13 | 14 |
import java.io.*; |
14 | 15 |
import java.net.HttpURLConnection; |
15 | 16 |
import java.net.URL; |
16 |
import java.net.URLEncoder; |
|
17 | 17 |
import java.sql.Timestamp; |
18 | 18 |
import java.util.Date; |
19 | 19 |
|
... | ... | |
26 | 26 |
* |
27 | 27 |
*/ |
28 | 28 |
public class SearchUtils { |
29 |
private static final Logger logger = Logger.getLogger(SearchUtils.class); |
|
29 |
private static final Logger logger = LogManager.getLogger(SearchUtils.class);
|
|
30 | 30 |
public static String searchAPIUrl=null;//"http://beta.services.openaire.eu:8480/search/"; |
31 | 31 |
|
32 | 32 |
private static String crossrefUrl=null; |
modules/uoa-claims/trunk/src/main/java/eu/dnetlib/data/emailSender/EmailSender.java | ||
---|---|---|
5 | 5 |
import eu.dnetlib.data.claims.entity.Notification; |
6 | 6 |
import eu.dnetlib.data.claims.entity.Project; |
7 | 7 |
import eu.dnetlib.data.claims.handler.*; |
8 |
import eu.dnetlib.data.claims.sql.SQLStoreException; |
|
8 | 9 |
import eu.dnetlib.data.claims.utils.ClaimUtils; |
9 |
//import eu.dnetlib.data.claims.utils.CommunityUtils; |
|
10 |
import eu.dnetlib.data.claims.sql.SQLStoreException; |
|
11 | 10 |
import eu.dnetlib.data.claims.utils.ManagerUtils; |
12 |
import org.apache.log4j.Logger; |
|
11 |
import org.apache.logging.log4j.LogManager; |
|
12 |
import org.apache.logging.log4j.Logger; |
|
13 | 13 |
import org.springframework.beans.factory.annotation.Autowired; |
14 | 14 |
|
15 | 15 |
import javax.mail.*; |
... | ... | |
21 | 21 |
|
22 | 22 |
public class EmailSender implements Runnable { |
23 | 23 |
|
24 |
private static final Logger logger = Logger.getLogger(EmailSender.class); |
|
24 |
private static final Logger logger = LogManager.getLogger(EmailSender.class);
|
|
25 | 25 |
|
26 | 26 |
@Autowired |
27 | 27 |
private FetchClaimHandler fetchClaimHandler = null; |
modules/uoa-claims/trunk/src/test/java/eu/dnetlib/data/claims/TestClass.java | ||
---|---|---|
16 | 16 |
import eu.dnetlib.data.claims.sql.SqlStore; |
17 | 17 |
import eu.dnetlib.data.claims.utils.*; |
18 | 18 |
import eu.dnetlib.data.emailSender.EmailSender; |
19 |
import org.apache.log4j.BasicConfigurator; |
|
20 |
import org.apache.log4j.Logger; |
|
19 |
import org.apache.logging.log4j.Level; |
|
20 |
import org.apache.logging.log4j.LogManager; |
|
21 |
import org.apache.logging.log4j.Logger; |
|
22 |
import org.apache.logging.log4j.core.config.Configurator; |
|
23 |
import org.apache.logging.log4j.core.config.DefaultConfiguration; |
|
21 | 24 |
import org.junit.Before; |
22 | 25 |
import org.junit.Test; |
23 | 26 |
import org.junit.runner.RunWith; |
... | ... | |
41 | 44 |
@ContextConfiguration(locations = {"springContext-claims.xml"}) |
42 | 45 |
@PropertySource("springContext-claims.properties") |
43 | 46 |
public class TestClass { |
44 |
private Logger log = Logger.getLogger(this.getClass()); |
|
47 |
private Logger log = LogManager.getLogger(this.getClass());
|
|
45 | 48 |
|
46 | 49 |
|
47 | 50 |
private SqlDAO sqlDAO; |
... | ... | |
66 | 69 |
|
67 | 70 |
@Before |
68 | 71 |
public void init() throws Exception { |
69 |
BasicConfigurator.configure(); |
|
72 |
Configurator.initialize(new DefaultConfiguration()); |
|
73 |
Configurator.setRootLevel(Level.INFO); |
|
70 | 74 |
ApplicationContext context = new ClassPathXmlApplicationContext("eu/dnetlib/data/claims/springContext-claims.xml"); |
71 | 75 |
|
72 | 76 |
directIndexHandler = context.getBean(DirectIndexHandler.class); |
... | ... | |
139 | 143 |
|
140 | 144 |
|
141 | 145 |
// claims = fetchClaimHandler.fetchClaimsByUser("argirok_1@hotmail.com",1,0,types, false); |
142 |
claims = fetchClaimHandler.fetchClaimsByContext("egi",100,0,null,"claim.claim_date",false,types,false); |
|
146 |
// claims = fetchClaimHandler.fetchClaimsByContext("egi",100,0,null,"claim.claim_date",false,types,false); |
|
147 |
// claims = fetchClaimHandler.fetchClaimsByContext("egi",100,0,null,"claim.claim_date",false,types,false); |
|
143 | 148 |
// (String openaireId, Integer limit, Integer offset, String keyword, String orderField, boolean descending, List<String> types, boolean addCurationInfo) throws Exception, SQLStoreException { |
144 | 149 |
// claims = fetchClaimHandler.fetchClaimsByUser("argirok@di.uoa.gr",3,0,null,"claim.claim_date",false,types,false); |
145 | 150 |
// |
modules/uoa-claims/trunk/src/test/java/eu/dnetlib/data/claims/parser/ExternalParserTest.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.claims.parser; |
2 | 2 |
|
3 | 3 |
import eu.dnetlib.data.claims.entity.Result; |
4 |
import eu.dnetlib.data.claims.handler.DirectIndexHandler; |
|
5 | 4 |
import eu.dnetlib.data.claims.utils.ClaimUtils; |
6 | 5 |
import eu.dnetlib.data.claims.utils.SearchUtils; |
7 |
import org.apache.log4j.BasicConfigurator; |
|
6 |
import org.apache.logging.log4j.Level; |
|
7 |
import org.apache.logging.log4j.core.config.Configurator; |
|
8 |
import org.apache.logging.log4j.core.config.DefaultConfiguration; |
|
8 | 9 |
import org.junit.Assert; |
9 | 10 |
import org.junit.Before; |
10 | 11 |
import org.junit.Test; |
11 |
import org.springframework.beans.factory.annotation.Autowired; |
|
12 | 12 |
import org.springframework.context.ApplicationContext; |
13 | 13 |
import org.springframework.context.support.ClassPathXmlApplicationContext; |
14 | 14 |
|
... | ... | |
21 | 21 |
|
22 | 22 |
@Before |
23 | 23 |
public void init() throws Exception { |
24 |
BasicConfigurator.configure(); |
|
24 |
Configurator.initialize(new DefaultConfiguration()); |
|
25 |
Configurator.setRootLevel(Level.INFO); |
|
25 | 26 |
ApplicationContext context = new ClassPathXmlApplicationContext("eu/dnetlib/data/claims/springContext-claims.xml"); |
26 | 27 |
|
27 | 28 |
searchUtils = context.getBean(SearchUtils.class); |
Also available in: Unified diff
log4j2 integrated + uoa-global-parent