You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by st...@outerthought.org on 2003/05/08 11:00:05 UTC

[WIKI-UPDATE] SamplesRefactor ExampleApps UnderstandingCocoonMounts Thu May 8 11:00:05 2003

Page: http://wiki.cocoondev.org/Wiki.jsp?page=SamplesRefactor , version: 7 on Thu May  8 08:35:47 2003 by DavidCrossley

- |tutorial| |?|?|
+ |tutorial| |yes|no|missing form widgets on linux
- |documents| |?|?|
?              ^ ^

+ |documents| |yes|yes|
?              ^^^ ^^^



Page: http://wiki.cocoondev.org/Wiki.jsp?page=ExampleApps , version: 35 on Thu May  8 08:57:29 2003 by 61.11.10.227

+ ----
+ ![Web Developer|iyyappan_n_i@hotmail.com]
+ I made a Custamizable Cocoon Internet Shop. If you are looking for 
+ examples of how to make small cocoon webs, try this. If you like it
+ drop me a word.
+ Thanks. 
+ Here you can find the [application|http://wiki.cocoondev.org/attach?page=ExampleApps%2Fshop.zip]. 
+ 
+ [iyyappan_n_i@hotmail.com]
+ 
+ ----


Page: http://wiki.cocoondev.org/Wiki.jsp?page=UnderstandingCocoonMounts , version: 27 on Thu May  8 08:50:41 2003 by 80.11.9.74

+ !!Some design ideas.
+ 
+ Auto-Mount may be a very powerful feature to design your cocoon server, and share resources between users/clients. Now, the problem is, what to let to the root sitemap, and what is the minimum to ask to sub-sitemaps.
+ 
+ !Components
+ 
+ Inheritance of components have been a little problem between some versions of Cocoon, it's now solved. But after experience, it's not so bad to keep the components you need in each sitemap, especially to have your own names for generators or transformers, and be able to move your app under any other sitemap, or put it directly as root.
+ 
+ !Static Resources
+ 
+ An interesting feature to ask to a root sitemap is service of static resources. Example :
+ 
+ {{{<map:match pattern="**.ai">
+   <map:read src="{1}.ai" mime-type="application/postscript"/>
+ </map:match>
+ <map:match pattern="**.aif">
+   <map:read src="{1}.aif" mime-type="audio/x-aiff"/>
+ </map:match>
+ <!-- ... -->}}}
+ 
+ There are lot of mime/type, and they are very useful in case of downloading on some browsers. Not funny to copy/paste the list everywhere. First, put it as [Resources]. It will be easier to manipulate.
+ 
+ {{{<map:resources>
+   <map:resource name="static">
+     <!-- all the pipeline fragments matching static resources -->
+   </map:resource>
+ <!-- ... -->
+ </map:resources>
+ 
+ <!-- call it like that where you want in a pipeline process -->
+ <map:call resource="static"/>}}}
+ 
+ __Now, where to put this call relatively to a mount?__
+ 
+ If you put it like that
+ {{{<map:call resource="static"/>
+ <map:match pattern="*/**">
+   <map:mount uri-prefix="{1}" src="{1}/" check-reload="yes"/>
+ </map:match>}}}
+ All urls like **.js, or **.css will be handled before sub-sitemap matches. Nice, no more need to declare them in each sub-sitemaps.
+ But sadly, now your clients will not be allowed to use the virtual matching of cocoon on common file extensions (example: producing images on request with a **.png url). __Bad solution__
+ 
+ If you put it like that
+ {{{<map:match pattern="*/**">
+   <map:mount uri-prefix="{1}" src="{1}/" check-reload="yes"/>
+   <map:call resource="static"/>
+ </map:match>}}}
+ Fix me, but sub-sitemap seems to throw the "Resource not found" error, before the call in the root sitemap.
+ 
+ An idea was to copy the pipeline in all sub-sitemaps (heavy). Fix me, but it seems impossible to use resource from root sitemap in sub-sitemaps. 
+ 
+ ''Forget the idea?'' There's an elegant solution with [ResourceExistsAction]. The contract of the root sitemap will become, ''"Serves static resource if exists, if not, give hand to sub-sitemaps"''. This is expressed, like that
+ {{{<map:match pattern="**">
+     <map:act type="resource-exists">
+       <map:parameter name="url" value="context://{1}"/>
+       <map:call resource="static"/>
+     </map:act>
+ </map:match>
+ <map:match pattern="*/**">
+   <map:mount uri-prefix="{1}" src="{1}/" check-reload="yes"/>
+ </map:match>}}}
+ 
+ In hope this helps, [Frédéric Glorieux|FrédéricGlorieux]
+ 
-     What are the components inherited from parent sitemap? Is it possible to continue the pipeline process of the parent sitemap if the sub-sitemap haven't matched something? Is it possible to call a resource from a parent sitemap <map:call resource="id"/>?'' -- Anonymous
?                                                                                                                                                                                                                                                                        ^^ ^^^  ^

+     What are the components inherited from parent sitemap? Is it possible to continue the pipeline process of the parent sitemap if the sub-sitemap haven't matched something? Is it possible to call a resource from a parent sitemap <map:call resource="id"/>?'' -- [Frédéric Glorieux|FrédéricGlorieux]
?                                                                                                                                                                                                                                                                        ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ +++ ^^