Project

General

Profile

1
<RESOURCE_PROFILE>
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="_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>AKA to DB</TITLE>
14
                <CODE>
15
                    <![CDATA[
16
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
17
                xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:utils="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions"
18
                exclude-result-prefixes="xs" version="2.0">
19

    
20
    <xsl:param name="parentDatasourceId"/>
21
    <xsl:param name="namespacePrefix"/>
22
    <xsl:param name="quote">"</xsl:param>
23

    
24
    <xsl:variable name="funderID" select="concat($namespacePrefix, '::AKA')"/>
25

    
26

    
27
    <!--<xsl:variable name="stream" select="normalize-space(.//column[@name='FUNDING STREAM(S)'])"/>-->
28
    <xsl:variable name="fundingID">
29

    
30
        <xsl:value-of select="$funderID"/>
31
    </xsl:variable>
32

    
33
    <xsl:variable name="projectId" select="concat($namespacePrefix, '::',  normalize-space(.//column[@name='Decision No.']))"/>
34

    
35
    <xsl:variable name="fundingPeriod" select="tokenize(.//column[@name='Funding period'],'-')"/>
36
    <xsl:variable name="startDate" select="normalize-space($fundingPeriod[1])"/>
37
    <xsl:variable name="endDate" select="normalize-space($fundingPeriod[2])"/>
38

    
39
    <xsl:variable name="dateFormat" select="string('dd.MM.yyyy')"/>
40
    <xsl:variable name="projectTitle" select="normalize-space(.//column[@name='Project title'])"/>
41

    
42
    <xsl:template match="/">
43
        <record>
44

    
45
            <xsl:copy-of select=".//*[local-name()='header']"/>
46
            <metadata>
47
                <xsl:if test="string-length($projectTitle) &gt; 0 and string-length($projectId) &gt; 0">
48
                    <ROWS>
49
                        <ROW table="projects">
50
                            <FIELD name="_dnet_resource_identifier_">
51
                                <xsl:value-of select="$projectId"/>
52
                            </FIELD>
53
                            <FIELD name="id">
54
                                <xsl:value-of select="$projectId"/>
55
                            </FIELD>
56
                            <FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
57
                            <FIELD name="code">
58
                                <xsl:value-of select="normalize-space(.//column[@name='Decision No.'])"/>
59
                            </FIELD>
60
                            <FIELD name="startdate" type="date" format="{$dateFormat}">
61
                                <xsl:value-of select="$startDate"/>
62
                            </FIELD>
63
                            <FIELD name="enddate" type="date" format="{$dateFormat}">
64
                                <xsl:value-of select="$endDate"/>
65
                            </FIELD>
66
                            <FIELD name="title">
67
                                <xsl:value-of select="$projectTitle"/>
68
                            </FIELD>
69
                            <FIELD name="call_identifier">
70
                                <xsl:value-of select=".//column[@name='Call']"/>
71
                            </FIELD>
72
                            <FIELD name="optional1">
73
                                <xsl:value-of select="concat(.//column[@name='Funding'], ' €')"/>
74
                            </FIELD>
75
                            <FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
76
                            <FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
77
                            <FIELD name="collectedfrom">
78
                                <xsl:value-of select="$parentDatasourceId"/>
79
                            </FIELD>
80
                            <FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD>
81
                        </ROW>
82

    
83
                        <ROW table="project_fundingpath">
84
                            <FIELD name="_dnet_resource_identifier_">
85
                                <xsl:value-of select="concat($fundingID,'@@', $projectId)"/>
86
                            </FIELD>
87
                            <FIELD name="funding">
88
                                <xsl:value-of select="$fundingID"/>
89
                            </FIELD>
90
                            <FIELD name="project">
91
                                <xsl:value-of select="$projectId"/>
92
                            </FIELD>
93
                            <FIELD name="startdate" type="date" format="{$dateFormat}">
94
                                <xsl:value-of select="$startDate"/>
95
                            </FIELD>
96
                            <FIELD name="enddate" type="date" format="{$dateFormat}">
97
                                <xsl:value-of select="$endDate"/>
98
                            </FIELD>
99
                        </ROW>
100
                        <xsl:variable name="organizationId" select="concat($namespacePrefix,'::',utils:md5(normalize-space(.//column[@name='Organisation'])))"/>
101
                        <ROW table = "dsm_organizations">
102
                            <FIELD name="_dnet_resource_identifier_">
103
                                <xsl:value-of select="$organizationId"/>
104
                            </FIELD>
105
                            <FIELD name="id">
106
                                <xsl:value-of select="$organizationId"/>
107
                            </FIELD>
108
                            <FIELD name="legalname">
109
                                <xsl:value-of select="normalize-space(.//column[@name='Organisation'])"/>
110
                            </FIELD>
111
                            <FIELD name="collectedfrom">
112
                                <xsl:value-of select="$parentDatasourceId"/>
113
                            </FIELD>
114
                            <FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
115
                            <FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
116
                        </ROW>
117
                        <ROW table="project_organization">
118
                            <FIELD name="_dnet_resource_identifier_">
119
                                <xsl:value-of select='concat($projectId, "@@", $organizationId)'/>
120
                            </FIELD>
121
                            <FIELD name="project">
122
                                <xsl:value-of select="$projectId"/>
123
                            </FIELD>
124
                            <FIELD name="organization">
125
                                <xsl:value-of select="$organizationId"/>
126
                            </FIELD>
127
                            <FIELD name="role">coordinator</FIELD>
128
                        </ROW>
129
                    </ROWS>
130
                </xsl:if>
131
            </metadata>
132
        </record>
133

    
134
    </xsl:template>
135
</xsl:stylesheet>
136
                    ]]>
137
                </CODE>
138
            </SCRIPT>
139
        </CONFIGURATION>
140
        <STATUS/>
141
        <SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
142
    </BODY>
143
</RESOURCE_PROFILE>
(1-1/20)