cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@locus.apache.org
Subject cvs commit: xml-cocoon/samples/slides README apachecon.css apachecon.xsl cocoon.png home.png navigation.xsl next-section.png next.png previous-section.png previous.png pyramid-model.gif schema.jpg slides.xml
Date Thu, 13 Apr 2000 10:41:50 GMT
stefano     00/04/13 03:41:49

  Added:       samples/slides README apachecon.css apachecon.xsl cocoon.png
                        home.png navigation.xsl next-section.png next.png
                        previous-section.png previous.png pyramid-model.gif
                        schema.jpg slides.xml
  Log:
  added my slides
  
  Revision  Changes    Path
  1.1                  xml-cocoon/samples/slides/README
  
  Index: README
  ===================================================================
  This directory includes everything you need to do the presentation that
  Stefano Mazzocchi <stefano@apache.org> gave at ApacheCON 2000. 
  These are the exact same slides used during the talk and they were presented 
  on Cocoon 1.7.1.
  
  Note that they made extensive use of new web technologies such as CSS and PNG, 
  so make sure you have a CSS + PNG capable web browser to access the pages. The
  presentation was tested under both MS-IE5 and Mozilla M14.
  
  This doesn't want to be an XML replacer for slide presentation applications, but
  a good example of a complex use of XML publishing. Also, the slide DTD is _very_
  rought since it was developed just for that purpose.
  
  We have no plans to support or moving further such DTDs or enforce its use, at
  the same time, we suggest you to take a look at how things are done and gain
  more knowledge on the possibilities of XML publishing.
  
  
  
  1.1                  xml-cocoon/samples/slides/apachecon.css
  
  Index: apachecon.css
  ===================================================================
  #main {
          border: none;
          font-size: 20pt;
          line-height: 24pt;
          font-family: Helvetica;
          font-variant: normal;
          font-style: normal;
          font-stretch: normal;
          font-size-adjust: none
          padding: 0.5em 0.5em 0.5em 0.5em
  }
  
  P {
          padding: 10px 10px 10px 10px;
          margin: 10px 20px 10px 20px;
  }
  
  P.quote {
          font-style: italic;
  }
  
  PRE {
          padding: 10px 10px 10px 10px;
  }
  
  H1 {
          font-size: 34pt;
          line-height: 36pt;
          text-align: center;
          padding: 30px 10px 10px 10px;
  }
  
  H3 {
          font-size: 20pt;
          line-height: 24pt;
          text-align: center;
          font-weight: lighter;
          font-style: normal
  }
  
  UL {
          font-size: 20pt;
          line-height: 35pt;
          margin: 30px 100px 30px 50px;
  }
  
  A:link { color: #0000A0 }
  A:visited { color: #A00000 }
  A:active { color: #00A000 }
  
  
  
  1.1                  xml-cocoon/samples/slides/apachecon.xsl
  
  Index: apachecon.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:template match="slide">
     <xsl:processing-instruction name="cocoon-format">type="text/html"</xsl:processing-instruction>
     <html>
      <head>
       <title><xsl:value-of select="title"/></title>
       <link rel="stylesheet" type="text/css" href="{@style}.css" title="Style"/>
      </head>
      <body>
       <table width="100%">
        <tr>
         <td>
          <table width="100%">
           <tr>
            <td width="100%"><img src="cocoon.png" border="0" height="51" width="317"/></td>
            <td>
             <xsl:apply-templates select="navigation"/>
            </td>
           </tr>
          </table>
         </td>
        </tr>
        <tr>
         <td>
          <div id="main">
           <xsl:apply-templates select="layout"/>
          </div>
         </td>
        </tr>
       </table>
      </body>
     </html>
    </xsl:template>
  
    <xsl:template match="navigation">
     <table>
      <tr>
       <td>
        <xsl:if test="previous">
         <a href="{previous/@href}"><img src="previous.png" border="0"/></a>
        </xsl:if>
        <xsl:if test="not(previous)">
         <img src="previous.png" border="0"/>
        </xsl:if>
       </td>
       <td>
        <xsl:if test="previous-section">
         <a href="{previous-section/@href}"><img src="previous-section.png" border="0"/></a>
        </xsl:if>
        <xsl:if test="not(previous-section)">
         <img src="previous-section.png" border="0"/>
        </xsl:if>
       </td>
       <td>
        <xsl:if test="home">
         <a href="{home/@href}"><img src="home.png" border="0"/></a>
        </xsl:if>
        <xsl:if test="not(home)">
         <img src="home.png" border="0"/>
        </xsl:if>
       </td>
       <td>
        <xsl:if test="next-section">
         <a href="{next-section/@href}"><img src="next-section.png" border="0"/></a>
        </xsl:if>
        <xsl:if test="not(next-section)">
         <img src="next-section.png" border="0"/>
        </xsl:if>
       </td>
       <td>
        <xsl:if test="next">
         <a href="{next/@href}"><img src="next.png" border="0"/></a>
        </xsl:if>
        <xsl:if test="not(next)">
         <img src="next.png" border="0"/>
        </xsl:if>
       </td>
      </tr>
     </table>
    </xsl:template>
  
    <xsl:template match="layout">
     <xsl:apply-templates/>
    </xsl:template>
  
    <xsl:template match="p|ol|ul|li|em|strong|br">
     <xsl:copy>
      <xsl:apply-templates/>
     </xsl:copy>
    </xsl:template>
  
    <xsl:template match="fork">
     <a href="" target="_blank">
      <xsl:apply-templates/>
     </a>
    </xsl:template>
  
    <xsl:template match="link">
     <a href="">
      <xsl:apply-templates/>
     </a>
    </xsl:template>
  
    <xsl:template match="title">
     <h1>
      <xsl:apply-templates/>
     </h1>
    </xsl:template>
  
    <xsl:template match="subtitle">
     <h3>
      <xsl:text>[</xsl:text>
      <xsl:apply-templates/>
      <xsl:text>]</xsl:text>
     </h3>
    </xsl:template>
  
    <xsl:template match="quote">
     <p class="quote">
      <xsl:apply-templates/>
     </p>
    </xsl:template>
  
    <xsl:template match="source">
     <pre class="source">
      <xsl:apply-templates/>
     </pre>
    </xsl:template>
  
    <xsl:template match="figure">
     <p class="figure" align="center">
      <img src="{@src}"/>
     </p>
    </xsl:template>
    
  </xsl:stylesheet>
  
  
  1.1                  xml-cocoon/samples/slides/cocoon.png
  
  	<<Binary file>>
  
  
  1.1                  xml-cocoon/samples/slides/home.png
  
  	<<Binary file>>
  
  
  1.1                  xml-cocoon/samples/slides/navigation.xsl
  
  Index: navigation.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:param name="section"/>
    <xsl:param name="slide"/>
  
    <xsl:template match="slides">
  
     <xsl:processing-instruction name="cocoon-process">type="xslt"</xsl:processing-instruction>
     <xsl:processing-instruction name="xml-stylesheet">href="<xsl:value-of select="@style"/>.xsl"
type="text/xsl"</xsl:processing-instruction>
  
     <slide style="{@style}">
       <xsl:if test="not($section)">
         <title>
          <xsl:value-of select="title"/>
         </title>
         <navigation>
          <next href="?section=1"/>
         </navigation>
         <layout>
          <h1><a href="?section=1"><xsl:value-of select="title"/></a></h1>
          <h3>
           <xsl:for-each select="authors/person">
            <xsl:value-of select="name"/> (<xsl:value-of select="email"/>)
           </xsl:for-each>
          </h3>
          <p class="quote">
           <xsl:value-of select="overview"/>
          </p>
         </layout>
       </xsl:if>
  
       <xsl:if test="$section">
        <xsl:if test="not($slide)">
         <xsl:apply-templates select="//section[$section]"/>
        </xsl:if>
        <xsl:if test="$slide">
         <xsl:apply-templates select="//section[$section]/slide[$slide]"/>
        </xsl:if>
       </xsl:if>
     </slide>
    </xsl:template>
  
  <!-- ================================ Section ============================== -->
  
    <xsl:template match="section">
      <title>
       <xsl:value-of select="title"/>
      </title>
  
      <navigation>
       <xsl:variable name="last">
        <xsl:value-of select="count(//section)"/>
       </xsl:variable>
       <xsl:variable name="previous-last">
        <xsl:value-of select="count(//section[$section - 1]/slide)"/>
       </xsl:variable>
  
       <home href=""/>
  
       <xsl:if test="$section!=1">
        <previous-section href="?section={$section - 1}"/>
        <previous href="?section={$section - 1}&amp;slide={$previous-last}"/>
       </xsl:if>
  
       <xsl:if test="$section!=$last">
        <next-section href="?section={$section + 1}"/>
       </xsl:if>
  
       <next href="?section={$section}&amp;slide=1"/>
      </navigation>
  
      <layout>
       <title><xsl:value-of select="title"/></title>
       <subtitle><xsl:value-of select="subtitle"/></subtitle>
      </layout>
    </xsl:template>
  
  <!-- ================================ Slide ============================== -->
  
    <xsl:template match="slide">
      <title>
       <xsl:value-of select="title"/>
      </title>
  
      <navigation>
       <xsl:variable name="last-section">
        <xsl:value-of select="count(//section)"/>
       </xsl:variable>
       <xsl:variable name="last">
        <xsl:value-of select="count(//section[$section]/slide)"/>
       </xsl:variable>
       <xsl:variable name="previous-last">
        <xsl:value-of select="count(//section[$section - 1]/slide)"/>
       </xsl:variable>
  
       <home href="?section={$section}"/>
  
       <xsl:if test="$slide!=1">
        <previous href="?section={$section}&amp;slide={$slide - 1}"/>
       </xsl:if>
       <xsl:if test="($slide=1)">
        <previous href="?section={$section}"/>
       </xsl:if>
  
       <xsl:if test="$slide!=$last">
        <next href="?section={$section}&amp;slide={$slide + 1}"/>
       </xsl:if>
       <xsl:if test="($slide=$last) and ($section!=$last-section)">
        <next href="?section={$section + 1}"/>
       </xsl:if>
  
       <xsl:if test="$section!=1">
        <previous-section href="?section={$section - 1}"/>
       </xsl:if>
       <xsl:if test="$section!=$last-section">
        <next-section href="?section={$section + 1}"/>
       </xsl:if>
      </navigation>
  
      <layout>
       <xsl:apply-templates/>
      </layout>
    </xsl:template>
    
    <xsl:template match="*|@*|text()">
     <xsl:copy>
      <xsl:apply-templates select="*|@*|text()"/>
     </xsl:copy>
    </xsl:template>
    
  </xsl:stylesheet>
  
  
  1.1                  xml-cocoon/samples/slides/next-section.png
  
  	<<Binary file>>
  
  
  1.1                  xml-cocoon/samples/slides/next.png
  
  	<<Binary file>>
  
  
  1.1                  xml-cocoon/samples/slides/previous-section.png
  
  	<<Binary file>>
  
  
  1.1                  xml-cocoon/samples/slides/previous.png
  
  	<<Binary file>>
  
  
  1.1                  xml-cocoon/samples/slides/pyramid-model.gif
  
  	<<Binary file>>
  
  
  1.1                  xml-cocoon/samples/slides/schema.jpg
  
  	<<Binary file>>
  
  
  1.1                  xml-cocoon/samples/slides/slides.xml
  
  Index: slides.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <?cocoon-process type="xslt"?>
  <?xml-stylesheet href="navigation.xsl" type="text/xsl"?>
  
  <slides style="apachecon">
    <title>Adding XML Capabilities with Cocoon</title>
  
    <authors>
     <person>
      <name>Stefano Mazzocchi</name>
      <email>stefano@apache.org</email>
     </person>
    </authors>
  
    <event>
     <name>ApacheCon 2000</name>
     <date>March 9, 2000</date>
     <time>7:30PM - 9:00PM</time>
     <location>Caribe Royale Resort Suites &amp; Villas. Orlando, Florida, U.S.A.</location>
    </event>
  
    <overview>
     This session will show how to install, set up, and work with the Cocoon XML
     publishing framework. The session will not cover XML technical details but
     will show detailed examples on Cocoon power and details on future development.
    </overview>
  
    <section>
     <title>Introduction</title>
     <subtitle>let's see if this is any good for me</subtitle>
  
     <slide>
      <title>Who am I?</title>
      <ul>
       <li>My name is <strong>Stefano Mazzocchi</strong></li>
       <li>Pronounced: <em>Stephan-O Madzock-key</em></li>
       <li>I'm italian</li>
       <li>I'm a student</li>
       <li>I'm Cocoon's author and main architect</li>
      </ul>
     </slide>
  
     <slide>
      <title>Ok, but what is Cocoon?</title>
      <ul>
       <li>A publishing framework</li>
       <li>A document generator</li>
       <li>A small revolution</li>
      </ul>
     </slide>
  
     <slide>
      <title>Publishing framework?</title>
      <ul>
       <li>something that helps you publishing your stuff on the web</li>
       <li>something that should impose strict yet flexible practices</li>
       <li>something that should allow you to reduce your costs</li>
      </ul>
     </slide>
  
     <slide>
      <title>Costs? What costs?</title>
      <ul>
       <li>management costs</li>
       <li>friction between human resources</li>
       <li>costs of adapting to new needs</li>
       <li>scalability costs</li>
      </ul>
     </slide>
  
     <slide>
      <title>The Cocoon Idea</title>
      <quote>
       The Cocoon project aims to change the way web information is created, 
       rendered and served.
      </quote>
      <quote>
       This new paradigm is based on fact that document content, style and
       logic are often created by different individuals or working groups.
      </quote>
      <quote>
       Cocoon aims to a complete separation of the three layers, allowing the 
       three layers to be independently designed, created and managed, reducing 
       management overhead, increasing work reuse and reducing time to market.
      </quote>
     </slide>
  
     <slide>
      <title>The XML Model</title>
      <p>Cocoon is an XML publishing framework.</p>
      <p>Key technolgies are:</p>
      <ul>
       <li>XML</li>
       <li>XML Namespaces</li>
       <li>XSLT</li>
       <li>XPath</li>
      </ul>
     </slide>
  
     <slide>
      <title>Supported Publishing Formats</title>
      <ul>
       <li>HTML+CSS</li>
       <li>XSL(FO)</li>
       <li>SVG</li>
       <li>WML</li>
       <li>VoxML</li>
       <li>VRML</li>
       <li>... you name it!</li>
      </ul>
     </slide>
     
     <slide>
      <title>What do you mean?</title>
      <p>I mean that Cocoon is able to <em>publish</em> your data in any
of
      the above formats depending on user parameters or user devices.</p>
      <p>All coming from a single file.</p>
      <p>And easily extensible to any other format thru the use of a highly
      modular architecture.</p>
     </slide>
      
     <slide>
      <title>Hard to believe?</title>
      <p><fork uri="http://localhost/cocoon/samples/index.xml">Let's take the
tour.</fork></p>
     </slide>
    </section>
  
    <section>
     <title>Installation</title>
     <subtitle>How to show your boss it was worth spending all that money for ApacheCon!</subtitle>
  
     <slide>
      <title>Cocoon Requirement</title>
      <p>To install Cocoon you need:</p>
      <ul>
       <li>a Java 1.1 compatible virtual machine</li>
       <li>a web server equipped with a Java Servlet API 2.x compliant servet engine</li>
      </ul>
     </slide>
     
     <slide>
      <title>Why Java?</title>
      <ul>
       <li>Portability</li>
       <li>Strong OO features (interfaces)</li>
       <li>Availability of XML components</li>
       <li>Dynamic Linking capabilities</li>
      </ul>
     </slide>
  
     <slide>
      <title>Why a servlet?</title>
      <ul>
       <li>again, portability</li>
       <li>ease of use</li>
       <li>natural choice with Java for the web</li>
      </ul>
     </slide>
     
     <slide>
      <title>Why not Servlet 2.2 or Java 1.2?</title>
      <p>guess what? portability!</p>
      <ul>
       <li>no 2.2 replacement for JServ available (yet! Tomcat is coming!)</li>
       <li>no JDK 1.2 port on every platform (even if Linux support is finally out!)</li>
      </ul>
     </slide>
     
     <slide>
      <title>How do I install it on my servlet engine?</title>
      <p>I probably don't know!</p>
      <p>I develop on Apache stuff and know almost nothing about other servlet engines.</p>
      <p>Even if Cocoon has been reported to work on all known ones, both commercial
and free.</p>
      <p>Anyway, you find detailed instructions for both <em>JServ</em>
and <em>Tomcat</em> in
        the handout and more up-to-date information on the web site.</p>
     </slide>
    </section>
  
    <section>
     <title>Cocoon Internals</title>
     <subtitle>getting a better picture</subtitle>
  
     <slide>
      <title>Cocoon General Vision</title>
      <figure src="schema.jpg"/>
     </slide>
     
     <slide>
      <title>The Content Generation Model</title>
      <ul>
       <li>producers: generate XML content</li>
       <li>processors: process XML content</li>
       <li>formatters: format XML into a stream representation</li>
      </ul>
     </slide>
  
     <slide>
      <title>Producer (generator)</title>
      <ul>
       <li>adapts the outside world to XML</li>
       <li>produces <em>structured</em> information (now DOM, later SAX)</li>
       <li>a parser is a producer</li>
       <li>not all producers are parsers</li>
       <li>producers are the XML equivalent of Servlets</li>
      </ul>
     </slide>
  
     <slide>
      <title>Processor (filter)</title>
      <ul>
       <li>process the structured content that comes in</li>
       <li>creates structured content</li>
       <li>examples: XSLT processor, SQL processor, LDAP processor</li>
       <li>there is not such </li>
       <li>Cocoon producers are the XML equivalent of Servlets</li>
      </ul>
     </slide>
  
     <slide>
      <title>Formatter (serializer)</title>
      <ul>
       <li>creates the final stream</li>
       <li>examples: FOP (fo-&gt;PDF), SVG serializer</li>
      </ul>
     </slide>
    </section>
  
    <section>
     <title>Dynamic Content</title>
     <subtitle>let's do useful stuff</subtitle>
  
     <slide>
      <title>Logic-Content Integration</title>
      <p>Possible alternatives are (for java):</p>
      <ul>
       <li>JSP</li>
       <li>WebMacro</li>
       <li>GSP</li>
      </ul>     
     </slide>
  
     <slide>
      <title>Logic-Content Integration</title>
      <p>Needs:</p>
      <ul>
       <li>logic and content reside on different files</li>
       <li>reuse of logic on different documents</li>
       <li>performance</li>
       <li>programming language abstraction</li>
       <li>output abstraction</li>
      </ul>     
     </slide>
  
     <slide>
      <title>The problems of JSP</title>
      <ul>
       <li>logic has direct access to output</li>
       <li>output is always streamed</li>
       <li>not really designed for language abstraction</li>
      </ul>     
     </slide>
  
     <slide>
      <title>Our solution: XSP</title>
      <ul>
       <li>logic has <strong>not</strong> direct access to output</li>
       <li>output is <strong>never</strong> streamed</li>
       <li>designed for language abstraction</li>
      </ul>     
     </slide>
  
     <slide>
      <title>What does it look like?</title>
      <source><![CDATA[
  <xsp:page>
   <page>
    <p>Current time is <xsp:expr>new Date()</xsp:expr></p>
   </page>
  </xsp:page
      ]]></source>     
     </slide>
  
     <slide>
      <title>How does it work?</title>
      <ul>
       <li>the XSP page is transformed into source code</li>
       <li>the source code is compiled</li>
       <li>the binary is executed at runtime</li>
       <li>basically like any other server pages technology</li>
      </ul>
     </slide>
  
     <slide>
      <title>Ok, so what's the point?</title>
      <ul>
       <li>you don't have access to the output stream!</li>
      </ul>
     </slide>
  
     <slide>
      <title>But still, this is mixing content and logic!</title>
      <p>Ok, look at this:</p>
      
      <source><![CDATA[
  <xsp:page>
   <page>
    <p>Current time is <util:date/></p>
   </page>
  </xsp:page
      ]]></source>
      
      <p>then you let Cocoon transform this with</p>
  
      <source><![CDATA[
  <xsl:template match="util:date">
   <xsp:expr>new Data()</xsp:expr>
  </xsl:template>
      ]]></source>
     </slide>
  
     <slide>
      <title>Possible different scenarios</title>
      <ul>
       <li><link uri="/cocoon/samples/xsp/view-source.xml?filename=page.xml">integrated
xsp tags</link></li>
       <li><link uri="/cocoon/samples/xsp/view-source.xml?filename=clean-page.xml">custom
tags transformed by your stylesheets</link></li>
       <li><link uri="/cocoon/samples/xsp/view-source.xml?filename=lib-page.xml">use
of cocoon taglibs</link></li>
      </ul>
     </slide>
  
     <slide>
      <title>Other dynamic possibilities</title>
      <ul>
       <li><link uri="/cocoon/samples/xsp/view-source.xml?filename=../sql/database-page.xml">SQLProcessor</link></li>
       <li><link uri="/cocoon/samples/xsp/view-source.xml?filename=../ldap/ldap.xml">LDAPProcessor</link></li>
       <li>... add yours</li>
      </ul>
     </slide>
  
     <slide>
      <title>Moving this into taglibs: why?</title>
      <ul>
       <li>performance</li>
       <li>integration</li>
       <li>portability</li>
       <li>standardization</li>
      </ul>
     </slide>
  
     <slide>
      <title>Still not powerful enough?</title>
      <p>Write your own:</p>
      <ul>
       <li>producer: to create from-java dynamic content</li>
       <li>processor: to process some XML in some complex ways</li>
       <li>formatter: to format an XML file to some binary formats</li>
      </ul>
     </slide>
    </section>
  
    <section>
     <title>Future Development: Cocoon2</title>
     <subtitle>improving the bleeding edge</subtitle>
  
     <slide>
      <title>Main Differences</title>
      <ul>
       <li>event driven architecture</li>
       <li>improved overall structure</li>
       <li>complete separation of contexts</li>
       <li>better batch support</li>
      </ul>
     </slide>
  
     <slide>
      <title>Main Benefits</title>
      <ul>
       <li>lower per-request memory consumption</li>
       <li>globally faster</li>
       <li>increased perceived performance</li>
       <li>enhanced modularity</li>
      </ul>
     </slide>
  
     <slide>
      <title>Main Drawbacks</title>
      <ul>
       <li>steeper learning curve (due to the sitemap)</li>
       <li>module back incompatibility</li>
      </ul>
     </slide>
  
     <slide>
      <title>The Cocoon pyramid of contracts</title>
      <figure src="pyramid-model.gif"/>
     </slide>
    </section>
  
    <section>
     <title>Final Info</title>
     <subtitle>where to find out more</subtitle>
     
     <slide>
      <title>Where do I get more info?</title>
      <ul>
       <li>Cocoon: <strong>http://xml.apache.org/cocoon/</strong></li>
       <li>XML and related info: <strong>http://www.xmlinfo.com/</strong></li>
       <li>XML and related specs: <strong>http://www.w3c.org/</strong></li>
      </ul>
     </slide>
  
     <slide>
      <title>The Cocoon Project</title>
      <p>Active Developers (in alphabetical order):</p>
      <ul>
       <li>Donald Ball</li>
       <li>Pierpaolo Fumagalli</li>
       <li>Stefano Mazzocchi</li>
       <li>Ricardo Rocha</li>
      </ul>
     </slide>
  
     <slide>
      <title>Thank you!</title>
      <p>Ok, I'm preparing the asbesto suite for the Q/A! :-)</p>
     </slide>
    </section>
  
    <legal>
     Copyright (c) 2000 Apache Software Foundation.
    </legal>
  
  </slides>
  
  
  

Mime
View raw message