Project

General

Profile

« Previous | Next » 

Revision 44364

partial implementation of infospace wfs

View differences:

modules/dnet-isti/trunk/src/main/java/eu/dnetlib/msro/workflows/nodes/RunMDStorePluginJobNode.java
1
package eu.dnetlib.msro.workflows.nodes;
2

  
3
import java.util.HashMap;
4
import java.util.Map;
5

  
6
import org.apache.commons.lang3.StringUtils;
7
import org.apache.commons.logging.Log;
8
import org.apache.commons.logging.LogFactory;
9
import org.springframework.beans.factory.annotation.Autowired;
10

  
11
import eu.dnetlib.enabling.locators.UniqueServiceLocator;
12
import eu.dnetlib.enabling.tools.blackboard.BlackboardJob;
13
import eu.dnetlib.msro.workflows.procs.Env;
14
import eu.dnetlib.msro.workflows.procs.Token;
15
import eu.dnetlib.rmi.data.MDStoreService;
16
import eu.dnetlib.rmi.manager.MSROException;
17

  
18
public class RunMDStorePluginJobNode extends BlackboardJobNode {
19

  
20
	private static final Log log = LogFactory.getLog(RunMDStorePluginJobNode.class);
21

  
22
	@Autowired
23
	private UniqueServiceLocator serviceLocator;
24

  
25
	private String pluginName;
26

  
27
	@Deprecated
28
	private String mdId;
29

  
30
	private Map<String, String> parameters = new HashMap<>();
31

  
32
	@Override
33
	protected String obtainServiceId(final Env env) {
34
		return serviceLocator.getServiceId(MDStoreService.class);
35
	}
36

  
37
	@Override
38
	protected void prepareJob(final BlackboardJob job, final Token token) throws Exception {
39
		job.setAction("RUN_PLUGIN");
40

  
41
		if (StringUtils.isNotBlank(pluginName)) {
42
			job.getParameters().put("plugin.name", pluginName);
43
		} else {
44
			log.error("pluginName is empty");
45
			throw new MSROException("pluginName is empty");
46
		}
47

  
48
		if (StringUtils.isNotBlank(mdId)) {
49
			job.getParameters().put("mdId", mdId);
50
		}
51

  
52
		if (parameters != null) {
53
			job.getParameters().putAll(parameters);
54
		}
55

  
56
		log.debug(job.getParameters());
57
	}
58

  
59
	public String getPluginName() {
60
		return pluginName;
61
	}
62

  
63
	public void setPluginName(final String pluginName) {
64
		this.pluginName = pluginName;
65
	}
66

  
67
	public Map<String, String> getParameters() {
68
		return parameters;
69
	}
70

  
71
	public void setParameters(final Map<String, String> parameters) {
72
		this.parameters = parameters;
73
	}
74

  
75
	@Deprecated
76
	public String getMdId() {
77
		return mdId;
78
	}
79

  
80
	@Deprecated
81
	public void setMdId(final String mdId) {
82
		this.mdId = mdId;
83
	}
84
}
modules/dnet-isti/trunk/src/main/resources/eu/dnetlib/isti/workflows/nodes/applicationContext-msro-isti.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
       xmlns="http://www.springframework.org/schema/beans"
4
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
5

  
6
	<bean id="wfNodeObtainISTIDataSourceParams"
7
		class="eu.dnetlib.msro.workflows.nodes.ObtainISTIDataSourceParamsJobNode"
8
		scope="prototype" />
9

  
10

  
11
	<bean id="wfNodeFetchMultipleMDStores"
12
		class="eu.dnetlib.msro.workflows.nodes.FetchMultipleMDStoresJobNode"
13
		scope="prototype" />
14

  
15
</beans>
modules/dnet-isti/trunk/src/main/java/eu/dnetlib/data/mdstore/plugins/EnrichProjectsPlugin.java
23 23
		final MDStore store = resolveStore(dao, params, "mdId");
24 24
		final MDStore projectsStore = resolveStore(dao, params, "projectsMdId");
