cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject cvs commit: xml-cocoon2/src/webapp/myapp/xsl style.xsl
Date Tue, 30 Apr 2002 15:32:21 GMT
kpiroumian    02/04/30 08:32:21

  Modified:    src/webapp sitemap.xmap
  Added:       src/webapp/myapp myapp.spp readme.html sitemap.xmap
               src/webapp/myapp/xml page.xml
               src/webapp/myapp/xsp page.xsp
               src/webapp/myapp/xsl style.xsl
  Added a "Quick start" application template to be used
  for "minimal Cocoon" build target.
  Revision  Changes    Path
  1.49      +6 -0      xml-cocoon2/src/webapp/sitemap.xmap
  Index: sitemap.xmap
  RCS file: /home/cvs/xml-cocoon2/src/webapp/sitemap.xmap,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- sitemap.xmap	25 Apr 2002 16:26:29 -0000	1.48
  +++ sitemap.xmap	30 Apr 2002 15:32:21 -0000	1.49
  @@ -482,6 +482,12 @@
  +  <!-- MyApp - minimal Cocoon Application Mount -->
  +  <map:pipeline>
  +    <map:match pattern="myapp/**">
  +      <map:mount uri-prefix="myapp" src="myapp/" check-reload="yes"/>
  +    </map:match>
  +  </map:pipeline>
     <!-- sub-sitemap example pipeline -->
  1.1                  xml-cocoon2/src/webapp/myapp/myapp.spp
  Index: myapp.spp
  <?xml version="1.0" encoding="UTF-8"?>
  	<Folder FolderName="XML Files" ExtStr="xml;cml;math;mtx;rdf;smil;svg;wml">
  		<File FilePath=".\xml\page.xml" HomeFolder="Yes"/>
  	<Folder FolderName="XSP" ExtStr="xsp">
  		<File FilePath=".\xsp\page.xsp" HomeFolder="Yes"/>
  	<Folder FolderName="XSL Files" ExtStr="xsl;xslt">
  		<File FilePath=".\xsl\style.xsl" HomeFolder="Yes"/>
  	<Folder FolderName="HTML Files" ExtStr="html;htm;xhtml;asp">
  		<File FilePath=".\readme.html" HomeFolder="Yes"/>
  		<File FilePath=".\readme.txt" HomeFolder="Yes"/>
  	<Folder FolderName="DTD/Schemas" ExtStr="dtd;dcd;xdr;biz;xsd"/>
  	<Folder FolderName="Entities" ExtStr="ent"/>
  	<File FilePath=".\sitemap.xmap" HomeFolder="Yes"/>
  1.1                  xml-cocoon2/src/webapp/myapp/readme.html
  Index: readme.html
  <!-- CVS: $Id: readme.html,v 1.1 2002/04/30 15:32:21 kpiroumian Exp $ -->
        <title>Minimal Cocoon Web Application - README</title>
               Minimal Cocoon Web Application Template
  	 by Konstantin Piroumian (
  	 Date: $Date: 2002/04/30 15:32:21 $
  This is the place where you can start hacking with Cocoon.
  What you have to know before using this template
  1. You should know basics of XML: how to create content
  2. You should be familiar more or less with XSLT
  3. You should be familiar with Web Applications 
  and servlet environment
  4. It's not neccessary, but it'd be fine if you were familiar
  with Java language, so you could create dynamic pages
  For newbies
  1. Create XML files, drop them into 'xml' directory
  2. Edit the stylesheet named style.xsl to render your xml, 
     just drop it into 'xsl' directory
  3. Access this URL: http://localhost:<port>/cocoon/myapp/<page>.xml 
         'page' is actual name of your xml file, say 'index.xml'
         'port' your app server port where it handles servlet requests, 
          8080 for Tomcat
  4. Enjoy!
  Note: Templates for XML, XSLT files are provided for your convenience.
  A little more advanced users
  1. Create XSP files, drop them into 'xml' directory
  2. Create/reuse stylesheet(s) to render your XSP output
  3. Access this URL: http://localhost:<port>/cocoon/myapp/<page>.xsp
  4. Fix your XSP, try again
  5. Enjoy!
  Very advanced users
  1. Read User docs (
  2. Edit your sitemap.xmap as needed for your application: 
  	- add/use components (see root sitemap to see what is availble)
  	- add/modify pipelines (change matching patterns, add actions)
  	- use more transformations in pipeline
  	- use aggregation
  	- create sitemap resources
  	- create sitemap views
  Not all the above is necessary for every application. 
  For advanced developers
  You don't need this application, you can create your own, if no, 
  then look a few lines upper  ;)
  1. Read Developer docs (
  2. Implement your own components:
  	- actions
  	- generators
  	- transformers
  	- serializers
  	- sources
  	- [add your own]
  Note: You can find a lot of samples to learn from in Cocoon sources.
  3. Declare your components in sitemap
  4. Debug your sitemap
  5. Debug your components
  6. Enjoy when it works!
  For all kind of users
  - Join Cocoon Users mail list and ask questions if you don't find the answer in FAQ or docs
  - Join Cocoon Dev mail list to participate in Cocoon development
  That's all folks!
  Cocoon Team wishes you Happy Hacking with Cocoon 2.1!
  1.1                  xml-cocoon2/src/webapp/myapp/sitemap.xmap
  Index: sitemap.xmap
  <?xml version="1.0"?>
  <map:sitemap xmlns:map="">
  <!-- CVS: $Id: sitemap.xmap,v 1.1 2002/04/30 15:32:21 kpiroumian Exp $ -->
      Minimal sitemap to start making XML/XSP/XSLT transformations.
      Author: Konstantin Piroumian "" 
          <map:generators default="file"/>
          <map:transformers default="xslt"/>
          <map:readers default="resource"/>
          <map:serializers default="html"/>
          <map:matchers default="wildcard"/>
          <map:selectors default="browser"/>
     <!-- =========================== Pipelines ================================= -->
                  <!-- Default URL matcher. Matches '/' URLs-->
                  <map:match pattern="">
                      <map:redirect-to uri="readme.html" />
                  <!-- This matches requests like 'page.xml' to display static output -->
                  <map:match pattern="*.xml">
                          <!-- {1} contains the value that substituted '*' in the pattern-->
                          <map:generate src="xml/{1}.xml"/>
                          <!-- You can change 'src' to 'xsl/{1}.xsl' to use custom stylesheets
                          for every page, e.g.: mypage.xml -> mypage.xsl  -->
                          <map:transform src="xsl/style.xsl"/>
                          <!-- Just output the result as HTML (default) 
                              Add 'type' attribute with 'xml' value to get XML output
                  <!-- This matches requests like 'page.xsp' to display dynamic output
                  <map:match pattern="*.xsp">
                          <!-- This generator uses 'serverpages' generator. 
                          See the root sitemap for other types of available components -->
                          <map:generate type="serverpages" src="xsp/{1}.xsp"/>
                          <map:transform src="xsl/style.xsl"/>
                  <!-- Display static HTML files, like readme.html -->             
                  <map:match pattern="*.html">
                      <map:read src="{1}.html" mime-type="text/html" />
                  <!-- Add your pipelines here -->
  <!-- end of file -->
  1.1                  xml-cocoon2/src/webapp/myapp/xml/page.xml
  Index: page.xml
  <?xml version="1.0" encoding="UTF-8"?>
  <!-- CVS: $Id: page.xml,v 1.1 2002/04/30 15:32:21 kpiroumian Exp $ -->
      <title>My App page</title>
          <para>Just a static contents</para>
  1.1                  xml-cocoon2/src/webapp/myapp/xsp/page.xsp
  Index: page.xsp
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <!-- CVS: $Id: page.xsp,v 1.1 2002/04/30 15:32:21 kpiroumian Exp $ -->
       XSP can be assotiated with the logicsheet using processing
       instruction xml-logicsheet or the xsp:logicsheet element.
       Do not use both methods!
  <?xml-logicsheet href="logicsheets/hello.xsl"?>
  <xsp:page language="java" xmlns:xsp="">
  <!-- Place your imports here. Note, that you shoud have imported 
      packages somewhere in classpath. -->
      <!-- Place your class level logic here -->
          private Date getDate() {
              return new Date();
      <!-- Your content root element -->    
          <!-- Place logicsheet declarations here. Href is relative to app context -->
          <xsp:logicsheet location="logicsheets/hello.xsl"/>
          <title>My App XSP Page</title>
                  Some dynamic content <xsp:expr>getDate()</xsp:expr>
  1.1                  xml-cocoon2/src/webapp/myapp/xsl/style.xsl
  Index: style.xsl
  <?xml version="1.0" encoding="UTF-8"?>
  <!-- CVS: $Id: style.xsl,v 1.1 2002/04/30 15:32:21 kpiroumian Exp $ -->
  <xsl:stylesheet version="1.0" xmlns:xsl="">
  <xsl:template match="page">
              <title><xsl:value-of select="title" /></title>
              <xsl:apply-templates />
  <xsl:template match="title">
      <h1><xsl:value-of select="." /></h1>

In case of troubles, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message