Project

General

Profile

1
<RESOURCE_PROFILE>
2
	<HEADER>
3
		<RESOURCE_IDENTIFIER value="bc8d96f0-f35d-4791-8da9-7bc9b788b978_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>ARC to DB</TITLE>
14
				<CODE>
15
					<![CDATA[
16
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
17
                xmlns:ands="http://ands.org.au/standards/rif-cs/registryObjects">
18

    
19
	<xsl:output indent="yes"/>
20

    
21
	<xsl:param name="varDatasourceId"/>
22

    
23
	<xsl:template match="/">
24
		<record>
25
			<xsl:copy-of select=".//*[local-name()='header']"/>
26
			<metadata>
27
				<ROWS>
28
					<xsl:for-each select="//ands:registryObject[@group='Australian Research Council']/ands:activity[@type='grant']">
29
						<xsl:variable name="projectId" select="concat('arc_________::', normalize-space(./ands:identifier[@type='arc']))"/>
30
						<xsl:variable name="fundingId">
31
							<xsl:choose>
32
								<xsl:when test="string-length(./ands:description[@type='fundingScheme']) &gt; 0">
33
									<xsl:value-of select="concat('arc_________::ARC::', normalize-space(./ands:description[@type='fundingScheme']))"/>
34
								</xsl:when>
35
								<xsl:otherwise>
36
									<xsl:value-of select="string('arc_________::ARC')"/>
37
								</xsl:otherwise>
38
							</xsl:choose>
39
						</xsl:variable>
40

    
41
						<ROW table="projects">
42
							<FIELD name="_dnet_resource_identifier_">
43
								<xsl:value-of select="$projectId"/>
44
							</FIELD>
45
							<FIELD name="id">
46
								<xsl:value-of select="$projectId"/>
47
							</FIELD>
48
							<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
49
							<FIELD name="code">
50
								<xsl:value-of select="normalize-space(.//ands:identifier[@type='arc'])"/>
51
							</FIELD>
52
							<FIELD name="title">
53
								<xsl:value-of select="./ands:name[@type='primary']/ands:namePart"/>
54
							</FIELD>
55
							<FIELD name="websiteurl">
56
								<xsl:value-of select="./ands:identifier[@type='purl']"/>
57
							</FIELD>
58

    
59
							<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']">
60
								<FIELD name="startdate" type="date" format="dd-MM-yyyy">
61
									<xsl:value-of select="concat('01-01-', normalize-space(.))"/>
62
								</FIELD>
63
							</xsl:for-each>
64
							<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']">
65
								<FIELD name="enddate" type="date" format="dd-MM-yyyy">
66
									<xsl:value-of select="concat('31-12-', normalize-space(.))"/>
67
								</FIELD>
68
							</xsl:for-each>
69

    
70
							<xsl:variable name="keywords">
71
								<xsl:for-each select="./ands:subject[@type='local']">
72
									<xsl:if test="position() != 1">,</xsl:if>
73
									<xsl:value-of select="."/>
74
								</xsl:for-each>
75
							</xsl:variable>
76
							<FIELD name="keywords">
77
								<xsl:value-of select="normalize-space($keywords)"/>
78
							</FIELD>
79
							<FIELD name="collectedfrom">
80
								<xsl:value-of select="$varDataSourceId"/>
81
							</FIELD>
82
							<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
83
							<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
84
						</ROW>
85

    
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
							<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']">
97
								<FIELD name="startdate" type="date" format="dd-MM-yyyy">
98
									<xsl:value-of select="concat('01-01-', normalize-space(.))"/>
99
								</FIELD>
100
							</xsl:for-each>
101
							<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']">
102
								<FIELD name="enddate" type="date" format="dd-MM-yyyy">
103
									<xsl:value-of select="concat('31-12-', normalize-space(.))"/>
104
								</FIELD>
105
							</xsl:for-each>
106
						</ROW>
107

    
108
					</xsl:for-each>
109
				</ROWS>
110
			</metadata>
111
		</record>
112
	</xsl:template>
113
</xsl:stylesheet>
114
		]]>
115
		</CODE>
116
		</SCRIPT>
117
		</CONFIGURATION>
118
<STATUS/>
119
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
120
		</BODY>
121
		</RESOURCE_PROFILE>
(2-2/22)