Project

General

Profile

« Previous | Next » 

Revision 52632

Mapping for journaltitles and irdb are now TDS rules and not anymore xslt in the classpath

View differences:

modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt/journaltitles2db.xsl
1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
                xmlns:stringUtils="org.apache.commons.lang.StringUtils"
4
                version="1.0">
5

  
6
	<xsl:param name="parentDatasourceId"/>
7
	<xsl:param name="namespacePrefix"/>
8

  
9
	<xsl:template match="/">
10
		<record>
11

  
12
			<xsl:copy-of select=".//*[local-name()='header']"/>
13
			<metadata>
14
				<xsl:variable name="rid" select="normalize-space(//column[./@name='ISSN'])"/>
15
				<xsl:variable name="datasourceId" select="concat($namespacePrefix, '::', $rid)"/>
16
				<xsl:variable name="ISSNNS" select="stringUtils:replace($rid,'-','')"/>
17

  
18
				<ROWS>
19
					<ROW table="dsm_datasources">
20
						<FIELD name="id">
21
							<xsl:value-of select="$datasourceId"/>
22
						</FIELD>
23
						<FIELD name="_dnet_resource_identifier_">
24
							<xsl:value-of select="$datasourceId"/>
25
						</FIELD>
26
						<FIELD name="officialname">
27
							<xsl:value-of select="normalize-space(//column[./@name='Title'])"/>
28
						</FIELD>
29
						<FIELD name="englishname">
30
							<xsl:value-of select="normalize-space(//column[./@name='Title'])"/>
31
						</FIELD>
32
						<FIELD name="od_contenttypes">
33
							<xsl:value-of select="string('Journal articles')"/>
34
						</FIELD>
35
						<FIELD name="languages">
36
							<xsl:value-of select="normalize-space(//column[./@name='Language'])"/>
37
						</FIELD>
38
						<FIELD name="issn">
39
							<xsl:value-of select="normalize-space(//column[./@name='ISSN'])"/>
40
						</FIELD>
41
						<FIELD name="eissn">
42
							<xsl:value-of select="normalize-space(//column[./@name='EISSN'])"/>
43
						</FIELD>
44
						<FIELD name="description">
45
							<xsl:value-of select="normalize-space(//column[./@name='Keyword'])"/>
46
						</FIELD>
47
						<FIELD name="websiteurl">
48
							<xsl:value-of select="normalize-space(//column[./@name='address'])"/>
49
						</FIELD>
50
						<FIELD name="namespaceprefix">
51
							<xsl:value-of select="concat('ojs_', $ISSNNS)"/>
52
						</FIELD>
53
						<FIELD name="typology">pubsrepository::journal</FIELD>
54
						<FIELD name="collectedfrom">
55
							<xsl:value-of select="$parentDatasourceId"/>
56
						</FIELD>
57
						<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
58
					</ROW>
59
				</ROWS>
60
			</metadata>
61
		</record>
62
	</xsl:template>
63

  
64
</xsl:stylesheet>
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt/irdb2db.xsl
1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
                version="1.0">
4

  
5
	<xsl:param name="parentDatasourceId"/>
6
	<xsl:param name="namespacePrefix"/>
7

  
8
	<xsl:template match="/">
9
		<xsl:variable name="oName" select="normalize-space(//column[./@name='1'])"/>
10

  
11
		<xsl:choose>
12
			<xsl:when test="string-length($oName) &gt; 0">
13
				<record>
14
					<xsl:copy-of select=".//*[local-name()='header']"/>
15
					<metadata>
16
						<xsl:variable name="rid" select="normalize-space(//column[./@name='journalid'])"/>
17
						<xsl:variable name="datasourceId" select="concat($namespacePrefix, '::', $rid)"/>
18
						<xsl:variable name="namespacePrefix" select='format-number($rid, "00000")'/>
19

  
20
						<ROWS>
21
							<ROW table="dsm_datasources">
22
								<FIELD name="id">
23
									<xsl:value-of select="$datasourceId"/>
24
								</FIELD>
25
								<FIELD name="_dnet_resource_identifier_">
26
									<xsl:value-of select="$datasourceId"/>
27
								</FIELD>
