Project

General

Profile

« Previous | Next » 

Revision 46704

Added node to set the validation report correctly in the env output parameters.

View differences:

modules/dnet-parthenos/trunk/src/main/java/eu/dnetlib/parthenos/workflows/nodes/ReportReaderJobNode.java
1
package eu.dnetlib.parthenos.workflows.nodes;
2

  
3
import java.util.Map;
4

  
5
import com.google.gson.Gson;
6
import eu.dnetlib.msro.workflows.graph.Arc;
7
import eu.dnetlib.msro.workflows.nodes.SimpleJobNode;
8
import eu.dnetlib.msro.workflows.procs.Env;
9
import eu.dnetlib.msro.workflows.util.WorkflowsConstants;
10
import org.apache.commons.logging.Log;
11
import org.apache.commons.logging.LogFactory;
12

  
13
/**
14
 * Created by Alessia Bardi on 05/04/17.
15
 *
16
 * @author Alessia Bardi
17
 */
18
public class ReportReaderJobNode extends SimpleJobNode {
19

  
20
	private static final Log log = LogFactory.getLog(ReportReaderJobNode.class);
21
	private String reportEnvParam = "validationReport";
22
	private String outputParam = reportEnvParam;
23

  
24
	@Override
25
	protected String execute(final Env env) throws Exception {
26
		Map<String, String> report = env.getAttribute(reportEnvParam, Map.class);
27
		Gson gson = new Gson();
28
		String theReport = gson.toJson(report);
29
		env.setAttribute( WorkflowsConstants.MAIN_LOG_PREFIX+outputParam, theReport);
30
		log.debug("Found the report: "+theReport);
31
		return Arc.DEFAULT_ARC;
32
	}
33

  
34
	public String getReportEnvParam() {
35
		return reportEnvParam;
36
	}
37

  
38
	public void setReportEnvParam(final String reportEnvParam) {
39
		this.reportEnvParam = reportEnvParam;
40
	}
41

  
42
	public String getOutputParam() {
43
		return outputParam;
44
	}
45

  
46
	public void setOutputParam(final String outputParam) {
47
		this.outputParam = outputParam;
48
	}
49
}
modules/dnet-parthenos/trunk/src/main/resources/eu/dnetlib/parthenos/workflows/nodes/applicationContext-parthenos-msro-nodes.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
	 xmlns:p="http://www.springframework.org/schema/p"
4
	 xmlns:http="http://cxf.apache.org/transports/http/configuration" xmlns="http://www.springframework.org/schema/beans"
5
	 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
6
						http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd">
7

  
8
	<bean id="wfNodeReportReader"
9
		class="eu.dnetlib.parthenos.workflows.nodes.ReportReaderJobNode"
10
		scope="prototype"/>
11

  
12

  
13
</beans>
modules/dnet-parthenos/trunk/src/main/resources/eu/dnetlib/bootstrap/profiles/workflows/transform_x3m_template.xml
77 77
						<PARAM name="eprParam" value="clean_epr"/>
78 78
					</PARAMETERS>
79 79
					<ARCS>
80
						<ARC to="LOG_REPORT"/>
81
					</ARCS>
82
				</NODE>
83
				<NODE name="LOG_REPORT" type="ReportReader">
84
					<DESCRIPTION>Store the validation report in the env</DESCRIPTION>
85
					<PARAMETERS>
86
					</PARAMETERS>
87
					<ARCS>
80 88
						<ARC to="UPDATE_INFO"/>
81 89
					</ARCS>
82 90
				</NODE>
modules/dnet-parthenos/trunk/pom.xml
27 27
			<version>${spring.version}</version>
28 28
			<scope>test</scope>
29 29
		</dependency>
30
		<dependency>
31
			<groupId>eu.dnetlib</groupId>
32
			<artifactId>dnet-msro-service</artifactId>
33
			<version>6.0.0-SAXONHE-SNAPSHOT</version>
34
		</dependency>
30 35
		<!--<dependency>-->
31 36
			<!--<groupId>org.gcube.common</groupId>-->
32 37
			<!--<artifactId>authorization-client</artifactId>-->
modules/dnet-parthenos/trunk/dnet-parthenos.iml
15 15
    <orderEntry type="library" name="Maven: junit:junit:4.12" level="project" />
16 16
    <orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
17 17
    <orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-core:4.2.5.RELEASE" level="project" />
18
    <orderEntry type="library" scope="TEST" name="Maven: commons-logging:commons-logging:1.2" level="project" />
18
    <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" />
19
    <orderEntry type="module" module-name="dnet-msro-service" />
20
    <orderEntry type="module" module-name="dnet-core-services" />
21
    <orderEntry type="module" module-name="dnet-core-components" />
22
    <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.2.5.RELEASE" level="project" />
23
    <orderEntry type="library" name="Maven: org.springframework:spring-expression:4.2.5.RELEASE" level="project" />
24
    <orderEntry type="library" name="Maven: org.springframework:spring-web:4.2.5.RELEASE" level="project" />
25
    <orderEntry type="library" name="Maven: org.quartz-scheduler:quartz:2.2.2" level="project" />
26
    <orderEntry type="library" name="Maven: c3p0:c3p0:0.9.1.1" level="project" />
27
    <orderEntry type="library" name="Maven: org.springframework:spring-context:4.2.5.RELEASE" level="project" />
28
    <orderEntry type="library" name="Maven: org.springframework:spring-aop:4.2.5.RELEASE" level="project" />
29
    <orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
