Project

General

Profile

« Previous | Next » 

Revision 61898

View differences:

modules/dnet-isti/trunk/src/main/resources/scripts/affilitions/pimpa_affiliations.xslt
1
<?xml version="1.0" encoding="UTF-8"?>
2

  
3
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
4
    <xsl:output method="text"/>
5
    
6
    <xsl:variable name="sq">'</xsl:variable>
7
    
8
    <xsl:template match="/">
9
        <xsl:for-each select="//Result/item">
10
            <xsl:variable name="year" select="./anno"/>
11
            <xsl:for-each select="./personale/item">
12
                <xsl:variable name="pid" select="concat('matricola:',./matricola)"/>
13
                <xsl:for-each select="./labs/item">
14
                    <xsl:variable name="gid" select="./sigla"/>
15
                    <xsl:value-of select="concat('INSERT INTO affiliations_temp(pid,gid,year) VALUES (' ,$sq, $pid, $sq, ',', $sq, $gid, $sq, ',', $year, ');&#xa;')"/>
16
                </xsl:for-each>
17
            </xsl:for-each>
18
        </xsl:for-each>
19
        
20
    </xsl:template>
21
    
22
    
23
</xsl:stylesheet>
modules/dnet-isti/trunk/src/main/resources/scripts/affilitions/affiliations_con_matricola.xslt
1
<?xml version="1.0" encoding="UTF-8"?>
2

  
3
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
4
    <xsl:output method="text"/>
5
    
6
    <xsl:variable name="sq">'</xsl:variable>
7
    
8
    <xsl:template match="/">
9
        <xsl:for-each select="//Result/item">
10
            <xsl:variable name="year" select="./anno"/>
11
            <xsl:for-each select="./personale/item[string-length(./matricola) &gt; 0]">
12
                <xsl:variable name="pid" select="concat('matricola:',./matricola)"/>
13
                <xsl:for-each select="./labs/item">
14
                    <xsl:variable name="gid" select="./sigla"/>
15
                    <xsl:value-of select="concat('INSERT INTO affiliations_temp(pid,gid,year) VALUES (' ,$sq, $pid, $sq, ',', $sq, $gid, $sq, ',', $year, ');&#xa;')"/>
16
                </xsl:for-each>
17
            </xsl:for-each>
18
        </xsl:for-each>
19
        
20
    </xsl:template>
21
    
22
    
23
</xsl:stylesheet>
modules/dnet-isti/trunk/src/main/resources/scripts/affilitions/affiliations_senza_matricola.xslt
1
<?xml version="1.0" encoding="UTF-8"?>
2

  
3
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
4
    <xsl:output method="text"/>
5
    
6
    <xsl:variable name="sq">'</xsl:variable>
7
    
8
    <xsl:template match="/">
9
        <xsl:for-each select="//Result/item">
10
            <xsl:variable name="year" select="./anno"/>
11
            <xsl:for-each select="./personale/item[string-length(./matricola) = 0]">
12
                <xsl:variable name="name" select="./nome"/>
13
		<xsl:variable name="surname" select="./cognome"/>
14
                <xsl:for-each select="./labs/item">
15
                    <xsl:variable name="gid" select="./sigla"/>
16
                    <xsl:value-of select="concat('INSERT INTO affiliations_temp_no_id(name,surname,gid,year) VALUES (' ,$sq, $name, $sq, ',', $sq, $surname, $sq, ',', $sq, $gid, $sq, ',', $year, ');&#xa;')"/>
17
                </xsl:for-each>
18
            </xsl:for-each>
19
        </xsl:for-each>
20
        
21
    </xsl:template>
22
    
23
    
24
</xsl:stylesheet>
modules/dnet-isti/trunk/src/main/resources/scripts/affilitions/readme.txt
2 2
   - WSDL: http://pimpa.isti.cnr.it/PERSONALE/web-services/iop/iop.webservice.php?wsdl
3 3
   - Method: getDataRange
4 4

  
5
2) Eseguire l'xslt sulla risposta 
5
2) Eseguire gli xslt sulla risposta 
6 6

  
7 7
3) Ricreare o svuotare la tabella temporanea affiliations_temp
8 8
  - create table affiliations_temp(pid varchar(32), gid varchar(16), year int);
9
  - create table affiliations_temp_no_id(name varchar(255), surname varchar(255), gid varchar(16), year int);
9 10

  
10
4) Importare le nuopvi affiliations sulla tabella temporanea 
11
4) Importare le nuove affiliations sulle tabelle temporanee 
11 12

  
12 13
5) Verificare che non esistano nuovi laboratori e/o nuove persone ed eventualmente inserirle una per una
13 14
   - select distinct t.pid, p.name, p.surname from affiliations_temp t left outer join persons p on (t.pid = p.id) where p.name IS NULL;
......
18 19

  
19 20
7) Effettuare controlli a campione
20 21

  
21
8) Cancellare la tabella temporanea
22
8) Cancellare la tabell temporanea
22 23
   - drop table affiliations_temp;
23 24

  
24 25
9) Cancellare e/o correggere (se possibile) le affiliations UNKNOWN

Also available in: Unified diff