1 |
52327
|
alessia.ba
|
<RESOURCE_PROFILE>
|
2 |
|
|
<HEADER>
|
3 |
52423
|
alessia.ba
|
<RESOURCE_IDENTIFIER value="e29e2faf-9ae1-42c3-a722-3e7a116886b6_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
|
4 |
52327
|
alessia.ba
|
<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>FCT to DB</TITLE>
|
14 |
|
|
<CODE>
|
15 |
53143
|
alessia.ba
|
<![CDATA[
|
16 |
35960
|
alessia.ba
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
17 |
39877
|
michele.ar
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
18 |
|
|
exclude-result-prefixes="xs" version="2.0">
|
19 |
32054
|
michele.ar
|
|
20 |
52370
|
miriam.bag
|
<xsl:param name="varDataSourceId"/>
|
21 |
|
|
<xsl:variable name="namespacePrefix" select="string('fct_________')"/>
|
22 |
35960
|
alessia.ba
|
|
23 |
48139
|
alessia.ba
|
<xsl:variable name="invalid" select="' ,-'"/>
|
24 |
|
|
<xsl:variable name="valid" select="'___'"/>
|
25 |
39877
|
michele.ar
|
|
26 |
48139
|
alessia.ba
|
<xsl:variable name="prefix" select="string('fct_________')"/>
|
27 |
|
|
<xsl:variable name="funderID" select="concat($prefix, '::FCT')"/>
|
28 |
39877
|
michele.ar
|
|
29 |
48139
|
alessia.ba
|
<xsl:template match="/">
|
30 |
|
|
<record>
|
31 |
|
|
<xsl:copy-of select=".//*[local-name()='header']"/>
|
32 |
|
|
<metadata>
|
33 |
|
|
<ROWS>
|
34 |
|
|
<xsl:for-each select="//project">
|
35 |
|
|
<xsl:call-template name="projectTemplate"/>
|
36 |
|
|
</xsl:for-each>
|
37 |
|
|
</ROWS>
|
38 |
|
|
</metadata>
|
39 |
39877
|
michele.ar
|
|
40 |
48139
|
alessia.ba
|
</record>
|
41 |
|
|
</xsl:template>
|
42 |
39877
|
michele.ar
|
|
43 |
48139
|
alessia.ba
|
<xsl:template name="projectTemplate">
|
44 |
39877
|
michele.ar
|
|
45 |
48139
|
alessia.ba
|
<xsl:variable name="projectId" select="concat($namespacePrefix, '::', ./id)"/>
|
46 |
|
|
<xsl:variable name="projectAcronym" select="./reference"/>
|
47 |
|
|
<xsl:variable name="tokens" select="tokenize(./reference,'/')"/>
|
48 |
|
|
<xsl:variable name="callID" select="concat($tokens[1], '/', $tokens[last()])"/>
|
49 |
32054
|
michele.ar
|
|
50 |
48139
|
alessia.ba
|
<ROW table="projects">
|
51 |
|
|
<FIELD name="_dnet_resource_identifier_">
|
52 |
|
|
<xsl:value-of select="$projectId"/>
|
53 |
|
|
</FIELD>
|
54 |
|
|
<FIELD name="id">
|
55 |
|
|
<xsl:value-of select="$projectId"/>
|
56 |
|
|
</FIELD>
|
57 |
|
|
<FIELD name="code">
|
58 |
|
|
<xsl:value-of select="./id"/>
|
59 |
|
|
</FIELD>
|
60 |
|
|
<FIELD name="call_identifier">
|
61 |
|
|
<xsl:value-of select="$callID"/>
|
62 |
|
|
</FIELD>
|
63 |
|
|
<FIELD name="websiteurl">
|
64 |
|
|
<xsl:value-of select="./refUri"/>
|
65 |
|
|
</FIELD>
|
66 |
|
|
<FIELD name="acronym">
|
67 |
|
|
<xsl:value-of select="./reference"/>
|
68 |
|
|
</FIELD>
|
69 |
|
|
<FIELD name="title">
|
70 |
|
|
<xsl:value-of select="./name"/>
|
71 |
|
|
</FIELD>
|
72 |
|
|
<FIELD name="startdate" type="date" format="dd/MM/yyyy">
|
73 |
|
|
<xsl:value-of select="./startDate"/>
|
74 |
|
|
</FIELD>
|
75 |
|
|
<FIELD name="enddate" type="date" format="dd/MM/yyyy">
|
76 |
|
|
<xsl:value-of select="./endDate"/>
|
77 |
|
|
</FIELD>
|
78 |
|
|
<FIELD name="keywords">
|
79 |
|
|
<xsl:for-each select="./classification/elem">
|
80 |
|
|
<xsl:if test="position() > 1">,</xsl:if>
|
81 |
|
|
<xsl:value-of select="."/>
|
82 |
|
|
</xsl:for-each>
|
83 |
|
|
</FIELD>
|
84 |
|
|
<FIELD name="collectedfrom">
|
85 |
52370
|
miriam.bag
|
<xsl:value-of select="$varDataSourceId"/>
|
86 |
48139
|
alessia.ba
|
</FIELD>
|
87 |
57309
|
miriam.bag
|
|
88 |
|
|
|
89 |
49668
|
alessia.ba
|
<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
|
90 |
|
|
<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
|
91 |
48139
|
alessia.ba
|
<xsl:if test="string-length(normalize-space(./oaMandate)) > 0">
|
92 |
|
|
<FIELD name="oa_mandate_for_publications" type="boolean">
|
93 |
|
|
<xsl:value-of select="./oaMandate"/>
|
94 |
|
|
</FIELD>
|
95 |
|
|
</xsl:if>
|
96 |
52337
|
miriam.bag
|
<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
|
97 |
48139
|
alessia.ba
|
</ROW>
|
98 |
32054
|
michele.ar
|
|
99 |
48139
|
alessia.ba
|
<xsl:for-each select="./funding">
|
100 |
|
|
<xsl:variable name="p1" select="normalize-space(./program)"/>
|
101 |
|
|
<xsl:variable name="p2" select="normalize-space(./program2)"/>
|
102 |
|
|
|
103 |
41672
|
michele.ar
|
<xsl:variable name="tmpFundingId">
|
104 |
|
|
<xsl:choose>
|
105 |
48139
|
alessia.ba
|
<xsl:when test="string-length($p1) > 0 and string-length($p2) > 0">
|
106 |
|
|
<xsl:value-of select="concat($funderID, '::', $p1, '::', $p2)"/>
|
107 |
41672
|
michele.ar
|
</xsl:when>
|
108 |
48139
|
alessia.ba
|
<xsl:when test="string-length($p1) > 0">
|
109 |
|
|
<xsl:value-of select="concat($funderID, '::', $p1)"/>
|
110 |
41672
|
michele.ar
|
</xsl:when>
|
111 |
|
|
<xsl:otherwise></xsl:otherwise>
|
112 |
|
|
</xsl:choose>
|
113 |
|
|
</xsl:variable>
|
114 |
39877
|
michele.ar
|
|
115 |
48139
|
alessia.ba
|
<xsl:variable name="fundingId" select="normalize-space($tmpFundingId)"/>
|
116 |
39877
|
michele.ar
|
|
117 |
48139
|
alessia.ba
|
<xsl:if test="string-length($fundingId) > 0">
|
118 |
|
|
<ROW table="project_fundingpath">
|
119 |
|
|
<FIELD name="_dnet_resource_identifier_">
|
120 |
|
|
<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
|
121 |
|
|
</FIELD>
|
122 |
|
|
<FIELD name="funding">
|
123 |
|
|
<xsl:value-of select="$fundingId"/>
|
124 |
|
|
</FIELD>
|
125 |
|
|
<FIELD name="project">
|
126 |
|
|
<xsl:value-of select="$projectId"/>
|
127 |
|
|
</FIELD>
|
128 |
|
|
<FIELD name="startdate" type="date" format="dd/MM/yyyy">
|
129 |
|
|
<xsl:value-of select="../startDate"/>
|
130 |
|
|
</FIELD>
|
131 |
|
|
<FIELD name="enddate" type="date" format="dd/MM/yyyy">
|
132 |
|
|
<xsl:value-of select="../endDate"/>
|
133 |
|
|
</FIELD>
|
134 |
|
|
<FIELD name="optional1">
|
135 |
|
|
<xsl:value-of select="./amount"/>
|
136 |
|
|
</FIELD>
|
137 |
|
|
<FIELD name="optional2">
|
138 |
|
|
<xsl:value-of select="./dateAwarded"/>
|
139 |
|
|
</FIELD>
|
140 |
|
|
</ROW>
|
141 |
|
|
</xsl:if>
|
142 |
|
|
</xsl:for-each>
|
143 |
|
|
|
144 |
|
|
</xsl:template>
|
145 |
32054
|
michele.ar
|
</xsl:stylesheet>
|
146 |
53143
|
alessia.ba
|
]]>
|
147 |
52327
|
alessia.ba
|
</CODE>
|
148 |
|
|
</SCRIPT>
|
149 |
|
|
</CONFIGURATION>
|
150 |
|
|
<STATUS/>
|
151 |
|
|
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
|
152 |
|
|
</BODY>
|
153 |
|
|
</RESOURCE_PROFILE>
|