25 25

  
26
		doneCallback.call(params);
27

  
26 28
	}
27 29

  
28 30
}
modules/dnet-isti/trunk/src/main/java/eu/dnetlib/data/mdstore/plugins/EnrichOpenairePlugin.java
22 22

  
23 23
		final MDStore store = resolveStore(dao, params, "mdId");
24 24

  
25
		doneCallback.call(params);
25 26
	}
26 27

  
27 28
}
modules/dnet-isti/trunk/src/main/resources/eu/dnetlib/isti/applicationContext-msro-isti.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
       xmlns="http://www.springframework.org/schema/beans"
4
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
5

  
6
	<bean id="wfNodeObtainISTIDataSourceParams"
7
		class="eu.dnetlib.msro.workflows.nodes.ObtainISTIDataSourceParamsJobNode"
8
		scope="prototype" />
9

  
10

  
11
	<bean id="wfNodeFetchMultipleMDStores"
12
		class="eu.dnetlib.msro.workflows.nodes.FetchMultipleMDStoresJobNode"
13
		scope="prototype" />
14
		
15
	<bean id="dedupMDstorePlugin"
16
		class="eu.dnetlib.data.mdstore.plugins.DedupPublicationsPlugin" />
17

  
18
	<bean id="enrichOpenaireMDstorePlugin"
19
		class="eu.dnetlib.data.mdstore.plugins.EnrichOpenairePlugin" />
20

  
21
	<bean id="enrichProjectsMDstorePlugin"
22
		class="eu.dnetlib.data.mdstore.plugins.EnrichProjectsPlugin" />
23
	
24

  
25
</beans>
modules/dnet-isti/trunk/src/main/resources/eu/dnetlib/bootstrap/profiles/TransformationRuleDSResources/openaireProjects.xml
1
<RESOURCE_PROFILE>
2
	<HEADER>
3
		<RESOURCE_IDENTIFIER
4
			value="9fbc7cfc-8c9b-4bf7-8fca-6869af283d37_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU=" />
5
		<RESOURCE_TYPE value="TransformationRuleDSResourceType" />
6
		<RESOURCE_KIND value="TransformationRuleDSResources" />
7
		<RESOURCE_URI value="" />
8
		<DATE_OF_CREATION value="2015-07-28T12:26:13+02:00" />
9
	</HEADER>
10
	<BODY>
11
		<CONFIGURATION>
12
			<IMPORTED />
13
			<SCRIPT>
14
				<TITLE>Openaire Projects Transformation</TITLE>
15
				<CODE><![CDATA[
16
                    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
17
						<xsl:template match="@*|node()">
18
							<xsl:copy>
19
								<xsl:apply-templates select="@*|node()"/>
20
							</xsl:copy>
21
						</xsl:template>
22
					</xsl:stylesheet>
23
                   ]]></CODE>
24
			</SCRIPT>
25
		</CONFIGURATION>
26
		<STATUS />
27
		<SECURITY_PARAMETERS />
28
	</BODY>
29
</RESOURCE_PROFILE>
modules/dnet-isti/trunk/src/main/resources/eu/dnetlib/bootstrap/profiles/workflows/infospace/enrichProjects.xml
46 46
				<NODE name="enrich_projects" type="RunMDStorePlugin" isJoin="true">
47 47
					<DESCRIPTION>Enrich with projects</DESCRIPTION>
48 48
					<PARAMETERS>
49
						<PARAM name="pluginName" value="enrichProjects"/>
49
						<PARAM name="pluginName" value="enrichProjectsMDstorePlugin"/>
50 50
						<PARAM name="parameters">
51 51
							<MAP>
52 52
								<ENTRY key="mdId" env="pubs_store_id" />
modules/dnet-isti/trunk/src/main/resources/eu/dnetlib/bootstrap/profiles/workflows/infospace/deduplication.xml
26 26
						<PARAM name="outputPrefix" value="source_"/>
27 27
					</PARAMETERS>
28 28
					<ARCS>
29
						<ARC to="dedup01"/>
