Project

General

Profile

« Previous | Next » 

Revision 60429

added information about funded amount and organization

View differences:

modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/funders/sfi_2_db.xml
14 14
				<CODE>
15 15
					<![CDATA[
16 16
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
17
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
18
                exclude-result-prefixes="xs" version="2.0">
17
    xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
19 18

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

  
23
	<xsl:template match="/">
24
		<record>
22
    <xsl:template match="/">
23
        <record>
25 24

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

  
28
			<metadata>
29
				<ROWS>
30
					<xsl:if test="normalize-space(.//column[@name='Proposal ID']) and normalize-space(.//column[@name='Project Title'])">
31
						<xsl:variable name="projectId" select="concat($namespacePrefix, '::',  normalize-space(.//column[@name='Proposal ID']))"/>
32
						<xsl:variable name="startDate" select=".//column[@name='Start Date']"/>
33
						<xsl:variable name="endDate" select=".//column[@name='End Date']"/>
34
						<ROW table="projects">
35
							<FIELD name="_dnet_resource_identifier_">
36
								<xsl:value-of select="$projectId"/>
37
							</FIELD>
38
							<FIELD name="id">
39
								<xsl:value-of select="$projectId"/>
40
							</FIELD>
41
							<FIELD name="code">
42
								<xsl:value-of select=".//column[@name='Proposal ID']"/>
43
							</FIELD>
44
							<FIELD name="title">
45
								<xsl:value-of select=".//column[@name='Project Title']"/>
46
							</FIELD>
47
							<FIELD name="startdate" type="date" format="dd/MM/yyyy">
48
								<xsl:value-of select="$startDate"/>
49
							</FIELD>
50
							<FIELD name="enddate" type="date" format="dd/MM/yyyy">
51
								<xsl:value-of select="$endDate"/>
52
							</FIELD>
53
							<FIELD name="collectedfrom">
54
								<xsl:value-of select="$varDataSourceId"/>
55
							</FIELD>
56
							<FIELD name="provenanceactionclass">sysimport:crosswalk:entityregistry</FIELD>
57
							<!-- 30/06/2016 must be converted into 2016-06-30-->
58
							<xsl:variable name="date" select="xs:date(concat(
59
							            substring($startDate,7,4),'-',
60
							            substring($startDate,4,2),'-',
61
							            substring($startDate,1,2)))"/>
62
							<FIELD name="oa_mandate_for_publications" type="boolean"><xsl:value-of select="$date &gt;= xs:date('2009-01-01')"/> </FIELD>
63
							<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
64
						</ROW>
27
            <metadata>
28
                <ROWS>
29
                    <xsl:if
30
                        test="normalize-space(.//column[@name = 'Proposal ID']) and normalize-space(.//column[@name = 'Proposal Title'])">
31
                        <xsl:variable name="projectId"
32
                            select="concat($namespacePrefix, '::', normalize-space(.//column[@name = 'Proposal ID']))"/>
33
                        <xsl:variable name="startDate" select=".//column[@name = 'Start Date']"/>
34
                        <xsl:variable name="endDate" select=".//column[@name = 'End Date']"/>
35
                        <ROW table="projects">
36
                            <FIELD name="_dnet_resource_identifier_">
37
                                <xsl:value-of select="$projectId"/>
38
                            </FIELD>
39
                            <FIELD name="id">
40
                                <xsl:value-of select="$projectId"/>
41
                            </FIELD>
42
                            <FIELD name="code">
43
                                <xsl:value-of select=".//column[@name = 'Proposal ID']"/>
44
                            </FIELD>
45
                            <FIELD name="title">
46
                                <xsl:value-of select=".//column[@name = 'Proposal Title']"/>
47
                            </FIELD>
48
                            <FIELD name="startdate" type="date" format="dd/MM/yyyy">
49
                                <xsl:value-of select="$startDate"/>
50
                            </FIELD>
51
                            <FIELD name="enddate" type="date" format="dd/MM/yyyy">
52
                                <xsl:value-of select="$endDate"/>
53
                            </FIELD>
54
                            <FIELD name="collectedfrom">
55
                                <xsl:value-of select="$varDataSourceId"/>
56
                            </FIELD>
