Project

General

Profile

1
<RESOURCE_PROFILE>
2
	<HEADER>
3
		<RESOURCE_IDENTIFIER value="6455a552-0cf2-4011-b82e-258d485ab4ff_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
4
		<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
5
		<RESOURCE_KIND value="TransformationRuleDSResources"/>
6
		<RESOURCE_URI value=""/>
7
		<DATE_OF_CREATION value="2018-06-04T11:15:30+00:00"/>
8
	</HEADER>
9
	<BODY>
10
		<CONFIGURATION>
11
			<IMPORTED/>
12
			<SCRIPT>
13
				<TITLE>NWO to DB</TITLE>
14
				<CODE>
15
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
16
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
17
                exclude-result-prefixes="xs" version="1.0">
18

    
19
	<xsl:param name="varDataSourceId"/>
20
	<xsl:variable name="namespacePrefix" select="string('nwo_________')"/>
21
	<xsl:param name="quote">"</xsl:param>
22

    
23
	<xsl:template name="getJson">
24
		<xsl:param name="varName"/>
25
		<xsl:param name="value"/>
26
		<xsl:value-of select="concat($quote, $varName, $quote, ':', $quote, $value, $quote)"/>
27
	</xsl:template>
28

    
29

    
30
	<xsl:template match="/">
31

    
32
		<xsl:variable name="prefix" select="string('nwo_________')"/>
33

    
34
		<record>
35

    
36
			<xsl:copy-of select=".//*[local-name()='header']"/>
37

    
38
			<metadata>
39
				<ROWS>
40
					<xsl:variable name="projectId" select="concat($namespacePrefix, '::',  normalize-space(.//column[@name='ProjectID']))"/>
41
					<xsl:variable name="startDate" select=".//column[@name='Werk startdat']"/>
42
					<xsl:variable name="endDate" select=".//column[@name='Werk einddat']"/>
43
					<xsl:variable name="dossiernr">
44
						<xsl:call-template name="getJson">
45
							<xsl:with-param name="varName">dossiernr</xsl:with-param>
46
							<xsl:with-param name="value">
47
								<xsl:value-of select=".//column[@name='Dossiernr']"/>
48
							</xsl:with-param>
49
						</xsl:call-template>
50
					</xsl:variable>
51
					<xsl:variable name="NWOgebied">
52
						<xsl:call-template name="getJson">
53
							<xsl:with-param name="varName">NWOgebied</xsl:with-param>
54
							<xsl:with-param name="value">
55
								<xsl:value-of select=".//column[@name='NWO gebied']"/>
56
							</xsl:with-param>
57
						</xsl:call-template>
58
					</xsl:variable>
59

    
60
					<xsl:variable name="jsonExtra">
61
						<xsl:value-of select="concat('{', $dossiernr, ',', $NWOgebied, '}')"/>
62
					</xsl:variable>
63
					<ROW table="projects">
64
						<FIELD name="_dnet_resource_identifier_">
65
							<xsl:value-of select="$projectId"/>
66
						</FIELD>
67
						<FIELD name="id">
68
							<xsl:value-of select="$projectId"/>
69
						</FIELD>
70
						<FIELD name="code">
71
							<xsl:value-of select=".//column[@name='ProjectID']"/>
72
						</FIELD>
73
						<FIELD name="title">
74
							<xsl:value-of select=".//column[@name='Proj titel']"/>
75
						</FIELD>
76
						<FIELD name="startdate" type="date" format="dd/MM/yyyy">
77
							<xsl:value-of select="$startDate"/>
78
						</FIELD>
79
						<FIELD name="enddate" type="date" format="dd/MM/yyyy">
80
							<xsl:value-of select="$endDate"/>
81
						</FIELD>
82
						<FIELD name="collectedfrom">
83
							<xsl:value-of select="$varDataSourceId"/>
84
						</FIELD>
85
						<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
86
						<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
87
						<FIELD name="optional1">
88
							<xsl:value-of select=".//column[@name='Dossiernr']"/>
89
						</FIELD>
90
						<FIELD name="optional2">
91
							<xsl:value-of select=".//column[@name='NWO gebied']"/>
92
						</FIELD>
93
						<FIELD name="jsonextrainfo">
94
							<xsl:value-of select="$jsonExtra"/>
95
						</FIELD>
96
						<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
97
					</ROW>
98

    
99
					<xsl:variable name="funderId" select="concat($prefix, '::NWO')"/>
100
					<ROW table="project_fundingpath">
101
						<FIELD name="_dnet_resource_identifier_">
102
							<xsl:value-of select="concat($funderId, '@@', $projectId)"/>
103
						</FIELD>
104
						<FIELD name="funding">
105
							<xsl:value-of select="$funderId"/>
106
						</FIELD>
107
						<FIELD name="project">
108
							<xsl:value-of select="$projectId"/>
109
						</FIELD>
110
						<FIELD name="startdate" type="date" format="dd/MM/yyyy">
111
							<xsl:value-of select="$startDate"/>
112
						</FIELD>
113
						<FIELD name="enddate" type="date" format="dd/MM/yyyy">
114
							<xsl:value-of select="$endDate"/>
115
						</FIELD>
116
					</ROW>
117

    
118
				</ROWS>
119
			</metadata>
120
		</record>
121
	</xsl:template>
122

    
123
</xsl:stylesheet>
124
				</CODE>
125
			</SCRIPT>
126
		</CONFIGURATION>
127
		<STATUS/>
128
		<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
129
	</BODY>
130
</RESOURCE_PROFILE>
(15-15/22)