29
						<ARC to="dedup"/>
30 30
					</ARCS>
31 31
				</NODE>
32 32
				
......
46 46
				<NODE name="dedup" type="RunMDStorePlugin" isJoin="true">
47 47
					<DESCRIPTION>Dedup</DESCRIPTION>
48 48
					<PARAMETERS>
49
						<PARAM name="pluginName" value="dedup"/>
49
						<PARAM name="pluginName" value="dedupMDstorePlugin"/>
50 50
						<PARAM name="parameters">
51 51
							<MAP>
52 52
								<ENTRY key="sourceMdId" env="source_id" />
modules/dnet-isti/trunk/src/main/resources/eu/dnetlib/bootstrap/profiles/workflows/infospace/index.xml
10 10
	<BODY>
11 11
		<CONFIGURATION>
12 12
			<PARAMETERS>
13
				<PARAM name="sourceFormat" description="MD Format (SOURCE)" required="true" type="string"/>
14
				<PARAM name="sourceLayout" description="MD Layout (SOURCE)" required="true" type="string"/>
15
				<PARAM name="sourceInterpretation" description="MD Interpretation (SOURCE)" required="true" type="string"/>
13 16
				<PARAM name="indexFormat" description="Index Format" required="true" type="string" />
14 17
				<PARAM name="indexLayout" description="Index Layout" required="true" type="string" />
15 18
				<PARAM name="indexInterpretation" description="Index Interpretation" required="true" type="string" />
16 19
			</PARAMETERS>
17 20

  
18 21
			<WORKFLOW>
22
			
23
			<NODE isStart="true"  name="verifySourceStore" type="VerifyMDStore">
24
					<DESCRIPTION>Verify source store</DESCRIPTION>
25
					<PARAMETERS>
26
						<PARAM name="format" ref="sourceFormat"/>
27
						<PARAM name="layout" ref="sourceLayout" />
28
						<PARAM name="interpretation" ref="sourceInterpretation" />
29
						<PARAM name="outputPrefix" value="source_"/>
30
					</PARAMETERS>
31
					<ARCS>
32
						<ARC to="fetchRecords"/>
33
					</ARCS>
34
				</NODE>
35
			
19 36
				<NODE isStart="true" name="verifyIndex" type="VerifyIndex">
20 37
					<DESCRIPTION />
21 38
					<PARAMETERS>
22
						<PARAM name="mdFormat" ref="indexFormat" />
39
						<PARAM name="format" ref="indexFormat" />
23 40
						<PARAM name="layout" ref="indexLayout" />
24 41
						<PARAM name="interpretation" ref="indexInterpretation" />
25 42
						<PARAM name="onFailed" value="notFound" />
26 43
						<PARAM name="outputPrefix" value="index_" />
27 44
					</PARAMETERS>
28 45
					<ARCS>
29
						<ARC to="fetchRecord" />
46
						<ARC to="doneIndex" />
30 47
						<ARC name="notFound" to="prepare" />
31 48
					</ARCS>
32 49
				</NODE>
......
59 76
						<PARAM name="mdFormat" ref="indexFormat" />
60 77
						<PARAM name="layout" ref="indexLayout" />
61 78
						<PARAM name="interpretation" ref="indexInterpretation" />
62
						<PARAM name="onFailed" value="notFound" />
63 79
						<PARAM name="outputPrefix" value="index_" />
64 80
					</PARAMETERS>
65 81
					<ARCS>
66
						<ARC to="fetchRecord" />
67
						<ARC name="notFound" to="prepare" />
82
						<ARC to="doneIndex" />
68 83
					</ARCS>
69 84
				</NODE>
70 85
				
71
				<NODE name="fetchRecord" type="FetchRecordsToIndex">
72
					<DESCRIPTION>Fetch records from STORE</DESCRIPTION>
86
				<NODE name="doneIndex">
87
					<DESCRIPTION />
88
					<PARAMETERS />
89
					<ARCS>
90
						<ARC to="fetchRecords" />
91
					</ARCS>
