Changeset 11:78a8dd1eeb2b

Show
Ignore:
Timestamp:
04/03/11 20:39:10 (13 years ago)
Author:
František Kučera <franta-hg@…>
Branch:
default
Message:

statický obsah a úloha pro čištění

Files:
2 added
2 modified

Legend:

Unmodified
Added
Removed
  • build.xml

    r10 r11  
    1111        </target> 
    1212         
    13         <target name="stránky" description="Vygeneruje XHTML webové stránky.">           
     13        <target name="stránky" description="Vygeneruje samotné XHTML webové stránky." depends="statický-obsah">          
    1414                <xslt basedir="${vstup}" destdir="${výstup}" includes="*.xml" extension=".xhtml" style="${šablona}/stránka.xsl"> 
    15                         <param name="konfigurák" expression="../${vstup}/web.conf"/> 
     15                        <param name="konfigurák" expression="../${vstup}/"/> 
    1616                        <classpath location="/usr/share/java/saxonb-9.0.jar"/> 
    1717                        <classpath location="${funkce}"/> 
     
    2222        </target> 
    2323         
    24         <target name="agregace" description="Vytvoří agregované výstupy: RSS, Atom, Sitemap.xml"> 
     24        <target name="agregace" description="Vytvoří agregované výstupy: RSS, Atom, Sitemap.xml."> 
    2525                <!-- TODO: sloučit, zjednodušit, parametrizovat --> 
    2626         
     
    5454        </target> 
    5555         
    56         <target name="kompiluj-funkce" description="">           
     56        <target name="kompiluj-funkce" description="Přeloží funkce napsané v Javě.">             
    5757                <mkdir dir="${funkce}"/> 
    5858                <javac 
     
    6363        </target> 
    6464         
     65        <target name="statický-obsah" description="Kopíruje JS, CSS, obrázky atd."> 
     66                <copy todir="${výstup}"> 
     67                        <fileset dir="${vstup}" excludes="*.xml,*.inc,web.conf"/> 
     68                </copy> 
     69        </target> 
     70         
     71        <target name="čisti" description="Smaže vygenerovaný obsah."> 
     72                <delete includeemptydirs="true"> 
     73                        <fileset dir="${výstup}" includes="**/*"/> 
     74                        <fileset dir="${funkce}" includes="**/*"/> 
     75                </delete> 
     76        </target> 
     77         
    6578</project> 
  • šablona/stránka.xsl

    r10 r11  
    1414                doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"  
    1515                doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"/> 
    16                  
    17         <xsl:param name="konfigurák"/> 
     16         
     17        <!-- Vstupní adresář: --> 
     18        <xsl:param name="vstup" select="'../vstup/'"/> 
    1819         
    1920        <!-- Celý dokument: --> 
    2021        <xsl:template match="/"> 
    21                 <xsl:variable name="konfigurace" select="document($konfigurák)"/> 
     22                <xsl:variable name="konfigurace" select="document(concat($vstup, 'web.conf'))"/> 
    2223                <html> 
    2324                        <head> 
     
    2930                        </head> 
    3031                        <body> 
    31                                 <xsl:apply-templates select="document(fn:encode-for-uri('../vstup/záhlaví.inc'))/g:stránka/h:text/node()"/>                      
     32                                <xsl:apply-templates select="document(fn:encode-for-uri(concat($vstup, 'záhlaví.inc')))/g:stránka/h:text/node()"/>                       
    3233                                <h1><xsl:value-of select="g:stránka/g:nadpis"/></h1> 
    3334                                <xsl:apply-templates select="g:stránka/h:text/node()"/> 
     
    4344                                        </xsl:for-each> 
    4445                                </ul> 
    45                                 <xsl:apply-templates select="document(fn:encode-for-uri('../vstup/zápatí.inc'))/g:stránka/h:text/node()"/>                               
     46                                <xsl:apply-templates select="document(fn:encode-for-uri(concat($vstup, 'zápatí.inc')))/g:stránka/h:text/node()"/>                                
    4647                        </body> 
    4748                </html> 
     
    5657    </xsl:template> 
    5758     
     59    <!-- Odkazy na JavaScript a kaskádové styly --> 
    5860    <xsl:template match="g:web/g:js"> 
    5961        <script src="{text()}" type="text/javascript" />