cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/xmldb/samples populate.xml samples.xml sitemap.xmap
Date Thu, 22 Jan 2004 03:42:12 GMT
vgritsenko    2004/01/21 19:42:12

  Modified:    src/blocks/xmldb/samples populate.xml samples.xml
                        sitemap.xmap
  Log:
  Add sample of mounting sitemap and serving pages from the xmldb: source.
  
  Revision  Changes    Path
  1.3       +64 -39    cocoon-2.1/src/blocks/xmldb/samples/populate.xml
  
  Index: populate.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/xmldb/samples/populate.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- populate.xml	12 Dec 2003 15:00:31 -0000	1.2
  +++ populate.xml	22 Jan 2004 03:42:12 -0000	1.3
  @@ -6,56 +6,81 @@
       +-->
   
   <html>
  -  <h2>Populating DB with samples data</h2>
  -  <h3>Create Collection</h3>
  +  <h2>Populating XML:DB with sample data</h2>
  +  <h3>Create collection ...</h3>
     <p>Create collection should succeed on the first run, but will fail on subsequent
runs</p>
     <textarea cols="75" rows="3">
       <x:query type="create" oid="cocoon/" xmlns:x="http://apache.org/cocoon/xmldb/1.0"/>
     </textarea>
   
  -  <h3>Create Samples Document</h3>
  +  <h3>Import sitemap.xmap ...</h3>
     <textarea cols="75" rows="3">
  -    <x:query type="create" collection="cocoon" oid="welcome" xmlns:x="http://apache.org/cocoon/xmldb/1.0">
  -      <!-- i:include src="samples.xml" xmlns:i="http://apache.org/cocoon/include/1.0"/
-->
  -      <samples name="XMLDB Samples" xmlns:xlink="http://www.w3.org/1999/xlink">
  -        <group name="Main examples page.">
  -          <sample name="Back" href="..">to Cocoon examples main page</sample>
  -        </group>
  -        <group name="Init Database">
  -          <sample name="Init" href="populate">
  -            Populate sample XMLDB Database
  -          </sample>
  -        </group>
  -        <group name="XMLDB Samples">
  +    <x:query type="create" collection="cocoon" oid="sitemap.xmap" xmlns:x="http://apache.org/cocoon/xmldb/1.0">
  +      <i:include src="sitemap.xmap" xmlns:i="http://apache.org/cocoon/include/1.0"/>
  +    </x:query>
  +  </textarea>
  +      
  +  <h3>Import xmldb2samples.xsl ...</h3>
  +  <textarea cols="75" rows="3">
  +    <x:query type="create" collection="cocoon" oid="xmldb2samples.xsl" xmlns:x="http://apache.org/cocoon/xmldb/1.0">
  +      <i:include src="xmldb2samples.xsl" xmlns:i="http://apache.org/cocoon/include/1.0"/>
  +    </x:query>
  +  </textarea>
  +
  +  <h3>Import samples.xml ...</h3>
  +  <textarea cols="75" rows="3">
  +    <x:query type="create" collection="cocoon" oid="samples.xml" xmlns:x="http://apache.org/cocoon/xmldb/1.0">
  +      <i:include src="samples.xml" xmlns:i="http://apache.org/cocoon/include/1.0"/>
  +    </x:query>
  +  </textarea>
  +
  +  <h3>Perform XUpdate on samples.xml ...</h3>
  +  <textarea cols="75" rows="3">
  +    <x:query type="update" collection="cocoon" oid="samples.xml" xmlns:x="http://apache.org/cocoon/xmldb/1.0">
  +      <xu:modifications version="1.0" xmlns:xu="http://www.xmldb.org/xupdate">
  +        <xu:remove select="/samples/group[@name = 'Init Database']"/>
  +        <xu:update select="/samples/group[@name = 'XMLDB Samples']/sample[@name='Mount
DB']/@name">Mount FS</xu:update>
  +        <xu:update select="/samples/group[@name = 'XMLDB Samples']/sample[@name='Mount
FS']/@href">..</xu:update>
  +        <xu:update select="/samples/group[@name = 'XMLDB Samples']/sample[@name='Mount