57
                            <FIELD name="fundedamount" type="float">
58
                                <xsl:value-of select=".//column[@name= 'Revised Total Commitment']"/>
59
                            </FIELD>
60
                            <FIELD name="currency">
61
                                <xsl:value-of select="string('EUR')"/>
62
                            </FIELD>
63
                            <xsl:if
64
                                test="normalize-space(.//column[@name='Lead Applicant'])">
65
                                <FIELD name="contactfullname">
66
                                    <xsl:value-of select="normalize-space(.//column[@name='Lead Applicant'])"/>
67
                                </FIELD>
68
                            </xsl:if>
69
                            <xsl:if test="normalize-space(.//column[@name='ORCID'])">
70
                                <FIELD name="optional1">
71
                                    <xsl:value-of select="normalize-space(.//column[@name='ORCID'])"/>
72
                                </FIELD>
73
                            </xsl:if>
74
                            <FIELD name="provenanceactionclass"
75
                                >sysimport:crosswalk:entityregistry</FIELD>
76
                            <!-- 30/06/2016 must be converted into 2016-06-30-->
77
                            <xsl:variable name="date"
78
                                select="
79
                                    xs:date(concat(
80
                                    substring($startDate, 7, 4), '-',
81
                                    substring($startDate, 4, 2), '-',
82
                                    substring($startDate, 1, 2)))"/>
83
                            <FIELD name="oa_mandate_for_publications" type="boolean">
84
                                <xsl:value-of select="$date &gt;= xs:date('2009-01-01')"/>
85
                            </FIELD>
86
                            <FIELD name="lastupdate" type="date">
87
                                <xsl:value-of select="current-dateTime()"/>
88
                            </FIELD>
89
                        </ROW>
65 90

  
66
						<xsl:if test="normalize-space(.//column[@name='Programme Name'])">
67
							<xsl:variable name="funderId" select="concat($namespacePrefix, '::SFI')"/>
68
							<xsl:variable name="fundingId" select="concat($funderId, '::', normalize-space(.//column[@name='Programme Name']))"/>
69
							<ROW table="project_fundingpath">
70
								<FIELD name="_dnet_resource_identifier_">
71
									<xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
72
								</FIELD>
73
								<FIELD name="funding">
74
									<xsl:value-of select="$fundingId"/>
75
								</FIELD>
76
								<FIELD name="project">
77
									<xsl:value-of select="$projectId"/>
78
								</FIELD>
79
								<FIELD name="startdate" type="date" format="dd/MM/yyyy">
80
									<xsl:value-of select="$startDate"/>
81
								</FIELD>
82
								<FIELD name="enddate" type="date" format="dd/MM/yyyy">
83
									<xsl:value-of select="$endDate"/>
84
								</FIELD>
85
							</ROW>
86
						</xsl:if>
91
                        <xsl:if test="normalize-space(.//column[@name = 'Programme Name'])">
92
                            <xsl:variable name="funderId" select="concat($namespacePrefix, '::SFI')"/>
93
                            <xsl:choose>
94
                                <xsl:when test="normalize-space(.//column[@name='Sub-programme Name'])">
95
                                    <xsl:variable name="fundingId"
96
                                        select="concat($funderId, '::', normalize-space(.//column[@name = 'Programme Name']), '::', normalize-space(.//column[@name='Sub-programme Name']))"/>
97
                                    <ROW table="project_fundingpath">
98
                                        <FIELD name="_dnet_resource_identifier_">
99
                                            <xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
100
                                        </FIELD>
101
                                        <FIELD name="funding">
102
                                            <xsl:value-of select="$fundingId"/>
103
                                        </FIELD>
104
                                        <FIELD name="project">
105
                                            <xsl:value-of select="$projectId"/>
106
                                        </FIELD>
107
                                        <FIELD name="startdate" type="date" format="dd/MM/yyyy">
108
                                            <xsl:value-of select="$startDate"/>
109
                                        </FIELD>
110
                                        <FIELD name="enddate" type="date" format="dd/MM/yyyy">
111
                                            <xsl:value-of select="$endDate"/>
112
                                        </FIELD>
113
                                    </ROW>
114
                                </xsl:when>
115
                                <xsl:otherwise>
