forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nicola...@apache.org
Subject cvs commit: xml-forrest/src/core/context resources.xmap
Date Tue, 30 Dec 2003 00:01:55 GMT
nicolaken    2003/12/29 16:01:55

  Modified:    src/core/context resources.xmap
  Log:
  Now skin resources can be generated from skinconf.xml from xslt.
  For example /myskin/css/my.css.xslt is used by forrest on skinconf.xml
  to get my.css.
  
  Tidied up sitemap using resources.
  
  Revision  Changes    Path
  1.5       +76 -52    xml-forrest/src/core/context/resources.xmap
  
  Index: resources.xmap
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/core/context/resources.xmap,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- resources.xmap	28 Nov 2003 17:12:43 -0000	1.4
  +++ resources.xmap	30 Dec 2003 00:01:55 -0000	1.5
  @@ -21,6 +21,7 @@
               <parameter name="quality" type="float" value="1.0" />
            </map:serializer>
            <map:serializer mime-type="image/png" name="svg2png" src="org.apache.cocoon.serialization.SVGSerializer"
/>
  +         <map:serializer name="text"   mime-type="text/plain"  src="org.apache.cocoon.serialization.TextSerializer"/>
         </map:serializers>
         <map:transformers default="xslt" />
         <map:readers default="resource" />
  @@ -34,54 +35,88 @@
                  <map:when test="{project:skins-dir}{forrest:skin}/{path}">
                     <map:read src="{project:skins-dir}{forrest:skin}/{path}" mime-type="{mime-type}"
/>
                  </map:when>
  +               <map:when test="{project:skins-dir}{forrest:skin}/{path}.xslt">
  +                  <map:call resource="pipe-text-resource">
  +                    <map:parameter name="path" value="{project:skins-dir}{forrest:skin}/{path}.xslt"
/>
  +                    <map:parameter name="mime-type" value="text/css" />
  +                  </map:call>
  +               </map:when>
  +               <map:when test="{forrest:home}context/skins/{forrest:skin}/{path}">
  +                  <map:read src="{forrest:home}context/skins/{forrest:skin}/{path}"
mime-type="{mime-type}" />
  +               </map:when>
  +               <map:when test="{forrest:home}context/skins/{forrest:skin}/{path}.xslt">
  +                  <map:call resource="pipe-text-resource">
  +                    <map:parameter name="path" value="{forrest:home}context/skins/{forrest:skin}/{path}.xslt"
/>
  +                    <map:parameter name="mime-type" value="text/css" />
  +                  </map:call>
  +               </map:when>
  +               <map:when test="{forrest:home}context/skins/common/{path}">
  +                  <map:read src="{forrest:home}context/skins/common/{path}" mime-type="{mime-type}"
/>
  +               </map:when>
                  <map:otherwise>
  -                <map:select type="exists">
  -                  <map:when test="{forrest:home}context/skins/{forrest:skin}/{path}">
  -                    <map:read src="{forrest:home}context/skins/{forrest:skin}/{path}"
mime-type="{mime-type}" />
  -                  </map:when>
  -                  <map:otherwise>
  -                    <map:read src="{forrest:home}context/skins/common/{path}" mime-type="{mime-type}"
/>
  -                  </map:otherwise>
  -                </map:select>
  +                  <map:call resource="pipe-text-resource">
  +                    <map:parameter name="path" value="{forrest:home}context/skins/common/{path}.xslt"
/>
  +                    <map:parameter name="mime-type" value="text/css" />
  +                  </map:call>
                  </map:otherwise>
               </map:select>
         </map:resource>
  +      
  +      <map:resource name="pipe-text-resource">
  +        <map:call resource="generate-xslt-resource">
  +           <map:parameter name="path" value="{path}" />
  +         </map:call>
  +         <map:serialize type="text" mime-type="{mime-type}"/>
  +      </map:resource>
  +      
  +      <map:resource name="generate-xslt-resource">
  +        <map:generate src="{project:skinconf}" />
  +        <map:transform src="{path}"/>
  +      </map:resource>
  +      
  +      <map:resource name="generate-xml-resource">
  +        <map:generate src="{project:skinconf}" />
  +        <map:transform src="{path}"/>
  +      </map:resource>
  +
  +      <map:resource name="transform-project2text">
  +         <map:transform src="{forrest:stylesheets}/project2text.xsl">
  +            <map:parameter name="config-file" value="{project:skinconf}"/>
  +         </map:transform>      
  +      </map:resource>
  +      
  +      <map:resource name="pipe-svg2png-resource">
  +         <map:call resource="generate-xml-resource">
  +           <map:parameter name="path" value="{path}" />
  +         </map:call>
  +         <map:call resource="transform-project2text"/>
  +         <map:serialize type="svg2png" />
  +      </map:resource>
  +      
      </map:resources>
      
      <map:pipelines>
  -      <map:pipeline>
  -         <map:match pattern="skin/**.js">
  -            <map:call resource="skin-read">
  -               <map:parameter name="path" value="scripts/{1}.js" />
  -               <map:parameter name="mime-type" value="application/x-javascript" />
  -            </map:call>
  -         </map:match>
  -
  -         <map:match pattern="**/skin/**.js">
  +       <map:pipeline>
  +         <map:match pattern="**skin/**.js">
               <map:call resource="skin-read">
                  <map:parameter name="path" value="scripts/{2}.js" />
                  <map:parameter name="mime-type" value="application/x-javascript" />
               </map:call>
            </map:match>
   
  +         <!-- @deprecated -->
            <map:match pattern="**.js">
               <map:read src="resources/scripts/{1}.js" mime-type="application/x-javascript"
