Subversion Repositories bacoAlunos

Rev

Blame | Compare with Previous | Last modification | View Log | RSS feed

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format"
               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
               xmlns:uc="http://baco.estgp.pt/schemas/courseunits/program/">
    <xsl:param name="site">http://localhost/bacoTESTE</xsl:param>
    <xsl:param name="revisor">automático</xsl:param>
    <xsl:param name="validadoCC">false</xsl:param>


    <xsl:template match="/">
        <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
            <fo:layout-master-set>
                <fo:simple-page-master master-name="A4VerticalFirst" page-width="210mm" page-height="297mm"
                                      margin-top="1cm" margin-bottom="1cm" margin-left="1cm" margin-right="1cm"
                                      reference-orientation="0">
                    <fo:region-body region-name="body" margin-top="20mm" margin-bottom="10mm" margin-right="0"
                                   margin-left="0"/>
                    <fo:region-before region-name="header" extent="15mm"/>
                    <fo:region-after region-name="footer" extent="1cm"/>
                </fo:simple-page-master>
                <fo:simple-page-master master-name="A4VerticalOther" page-width="210mm" page-height="297mm"
                                      margin-top="1cm" margin-bottom="1cm" margin-left="1cm" margin-right="1cm"
                                      reference-orientation="0">
                    <fo:region-body region-name="body" margin-top="20mm" margin-bottom="10mm" margin-right="0"
                                   margin-left="0"/>
                    <fo:region-after region-name="footer" extent="1cm"/>
                </fo:simple-page-master>
                <fo:page-sequence-master master-name="paginas">
                    <fo:repeatable-page-master-alternatives>
                        <fo:conditional-page-master-reference page-position="first" master-reference="A4VerticalFirst"/>
                        <fo:conditional-page-master-reference master-reference="A4VerticalOther"/>
                    </fo:repeatable-page-master-alternatives>
                </fo:page-sequence-master>

            </fo:layout-master-set>

            <!--LAYOUT DE PAGINA ESCOLHIDO-->
            <fo:page-sequence master-reference="paginas" >
                <xsl:call-template name="page"/>
            </fo:page-sequence>


        </fo:root>
    </xsl:template>


    <xsl:template name="page">
        <fo:static-content flow-name="header">

            <fo:block text-align="left" >
                <fo:table width="100%" table-layout="fixed" border-bottom="1px solid black" margin-bottom="5pt">
                    <fo:table-column column-width="100%"/>


                    <fo:table-body>
                        <fo:table-row>
                            <fo:table-cell >
                                <fo:block>
                                    <fo:external-graphic height="auto" width="auto"
                                                        content-height="30">
                                        <!--<xsl:attribute name="src">url('http://www.ipportalegre.pt/imagens/Logos/ESTG/Logotipo%20ESTG.jpg')</xsl:attribute>-->
                                        <xsl:attribute name="src">url('<xsl:value-of select="$site"/>/imgs/logoestg.gif')</xsl:attribute>
                                    </fo:external-graphic>
                                </fo:block>
                                <fo:block font-size="16pt">
                                    Sumários Lançados <xsl:value-of select="//anoLectivo"/>
                                </fo:block>

                            </fo:table-cell>

                        </fo:table-row>

                    </fo:table-body>
                </fo:table>

            </fo:block>


        </fo:static-content>
        <fo:static-content flow-name="footer">

            <fo:table width="100%" table-layout="fixed"  border-top="1px solid black" font-size="6.5pt" >
                <fo:table-column column-width="20%"/>
                <fo:table-column column-width="80%"  />


                <fo:table-body>
                    <fo:table-row>
                        <fo:table-cell  padding-top="3pt">
                            <fo:block >
                               Revisto a <xsl:value-of select="//updateDate"/> por <xsl:value-of select="$revisor"/> / Página <fo:page-number/>
                            </fo:block>
                            <fo:block font-size="5pt">
                                ESTG.SA.xxxx.1
                            </fo:block>

                        </fo:table-cell>
                        <fo:table-cell padding-top="3pt" >
                            <fo:block font-size="6pt" text-align="right">
                                http://www.estgp.pt | gerado pela plataforma baco® 2015
                            </fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                </fo:table-body>
            </fo:table>
        </fo:static-content>

        <fo:flow flow-name="body">
            <fo:block>
                <xsl:apply-templates select="/courseUnit"/>
            </fo:block>
        </fo:flow>
    </xsl:template>

    <xsl:template match="/courseUnit">

        <fo:table table-layout="fixed" border="0px solid black" margin="0.5em" font-size="8.5pt">
            <xsl:call-template name="gen_cols"/>
            <fo:table-body text-align="left">

                <xsl:call-template name="gen_header"/>

                <xsl:call-template name="gen_line"/>

            </fo:table-body>
        </fo:table>
    </xsl:template>

    <xsl:template name="gen_cols">
        <fo:table-column column-width="15em"  />
        <fo:table-column/>
    </xsl:template>




    <xsl:template name="gen_header">

    </xsl:template>








    <xsl:attribute-set name="myBorder">
        <xsl:attribute name="border">solid 0.2mm black</xsl:attribute>
    </xsl:attribute-set>

    <xsl:template name="gen_line">

        <fo:table-row background-color="#FFF" color="#000" padding="0">
            <fo:table-cell border-right="1px solid gray"  border-bottom="1px solid gray" display-align="center"  >
                <fo:block text-align="right" padding="3pt" font-weight="bold">
                Ano Lectivo
                </fo:block>
            </fo:table-cell>
            <fo:table-cell border-right="1px solid gray"  border-bottom="1px solid gray" display-align="center"  >
                <fo:block >
                <xsl:value-of select="@importYear"/>
                </fo:block>
            </fo:table-cell>
        </fo:table-row>
        <fo:table-row background-color="#FFF" color="#000" padding="0">
            <fo:table-cell border-right="1px solid gray"  border-bottom="1px solid gray" display-align="center"  >
                <fo:block text-align="right" padding="3pt" font-weight="bold">
                Curso
                </fo:block>
            </fo:table-cell>
            <fo:table-cell border-right="1px solid gray"  border-bottom="1px solid gray" display-align="center"  >
                <fo:block >
                <xsl:value-of select="//courseName"/> / <xsl:value-of select="//courseCode"/>
                </fo:block>
            </fo:table-cell>
        </fo:table-row>
        <fo:table-row background-color="#FFF" color="#000" padding="0">
            <fo:table-cell border-right="1px solid gray"  border-bottom="1px solid gray" display-align="center"  >
                <fo:block text-align="right" padding="3pt" font-weight="bold">
                Unidade Curricular
                </fo:block>
            </fo:table-cell>
            <fo:table-cell border-right="1px solid gray"  border-bottom="1px solid gray" display-align="center"  >
                <fo:block >
                <xsl:value-of select="//name"/> / <xsl:value-of select="//courseUnitCode"/>
                </fo:block>
            </fo:table-cell>
        </fo:table-row>
        <fo:table-row background-color="#FFF" color="#000" padding="0">
            <fo:table-cell border-right="1px solid gray"  border-bottom="1px solid gray" display-align="center"  >
                <fo:block text-align="right" padding="3pt" font-weight="bold">
                Professor Responsável
                </fo:block>
            </fo:table-cell>
            <fo:table-cell border-right="1px solid gray"  border-bottom="1px solid gray" display-align="center"  >
                <fo:block >
                    <xsl:value-of select="//responsavel/@name"/> / <xsl:value-of select="//responsavel/@email"/>
                </fo:block >
            </fo:table-cell>
        </fo:table-row>
        <xsl:for-each select="//teacher">
            <fo:table-row background-color="#FFF" color="#000" padding="0">
                <fo:table-cell border-right="1px solid gray"  border-bottom="1px solid gray" display-align="center"  >
                    <fo:block text-align="right" padding="3pt" font-weight="bold">
                    Docente
                    </fo:block>
                </fo:table-cell>
                <fo:table-cell border-right="1px solid gray"  border-bottom="1px solid gray" display-align="center"  >
                    <fo:block >
                    <xsl:value-of select="./@name"/> / <xsl:value-of select="./@email"/>
                    </fo:block>
                </fo:table-cell>
            </fo:table-row>
        </xsl:for-each>

        <fo:table-row background-color="#FFF" color="#000" padding="0">

            <fo:table-cell number-columns-spanned="2" border-right="1px solid gray"  border-bottom="1px solid gray" display-align="center"   >
                <fo:block text-align="left" padding="3pt" font-weight="bold">
                    Sumários Lançados (<xsl:value-of select="//summaries/@number"/>)
                </fo:block>
            </fo:table-cell>


        </fo:table-row>


        <xsl:if test="//summary">
            <fo:table-row background-color="#FFF" color="#000" padding="0">

                <fo:table-cell padding="0" number-columns-spanned="2" border-right="1px solid gray"  border-bottom="1px solid gray" display-align="center"   >


                    <fo:table  margin-top="10px" margin-bottom="5px"  table-layout="fixed" border="1px solid black" >
                        <fo:table-column/>
                        <fo:table-column/>
                        <fo:table-column/>
                        <fo:table-column/>
                        <fo:table-column/>

                        <fo:table-body>


                            <xsl:for-each select="//summary">
                                <xsl:sort select="dataAula" case-order="lower-first"/>
                                <fo:table-row>
                                    <fo:table-cell border-bottom="0.5px solid gray">
                                        <fo:block font-size="8pt">
                                            <xsl:value-of select="./dataAula"/>
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell border-bottom="0.5px solid gray" >
                                        <fo:block font-size="8pt" >
                                            Aula <xsl:value-of select="./numeroAula"/>
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell border-bottom="0.5px solid gray" >
                                        <fo:block font-size="8pt">
                                            <xsl:value-of select="./tipoAula"/>
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell border-bottom="0.5px solid gray">
                                        <fo:block font-size="8pt">
                                            <xsl:value-of select="./numeroHoras"/> Horas
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell border-bottom="0.5px solid gray" >
                                        <fo:block font-size="8pt">
                                            <xsl:value-of select="./alunosPresentes"/> Alunos
                                        </fo:block>
                                    </fo:table-cell>

                                </fo:table-row>

                                <fo:table-row>
                                    <fo:table-cell border-bottom="0.5px solid gray">
                                        <fo:block font-size="8pt">
                                           Titulo
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell number-columns-spanned="4" border-bottom="0.5px solid gray">
                                        <fo:block font-size="8pt">
                                            <xsl:value-of select="./titulo"/>
                                        </fo:block>
                                    </fo:table-cell>
                                </fo:table-row>

                                <fo:table-row>
                                    <fo:table-cell border-bottom="1px solid gray"  >
                                        <fo:block font-size="8pt">
                                            Descrição
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell border-bottom="1px solid gray"  number-columns-spanned="4">
                                        <fo:block font-size="8pt">
                                            <xsl:value-of select="./descricao"/>
                                        </fo:block>
                                    </fo:table-cell>
                                </fo:table-row>

                                <fo:table-row height='20px'>
                                    <fo:table-cell number-columns-spanned="5" >
                                        <fo:block ></fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                            </xsl:for-each>
                        </fo:table-body>
                    </fo:table>
                </fo:table-cell>
            </fo:table-row>
        </xsl:if>

            <!--

           <fo:table-cell border-bottom="1px solid gray" padding="0" padding-top="5px" padding-bottom="5px" padding-left="0mm" display-align="center">





           </fo:table-cell>
           -->




    </xsl:template>







</xsl:stylesheet>