28
								<FIELD name="officialname">
29
									<xsl:value-of select="$oName"/>
30
								</FIELD>
31
								<FIELD name="englishname">
32
									<xsl:value-of select="$oName"/>
33
								</FIELD>
34
								<FIELD name="od_contenttypes">
35
									<xsl:value-of select="string('Journal articles')"/>
36
								</FIELD>
37
								<FIELD name="websiteurl">
38
									<xsl:value-of select="normalize-space(//column[./@name='2'])"/>
39
								</FIELD>
40
								<FIELD name="namespaceprefix">
41
									<xsl:value-of select="concat('irdb___',$namespacePrefix)"/>
42
								</FIELD>
43
								<FIELD name="typology">pubsrepository::journal</FIELD>
44
								<FIELD name="collectedfrom">
45
									<xsl:value-of select="$parentDatasourceId"/>
46
								</FIELD>
47
								<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
48
							</ROW>
49
						</ROWS>
50
					</metadata>
51
				</record>
52
			</xsl:when>
53
			<xsl:otherwise>
54
				<JUNK/>
55
			</xsl:otherwise>
56
		</xsl:choose>
57
	</xsl:template>
58
</xsl:stylesheet>
modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/datasources/journaltitles2db.xml
1
<RESOURCE_PROFILE>
2
	<HEADER>
3
		<RESOURCE_IDENTIFIER value="a0588a13-4085-46fd-9542-a97a91577cea_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
4
		<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
5
		<RESOURCE_KIND value="TransformationRuleDSResources"/>
6
		<RESOURCE_URI value=""/>
7
		<DATE_OF_CREATION value="2018-07-02T11:15:30+00:00"/>
8
	</HEADER>
9
	<BODY>
10
		<CONFIGURATION>
11
			<IMPORTED/>
12
			<SCRIPT>
13
				<TITLE>JOURNALTITLES 2 DB</TITLE>
14
				<CODE>
15
					<![CDATA[
16
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
17
                xmlns:stringUtils="org.apache.commons.lang.StringUtils"
18
                version="1.0">
19

  
20
	<xsl:param name="varDataSourceId"/>
21

  
22
	<xsl:template match="/">
23
	    <xsl:variable name="namespacePrefix"
24
             select="normalize-space(//oaf:datasourceprefix)" />
25
		<record>
26

  
27
			<xsl:copy-of select=".//*[local-name()='header']"/>
28
			<metadata>
29
				<xsl:variable name="rid" select="normalize-space(//column[./@name='ISSN'])"/>
30
				<xsl:variable name="datasourceId" select="concat($namespacePrefix, '::', $rid)"/>
31
				<xsl:variable name="ISSNNS" select="stringUtils:replace($rid,'-','')"/>
32

  
33
				<ROWS>
34
					<ROW table="dsm_datasources">
35
						<FIELD name="id">
36
							<xsl:value-of select="$datasourceId"/>
37
						</FIELD>
38
						<FIELD name="_dnet_resource_identifier_">
39
							<xsl:value-of select="$datasourceId"/>
40
						</FIELD>
41
						<FIELD name="officialname">
42
							<xsl:value-of select="normalize-space(//column[./@name='Title'])"/>
43
						</FIELD>
44
						<FIELD name="englishname">
45
							<xsl:value-of select="normalize-space(//column[./@name='Title'])"/>
46
						</FIELD>
47
						<FIELD name="od_contenttypes">
48
							<xsl:value-of select="string('Journal articles')"/>
49
						</FIELD>
50
						<FIELD name="languages">
51
							<xsl:value-of select="normalize-space(//column[./@name='Language'])"/>
52
						</FIELD>
53
						<FIELD name="issn">
54
							<xsl:value-of select="normalize-space(//column[./@name='ISSN'])"/>
55
						</FIELD>
56
						<FIELD name="eissn">
57
							<xsl:value-of select="normalize-space(//column[./@name='EISSN'])"/>
58
						</FIELD>
59
						<FIELD name="description">
60
							<xsl:value-of select="normalize-space(//column[./@name='Keyword'])"/>
61
						</FIELD>
62
						<FIELD name="websiteurl">
63
							<xsl:value-of select="normalize-space(//column[./@name='address'])"/>
64
						</FIELD>
65
						<FIELD name="namespaceprefix">
66
							<xsl:value-of select="concat('ojs_', $ISSNNS)"/>
67
						</FIELD>
68
						<FIELD name="typology">pubsrepository::journal</FIELD>
69
						<FIELD name="collectedfrom">
70
							<xsl:value-of select="$varDataSourceId"/>
71
						</FIELD>
72
						<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
73
					</ROW>
74
				</ROWS>
75
			</metadata>
76
		</record>
77
	</xsl:template>
78

  
79
</xsl:stylesheet>
80
		]]>