/>
            </map:match>
   
  -         <map:match pattern="skin/**.css">
  -            <map:call resource="skin-read">
  -               <map:parameter name="path" value="css/{1}.css" />
  -               <map:parameter name="mime-type" value="text/css" />
  -            </map:call>
  -         </map:match>
  -
  -         <map:match pattern="**/skin/**.css">
  +         <map:match pattern="**skin/**.css">
               <map:call resource="skin-read">
                  <map:parameter name="path" value="css/{2}.css" />
                  <map:parameter name="mime-type" value="text/css" />
               </map:call>
            </map:match>
   
  +         <!-- @deprecated -->
            <map:match pattern="**.css">
               <map:read src="resources/css/{1}.css" mime-type="text/css" />
            </map:match>
  @@ -93,7 +128,7 @@
               </map:call>
            </map:match>
   
  -<!-- DS: handles images local to a contributor directory -->
  +         <!-- DS: handles images local to a contributor directory -->
            <map:match pattern="**my-images/**.*">
               <map:read src="{project:content.xdocs}{1}my-images/{2}.{3}" mime-type="image/{3}"
/>
            </map:match>
  @@ -101,25 +136,19 @@
            <map:match pattern="images/**.png">
               <map:select type="exists">
                  <map:when test="{project:content.xdocs}/images/{1}.svg">
  -                  <map:generate src="{project:content.xdocs}/images/{1}.svg" />
  -                  <map:transform src="{forrest:stylesheets}/project2text.xsl">
  -                    <map:parameter name="config-file" value="{project:skinconf}"/>
  -                  </map:transform>
  -                  <map:serialize type="svg2png" />
  +                  <map:call resource="pipe-svg2png-resource">
  +                    <map:parameter name="path" value="{project:content.xdocs}/images/{1}.svg"
/>
  +                  </map:call>
                  </map:when>
                  <map:when test="{project:resources.images}/{1}.svg">
  -                  <map:generate src="{project:resources.images}/{1}.svg" />
  -                  <map:transform src="{forrest:stylesheets}/project2text.xsl">
  -                    <map:parameter name="config-file" value="{project:skinconf}"/>
  -                  </map:transform>
  -                  <map:serialize type="svg2png" />
  +                  <map:call resource="pipe-svg2png-resource">
  +                    <map:parameter name="path" value="{project:resources.images}/{1}.svg"
/>
  +                  </map:call>
                  </map:when>
                  <map:when test="resources/images/{1}.svg">
  -                  <map:generate src="resources/images/{1}.svg" />
  -                  <map:transform src="{forrest:stylesheets}/project2text.xsl">
  -                    <map:parameter name="config-file" value="{project:skinconf}"/>
  -                  </map:transform>
  -                  <map:serialize type="svg2png" />
  +                  <map:call resource="pipe-svg2png-resource">
  +                    <map:parameter name="path" value="resources/images/{1}.svg" />
  +                  </map:call>
                  </map:when>
                  <map:when test="{project:content.xdocs}/images/{1}.png">
                     <map:read src="{project:content.xdocs}/images/{1}.png" mime-type="image/png"
/>
  @@ -180,17 +209,13 @@
            <map:match pattern="**.png">
               <map:select type="exists">
                  <map:when test="{project:content.xdocs}/{1}.svg">
  -                  <map:generate src="{project:content.xdocs}/{1}.svg" />
  -                  <map:transform src="{forrest:stylesheets}/project2text.xsl">
  -                    <map:parameter name="config-file" value="{project:skinconf}"/>
  -                  </map:transform>
  -                  <map:serialize type="svg2png" />
  +                  <map:call resource="pipe-svg2png-resource">
  +                    <map:parameter name="path" value="{project:content.xdocs}/{1}.svg"
/>
  +                  </map:call>
                  </map:when>
                  <map:when test="{project:content.xdocs}/{1}.aart">
                     <map:generate type="asciiart-svg" src="{project:content.xdocs}/{1}.aart"
/>
  -                  <map:transform src="{forrest:stylesheets}/project2text.xsl">
  -                    <map:parameter name="config-file" value="{project:skinconf}"/>
  -                  </map:transform>
  +                  <map:call resource="transform-project2text"/>
                     <map:serialize type="svg2png" />
                  </map:when>
                  <map:otherwise>
  @@ -207,5 +232,4 @@
            </map:match>
         </map:pipeline>
      </map:pipelines>
  -</map:sitemap>
  -
  +</map:sitemap>
  \ No newline at end of file
  
  
  

Mime
View raw message