30
    <orderEntry type="library" name="Maven: org.springframework:spring-beans:4.2.5.RELEASE" level="project" />
31
    <orderEntry type="library" name="Maven: org.springframework:spring-context-support:4.2.5.RELEASE" level="project" />
32
    <orderEntry type="library" name="Maven: net.sf.ehcache:ehcache-core:2.6.2" level="project" />
33
    <orderEntry type="library" name="Maven: org.apache.lucene:lucene-queryparser:5.5.0" level="project" />
34
    <orderEntry type="library" name="Maven: org.apache.lucene:lucene-core:5.5.0" level="project" />
35
    <orderEntry type="library" name="Maven: org.apache.lucene:lucene-queries:5.5.0" level="project" />
36
    <orderEntry type="library" name="Maven: org.apache.lucene:lucene-sandbox:5.5.0" level="project" />
37
    <orderEntry type="library" name="Maven: org.z3950.zing:cql-java:1.7" level="project" />
38
    <orderEntry type="library" name="Maven: org.antlr:stringtemplate:3.2" level="project" />
39
    <orderEntry type="library" name="Maven: org.antlr:antlr:2.7.7" level="project" />
40
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.4.1" level="project" />
41
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.1" level="project" />
42
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-core:3.1.5" level="project" />
43
    <orderEntry type="library" name="Maven: org.codehaus.woodstox:woodstox-core-asl:4.4.1" level="project" />
44
    <orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:3.1.4" level="project" />
45
    <orderEntry type="library" name="Maven: org.apache.ws.xmlschema:xmlschema-core:2.2.1" level="project" />
46
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-jaxws:3.1.5" level="project" />
47
    <orderEntry type="library" name="Maven: xml-resolver:xml-resolver:1.2" level="project" />
48
    <orderEntry type="library" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
49
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-soap:3.1.5" level="project" />
50
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-wsdl:3.1.5" level="project" />
51
    <orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.3" level="project" />
52
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-databinding-jaxb:3.1.5" level="project" />
53
    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.11" level="project" />
54
    <orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.2.11" level="project" />
55
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-bindings-xml:3.1.5" level="project" />
56
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-frontend-simple:3.1.5" level="project" />
57
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-addr:3.1.5" level="project" />
58
    <orderEntry type="library" name="Maven: org.apache.cxf:cxf-rt-ws-policy:3.1.5" level="project" />
59
    <orderEntry type="library" name="Maven: org.apache.neethi:neethi:3.0.3" level="project" />
60
    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.8" level="project" />
61
    <orderEntry type="library" name="Maven: jaxen:jaxen:1.1.6" level="project" />
62
    <orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
63
    <orderEntry type="library" name="Maven: com.ximpleware:vtd-xml:2.13" level="project" />
64
    <orderEntry type="library" name="Maven: com.mycila:xmltool:3.3" level="project" />
65
    <orderEntry type="library" name="Maven: joda-time:joda-time:2.9.9" level="project" />
66
    <orderEntry type="library" name="Maven: org.springframework:spring-test:4.2.5.RELEASE" level="project" />
67
    <orderEntry type="library" name="Maven: com.google.code.gson:gson:2.6.2" level="project" />
68
    <orderEntry type="library" name="Maven: org.mongodb:mongo-java-driver:3.4.2" level="project" />
69
    <orderEntry type="library" name="Maven: com.typesafe:config:1.3.0" level="project" />
70
    <orderEntry type="library" name="Maven: javax.mail:mail:1.4.7" level="project" />
71
    <orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
72
    <orderEntry type="library" name="Maven: org.codehaus.groovy:groovy-all:2.4.6" level="project" />
73
    <orderEntry type="library" name="Maven: gr.forth.ics.isl:x3ml-engine:1.7.5-SNAPSHOT" level="project" />
74
    <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.5" level="project" />
75
    <orderEntry type="library" name="Maven: commons-io:commons-io:2.5" level="project" />
76
    <orderEntry type="library" name="Maven: com.thoughtworks.xstream:xstream:1.4.2" level="project" />
77
    <orderEntry type="library" name="Maven: xmlpull:xmlpull:1.1.3.1" level="project" />
78
    <orderEntry type="library" name="Maven: xpp3:xpp3_min:1.1.4c" level="project" />
79
    <orderEntry type="library" name="Maven: com.damnhandy:handy-uri-templates:2.1.6" level="project" />
80
    <orderEntry type="library" name="Maven: org.apache.jena:jena-core:2.11.1" level="project" />
81
    <orderEntry type="library" name="Maven: org.apache.jena:jena-iri:1.0.1" level="project" />
82
    <orderEntry type="library" name="Maven: xerces:xercesImpl:2.11.0" level="project" />
83
    <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
84
    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.6.4" level="project" />
85
    <orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.6.4" level="project" />
86
    <orderEntry type="library" name="Maven: commons-cli:commons-cli:1.2" level="project" />
87
    <orderEntry type="library" name="Maven: net.sf.saxon:Saxon-HE:9.5.1-5" level="project" />
88
    <orderEntry type="library" name="Maven: org.jooq:joox:1.2.0" level="project" />
89
    <orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
90
    <orderEntry type="library" name="Maven: gr.forth.ics.isl:X3ML_reverse_utils:1.5" level="project" />
91
    <orderEntry type="library" name="Maven: org.jsoup:jsoup:1.7.3" level="project" />
19 92
    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
20 93
  </component>
21 94
</module>

Also available in: Unified diff