cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Koen Pellegrims" <koen.pellegr...@pandora.be>
Subject Re: Sitemap configuration to generate pdf.
Date Fri, 25 Jan 2002 16:25:34 GMT
<map:generate> defines where you will get your initial XML from. 
In your case, this should be your xsp, you need: <map:generate type="serverpages" src="whereveryourxspis/{1}.xsp"/>

In your example, cocoon will try to mach {1} (which is the filename, without the extension)
somewhere else in the sitemap. Obviously it can't find a match an produces an error...



----- Original Message ----- 
  From: MOODAD (Shadi LB Soft) 
  To: cocoon-dev@xml.apache.org ; cocoon-users@xml.apache.org 
  Sent: Friday, January 25, 2002 5:12 PM
  Subject: Sitemap configuration to generate pdf.


    
  Hi. 
  I'm trying to use coconn 2 as a servlet to generate pdf reports from xsp files. 
  so i have used the following configuration of the sitemap.xsp (check attachement) but it
didn't work. 
  with the folloing pipeline (a test one that just generate html not pdf) 
    <map:pipeline> 
     <map:match pattern="**.xsp"> 
      <map:generate type="file" src="cocoon:/{1}"/> 
      <map:transform src="cocoon:/xml2html.xsl"/> 
      <map:serialize type="html"/> 
     </map:match> 
    </map:pipeline> 
   I'm trying to match each xsp file than use the xml2html.xsl to transform the xsp file to
a html 
  but i got the error 
  org.apache.cocoon.ProcessingException: Failed to execute pipeline.: java.lang.RuntimeException:
Problem in getTransformer:Error in creating Transform Handler 
     at org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java:383)

  I don't understand why to use the map:generate or how to use it. in fact the execution of
the xsp file will give an xml. 
  then i need to process it using the xml2html.xsl. 

  Plz if someone know where is the problem or if he used such a model to give me some hints
I'll be very thanxfull. 

  Thanx in advc 
  -- 
  Soft Solutions 
  Net Developper 
  Moodad Shadi 

  www.softsolutions.fr 
    



------------------------------------------------------------------------------


  <?xml version="1.0"?>

  <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">

  <!-- =========================== Components ================================ -->
   <map:components>
    <map:generators default="file">
     <map:generator  name="file"        src="org.apache.cocoon.generation.FileGenerator"
label="content"
                     pool-max="32" pool-min="16" pool-grow="4"/>
     <map:generator  name="directory"   src="org.apache.cocoon.generation.DirectoryGenerator"
label="content"/>
     <map:generator  name="imagedirectory"   src="org.apache.cocoon.generation.ImageDirectoryGenerator"
label="content"/>
     <map:generator  name="serverpages" src="org.apache.cocoon.generation.ServerPagesGenerator"
label="content"/>
     <map:generator  name="request"     src="org.apache.cocoon.generation.RequestGenerator"/>
     <map:generator  name="status"      src="org.apache.cocoon.generation.StatusGenerator"/>
     <map:generator  name="extractor"   src="org.apache.cocoon.generation.FragmentExtractorGenerator"/>
     <map:generator  name="script"      src="org.apache.cocoon.generation.ScriptGenerator"/>
     <map:generator  name="velocity"    src="org.apache.cocoon.generation.VelocityGenerator"/>
     <map:generator  name="jsp"         src="org.apache.cocoon.generation.JspGenerator"/>
     <map:generator  name="stream"      src="org.apache.cocoon.generation.StreamGenerator"/>
    </map:generators>


    <map:transformers default="xslt">
     <map:transformer     name="xslt"      src="org.apache.cocoon.transformation.TraxTransformer"
                          pool-max="32" pool-min="16" pool-grow="4">
      <use-request-parameters>false</use-request-parameters>
      <use-browser-capabilities-db>false</use-browser-capabilities-db>
     </map:transformer>
     <map:transformer     name="log"       src="org.apache.cocoon.transformation.LogTransformer"/>
     <map:transformer     name="sql"       src="org.apache.cocoon.transformation.SQLTransformer"/>
     <map:transformer     name="extractor" src="org.apache.cocoon.transformation.FragmentExtractorTransformer"/>
     <map:transformer     name="i18n"      src="org.apache.cocoon.transformation.I18nTransformer">
      <catalogue-name>messages</catalogue-name>
      <catalogue-location>translations</catalogue-location>
     </map:transformer>
     <map:transformer     name="xinclude"  src="org.apache.cocoon.transformation.XIncludeTransformer"/>
     <map:transformer     name="cinclude"  src="org.apache.cocoon.transformation.CIncludeTransformer"/>
     <map:transformer     name="filter"  src="org.apache.cocoon.transformation.FilterTransformer"/>
     <map:transformer     name="writeDOMsession"  src="org.apache.cocoon.transformation.WriteDOMSessionTransformer"/>
     <map:transformer     name="readDOMsession"  src="org.apache.cocoon.transformation.ReadDOMSessionTransformer"/>
    </map:transformers>

    <map:readers default="resource">
     <map:reader name="resource"       src="org.apache.cocoon.reading.ResourceReader"/>
    </map:readers>


    <map:serializers default="html">
     <map:serializer name="links"                               src="org.apache.cocoon.serialization.LinkSerializer"/>
     <map:serializer name="xml"    mime-type="text/xml"         src="org.apache.cocoon.serialization.XMLSerializer"
                     pool-max="32" pool-min="16" pool-grow="4"/>
     <map:serializer name="html"   mime-type="text/html"        src="org.apache.cocoon.serialization.HTMLSerializer"/>
     <map:serializer name="vrml"   mime-type="model/vrml"       src="org.apache.cocoon.serialization.TextSerializer"/>
     <map:serializer name="wap"    mime-type="text/vnd.wap.wml" src="org.apache.cocoon.serialization.XMLSerializer">
      <doctype-public>-//WAPFORUM//DTD WML 1.1//EN</doctype-public>
      <doctype-system>http://www.wapforum.org/DTD/wml_1.1.xml</doctype-system>
      <encoding>ASCII</encoding>
      <omit-xml-declaration>yes</omit-xml-declaration>
     </map:serializer>
     <map:serializer name="svgxml" mime-type="image/svg-xml"    src="org.apache.cocoon.serialization.XMLSerializer">
      <doctype-public>-//W3C//DTD SVG 20000303 Stylable//EN</doctype-public>
      <doctype-system>http://www.w3.org/TR/2000/03/WD-SVG-20000303/</doctype-system>
     </map:serializer>
     <map:serializer name="fo2pdf" src="org.apache.cocoon.serialization.FOPSerializer"