92
				</NODE>
93
				
94
				<NODE name="fetchRecords" type="FetchMDStoreRecords" isJoin="true">
95
					<DESCRIPTION>Fetch records</DESCRIPTION>
73 96
					<PARAMETERS>
74
						<PARAM name="eprOutputParam" value="index_epr" />
97
						<PARAM name="mdId" env="source_id"/>
98
						<PARAM name="eprParam" value="index_epr"/>
75 99
					</PARAMETERS>
76 100
					<ARCS>
77
						<ARC to="indexRecords" />
101
						<ARC to="indexRecords"/>
78 102
					</ARCS>
79 103
				</NODE>
104
				
80 105
				<NODE name="indexRecords" type="UpdateIndex">
81 106
					<DESCRIPTION>Index records</DESCRIPTION>
82 107
					<PARAMETERS>
modules/dnet-isti/trunk/src/main/resources/eu/dnetlib/bootstrap/profiles/workflows/infospace/infospace.xml
24 24
						<PARAM name="wfTemplateParams">
25 25
							<MAP>
26 26
								<ENTRY key="format" value="PFM"/>
27
								<ENTRY key="layout" value="union"/>
28
								<ENTRY key="interpretation" value="store"/>
27
								<ENTRY key="layout" value="store"/>
28
								<ENTRY key="interpretation" value="union"/>
29 29
							</MAP>
30 30
						</PARAM>
31 31
					</PARAMETERS>
......
41 41
						<PARAM name="wfTemplateParams">
42 42
							<MAP>
43 43
								<ENTRY key="format" value="PKG"/>
44
								<ENTRY key="layout" value="dedup"/>
45
								<ENTRY key="interpretation" value="store"/>
44
								<ENTRY key="layout" value="store"/>
45
								<ENTRY key="interpretation" value="dedup"/>
46 46
							</MAP>
47 47
						</PARAM>
48 48
					</PARAMETERS>
......
58 58
						<PARAM name="wfTemplateParams">
59 59
							<MAP>
60 60
								<ENTRY key="format" value="PFM"/>
61
								<ENTRY key="layout" value="final"/>
62
								<ENTRY key="interpretation" value="store"/>
61
								<ENTRY key="layout" value="store"/>
62
								<ENTRY key="interpretation" value="final"/>
63 63
							</MAP>
64 64
						</PARAM>
65 65
					</PARAMETERS>
......
75 75
						<PARAM name="wfTemplateParams">
76 76
							<MAP>
77 77
								<ENTRY key="format" value="PFM"/>
78
								<ENTRY key="sourceLayout" value="cleaned"/>
79
								<ENTRY key="sourceInterpretation" value="store"/>
80
								<ENTRY key="targetLayout" value="union"/>
81
								<ENTRY key="targetInterpretation" value="store"/>
78
								<ENTRY key="sourceLayout" value="store"/>
79
								<ENTRY key="sourceInterpretation" value="cleaned"/>
80
								<ENTRY key="targetLayout" value="store"/>
81
								<ENTRY key="targetInterpretation" value="union"/>
82 82
							</MAP>
83 83
						</PARAM>
84 84
					</PARAMETERS>
......
94 94
						<PARAM name="wfTemplateParams">
95 95
							<MAP>
96 96
								<ENTRY key="sourceFormat" value="PFM"/>
97
								<ENTRY key="sourceLayout" value="union"/>
98
								<ENTRY key="sourceInterpretation" value="store"/>
97
								<ENTRY key="sourceLayout" value="store"/>
98
								<ENTRY key="sourceInterpretation" value="union"/>
99 99
								<ENTRY key="targetFormat" value="PKG"/>
100
								<ENTRY key="targetLayout" value="dedup"/>
101
								<ENTRY key="targetInterpretation" value="store"/>
100
								<ENTRY key="targetLayout" value="store"/>
101
								<ENTRY key="targetInterpretation" value="dedup"/>
102 102
							</MAP>
103 103
						</PARAM>
104 104
					</PARAMETERS>
