stefano 2003/03/01 09:48:00
Modified: src/webapp/samples samples.xml sitemap.xmap Log: starting to cleanup the huge samples mess (this will take a while people, so please be patient) Revision Changes Path 1.41 +11 -92 xml-cocoon2/src/webapp/samples/samples.xml Index: samples.xml =================================================================== RCS file: /home/cvs/xml-cocoon2/src/webapp/samples/samples.xml,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- samples.xml 15 Feb 2003 04:28:53 -0000 1.40 +++ samples.xml 1 Mar 2003 17:48:00 -0000 1.41 @@ -1,70 +1,8 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- CVS: $Id$ --> -<samples xmlns:xlink="http://www.w3.org/1999/xlink"> - <group name="Hello World!"> - <sample name="XML" href="hello-world/hello.html.source"> - A simple XML page source. - </sample> - <sample name="Web Service" href="hello-world/hello.service"> - A simple Web Service (REST style). - </sample> - <sample name="Web Service WSDL" href="hello-world/hello.service/WSDL"> - WSDL for the Web Service. - </sample> - <sample name="HTML" href="hello-world/hello.html"> - This is a very simple demonstration of how to use Cocoon. A simple XML page - is transformed into an HTML page. - </sample> - <sample name="XHTML" href="hello-world/hello.xhtml"> - Here it is output as XHTML. - </sample> - <sample name="TEXT" href="hello-world/hello.txt"> - The XML page is transformed into a plain text page. - </sample> - <sample name="WML" href="hello-world/hello.wml"> - Now something more juicy: the exact same page is translated into WAP WML. - </sample> - <sample name="VoxML" href="hello-world/hello.vml"> - Maybe you have your hands busy? with VoxML you don't need hands, just your voice. - </sample> - <sample name="SVG" href="hello-world/hello.svg"> - Need a fancier look? No problem, SVG is your friend. - </sample> - <sample name="SVG JPEG" href="hello-world/hello.jpg"> - Need a fancier look but don't have an SVG browser? SVG is served as JPEG by Cocoon. - </sample> - <sample name="SWF" href="hello-world/hello.swf"> - If you have a flash plugin Cocoon will serve you a SWF. - </sample> - <sample name="VRML" href="hello-world/hello.wrl"> - Need more space? Well, not really useful in this case, but VRML may come handy. - </sample> - <sample name="PDF" href="hello-world/hello.pdf"> - Printed HTML sucks? Don't worry, your friend Cocoon gives you a nice PDF (fop). - </sample> - <sample name="PDF" href="hello-world/hello2.pdf"> - Printed HTML sucks? Don't worry, your friend Cocoon gives you a nice PDF (itext). - </sample> - <sample name="PS" href="hello-world/hello.ps"> - You prefer postscript? No problem, here it is! - </sample> - <sample name="RTF" href="hello-world/hello.rtf"> - How about RTF? Load this one in your favorite wordprocessor! - </sample> - <sample name="XLS" href="hello-world/hello.xls"> - Still stuck with legacy file formats? Don't worry, here is an example. - </sample> - </group> - <group name="Web Applications"> - <sample name="Web Applications" href="sample-apps"> - Samples showing how to perform form processing, state management, - and simple web-application with login and protected resources. - </sample> - </group> + +<samples> + <group name="System Tools And Pages"> - <!-- sample name="Sitemap Editor" href="sitebuilder/openSubSite/"> - Cocoon/JSP based Sitemap Editor. - </sample --> <sample name="Status Page" href="status"> Cocoon status page. </sample> @@ -84,6 +22,7 @@ This example shows what happens if an error is triggered in the pipeline. </sample> </group> + <group name="Control flow"> <sample name="Documentation" href="flow/"> Introduction to Cocoon's control flow of Web pages. @@ -92,6 +31,7 @@ Samples implemented using control flow. </sample> </group> + <group name="XMLForm: Form Handling and Web Services"> <sample name="Documentation" href="xmlform/overview.html"> Introduction to Cocoon's form handling framework, @@ -108,6 +48,7 @@ exposed as a Web Service. </sample> </group> + <group name="Web Site Syndication"> <sample name="Examples" href="webserviceproxy/"> Demonstrates how to embed One Web Site functionality @@ -121,34 +62,14 @@ services without writing a single line of business logic code. Only styling is used in addition to the proxy. </sample> - <sample name="Documentation" href="../documents/userdocs/generators/wsproxy-generator.html"> - Learn about syndication of web content and functionality. - Look at use cases, diagrams and sample code. - </sample> </group> + <group name="Internationalization & Localization"> <sample name="i18n samples" href="i18n/"> Internationalization with Cocoon </sample> </group> - <group name="Documentation"> - <sample name="Docs" href="../documents/index"> - The Cocoon documentation. - </sample> - <sample name="List of docs" href="../documents/doclist.html"> - Generated list of all documentation (aggregates each book.xml) - </sample> - <sample name="Slides" href="../slides/slides"> - An old, but still relevant, presentation of Cocoon 1 shown at - ApacheCon 2000 (an example of complex XSLT usage). - </sample> - <sample name="Search the docs" href="search/welcome"> - Search into the Cocoon documentation using Apache Lucene. - </sample> - <sample name="Check links" href="linkstatus/"> - Verify that there are no broken hyperlinks in the Cocoon documentation. - </sample> - </group> + <group name="More Samples"> <sample name="Static Content" href="sample-static"> How to produce different type of static content. @@ -163,14 +84,11 @@ Samples showing possible ways how to use Cocoon sources in sitemap. (These samples are served by sub-sitemap) </sample> - <sample name="Legacy file formats" href="poi/"> - Samples showing how to use Apache POI to use common office file formats - with Cocoon. - </sample> - <sample name="Miscellaneous" href="misc/"> + <sample name="Miscellaneous" href="misc/"> Other samples: Catalog entity resolver, ... </sample> </group> + <group name="Block samples"> <sample name="Blocks with samples" href="blocks"> Functionality outside the core has been moved to units called "blocks". @@ -179,6 +97,7 @@ Look here ... samples for more and more blocks are in this section. </sample> </group> + <group name="Scratchpad samples"> <sample name="Try Scratchpad" href="scratchpad"> Here is a peek of what the next release of Cocoon will bring. 1.30 +7 -380 xml-cocoon2/src/webapp/samples/sitemap.xmap Index: sitemap.xmap =================================================================== RCS file: /home/cvs/xml-cocoon2/src/webapp/samples/sitemap.xmap,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- sitemap.xmap 31 Jan 2003 18:20:45 -0000 1.29 +++ sitemap.xmap 1 Mar 2003 17:48:00 -0000 1.30 @@ -1,56 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> -<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0"> -<!-- - This is the 'heart' of Cocoon. The sitemap maps URI space to - resources. It consists basicly of two parts: components and - pipelines. Pipelines are made out of components. There is such a - vast number of components available that it would be impossible to - describe them here, please refer to the accompanying - documentation. For specific components, have a look also at the - javadocs for them. Most pipelines are present to demonstrate some - feature or technique, often they are explained in more detail in - the accompanying documentation. - - There are some other, less important parts that deal with - resources, views and action sets. For now, ignore them. ---> - +<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0"> <!-- =========================== Components ================================ --> <map:components> - -<!-- - All pipelines consist at least of two components: a generator, that - produces the content and a serialiser, that delivers the content to - the client. - - More precisely: a generator generates SAX events and a serializer - consumes these events and produces a character stream. - - Some things to note here: each generator has a unique name, this - name is mapped to a java class, one name is declared as default - generator. In addition each generator may have additional - configurations as child elements. - - Additional attributes are targeted at the component manager. The optional - "label" attribute is relevant for the view concept below. The optional - "logger" attribute defines the logging category where messages produced - by a component should go. If there's no "logger" attribute, the category - used is the one defined for the "sitemap" component in cocoon.xconf. - - We have chosen in this example sitemap to use a different logging category - for each component, which allows fine-grained classification of log - messages. But you are free to use any category you want. - - It is possible to have the same java class declared as different - generators by using different names. No configuration options are - shared between these instances, however. - - All components follow this schema. - ---> <map:generators default="file"/> <map:transformers default="xslt"/> <map:readers default="resource"/> @@ -63,67 +17,26 @@ </map:matcher> </map:matchers> <map:selectors default="browser"/> - -<!-- - Actions are executed during pipeline setup. Their purpose is to - execute some arbitrary complex code. They are the work horses of - pipelines. Use them to update databases, check external resources - etc. The execution may fail or complete successfully. Only if the - execution was successful, the pipeline fragment contained inside is - used within the pipeline. Related concepts are matchers and - selectors. - - Since this is important, let me repeat it: Actions are executed - during pipeline setup. ---> - <map:actions> -<!-- example, see databases block samples for more --> -<!-- - <map:action logger="sitemap.action.add-employee" name="add-employee" src="org.apache.cocoon.acting.DatabaseAddAction"/> - <map:action logger="sitemap.action.del-employee" name="del-employee" src="org.apache.cocoon.acting.DatabaseDeleteAction"/> - <map:action logger="sitemap.action.upd-employee" name="upd-employee" src="org.apache.cocoon.acting.DatabaseUpdateAction"/> ---> - </map:actions> - </map:components> <!-- =========================== Views =================================== --> -<!-- - Views provide diffent, well, views to resources. Views are - orthogonal to pipelines. Please refer to the docs. ---> <map:views> - <map:view name="content" from-label="content"> - <map:serialize type="xml"/> - </map:view> <map:view name="pretty-content" from-label="data"> <map:transform src="common/style/xsl/html/simple-xml2html.xsl"/> <map:serialize type="html"/> </map:view> - <map:view name="links" from-position="last"> - <map:serialize type="links"/> - </map:view> - </map:views> <!-- =========================== Resources ================================= --> -<!-- - Resources are pipeline fragments that may be used from different - pipeline fragments. For our needs, they behave exactly like - pipelines, only that they are not accessible from outside. - Hence I will explain what's inside below for pipelines. ---> - <map:resources> <map:resource name="slides"> <map:generate src="docs/samples/slides/slides.xml"/> <map:transform src="stylesheets/slides/slides-navigation.xsl"> <map:parameter name="use-request-parameters" value="true"/> - <map:parameter name="use-browser-capabilities-db" value="true"/> </map:transform> <map:transform src="stylesheets/slides/slides-apachecon.xsl"/> <map:serialize/> @@ -184,57 +97,9 @@ </map:resource> </map:resources> -<!-- ========================== Action sets ================================ --> - -<!-- - Action sets group actions together. If some actions are often used - together in pipeline fragments, it's easier to group them and refer - to the group. For more info, please see the docs. ---> - <map:action-sets> -<!-- example, see databases block samples for more --> -<!-- - <map:action-set name="employee"> - <map:act action="Add" type="add-employee"/> - <map:act action="Delete" type="del-employee"/> - <map:act action="Update" type="upd-employee"/> - </map:action-set> ---> - </map:action-sets> - <!-- =========================== Pipelines ================================= --> -<!-- - Pipelines. The beef. Pipelines specify, how the processing of your - content is done. Usually, a pipeline consists of several fragments - that specify the generation, transformation, and serialization of - SAX events. - - Processing is done in two steps: - - 1) The top level elements are executed in order of appearance until - one signals success. These top level elements are usually - matchers. AFAIK other components are not supported for this. - - Other components are called depth-first to determine what - fragments make up the processing pipeline. When a component - fails, no nested components are called but the next component on - the same level. - - 2) Once it is determined which generator, which transformers and - wich serializer is used, these components are executed. During - this, the pipeline may not be changed. - - - You may have as many pipelines in your sitemap as you like. However, - it seems that the only purposes would be to specify different error - handlers. ---> - <map:pipelines> - <map:component-configurations> - <!-- Define component configuration here --> - </map:component-configurations> <map:pipeline> <!-- Welcome site with all samples --> @@ -284,6 +149,7 @@ <!-- Mount: --> <map:mount check-reload="yes" src="sub/sitemap.xmap" uri-prefix="sub"/> + <!-- Sitemaps may be organized hierarchically. Here such a subsitemap is "mounted" (think: unix filesystems) to be responsible for all @@ -317,35 +183,6 @@ <map:transform src="stylesheets/simple-xml2html.xsl"/> <map:serialize/> </map:match> - - <!-- Below goes entries added by Cocoon build system --> - - - <!-- XSP pages written in Javascript --> - <map:match pattern="xsp-js/*"> - <map:generate src="docs/samples/xsp-js/{1}.xsp" type="serverpages"> - <map:parameter name="programming-language" value="js"/> - </map:generate> - <map:transform src="context://samples/stylesheets/dynamic-page2html.xsl"> - <map:parameter name="servletPath" value="{request:servletPath}"/> - <map:parameter name="sitemapURI" value="{request:sitemapURI}"/> - <map:parameter name="contextPath" value="{request:contextPath}"/> - <map:parameter name="file" value=".xsp"/> - </map:transform> - <map:serialize/> - </map:match> - - - <!-- ======================= XML:DB ============================== --> - <map:match pattern="xmldb/**"> - <map:match pattern="xpath" type="request-parameter"> - <map:generate src="xmldb:xindice://localhost:4080/db/{../1}#{1}"/> - <map:serialize type="xml"/> - </map:match> - - <map:generate src="xmldb:xindice://localhost:4080/db/{1}"/> - <map:serialize type="xml"/> - </map:match> </map:pipeline> <!-- main samples pipeline --> @@ -421,51 +258,6 @@ <map:serialize/> </map:match> - - - <map:match pattern="welcome-svg"> - <map:generate src="samples.xml"/> - <map:transform src="stylesheets/svg-samples2html.xsl"/> - <map:transform type="extractor"/> - <!-- - Here, several transformers are needed to obtain the desired - result. Note, that the above is not the default transformer but - one named "extractor". Interestingly enough, this transformer - does not need any additional configuration or input. - - If we look at it's javadocs it says: - - "[...] The transformation half of the FragmentExtractor. This - transformer sieves an incoming stream of xml with embedded SVG - images and replaces the images with an xlink locator pointing - to the image. [...]" - - So, this interacts with the fragment below, doing the actual - generating. - --> - <map:transform src="stylesheets/fragment-extractor.xsl"/> - <map:serialize/> - </map:match> - - <map:match pattern="welcome-svg-images/*.png"> - <map:generate src="{1}" type="extractor"/> - <!-- - Again, citing the javadocs: - - "[...] The generation half of - FragmentExtractor. FragmentExtractor is a transformer-generator - pair which is designed to allow sitemap managers to extract - certain nodes from a SAX stream and move them into a separate - pipeline. The main use for this is to extract inline SVG images - and serve them up through a separate pipeline, usually - serializing them to PNG or JPEG format first. [...]" - --> - <map:serialize type="svg2png"/> - </map:match> - - - - <!-- ================ Hello =========================== --> <map:match pattern="deli.html"> @@ -504,24 +296,12 @@ <map:serialize type="xml"/> </map:match> - <map:match pattern="hello.svg"> - <map:generate src="docs/samples/hello-page.xml"/> - <map:transform src="stylesheets/page/simple-page2svg.xsl"/> - <map:serialize type="svg2jpeg"/> - </map:match> - <map:match pattern="hello.wrl"> <map:generate src="docs/samples/hello-page.xml"/> <map:transform src="stylesheets/page/simple-page2vrml.xsl"/> <map:serialize type="vrml"/> </map:match> - <map:match pattern="hello.pdf"> - <map:generate src="docs/samples/hello-page.xml"/> - <map:transform src="stylesheets/page/simple-page2fo.xsl"/> - <map:serialize type="fo2pdf"/> - </map:match> - <map:match pattern="redirect"> <map:act type="request"> <map:parameter name="parameters" value="true"/> @@ -621,41 +401,6 @@ <!-- ================ Static =========================== --> - <map:match pattern="fo"> - <map:generate src="docs/samples/fo/readme.fo"/> - <map:serialize type="fo2pdf"/> - </map:match> - - <map:match pattern="svg"> - <map:generate src="docs/samples/svg/henryV.svg"/> - <map:serialize type="svg2png"/> - </map:match> - - <map:match pattern="scripts/*"> - <map:generate src="docs/samples/scripts/{1}" type="script"/> - <map:transform src="context://samples/stylesheets/page/simple-page2html.xsl"> - <map:parameter name="servletPath" value="{request:servletPath}"/> - <map:parameter name="sitemapURI" value="{request:sitemapURI}"/> - <map:parameter name="contextPath" value="{request:contextPath}"/> - <map:parameter name="file" value="docs/samples/scripts/{1}"/> - <map:parameter name="remove" value="{0}"/> - </map:transform> - <map:serialize type="html"/> - </map:match> - - <map:match pattern="templates/*"> - <map:generate src="templates/{1}" type="velocity"> - <map:parameter name="name" value="Velocity"/> - <map:parameter name="project" value="Cocoon"/> - </map:generate> - <map:transform src="context://samples/stylesheets/page/simple-page2html.xsl"> - <map:parameter name="servletPath" value="{request:servletPath}"/> - <map:parameter name="sitemapURI" value="{request:sitemapURI}"/> - <map:parameter name="contextPath" value="{request:contextPath}"/> - </map:transform> - <map:serialize type="html"/> - </map:match> - <map:match pattern="slides/slides"> <map:call resource="slides"/> <!-- @@ -691,6 +436,7 @@ </map:match> <!-- =========================== Dynamic ================================ --> + <map:match pattern="xsp/*"> <map:generate src="docs/samples/xsp/{1}.xsp" type="serverpages"/> <map:transform src="context://samples/stylesheets/dynamic-page2html.xsl"> @@ -716,89 +462,8 @@ <map:serialize/> </map:match> - - <!-- ========================== session state ================================= --> - - <map:match pattern="session-state/example"> - <!-- - This example like the next one show, that matches can be - nested and don't need to match on URIs alone. By using a - session attribute or the referer header for matches it is - easy to model a state machine with the sitemap. - - There are user documents on this. - --> - <map:act type="session-isvalid"> - <!-- if session is valid ... --> - - <map:match pattern="1" type="sessionstate"> - <!-- if a specific session attribute matches pattern "1" --> - <map:match pattern="1" type="next-page"> - <map:call resource="dynamic-page1"> - <map:parameter name="target" value="docs/samples/session-state"/> - <map:parameter name="remove" value="session-state/example"/> - </map:call> - <!-- by calling this resource, the rest of this fragment here is irrelevant --> - </map:match> - <map:match pattern="2" type="next-page"> - <map:call resource="dynamic-page1"> - <map:parameter name="target" value="docs/samples/session-state"/> - <map:parameter name="remove" value="session-state/example"/> - </map:call> - </map:match> - </map:match> - - <map:match pattern="2" type="sessionstate"> - <map:match pattern="1" type="next-page"> - <map:call resource="dynamic-page1"> - <map:parameter name="target" value="docs/samples/session-state"/> - <map:parameter name="remove" value="session-state/example"/> - </map:call> - </map:match> - <map:match pattern="2" type="next-page"> - <map:call resource="dynamic-page1"> - <map:parameter name="target" value="docs/samples/session-state"/> - <map:parameter name="remove" value="session-state/example"/> - </map:call> - </map:match> - </map:match> - - <map:call resource="dynamic-page2"> - <map:parameter name="target" value="docs/samples/session-state/state0"/> - <map:parameter name="remove" value="session-state/example"/> - </map:call> - </map:act> - <!-- end if session is valid --> - - <map:call resource="dynamic-page"> - <map:parameter name="target" value="docs/samples/session-state/start"/> - <map:parameter name="remove" value="session-state/example"/> - </map:call> - </map:match> - - <!-- ========================== referer ================================= --> - - <map:match pattern="referer/*"> - <map:match pattern="http://*/cocoon/samples/referer/a" type="referer-match"> - <map:call resource="simple-page"> - <map:parameter name="target" value="docs/samples/referer/a/{../1}"/> - <map:parameter name="remove" value="{../0}"/> - </map:call> - </map:match> - <map:match pattern="http://*/cocoon/samples/referer/b" type="referer-match"> - <map:call resource="simple-page"> - <map:parameter name="target" value="docs/samples/referer/b/{../1}"/> - <map:parameter name="remove" value="{../0}"/> - </map:call> - </map:match> - - <map:call resource="simple-page"> - <map:parameter name="target" value="docs/samples/referer/a/a"/> - <map:parameter name="remove" value="{0}"/> - </map:call> - </map:match> - <!-- ========================== Stream ================================= --> + <map:match pattern="request1"> <map:generate type="stream"> <map:parameter name="form-name" value="Foo"/> @@ -818,6 +483,7 @@ </map:match> <!-- ========================== XSP Sources ============================== --> + <map:match pattern="view-source/*"> <map:read mime-type="text/plain" src="docs/samples/slides/{1}"/> </map:match> @@ -838,12 +504,14 @@ </map:match> <!-- ========================== SOAP ============================== --> + <map:match pattern="soap/*"> <map:generate src="docs/samples/soap/{1}.xml" type="serverpages"/> <map:serialize type="xml"/> </map:match> <!-- ======================== XScript Samples ========================= --> + <map:match pattern="xscript/soap-getquote1"> <map:generate src="docs/samples/xscript/soap-getquote1.xsp" type="serverpages"/> <map:transform src="docs/samples/xscript/soap-getquote1.xsl"/> @@ -869,20 +537,7 @@ <map:serialize/> </map:match> - <!-- ========================== Tidy Samples ============================== --> - - <map:match pattern="yahoo"> - <map:generate src="http://www.yahoo.com" type="html"> - <map:parameter name="xpath" value="/html/body/center/table[4]/tr[1]/td[1]"/> - </map:generate> - <map:transform src="stylesheets/news/news.xsl"/> - <map:serialize type="html"/> - </map:match> - <!-- ========================= Server ================================ --> - <map:match pattern="legacyProfiles/**.rdf"> - <map:read mime-type="text/rdf" src="resources/legacyProfiles/{1}.rdf"/> - </map:match> <map:match pattern="request"> <map:generate type="request"/> @@ -939,32 +594,6 @@ <map:read mime-type="image/png" src="resources/images/{1}.png"/> </map:match> -<!-- <map:match pattern="**/"> - <map:generate src="{1}" type="directory"/> - <map:transform src="stylesheets/system/directory2html.xsl"/> - <map:serialize/> - </map:match>--> - - <map:handle-errors> - <map:transform src="context://samples/stylesheets/system/error2html.xsl"/> - <map:serialize status-code="500"/> - </map:handle-errors> - - </map:pipeline> - <map:pipeline> - - <map:match pattern=""> - <map:redirect-to uri="welcome"/> - </map:match> - - <map:match pattern="welcome"> - <map:generate src="samples.xml"/> - <map:transform src="context://samples/common/style/xsl/html/simple-samples2html.xsl"> - <map:parameter name="contextPath" value="{request:contextPath}"/> - </map:transform> - <map:serialize/> - </map:match> - <map:match pattern="scratchpad"> <map:generate src="scratchpad-samples.xml"/> <map:transform src="context://samples/common/style/xsl/html/simple-samples2html.xsl"> @@ -1036,5 +665,3 @@ </map:pipelines> </map:sitemap> - -<!-- end of file -->