forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cyriaque Dupoirieux <Cyriaque.Dupoiri...@pcotech.fr>
Subject Re: Quick way to skin php-files?
Date Tue, 29 Nov 2005 15:00:58 GMT
Ferdinand Soethe a écrit :

>>This is untested, but would be where I would start experimenting and I'm
>>pretty sure is close to correct (maybe even correct ;-).
>>    
>>
>
>Thanks Ross, that was exactly what I was looking for. I just didn't
>know where to intercept. Will give it a try right away ...
>
>  
>
Hi,

    I made this in my php pipeline :
  <map:pipeline>

    <!-- PHP Documentation -->
    <map:match type="regexp" pattern="^(.*?)([^/]*).php$">
      <map:generate src="cocoon://{1}{2}.html"/>
      <map:transform src="resources/stylesheets/php/document2php.xsl"/>
      <map:serialize type="html"/>
    </map:match>

  </map:pipeline>
And I realise with the cocoon profiler - thank you Ross - that it takes 
lot of time to call the <map:generate src="cocoon://{1}{2}.html"/> - and 
certainly lots of CPU because with dozens of php files I get an Out of 
Memory... -

Here is an example of the profiler for a small php page :

*livres/livres.php* (2 results, total time: 4720, average time: 2360) 	0 
<http://localhost:8888/cprofile.html?key=3889731732187908544&result=0> 
1 <http://localhost:8888/cprofile.html?key=3889731732187908544&result=1>
1 	file /src=/cocoon://livres/livres.html 	3031 	3031 	3031
2 	xslt /src=/resources/stylesheets/php/document2php.xsl 	46 	46 	46
3 	html  	16 	16 	16
4 	TOTAL 	2360 	3891 	829
*livres/livres.xml* (4 results, total time: 46, average time: 11) 	0 
<http://localhost:8888/cprofile.html?key=-8345536717863364507&result=0> 	1 
<http://localhost:8888/cprofile.html?key=-8345536717863364507&result=1> 	2 
<http://localhost:8888/cprofile.html?key=-8345536717863364507&result=2> 	3 
<http://localhost:8888/cprofile.html?key=-8345536717863364507&result=3>
1 
file /src=/D:\duc\VIEWSI~1/src/documentation/content/xdocs/livres/livres.xml 
	4 	0 	16 	0 	0
2 	xml-document  	11 	0 	0 	15 	31
3 	TOTAL 	11 	0 	0 	15 	31


What's wrong with me - or exactly what's wrong with my pipeline ;-)  ?

Salutations,
Cyriaque,

>OK. I put this
>
><!-- php Pilelines -->
>            <!--pipeline that "marries" the docs in the root dir with the skin to produce
html-->
>            <map:match pattern="*.php">
>                <map:aggregate element="site">
>                    <map:part src="cocoon:/skinconf.xml"/>
>                    <map:part src="cocoon:/build-info"/>
>                    <map:part src="cocoon:/tab-{1}.html"/>
>                    <map:part src="cocoon:/menu-{1}.html"/>
>                    <map:part src="cocoon:/body-{1}.html"/>
>                </map:aggregate>
>                
>                <map:call resource="skinit">
>                    <map:parameter name="type" value="site2xhtml"/>
>                    <map:parameter name="path" value="{1}.html"/>
>                </map:call>
>            </map:match>         
>            <!--pipeline that "marries" the docs in all other dirs then root with the
skin to produce html-->
>            <map:match pattern="**/*.php">
>                <map:aggregate element="site">
>                    <map:part src="cocoon:/skinconf.xml"/>
>                    <map:part src="cocoon:/build-info"/>
>                    <map:part src="cocoon:/{1}/tab-{2}.html"/>
>                    <map:part src="cocoon:/{1}/menu-{2}.html"/>
>                    <map:part src="cocoon:/{1}/body-{2}.html"/>
>                </map:aggregate>
>                <map:call resource="skinit">
>                    <map:parameter name="type" value="site2xhtml"/>
>                    <map:parameter name="path" value="{1}.html"/>
>                </map:call>
>            </map:match>
>
>into my custom sitemap and copied the skinit-ressource into it as well
>(because Forrest complained).
>
>Then I entered a href of
>
>        abc.php
>
>into my sitemap and placed the html-document
>abc.html into xdocs.
>
>However trying that menu-item I only received this rather unspecific
>error message:
>
>Message: null
>Description: No details available.
>Sender: org.apache.cocoon.servlet.CocoonServlet
>Source: Cocoon Servlet
>Request URI
>anmeldungPHP.php
>cause
>null
>request-uri
>/anmeldungPHP.php
>
>Any ideas?
>
>--
>Ferdinand Soethe
>
>
>  
>

Mime
View raw message