Project

General

Profile

« Previous | Next » 

Revision 57953

change the ANR 2 DB transformation to consider projects without title. This projects will be removed from the collected set

View differences:

modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/funders/anr2db.xml
35 35
    <xsl:variable name="Id">
36 36
        <xsl:value-of select="normalize-space(.//column[@isID='true'])"/>
37 37
    </xsl:variable>
38
    <xsl:template name="terminate">
39
        <xsl:message terminate="yes"> record is not compliant, transformation is
40
            interrupted. </xsl:message>
41
    </xsl:template>
38 42
    <xsl:template match="/">
39
        <record>
43
        <xsl:choose>
44
            <xsl:when test=".//column[@name = 'TitreUk (SIM et autres sources complémentaires)'] | .//column[@name = 'TitreFr (SIM et autres sources complémentaires)'] | .//column[@name = 'Projet Nom Complet']">
45
                <record>
40 46

  
41
            <xsl:copy-of select=".//*[local-name() = 'header']"/>
47
                    <xsl:copy-of select=".//*[local-name() = 'header']"/>
42 48

  
43
            <metadata>
44
                <ROWS>
45
                    <xsl:variable name="projectId"
46
                        select="concat($namespacePrefix, '::', $Id)"/>
47
                   <!-- <xsl:variable name="startDate"
49
                    <metadata>
50
                        <ROWS>
51
                            <xsl:variable name="projectId"
52
                                select="concat($namespacePrefix, '::', $Id)"/>
53
                            <!-- <xsl:variable name="startDate"
48 54
                        select="replace(.//column[@name = 'PROJECT STARTING DATE'], '/', '-')"/>
49 55
                    <xsl:variable name="endDate"
50 56
                        select="replace(.//column[@name = 'PROJECT COMPLETION DATE'], '/', '-')"/>
51 57
                   -->
52 58

  
53
                    <ROW table="projects">
54
                        <FIELD name="_dnet_resource_identifier_">
55
                            <xsl:value-of select="$projectId"/>
56
                        </FIELD>
57
                        <FIELD name="id">
58
                            <xsl:value-of select="$projectId"/>
59
                        </FIELD>
60
                        <FIELD name="code">
61
                            <xsl:value-of
62
                                select="$Id"/>
63
                        </FIELD>
64
                        <FIELD name="title">
65
                            <xsl:value-of select=".//column[@name = 'TitreUk (SIM et autres sources complémentaires)'] | .//column[@name = 'Projet Nom Complet']"/>
66
                        </FIELD>
59
                            <ROW table="projects">
60
                                <FIELD name="_dnet_resource_identifier_">
61
                                    <xsl:value-of select="$projectId"/>
62
                                </FIELD>
63
                                <FIELD name="id">
64
                                    <xsl:value-of select="$projectId"/>
65
                                </FIELD>
66
                                <FIELD name="code">
67
                                    <xsl:value-of
68
                                        select="$Id"/>
69
                                </FIELD>
70
                                <xsl:choose>
71
                                    <xsl:when test=".//column[@name = 'TitreUk (SIM et autres sources complémentaires)']">
72
                                        <FIELD name="title">
73
                                            <xsl:value-of select=".//column[@name = 'TitreUk (SIM et autres sources complémentaires)']"/>
74
                                        </FIELD>
75
                                    </xsl:when>
76
                                    <xsl:otherwise>
77
                                        <FIELD name="title">
78
                                            <xsl:value-of select=".//column[@name = 'TitreFr (SIM et autres sources complémentaires)'] | .//column[@name = 'Projet Nom Complet']"/>
79
                                        </FIELD>
80
                                    </xsl:otherwise>
81
                                </xsl:choose>
67 82

  
68
                            <FIELD name="acronym">
69
                                <xsl:value-of select=".//column[@name = 'Acronyme (SIM)'] | .//column[@name = 'Acronyme']"/>
70
                            </FIELD>
71
                     <!--   <FIELD name="startdate" type="date" format="{$dateFormat}">
83

  
84
                                <FIELD name="acronym">
85
                                    <xsl:value-of select=".//column[@name = 'Acronyme (SIM)'] | .//column[@name = 'Acronyme']"/>
86
                                </FIELD>
87
                                <!--   <FIELD name="startdate" type="date" format="{$dateFormat}">
72 88
                            <xsl:value-of select="$startDate"/>
73 89
                        </FIELD>
74 90
                        <FIELD name="enddate" type="date" format="{$dateFormat}">
75 91
                            <xsl:value-of select="$endDate"/>
76 92
                        </FIELD>-->
77 93

  
78
                        <FIELD name="collectedfrom">
79
                            <xsl:value-of select="$varDataSourceId"/>
80
                        </FIELD>
81
                        <FIELD name="provenanceactionclass"
82
                            >sysimport:crosswalk:entityregistry</FIELD>
83
                        <FIELD name="provenanceactionscheme">dnet:provenanceActions</FIELD>
84
                        <FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD>
85
                        <FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
86
                    </ROW>
87
                    <ROW table="project_fundingpath">
88
                        <FIELD name="_dnet_resource_identifier_">
89
                            <xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
90
                        </FIELD>
91
                        <FIELD name="funding">
92
                            <xsl:value-of select="$fundingId"/>
93
                        </FIELD>
94
                        <FIELD name="project">
95
                            <xsl:value-of select="$projectId"/>
96
                        </FIELD>
97
                       <!-- <FIELD name="startdate" type="date" format="{$dateFormat}">
94
                                <FIELD name="collectedfrom">
95
                                    <xsl:value-of select="$varDataSourceId"/>
96
                                </FIELD>
97
                                <FIELD name="provenanceactionclass"
98
                                    >sysimport:crosswalk:entityregistry</FIELD>
99
                                <FIELD name="provenanceactionscheme">dnet:provenanceActions</FIELD>
100
                                <FIELD name="oa_mandate_for_publications" type="boolean">false</FIELD>
101
                                <FIELD name="lastupdate" type="date"><xsl:value-of select="current-dateTime()"/></FIELD>
102
                            </ROW>
103
                            <ROW table="project_fundingpath">
104
                                <FIELD name="_dnet_resource_identifier_">
105
                                    <xsl:value-of select="concat($fundingId, '@@', $projectId)"/>
106
                                </FIELD>
107
                                <FIELD name="funding">
108
                                    <xsl:value-of select="$fundingId"/>
109
                                </FIELD>
110
                                <FIELD name="project">
111
                                    <xsl:value-of select="$projectId"/>
112
                                </FIELD>
113
                                <!-- <FIELD name="startdate" type="date" format="{$dateFormat}">
98 114
                            <xsl:value-of select="$startDate"/>
99 115
                        </FIELD>
100 116
                        <FIELD name="enddate" type="date" format="{$dateFormat}">
101 117
                            <xsl:value-of select="$endDate"/>
102 118
                        </FIELD> -->
103
                    </ROW>
119
                            </ROW>
104 120

  
105
                </ROWS>
106
            </metadata>
107
        </record>
121
                        </ROWS>
122
                    </metadata>
123
                </record>
124
            </xsl:when>
125
            <xsl:otherwise>
126
                <xsl:call-template name="terminate"></xsl:call-template>
127
            </xsl:otherwise>
128
        </xsl:choose>
129

  
108 130
    </xsl:template>
109 131
</xsl:stylesheet>
110 132
]]>

Also available in: Unified diff