mime-type="application/pdf"/>
    </map:serializers>


    <map:matchers default="wildcard">
     <map:matcher name="wildcard" src="org.apache.cocoon.matching.WildcardURIMatcher"/>
     <map:matcher name="regexp" src="org.apache.cocoon.matching.RegexpURIMatcher"/>
     <map:matcher name="request" src="org.apache.cocoon.matching.RequestParamMatcher"/>
     <map:matcher name="sessionstate" src="org.apache.cocoon.matching.WildcardSessionAttributeMatcher">
        <attribute-name>org.apache.cocoon.SessionState</attribute-name>
     </map:matcher>
     <map:matcher name="next-page" src="org.apache.cocoon.matching.WildcardParameterValueMatcher">
        <parameter-name>next-state</parameter-name>
     </map:matcher>
     <map:matcher name="referer-match" src="org.apache.cocoon.matching.WildcardHeaderMatcher">
        <header-name>referer</header-name>
     </map:matcher>
    </map:matchers>



    <map:selectors default="browser">
     <map:selector name="browser" src="org.apache.cocoon.selection.BrowserSelector">
      <browser name="explorer" useragent="MSIE"/>
      <browser name="pocketexplorer" useragent="MSPIE"/>
      <browser name="handweb" useragent="HandHTTP"/>
      <browser name="avantgo" useragent="AvantGo"/>
      <browser name="imode" useragent="DoCoMo"/>
      <browser name="opera" useragent="Opera"/>
      <browser name="lynx" useragent="Lynx"/>
      <browser name="java" useragent="Java"/>
      <browser name="wap" useragent="Nokia"/>
      <browser name="wap" useragent="UP"/>
      <browser name="wap" useragent="Wapalizer"/>
      <browser name="mozilla5" useragent="Mozilla/5"/>
      <browser name="mozilla5" useragent="Netscape6/"/>
      <browser name="netscape" useragent="Mozilla"/>
     </map:selector>
     <map:selector name="parameter" src="org.apache.cocoon.selection.ParameterSelector"/>
    </map:selectors>


   </map:components>


  <!-- =========================== Pipelines ================================= -->
   <map:pipelines>

    <!-- Utility for viewing source xml or html-->
    <map:pipeline>
     <map:match pattern="**.source">
      <map:generate src="cocoon:/{1}" />
      <map:transform src="stylesheets/simple-xml2html.xsl"/>
      <map:serialize/>
     </map:match>
    </map:pipeline>
    
    <map:pipeline>
     <map:match pattern="**.xsp">
      <map:generate type="file" src="cocoon:/{1}.1xsp"/>
      <map:transform src="cocoon:/xml2xml.xsl"/>
      <map:serialize type="html"/>
     </map:match>
    </map:pipeline>

   </map:pipelines>

  </map:sitemap>

  <!-- end of file -->




------------------------------------------------------------------------------


  ---------------------------------------------------------------------
  Please check that your question has not already been answered in the
  FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

  To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
  For additional commands, e-mail: <cocoon-users-help@xml.apache.org>

Mime
View raw message