81
				</CODE>
82
			</SCRIPT>
83
		</CONFIGURATION>
84
		<STATUS/>
85
		<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
86
	</BODY>
87
</RESOURCE_PROFILE>
modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/datasources/irdb2db.xml
1
<RESOURCE_PROFILE>
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="5f71dbb8-2284-4e9f-8fa0-94e849932e3b_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
4
        <RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
5
        <RESOURCE_KIND value="TransformationRuleDSResources"/>
6
        <RESOURCE_URI value=""/>
7
        <DATE_OF_CREATION value="2018-07-02T11:15:30+00:00"/>
8
    </HEADER>
9
    <BODY>
10
        <CONFIGURATION>
11
            <IMPORTED/>
12
            <SCRIPT>
13
                <TITLE>IRDB 2 DB</TITLE>
14
                <CODE>
15
                    <![CDATA[
16
                    <?xml version="1.0" encoding="UTF-8"?>
17
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
18
                version="1.0">
19

  
20
	<xsl:param name="varDataSourceId"/>
21
	<xsl:variable name="namespacePrefix" select="string('irdb________')"/>
22

  
23

  
24
	<xsl:template match="/">
25
		<xsl:variable name="oName" select="normalize-space(//column[./@name='1'])"/>
26

  
27
		<xsl:choose>
28
			<xsl:when test="string-length($oName) &gt; 0">
29
				<record>
30
					<xsl:copy-of select=".//*[local-name()='header']"/>
31
					<metadata>
32
						<xsl:variable name="rid" select="normalize-space(//column[./@name='journalid'])"/>
33
						<xsl:variable name="datasourceId" select="concat($namespacePrefix, '::', $rid)"/>
34
						<xsl:variable name="namespacePrefix" select='format-number($rid, "00000")'/>
35

  
36
						<ROWS>
37
							<ROW table="dsm_datasources">
38
								<FIELD name="id">
39
									<xsl:value-of select="$datasourceId"/>
40
								</FIELD>
41
								<FIELD name="_dnet_resource_identifier_">
42
									<xsl:value-of select="$datasourceId"/>
43
								</FIELD>
44
								<FIELD name="officialname">
45
									<xsl:value-of select="$oName"/>
46
								</FIELD>
47
								<FIELD name="englishname">
48
									<xsl:value-of select="$oName"/>
49
								</FIELD>
50
								<FIELD name="od_contenttypes">
51
									<xsl:value-of select="string('Journal articles')"/>
52
								</FIELD>
53
								<FIELD name="websiteurl">
54
									<xsl:value-of select="normalize-space(//column[./@name='2'])"/>
55
								</FIELD>
56
								<FIELD name="namespaceprefix">
57
									<xsl:value-of select="concat('irdb___',$namespacePrefix)"/>
58
								</FIELD>
59
								<FIELD name="typology">pubsrepository::journal</FIELD>
60
								<FIELD name="collectedfrom">
61
									<xsl:value-of select="$varDataSourceId"/>
62
								</FIELD>
63
								<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
64
							</ROW>
65
						</ROWS>
66
					</metadata>
67
				</record>
68
			</xsl:when>
69
			<xsl:otherwise>
70
				<JUNK/>
71
			</xsl:otherwise>
72
		</xsl:choose>
73
	</xsl:template>
74
</xsl:stylesheet>
75

  
76
		]]>
77
                </CODE>
78
            </SCRIPT>
79
        </CONFIGURATION>
80
        <STATUS/>
81
        <SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
82
    </BODY>
83
</RESOURCE_PROFILE>

Also available in: Unified diff