......
114 114
						<PARAM name="wfTemplateParams">
115 115
							<MAP>
116 116
								<ENTRY key="format" value="PKG"/>
117
								<ENTRY key="layout" value="dedup"/>
118
								<ENTRY key="interpretation" value="store"/>
117
								<ENTRY key="layout" value="store"/>
118
								<ENTRY key="interpretation" value="dedup"/>
119 119
							</MAP>
120 120
						</PARAM>
121 121
					</PARAMETERS>
......
131 131
						<PARAM name="wfTemplateParams">
132 132
							<MAP>
133 133
								<ENTRY key="pubsFormat" value="PKG"/>
134
								<ENTRY key="pubsLayout" value="dedup"/>
135
								<ENTRY key="pubsInterpretation" value="store"/>
134
								<ENTRY key="pubsLayout" value="store"/>
135
								<ENTRY key="pubsInterpretation" value="dedup"/>
136 136
								<ENTRY key="projectsFormat" value="PRJ"/>
137
								<ENTRY key="projectsLayout" value="cleaned"/>
138
								<ENTRY key="projectsInterpretation" value="store"/>
137
								<ENTRY key="projectsLayout" value="store"/>
138
								<ENTRY key="projectsInterpretation" value="cleaned"/>
139 139
							</MAP>
140 140
						</PARAM>
141 141
					</PARAMETERS>
......
151 151
						<PARAM name="wfTemplateParams">
152 152
							<MAP>
153 153
								<ENTRY key="sourceFormat" value="PKG"/>
154
								<ENTRY key="sourceLayout" value="dedup"/>
155
								<ENTRY key="sourceInterpretation" value="store"/>
154
								<ENTRY key="sourceLayout" value="store"/>
155
								<ENTRY key="sourceInterpretation" value="dedup"/>
156 156
								<ENTRY key="targetFormat" value="PFM"/>
157
								<ENTRY key="targetLayout" value="final"/>
158
								<ENTRY key="targetInterpretation" value="store"/>
157
								<ENTRY key="targetLayout" value="store"/>
158
								<ENTRY key="targetInterpretation" value="final"/>
159 159
							</MAP>
160 160
						</PARAM>
161 161
					</PARAMETERS>
......
170 170
						<PARAM name="wfTemplateId" value="d24261dd-0a5d-4a66-8ca9-c0b8f5a790d1_V29ya2Zsb3dUZW1wbGF0ZURTUmVzb3VyY2VzL1dvcmtmbG93VGVtcGxhdGVEU1Jlc291cmNlVHlwZQ=="/>
171 171
						<PARAM name="wfTemplateParams">
172 172
							<MAP>
173
							<ENTRY key="sourceFormat" value="PFM"/>
174
								<ENTRY key="sourceLayout" value="store"/>
175
								<ENTRY key="sourceInterpretation" value="final
176
								
177
								
178
								
179
								
180
								
181
								
182
								
183
								"/>
173 184
								<ENTRY key="indexFormat" value="PFM"/>
174
								<ENTRY key="indexLayout" value="final"/>
175
								<ENTRY key="indexInterpretation" value="index"/>
185
								<ENTRY key="indexLayout" value="index"/>
186
								<ENTRY key="indexInterpretation" value="final"/>
176 187
							</MAP>
177 188
						</PARAM>
178 189
					</PARAMETERS>
modules/dnet-isti/trunk/src/main/resources/eu/dnetlib/bootstrap/profiles/workflows/infospace/enrichOpenaire.xml
31 31
				<NODE name="enrich_openaire" type="RunMDStorePlugin">
32 32
					<DESCRIPTION>Enrich using Openaire</DESCRIPTION>
33 33
					<PARAMETERS>
34
						<PARAM name="pluginName" value="enrichOpenaire"/>
34
						<PARAM name="pluginName" value="enrichOpenaireMDstorePlugin"/>
35 35
						<PARAM name="parameters">
36 36
							<MAP>
37 37
								<ENTRY key="mdId" env="store_id" />

Also available in: Unified diff