Project

General

Profile

1
<RESOURCE_PROFILE>
2
	<HEADER>
3
		<RESOURCE_IDENTIFIER value="b2f93c95-f4e7-447e-9048-1a651630670e_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>CORDA to DB</TITLE>
14
				<CODE>
15
					<![CDATA[
16
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
17

    
18
	<xsl:param name="varDataSourceId"/>
19

    
20
	<xsl:template name="dateCorda">
21
		<xsl:param name="datename"/>
22
		<xsl:param name="datevalue"/>
23
		<FIELD name="{$datename}" type="date" format="dd-MMM-yyyy">
24
			<xsl:value-of select="concat(substring($datevalue, 1, 2),'-',substring($datevalue,3,3),'-',substring($datevalue,6,4))"/>
25
		</FIELD>
26
	</xsl:template>
27

    
28
	<xsl:variable name="namespacePrefix" select="string('ec__________')"/>
29
	<xsl:variable name="funderID" select="concat($namespacePrefix, '::EC')"/>
30

    
31
	<xsl:template match="/">
32
		<record>
33
			<xsl:copy-of select=".//*[local-name()='header']"/>
34
			<metadata>
35
				<ROWS>
36
					<xsl:for-each select="//Project">
37

    
38
						<xsl:variable name="specificName">
39
							<xsl:choose>
40
								<xsl:when test="normalize-space(./ProjectSpecificProgram)">
41
									<xsl:value-of select="normalize-space(./ProjectSpecificProgram)"/>
42
								</xsl:when>
43
								<xsl:otherwise>
44
									<xsl:value-of select="string('UNKNOWN')"/>
45
								</xsl:otherwise>
46
							</xsl:choose>
47
						</xsl:variable>
48

    
49
						<xsl:variable name="specificDesc" select="./ProjectSpecificProgramDescr"/>
50
						<xsl:variable name="specificId" select="normalize-space(concat($funderID, '::FP7::', $specificName))"/>
51

    
52
						<xsl:variable name="projectProgramName">
53
							<xsl:choose>
54
								<xsl:when test="normalize-space(./ProjectProgram)">
55
									<xsl:value-of select="normalize-space(./ProjectProgram)"/>
56
								</xsl:when>
57
								<xsl:otherwise>
58
									<xsl:value-of select="string('UNKNOWN')"/>
59
								</xsl:otherwise>
60
							</xsl:choose>
61
						</xsl:variable>
62

    
63
						<xsl:variable name="projectProgramDesc" select="./ProjectProgramDescr"/>
64
						<xsl:variable name="projectProgramId" select="concat($funderID, '::FP7::', $specificName, '::', $projectProgramName)"/>
65
						<xsl:variable name="projectId" select="concat('corda_______::', normalize-space(./ProjectId))"/>
66

    
67

    
68
						<ROW table="projects">
69
							<FIELD name="_dnet_resource_identifier_">
70
								<xsl:value-of select="$projectId"/>
71
							</FIELD>
72
							<FIELD name="id">
73
								<xsl:value-of select="$projectId"/>
74
							</FIELD>
75
							<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
76
							<FIELD name="code">
77
								<xsl:value-of select="./ProjectId"/>
78
							</FIELD>
79
							<FIELD name="acronym">
80
								<xsl:value-of select="./ProjectAcronym"/>
81
							</FIELD>
82
							<FIELD name="title">
83
								<xsl:value-of select="./ProjectTitle"/>
84
							</FIELD>
85
							<xsl:call-template name="dateCorda">
86
								<xsl:with-param name="datename">startdate</xsl:with-param>
87
								<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
88
							</xsl:call-template>
89
							<xsl:call-template name="dateCorda">
90
								<xsl:with-param name="datename">enddate</xsl:with-param>
91
								<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
92
							</xsl:call-template>
93
							<FIELD name="call_identifier">
94
								<xsl:value-of select="./ProjectCallIdentifier"/>
95
							</FIELD>
96
							<FIELD name="ec_sc39" type="boolean">
97
								<xsl:value-of select="./SpecialClause39"/>
98
							</FIELD>
99
							<FIELD name="oa_mandate_for_publications" type="boolean">
100
								<xsl:value-of select="./SpecialClause39"/>
101
							</FIELD>
102
							<FIELD name="collectedfrom">
103
								<xsl:value-of select="$varDataSourceId"/>
104
							</FIELD>
105
							<FIELD name="contracttypeclass">
106
								<xsl:value-of select="./ProjectFundingScheme"/>
107
							</FIELD>
108
							<FIELD name="contracttypescheme">ec:FP7contractTypes</FIELD>
109
							<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
110
							<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
111
							<FIELD name="websiteurl">
112
								<xsl:value-of select="./ProjectInternetAddress"/>
113
							</FIELD>
114
							<FIELD name="optional1">
115
								<xsl:value-of select="./ProjectSubFundingScheme"/>
116
							</FIELD>
117
							<FIELD name="optional2">
118
								<xsl:value-of select="./ProjectCallWebpageUrl"/>
119
							</FIELD>
120
							<xsl:variable name="personSurname" select="normalize-space(./CoordinatorContactPerson/PersonLastName)"/>
121
							<xsl:variable name="personFirstName" select="normalize-space(./CoordinatorContactPerson/PersonFirstName)"/>
122
							<xsl:variable name="contactfullname">
123
								<xsl:choose>
124
									<xsl:when test="string-length($personFirstName) &gt; 0 and string-length($personSurname) &gt; 0">
125
										<xsl:value-of select="normalize-space(concat($personSurname, ', ', $personFirstName))"/>
126
									</xsl:when>
127
									<xsl:when test="string-length($personFirstName) &gt; 0">
128
										<xsl:value-of select="$personFirstName"/>
129
									</xsl:when>
130
									<xsl:when test="string-length($personSurname) &gt; 0">
131
										<xsl:value-of select="$personSurname"/>
132
									</xsl:when>
133
									<xsl:otherwise>
134
										<xsl:value-of select="''"/>
135
									</xsl:otherwise>
136
								</xsl:choose>
137
							</xsl:variable>
138
							<xsl:if test="string-length($contactfullname) &gt; 0">
139
								<FIELD name="contactfullname">
140
									<xsl:value-of select="$contactfullname"/>
141
								</FIELD>
142
							</xsl:if>
143
							<xsl:variable name="contactfax" select="normalize-space(./CoordinatorContactPerson/ContactFax)"/>
144
							<xsl:if test="string-length($contactfax) &gt; 0">
145
								<FIELD name="contactfax">
146
									<xsl:value-of select="$contactfax"/>
147
								</FIELD>
148
							</xsl:if>
149
							<xsl:variable name="contactphone" select="normalize-space(./CoordinatorContactPerson/ContactPhone)"/>
150
							<xsl:if test="string-length($contactphone) &gt; 0">
151
								<FIELD name="contactphone">
152
									<xsl:value-of select="$contactphone"/>
153
								</FIELD>
154
							</xsl:if>
155
							<xsl:variable name="contactemail" select="normalize-space(./CoordinatorContactPerson/ContactEmail)"/>
156
							<xsl:if test="string-length($contactemail) &gt; 0">
157
								<FIELD name="contactemail">
158
									<xsl:value-of select="$contactemail"/>
159
								</FIELD>
160
							</xsl:if>
161
						</ROW>
162

    
163
						<ROW table="project_fundingpath">
164
							<FIELD name="_dnet_resource_identifier_">
165
								<xsl:value-of select="concat($projectProgramId, '@@', $projectId)"/>
166
							</FIELD>
167
							<FIELD name="funding">
168
								<xsl:value-of select="$projectProgramId"/>
169
							</FIELD>
170
							<FIELD name="project">
171
								<xsl:value-of select="$projectId"/>
172
							</FIELD>
173
							<xsl:call-template name="dateCorda">
174
								<xsl:with-param name="datename">startdate</xsl:with-param>
175
								<xsl:with-param name="datevalue" select="./ProjectStartDate"></xsl:with-param>
176
							</xsl:call-template>
177
							<xsl:call-template name="dateCorda">
178
								<xsl:with-param name="datename">enddate</xsl:with-param>
179
								<xsl:with-param name="datevalue" select="./ProjectEndDate"></xsl:with-param>
180
							</xsl:call-template>
181
							<FIELD name="semanticclass">
182
								<xsl:value-of select="./ProjectFundingScheme"/>
183
							</FIELD>
184
							<FIELD name="semanticscheme">ec:FP7contractTypes</FIELD>
185
						</ROW>
186
					</xsl:for-each>
187

    
188
					<xsl:for-each select="//OrganisationParticipant">
189
						<xsl:variable name="organizationId" select="concat('corda_______::', ./OrganisationPIC)"/>
190
						<xsl:variable name="projectId" select="concat('corda_______::', normalize-space(../ProjectId))"/>
191
						<xsl:variable name="whitelist" select="'0123456789'"/>
192
						<ROW table="dsm_organizations">
193
							<FIELD name="_dnet_resource_identifier_">
194
								<xsl:value-of select="$organizationId"/>
195
							</FIELD>
196
							<FIELD name="id">
197
								<xsl:value-of select="$organizationId"/>
198
							</FIELD>
199
							<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
200
							<FIELD name="legalshortname">
201
								<xsl:value-of select="./OrganisationShortName"/>
202
							</FIELD>
203
							<FIELD name="legalname">
204
								<xsl:value-of select="./OrganisationLegalName"/>
205
							</FIELD>
206
							<FIELD name="websiteurl">
207
								<xsl:choose>
208
									<xsl:when test="starts-with(normalize-space(./OrganisationWebPage), 'http')">
209
										<xsl:value-of select="./OrganisationWebPage"/>
210
									</xsl:when>
211
									<xsl:when test="string-length(normalize-space(./OrganisationWebPage)) &gt; 0">
212
										<xsl:value-of select="concat('http://', normalize-space(./OrganisationWebPage))"/>
213
									</xsl:when>
214
								</xsl:choose>
215
							</FIELD>
216
							<FIELD name="ec_legalbody" type="boolean">
217
								<xsl:value-of select="./PublicBody"/>
218
							</FIELD>
219
							<FIELD name="ec_legalperson" type="boolean">
220
								<xsl:value-of select="./LegalPerson"/>
221
							</FIELD>
222
							<FIELD name="ec_nonprofit" type="boolean">
223
								<xsl:value-of select="./NonProfit"/>
224
							</FIELD>
225
							<FIELD name="ec_researchorganization" type="boolean">
226
								<xsl:value-of select="./ResearchOrganisation"/>
227
							</FIELD>
228
							<FIELD name="ec_highereducation" type="boolean">
229
								<xsl:value-of select="./HigherEducation"/>
230
							</FIELD>
231
							<FIELD name="ec_internationalorganizationeurinterests" type="boolean">
232
								<xsl:value-of select="./InternationalOrgEurInterest"/>
233
							</FIELD>
234
							<FIELD name="ec_internationalorganization" type="boolean">
235
								<xsl:value-of select="./InternationalOrgEurInterest"/>
236
							</FIELD>
237
							<FIELD name="ec_enterprise" type="boolean">
238
								<xsl:value-of select="./Enterprise"/>
239
							</FIELD>
240
							<FIELD name="ec_smevalidated" type="boolean">
241
								<xsl:value-of select="./SMEValidated"/>
242
							</FIELD>
243
							<FIELD name="countryclass">
244
								<xsl:value-of select="./OrganisationCountry"/>
245
							</FIELD>
246
							<FIELD name="countryscheme">dnet:countries</FIELD>
247
							<FIELD name="collectedfrom">
248
								<xsl:value-of select="$varDataSourceId"/>
249
							</FIELD>
250
							<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
251

    
252
							<FIELD name="trust" type="float">
253
								<xsl:value-of select="0.8"/>
254
							</FIELD>
255
						</ROW>
256

    
257
						<ROW table="project_organization">
258
							<FIELD name="_dnet_resource_identifier_">
259
								<xsl:value-of select='concat($projectId, "@@", $organizationId)'/>
260
							</FIELD>
261
							<xsl:choose>
262
								<xsl:when test="string-length(translate(./ParticipantOrder, $whitelist, '')) &gt; 0">
263
									<FIELD name="participantnumber" type="int">9999</FIELD>
264
								</xsl:when>
265
								<xsl:otherwise>
266
									<FIELD name="participantnumber" type="int">
267
										<xsl:value-of select="./ParticipantOrder"/>
268
									</FIELD>
269
								</xsl:otherwise>
270
							</xsl:choose>
271
							<FIELD name="project">
272
								<xsl:value-of select="$projectId"/>
273
							</FIELD>
274
							<FIELD name="resporganization">
275
								<xsl:value-of select="$organizationId"/>
276
							</FIELD>
277
							<xsl:choose>
278
								<xsl:when test="./ParticipantOrder = 1">
279
									<FIELD name="semanticclass">coordinator</FIELD>
280
								</xsl:when>
281
								<xsl:otherwise>
282
									<FIELD name="semanticclass">participant</FIELD>
283
								</xsl:otherwise>
284
							</xsl:choose>
285
						</ROW>
286
					</xsl:for-each>
287
				</ROWS>
288
			</metadata>
289
		</record>
290
	</xsl:template>
291
</xsl:stylesheet>
292
		]]>
293
		</CODE>
294
		</SCRIPT>
295
		</CONFIGURATION>
296
<STATUS/>
297
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
298
		</BODY>
299
		</RESOURCE_PROFILE>
(4-4/21)