You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by eg...@apache.org on 2003/11/24 18:25:50 UTC

cvs commit: cocoon-lenya/src/webapp/lenya/pubs/default/config/tasks targets.xml

egli        2003/11/24 09:25:50

  Modified:    src/webapp/lenya/pubs/default/config/tasks targets.xml
  Added:       src/webapp/lenya/xslt/authoring addMetaData.xsl
               src/webapp/lenya/xslt linkRewrite.xsl
  Log:
  Ported the remaining dependencies from unizh to the core:
  * add meta data
  * link rewriting
  
  Revision  Changes    Path
  1.1                  cocoon-lenya/src/webapp/lenya/xslt/authoring/addMetaData.xsl
  
  Index: addMetaData.xsl
  ===================================================================
  <?xml version="1.0" encoding="UTF-8" ?>
  
  <!--
      Document   : 
      Created on : 
      Author     : 
      Description:
          Purpose of transformation follows.
  -->
  
  <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
    exclude-result-prefixes="xhtml"
    >
  
    <xsl:param name="creator"/>
    <xsl:param name="title"/>
    <xsl:param name="description"/>
    <xsl:param name="subject"/>
    <xsl:param name="language"/>
    <xsl:param name="publisher"/>
    <xsl:param name="date"/>
    <xsl:param name="rights"/>
  
    <xsl:template match="dc:creator[$creator!='']">
      <dc:creator>
        <xsl:value-of select="$creator"/>
      </dc:creator>
    </xsl:template>  
  
    <xsl:template match="dc:title[$title!='']">
      <dc:title>
        <xsl:value-of select="$title"/>
      </dc:title>
    </xsl:template>  
  
    <xsl:template match="dc:description[$description!='']">
      <dc:description>
        <xsl:value-of select="$description"/>
      </dc:description>
    </xsl:template>  
  
    <xsl:template match="dc:subject[$subject!='']">
      <dc:subject>
        <xsl:value-of select="$subject"/>
      </dc:subject>
    </xsl:template>  
  
    <xsl:template match="dc:language[$language!='']">
      <dc:language>
        <xsl:value-of select="$language"/>
      </dc:language>
    </xsl:template>  
  
    <xsl:template match="dc:publisher[$publisher!='']">
      <dc:publisher>
        <xsl:value-of select="$publisher"/>
      </dc:publisher>
    </xsl:template>  
  
    <xsl:template match="dcterms:created[$date!='']">
      <dcterms:created>
        <xsl:value-of select="$date"/>
      </dcterms:created>
    </xsl:template>  
  
    <xsl:template match="dc:rights[$rights!='']">
      <dc:rights>
        <xsl:value-of select="$rights"/>
      </dc:rights>
    </xsl:template>  
  
    <!-- Identity transformation -->
    <xsl:template match="@*|*">
      <xsl:copy>
        <xsl:apply-templates select="@*|node()"/>
      </xsl:copy>
    </xsl:template>  
    
  </xsl:stylesheet>
  
  
  
  1.1                  cocoon-lenya/src/webapp/lenya/xslt/linkRewrite.xsl
  
  Index: linkRewrite.xsl
  ===================================================================
  <?xml version="1.0" encoding="UTF-8" ?>
  
  <!-- $Id: linkRewrite.xsl,v 1.1 2003/11/24 17:25:49 egli Exp $ -->
  
  <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
    exclude-result-prefixes="xhtml"
    >
  
    <xsl:param name="idbefore"/>
    <xsl:param name="idafter"/>
    
    <xsl:template match="xhtml:a">
      <xsl:variable name="href">
        <xsl:choose>
  	<xsl:when test="@href=$idbefore">
  	  <xsl:value-of select="$idafter"/>
  	</xsl:when>
  	<xsl:otherwise>
  	  <xsl:value-of select="@href"/>
  	</xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      <a href="{$href}">
        <xsl:apply-templates select="@*[not(local-name()='href')]|node()"/>
      </a>
    </xsl:template>
  
    <xsl:template match="@*|node()" priority="-1">
      <xsl:copy>
        <xsl:apply-templates select="@*|node()"/>
      </xsl:copy>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.21      +3 -3      cocoon-lenya/src/webapp/lenya/pubs/default/config/tasks/targets.xml
  
  Index: targets.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/pubs/default/config/tasks/targets.xml,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- targets.xml	9 Nov 2003 05:03:01 -0000	1.20
  +++ targets.xml	24 Nov 2003 17:25:49 -0000	1.21
  @@ -207,7 +207,7 @@
       <xslt in="${document.file}"
         out="${temp.file}" 
         force="true"
  -      style="${pub.dir}/../unizh/xslt/authoring/addMetaData.xsl">
  +      style="${pub.dir}/../../xslt/authoring/addMetaData.xsl">
         <param name="title" expression="${create.title}"/>
         <param name="creator" expression="${create.creator}"/>
         <param name="subject" expression="${create.subject}"/>
  @@ -283,7 +283,7 @@
       <xslt in="${document.old.file}"
         out="${document.new.file}" 
         force="true"
  -      style="${pub.dir}/../unizh/xslt/authoring/addMetaData.xsl">
  +      style="${pub.dir}/../../xslt/authoring/addMetaData.xsl">
         <param name="title" expression="${create.title}"/>
         <param name="creator" expression="${create.creator}"/>
         <param name="subject" expression="${create.subject}"/>
  @@ -613,7 +613,7 @@
       <taskdef name="linkRewrite" classname="org.apache.lenya.cms.ant.LinkRewriteTask"/>
       
       <linkRewrite baseDir="${pub.dir}/${authoring.dir}"
  -      stylesheet="${pub.dir}/../unizh/xslt/linkRewrite.xsl"
  +      stylesheet="${pub.dir}/../../xslt/linkRewrite.xsl"
         area="${authoring.area}"
         oldDocumentId="${node.firstdocumentid}"
         newDocumentId="${node.newdocumentid}"/>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org