Project

General

Profile

1
<RESOURCE_PROFILE>
2
	<HEADER>
3
		<RESOURCE_IDENTIFIER value="5e0cef7e-2099-4a19-ad93-36c212486279_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>TUBITAK projects 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="2.0">
18

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

    
23
	<xsl:variable name="funderID" select="concat('tubitakf____', '::tubitak')"/>
24

    
25

    
26
	<xsl:variable name="stream" select="normalize-space(.//column[@name='FUNDING STREAM(S)'])"/>
27
	<xsl:variable name="fundingID">
28
		<xsl:choose>
29
			<xsl:when test="string-length($stream) &gt; 0">
30
				<xsl:value-of select="concat($funderID, '::', $stream)"/>
31
			</xsl:when>
32
			<xsl:otherwise>
33
				<xsl:value-of select="$funderID"/>
34
			</xsl:otherwise>
35
		</xsl:choose>
36

    
37
	</xsl:variable>
38

    
39
	<xsl:variable name="projectId" select="concat($namespacePrefix, '::',  normalize-space(.//column[@name='PROJECT IDENTIFIER']))"/>
40

    
41

    
42
	<xsl:variable name="startDate" select="translate(.//column[@name='START DATE'],'/\','--')"/>
43
	<xsl:variable name="endDate" select="translate(.//column[@name='END DATE'],'/\','--')"/>
44

    
45
	<xsl:variable name="dateFormat" select="string('dd-MM-yyyy')"/>
46
	<xsl:variable name="projectTitle" select="normalize-space(.//column[@name='PROJECT TITLE or ACRONYM'])"/>
47

    
48
	<xsl:template match="/">
49
		<record>
50

    
51
			<xsl:copy-of select=".//*[local-name()='header']"/>
52
			<metadata>
53
				<ROWS>
54
					<xsl:if test="string-length($projectTitle) &gt; 0 and string-length($projectId) &gt; 0">
55
						<ROW table="projects">
56
							<FIELD name="_dnet_resource_identifier_">
57
								<xsl:value-of select="$projectId"/>
58
							</FIELD>
59
							<FIELD name="id">
60
								<xsl:value-of select="$projectId"/>
61
							</FIELD>
62
							<FIELD name="code">
63
								<xsl:value-of select="normalize-space(.//column[@name='PROJECT IDENTIFIER'])"/>
64
							</FIELD>
65
							<FIELD name="startdate" type="date" format="{$dateFormat}">
66
								<xsl:value-of select="$startDate"/>
67
							</FIELD>
68
							<FIELD name="enddate" type="date" format="{$dateFormat}">
69
								<xsl:value-of select="$endDate"/>
70
							</FIELD>
71
							<FIELD name="title">
72
								<xsl:value-of select="$projectTitle"/>
73
							</FIELD>
74

    
75

    
76
							<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
77
							<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
78
							<FIELD name="collectedfrom">
79
								<xsl:value-of select="$varDataSourceId"/>
80
							</FIELD>
81

    
82
							<FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD>
83
							<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
84
						</ROW>
85
					</xsl:if>
86
					<ROW table="project_fundingpath">
87
						<FIELD name="_dnet_resource_identifier_">
88
							<xsl:value-of select="concat($fundingID,'@@', $projectId)"/>
89
						</FIELD>
90
						<FIELD name="funding">
91
							<xsl:value-of select="$fundingID"/>
92
						</FIELD>
93
						<FIELD name="project">
94
							<xsl:value-of select="$projectId"/>
95
						</FIELD>
96
						<FIELD name="startdate" type="date" format="{$dateFormat}">
97
							<xsl:value-of select="$startDate"/>
98
						</FIELD>
99
						<FIELD name="enddate" type="date" format="{$dateFormat}">
100
							<xsl:value-of select="$endDate"/>
101
						</FIELD>
102
					</ROW>
103

    
104

    
105
				</ROWS>
106
			</metadata>
107
		</record>
108
	</xsl:template>
109
</xsl:stylesheet>
110
				</CODE>
111
			</SCRIPT>
112
		</CONFIGURATION>
113
		<STATUS/>
114
		<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
115
	</BODY>
116
</RESOURCE_PROFILE>
(21-21/22)