1
|
<RESOURCE_PROFILE>
|
2
|
<HEADER>
|
3
|
<RESOURCE_IDENTIFIER value="6cc23fa1-0c10-4395-8019-2a3ba7ba777e_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
|
4
|
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
|
5
|
<RESOURCE_KIND value="TransformationRuleDSResources"/>
|
6
|
<RESOURCE_URI value=""/>
|
7
|
<DATE_OF_CREATION value="2021-02-05T15:37:59+00:00"/>
|
8
|
</HEADER>
|
9
|
<BODY>
|
10
|
<CONFIGURATION>
|
11
|
<IMPORTED/>
|
12
|
<SCRIPT>
|
13
|
<TITLE>GSRI to DB</TITLE>
|
14
|
<CODE>
|
15
|
<![CDATA[
|
16
|
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
17
|
xmlns:utils="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions">
|
18
|
|
19
|
<xsl:param name="varDataSourceId"/>
|
20
|
<xsl:variable name="namespacePrefix" select="string('gsri________')"/>
|
21
|
|
22
|
<xsl:variable name="dateFormat" select="string('yyyy-MM-dd')"/>
|
23
|
<xsl:variable name="funderID" select="concat($namespacePrefix, '::GSRI')"/>
|
24
|
<xsl:param name="quote">"</xsl:param>
|
25
|
|
26
|
|
27
|
|
28
|
|
29
|
<xsl:template match="/">
|
30
|
<xsl:variable name="sector" select=".//column[@name='Sector ΕΤΑΚ']"/>
|
31
|
<xsl:variable name="description" select=".//column[@name='Περιγραφή Φυσικού Αντικειμένου Έργου']"/>
|
32
|
<record>
|
33
|
|
34
|
<xsl:copy-of select=".//*[local-name() = 'header']"/>
|
35
|
|
36
|
<metadata>
|
37
|
<ROWS>
|
38
|
<xsl:variable name="projectId"
|
39
|
select="concat($namespacePrefix, '::', normalize-space(utils:md5(.//column[@name='Project ID (MIS)'])))"/>
|
40
|
|
41
|
<!--<xsl:variable name="contact" select="tokenize(.//column[@name='Project Leader'],' ')"/>-->
|
42
|
|
43
|
|
44
|
<ROW table="projects">
|
45
|
<FIELD name="_dnet_resource_identifier_">
|
46
|
<xsl:value-of select="$projectId"/>
|
47
|
</FIELD>
|
48
|
<FIELD name="id">
|
49
|
<xsl:value-of select="$projectId"/>
|
50
|
</FIELD>
|
51
|
<FIELD name="code">
|
52
|
<xsl:value-of
|
53
|
select="normalize-space(.//column[@name = 'Project ID (MIS)'])"
|
54
|
/>
|
55
|
</FIELD>
|
56
|
<FIELD name="title">
|
57
|
<xsl:value-of
|
58
|
select=".//column[@name = 'Project Title']"/>
|
59
|
</FIELD>
|
60
|
|
61
|
<!-- <FIELD name="contactfullname">
|
62
|
<xsl:value-of select="concat($contact[2],', ', $contact[1])"/>
|
63
|
</FIELD>-->
|
64
|
<xsl:choose>
|
65
|
<xsl:when test="$sector != '' ">
|
66
|
|
67
|
|
68
|
<FIELD name="optional2">
|
69
|
<xsl:value-of
|
70
|
select="concat('{',$quote,'sector',$quote,':',$quote,$sector,$quote,'}')"
|
71
|
/>
|
72
|
</FIELD>
|
73
|
</xsl:when>
|
74
|
|
75
|
</xsl:choose>
|
76
|
<FIELD name="collectedfrom">
|
77
|
<xsl:value-of select="$varDataSourceId"/>
|
78
|
</FIELD>
|
79
|
<!-- <FIELD name="optional1">
|
80
|
<xsl:value-of select="concat(.//column[@name='Budget (€)'],' €')"/>
|
81
|
</FIELD>-->
|
82
|
<FIELD name="provenanceactionclass"
|
83
|
>sysimport:crosswalk:entityregistry</FIELD>
|
84
|
<FIELD name="provenanceactionscheme"
|
85
|
>dnet:provenanceActions</FIELD>
|
86
|
<FIELD name="oa_mandate_for_publications" type="boolean"
|
87
|
>false</FIELD>
|
88
|
<FIELD name="lastupdate" type="date">
|
89
|
<xsl:value-of select="current-dateTime()"/>
|
90
|
</FIELD>
|
91
|
</ROW>
|
92
|
<ROW table="project_fundingpath">
|
93
|
<FIELD name="_dnet_resource_identifier_">
|
94
|
<xsl:value-of
|
95
|
select="concat($funderID, '@@', $projectId)"/>
|
96
|
</FIELD>
|
97
|
<FIELD name="funding">
|
98
|
<xsl:value-of select="$funderID"/>
|
99
|
</FIELD>
|
100
|
<FIELD name="project">
|
101
|
<xsl:value-of select="$projectId"/>
|
102
|
</FIELD>
|
103
|
|
104
|
</ROW>
|
105
|
<xsl:if test=".//column[@name='Beneficiary Name'] != ''">
|
106
|
|
107
|
<xsl:variable name="organizationId"
|
108
|
select="concat($namespacePrefix,'::',utils:md5(normalize-space(.//column[@name='Beneficiary Name'])))"/>
|
109
|
<ROW table="dsm_organizations">
|
110
|
|
111
|
<FIELD name="_dnet_resource_identifier_">
|
112
|
<xsl:value-of select="$organizationId"/>
|
113
|
</FIELD>
|
114
|
<FIELD name="id">
|
115
|
<xsl:value-of select="$organizationId"/>
|
116
|
</FIELD>
|
117
|
<xsl:choose>
|
118
|
<xsl:when test="string-length(.//column[@name='Beneficiary Name']) > 255">
|
119
|
<FIELD name="legalname">
|
120
|
<xsl:value-of
|
121
|
select="normalize-space(substring(.//column[@name='Beneficiary Name'],1,255))"
|
122
|
/>
|
123
|
</FIELD>
|
124
|
</xsl:when>
|
125
|
<xsl:otherwise>
|
126
|
<FIELD name="legalname">
|
127
|
<xsl:value-of
|
128
|
select="normalize-space(.//column[@name='Beneficiary Name'])"
|
129
|
/>
|
130
|
</FIELD>
|
131
|
</xsl:otherwise>
|
132
|
</xsl:choose>
|
133
|
|
134
|
<FIELD name="country">
|
135
|
<xsl:value-of select="string('GR')" />
|
136
|
</FIELD>
|
137
|
<FIELD name="collectedfrom">
|
138
|
<xsl:value-of select="$varDataSourceId"/>
|
139
|
</FIELD>
|
140
|
<FIELD name="provenanceaction"
|
141
|
>sysimport:crosswalk:entityregistry</FIELD>
|
142
|
<FIELD name="lastupdate" type="date">
|
143
|
<xsl:value-of select="current-dateTime()"/>
|
144
|
</FIELD>
|
145
|
</ROW>
|
146
|
<ROW table="project_organization">
|
147
|
<FIELD name="_dnet_resource_identifier_">
|
148
|
<xsl:value-of
|
149
|
select='concat($projectId, "@@", $organizationId)'
|
150
|
/>
|
151
|
</FIELD>
|
152
|
<FIELD name="project">
|
153
|
<xsl:value-of select="$projectId"/>
|
154
|
</FIELD>
|
155
|
<FIELD name="resporganization">
|
156
|
<xsl:value-of select="$organizationId"/>
|
157
|
</FIELD>
|
158
|
<FIELD name="semanticclass">coordinator</FIELD>
|
159
|
</ROW>
|
160
|
</xsl:if>
|
161
|
</ROWS>
|
162
|
</metadata>
|
163
|
</record>
|
164
|
</xsl:template>
|
165
|
</xsl:stylesheet>
|
166
|
]]>
|
167
|
|
168
|
</CODE>
|
169
|
</SCRIPT>
|
170
|
</CONFIGURATION>
|
171
|
<STATUS/>
|
172
|
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
|
173
|
</BODY>
|
174
|
</RESOURCE_PROFILE>
|