Project

General

Profile

1
<RESOURCE_PROFILE>
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="890e0f3f-ed99-46a2-a3b4-b0feabb760e3_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>DFG to DB</TITLE>
14
                <CODE>
15
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:utils="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions">
16

    
17
    <xsl:param name="varDataSourceId"/>
18
    <xsl:variable name="namespacePrefix" select="string('dfgf________')"/>
19

    
20
    <xsl:variable name="dateFormat" select="string('yyyy')"/>
21
    <xsl:variable name="funderID" select="concat($namespacePrefix, '::DFG')"/>
22
    <xsl:variable name="fundingId">
23
        <xsl:value-of select="concat($funderID,'::',utils:md5(.//column[@name='Funding Programme']))"/>
24
    </xsl:variable>
25

    
26

    
27
    <xsl:template match="/">
28
        <record>
29

    
30
            <xsl:copy-of select=".//*[local-name()='header']"/>
31

    
32
            <metadata>
33
                <ROWS>
34
                    <xsl:variable name="projectId" select="concat($namespacePrefix, '::',  normalize-space(.//column[@name='Project ID']))"/>
35
                    <xsl:variable name="startDate" select="replace(.//column[@name='Funding Start Year'],'/','-')"/>
36

    
37
                    <ROW table="projects">
38

    
39
                        <FIELD name="_dnet_resource_identifier_">
40
                            <xsl:value-of select="$projectId"/>
41
                        </FIELD>
42
                        <FIELD name="id">
43
                            <xsl:value-of select="$projectId"/>
44
                        </FIELD>
45
                        <FIELD name="code">
46
                            <xsl:value-of select="normalize-space(.//column[@name='Project ID'])"/>
47
                        </FIELD>
48
                        <FIELD name="title">
49
                            <xsl:value-of select=".//column[@name='Project Title English**']"/>
50
                        </FIELD>
51
                        <FIELD name="startdate" type="date" format="{$dateFormat}">
52
                            <xsl:value-of select="$startDate"/>
53
                        </FIELD>
54
                        <FIELD name="collectedfrom">
55
                            <xsl:value-of select="$varDataSourceId"/>
56
                        </FIELD>
57
                        <FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
58
                        <FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
59
                        <FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD>
60
                         <FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
61
                    </ROW>
62
                    <ROW table="project_fundingpath">
63
                        <FIELD name="_dnet_resource_identifier_">
64
                            <xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
65
                        </FIELD>
66
                        <FIELD name="funding">
67
                            <xsl:value-of select="$fundingId"/>
68
                        </FIELD>
69
                        <FIELD name="project">
70
                            <xsl:value-of select="$projectId"/>
71
                        </FIELD>
72
                        <FIELD name="startdate" type="date" format="{$dateFormat}">
73
                            <xsl:value-of select="$startDate"/>
74
                        </FIELD>
75

    
76
                    </ROW>
77
                </ROWS>
78
            </metadata>
79
        </record>
80
    </xsl:template>
81
</xsl:stylesheet>
82
        </CODE>
83
        </SCRIPT>
84
        </CONFIGURATION>
85
<STATUS/>
86
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
87
        </BODY>
88
        </RESOURCE_PROFILE>
(8-8/22)