FS']">
  +           Go back to the file system version of this page.
  +        </xu:update>
  +        <xu:append select="/samples/group[@name = 'XMLDB Samples']" child="1">
  +          <note>
  +            This sitemap, page, and XSLT stylesheet for browser, all are served from
  +            the XML:DB. Click below to go back to file system version.
  +          </note>
  +        </xu:append>
  +      </xu:modifications>
  +    </x:query>
  +  </textarea>
  +
  +  <h3>Import samples.xml as xsamples.xml ...</h3>
  +  <textarea cols="75" rows="3">
  +    <x:query type="create" collection="cocoon" oid="xsamples.xml" xmlns:x="http://apache.org/cocoon/xmldb/1.0">
  +      <i:include src="samples.xml" xmlns:i="http://apache.org/cocoon/include/1.0"/>
  +    </x:query>
  +  </textarea>
  +
  +  <h3>Perform XUpdate on xsamples.xml ...</h3>
  +  <textarea cols="75" rows="3">
  +    <x:query type="update" collection="cocoon" oid="xsamples.xml" xmlns:x="http://apache.org/cocoon/xmldb/1.0">
  +      <xu:modifications version="1.0" xmlns:xu="http://www.xmldb.org/xupdate">
  +        <xu:update select="/samples/group[@name = 'XMLDB Samples']/sample[@name='From
DB']/@name">From File System</xu:update>
  +        <xu:update select="/samples/group[@name = 'XMLDB Samples']/sample[@name='From
File System']/@href">welcome</xu:update>
  +        <xu:update select="/samples/group[@name = 'XMLDB Samples']/sample[@name='From
File System']">
  +           Go back to the file system version of this page.
  +        </xu:update>
  +        <xu:append select="/samples/group[@name = 'XMLDB Samples']" child="1">
             <note>
  -            This page is served from the XMLDB. Click below to go back to file system
  +            This page is served from the XML:DB. Click below to go back to file system
               version of the file.
             </note>
  -          <sample name="From File System" href="welcome">
  -            This samples page, but served from the file system.
  -          </sample>
  -          <sample name="Browser" href="browse/">
  -            Simple database browser
  -          </sample>
  -        </group>
  -        <group name="XMLDB Source">
  -          <sample name="Get Collection" href="db/cocoon/">
  -            Get /db/cocoon collection.
  -          </sample>
  -          <sample name="Get Resource" href="db/cocoon/welcome">
  -            Get /db/cocoon/welcome resource.
  -          </sample>
  -          <sample name="Query Collection" href="db/cocoon/?xpath=/samples/group">
  -            Query /db/cocoon collection.
  -          </sample>
  -          <sample name="Query Collection" href="db/cocoon/welcome?xpath=/samples/group">
  -            Query /db/cocoon/welcome resource (same query).
  -          </sample>
  -        </group>
  -      </samples>
  +        </xu:append>
  +      </xu:modifications>
       </x:query>
     </textarea>
   
     <h3>Done</h3>
  +  <p>Review results of all operations and go check other samples.</p>
     <a href="./">Go Back</a>
   </html>
  
  
  
  1.4       +7 -2      cocoon-2.1/src/blocks/xmldb/samples/samples.xml
  
  Index: samples.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/xmldb/samples/samples.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- samples.xml	21 Jan 2004 13:09:43 -0000	1.3
  +++ samples.xml	22 Jan 2004 03:42:12 -0000	1.4
  @@ -13,6 +13,9 @@
     </group>
   
     <group name="Init Database">
  +    <note>
  +      Init database first before checking out other samples!
  +    </note>
       <sample name="Init" href="populate">
         Populate sample XMLDB Database
       </sample>
  @@ -21,7 +24,9 @@
     <group name="XMLDB Samples">
       <sample name="From DB" href="xwelcome">
         This samples page, but obtained from the XMLDB database
  -      (don't forget to Init database first)
  +    </sample>
  +    <sample name="Mount DB" href="xmount/">
  +      Serve these completely from the XML:DB, including sitemap, XMLs, and XSLTs.
       </sample>
       <sample name="Browser" href="browse/">
         Simple database browser
  
  
  
  1.7       +5 -1      cocoon-2.1/src/blocks/xmldb/samples/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/xmldb/samples/sitemap.xmap,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- sitemap.xmap	12 Jan 2004 18:08:38 -0000	1.6
  +++ sitemap.xmap	22 Jan 2004 03:42:12 -0000	1.7
  @@ -41,11 +41,15 @@
         </map:match>
      
         <map:match pattern="xwelcome">
  -        <map:generate src="xmldb:xindice-embed:///db/cocoon/welcome"/>
  +        <map:generate src="xmldb:xindice-embed:///db/cocoon/xsamples.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="xmount/**">
  +        <map:mount uri-prefix="xmount" src="xmldb:xindice-embed:///db/cocoon/sitemap"
check-reload="yes"/>
         </map:match>
   
         <map:match pattern="populate">
  
  
  

Mime
View raw message