116
                                    <xsl:variable name="fundingId"
117
                                        select="concat($funderId, '::', normalize-space(.//column[@name = 'Programme Name']))"/>
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
                                    </ROW>
135
                                </xsl:otherwise>
87 136

  
88
						<xsl:if test="normalize-space(.//column[@name='Research Body'])">
89
							<xsl:variable name="organizationId" select="concat($namespacePrefix, '::', normalize-space(.//column[@name='Research Body']))"/>
90
							<ROW table="dsm_organizations">
91
								<FIELD name="_dnet_resource_identifier_">
92
									<xsl:value-of select="$organizationId"/>
93
								</FIELD>
94
								<FIELD name="id">
95
									<xsl:value-of select="$organizationId"/>
96
								</FIELD>
97
								<FIELD name="legalname">
98
									<xsl:value-of select=".//column[@name='Research Body']"/>
99
								</FIELD>
100
								<FIELD name="country">IE</FIELD>
137
                            </xsl:choose>
101 138

  
102
								<FIELD name="collectedfrom">
103
									<xsl:value-of select="$varDataSourceId"/>
104
								</FIELD>
105
								<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
106
								<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
107
							</ROW>
108
							<ROW table="project_organization">
109
								<FIELD name="_dnet_resource_identifier_">
110
									<xsl:value-of select='concat($projectId, "@@", $organizationId)'/>
111
								</FIELD>
112
								<FIELD name="project">
113
									<xsl:value-of select="$projectId"/>
114
								</FIELD>
115
								<FIELD name="resporganization">
116
									<xsl:value-of select="$organizationId"/>
117
								</FIELD>
118
								<FIELD name="participantnumber" type="int">1</FIELD>
119
								<FIELD name="semanticclass">coordinator</FIELD>
120
							</ROW>
121
						</xsl:if>
122
					</xsl:if>
123
				</ROWS>
124
			</metadata>
125
		</record>
126
	</xsl:template>
139
                        </xsl:if>
127 140

  
141
                        <xsl:if test="normalize-space(.//column[@name = 'Research Body'])">
142
                            <xsl:variable name="organizationId"
143
                                select="concat($namespacePrefix, '::', normalize-space(.//column[@name = 'Research Body']))"/>
144
                            <ROW table="dsm_organizations">
145
                                <FIELD name="_dnet_resource_identifier_">
146
                                    <xsl:value-of select="$organizationId"/>
147
                                </FIELD>
148
                                <FIELD name="id">
149
                                    <xsl:value-of select="$organizationId"/>
150
                                </FIELD>
151
                                <FIELD name="legalname">
152
                                    <xsl:value-of select=".//column[@name = 'Research Body']"/>
153
                                </FIELD>
154
                                <FIELD name="country">IE</FIELD>
155

  
156
                                <FIELD name="collectedfrom">
157
                                    <xsl:value-of select="$varDataSourceId"/>
158
                                </FIELD>
159
                                <FIELD name="provenanceaction"
160
                                    >sysimport:crosswalk:entityregistry</FIELD>
161
                                <FIELD name="lastupdate" type="date">
162
                                    <xsl:value-of select="current-dateTime()"/>
163
                                </FIELD>
164
                            </ROW>
165
                            <ROW table="project_organization">
166
                                <FIELD name="_dnet_resource_identifier_">
167
                                    <xsl:value-of select='concat($projectId, "@@", $organizationId)'
168
                                    />
169
                                </FIELD>
170
                                <FIELD name="project">
171
                                    <xsl:value-of select="$projectId"/>
172
                                </FIELD>
173
                                <FIELD name="resporganization">
174
                                    <xsl:value-of select="$organizationId"/>
175
                                </FIELD>
176
                                <FIELD name="participantnumber" type="int">1</FIELD>
177
                                <FIELD name="semanticclass">coordinator</FIELD>
178
                            </ROW>
179
                        </xsl:if>
180
                    </xsl:if>
181
                </ROWS>
182
            </metadata>
183
        </record>
184
    </xsl:template>
185

  
128 186
</xsl:stylesheet>
187

  
129 188
					]]>
130 189
				</CODE>
131 190
			</SCRIPT>

Also available in: Unified diff