Project

General

Profile

1 52327 alessia.ba
<RESOURCE_PROFILE>
2
	<HEADER>
3 52416 alessia.ba
		<RESOURCE_IDENTIFIER value="bc8d96f0-f35d-4791-8da9-7bc9b788b978_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>ARC to DB</TITLE>
14
				<CODE>
15 53218 miriam.bag
					<![CDATA[
16 52327 alessia.ba
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
17 48139 alessia.ba
                xmlns:ands="http://ands.org.au/standards/rif-cs/registryObjects">
18
19 37863 alessia.ba
	<xsl:output indent="yes"/>
20 48139 alessia.ba
21 52370 miriam.bag
	<xsl:param name="varDatasourceId"/>
22 48139 alessia.ba
23 35420 michele.ar
	<xsl:template match="/">
24 48960 claudio.at
		<record>
25 35420 michele.ar
			<xsl:copy-of select=".//*[local-name()='header']"/>
26
			<metadata>
27
				<ROWS>
28 37863 alessia.ba
					<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 41476 claudio.at
						<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 37863 alessia.ba
						<ROW table="projects">
42 48139 alessia.ba
							<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 52335 alessia.ba
							<FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
49 48139 alessia.ba
							<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 37863 alessia.ba
							<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']">
60 48139 alessia.ba
								<FIELD name="startdate" type="date" format="dd-MM-yyyy">
61
									<xsl:value-of select="concat('01-01-', normalize-space(.))"/>
62
								</FIELD>
63 37863 alessia.ba
							</xsl:for-each>
64
							<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']">
65 48139 alessia.ba
								<FIELD name="enddate" type="date" format="dd-MM-yyyy">
66
									<xsl:value-of select="concat('31-12-', normalize-space(.))"/>
67
								</FIELD>
68 37863 alessia.ba
							</xsl:for-each>
69 48139 alessia.ba
70 37863 alessia.ba
							<xsl:variable name="keywords">
71
								<xsl:for-each select="./ands:subject[@type='local']">
72 48139 alessia.ba
									<xsl:if test="position() != 1">,</xsl:if>
73 37863 alessia.ba
									<xsl:value-of select="."/>
74
								</xsl:for-each>
75
							</xsl:variable>
76 48139 alessia.ba
							<FIELD name="keywords">
77
								<xsl:value-of select="normalize-space($keywords)"/>
78
							</FIELD>
79 57276 miriam.bag
							<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 48139 alessia.ba
							<FIELD name="collectedfrom">
91 53888 alessia.ba
								<xsl:value-of select="$varDatasourceId"/>
92 48139 alessia.ba
							</FIELD>
93 37863 alessia.ba
							<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
94
							<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
95 35420 michele.ar
						</ROW>
96 48139 alessia.ba
97 35420 michele.ar
						<ROW table="project_fundingpath">
98 48139 alessia.ba
							<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 37863 alessia.ba
							<xsl:for-each select="./ands:existenceDates/ands:startDate[@dateFormat='W3CDTF']">
108 48139 alessia.ba
								<FIELD name="startdate" type="date" format="dd-MM-yyyy">
109
									<xsl:value-of select="concat('01-01-', normalize-space(.))"/>
110
								</FIELD>
111 37863 alessia.ba
							</xsl:for-each>
112
							<xsl:for-each select="./ands:existenceDates/ands:endDate[@dateFormat='W3CDTF']">
113 48139 alessia.ba
								<FIELD name="enddate" type="date" format="dd-MM-yyyy">
114
									<xsl:value-of select="concat('31-12-', normalize-space(.))"/>
115
								</FIELD>
116 37863 alessia.ba
							</xsl:for-each>
117 35420 michele.ar
						</ROW>
118 48139 alessia.ba
119 35420 michele.ar
					</xsl:for-each>
120
				</ROWS>
121
			</metadata>
122
		</record>
123
	</xsl:template>
124
</xsl:stylesheet>
125 53218 miriam.bag
]]>
126 52327 alessia.ba
		</CODE>
127
		</SCRIPT>
128
		</CONFIGURATION>
129
<STATUS/>
130
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
131
		</BODY>
132
		</RESOURCE_PROFILE>