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="summary">
80
                                <xsl:value-of select="//ands:description[@type='brief']"/>
81
                            </FIELD>
82
                            <xsl:if test="//ands:description[@type='fundingAmount']">
83
                                <FIELD name="fundedamount" type="float">
84
                                    <xsl:value-of select="translate(//ands:description[@type='fundingAmount'],'$,','')"/>
85
                                </FIELD>
86
                                <FIELD name="currency">
87
                                    <xsl:value-of select="string('AUD')"/>
88
                                </FIELD>
89
                            </xsl:if>
90
							<FIELD name="collectedfrom">
91
								<xsl:value-of select="$varDatasourceId"/>
92
							</FIELD>
93
							<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
94
							<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
95
						</ROW>
96

    
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
							<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']">
108
								<FIELD name="startdate" type="date" format="dd-MM-yyyy">
109
									<xsl:value-of select="concat('01-01-', normalize-space(.))"/>
110
								</FIELD>
111
							</xsl:for-each>
112
							<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']">
113
								<FIELD name="enddate" type="date" format="dd-MM-yyyy">
114
									<xsl:value-of select="concat('31-12-', normalize-space(.))"/>
115
								</FIELD>
116
							</xsl:for-each>
117
						</ROW>
118

    
119
					</xsl:for-each>
120
				</ROWS>
121
			</metadata>
122
		</record>
123
	</xsl:template>
124
</xsl:stylesheet>
125
]]>
126
		</CODE>
127
		</SCRIPT>
128
		</CONFIGURATION>
129
<STATUS/>
130
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
131
		</BODY>
132
		</RESOURCE_PROFILE>
(2-2/26)