You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by ov...@apache.org on 2002/01/09 00:19:32 UTC

cvs commit: xml-cocoon2/src/scratchpad/schecoon/scheme test.scm

ovidiu      02/01/08 15:19:32

  Modified:    src/scratchpad/schecoon/scheme test.scm
  Log:
  Added the first working example of a reader.
  
  Revision  Changes    Path
  1.2       +19 -15    xml-cocoon2/src/scratchpad/schecoon/scheme/test.scm
  
  Index: test.scm
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/schecoon/scheme/test.scm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- test.scm	3 Jan 2002 12:31:35 -0000	1.1
  +++ test.scm	8 Jan 2002 23:19:32 -0000	1.2
  @@ -1,47 +1,51 @@
   (load-module "sisc.modules.J2S")
  -(load-module "org.apache.cocoon.scheme.sitemap.SitemapComponents")
  +(load-module "org.apache.cocoon.scheme.sitemap.SchemeSitemap")
   
   ;;; sample sitemap with the associated pipeline definitions
   (define pipelines
     (define-pipelines
  -    (define-pipeline docbook-xhtml (cm env file . args)
  -       (transform cm env
  +    (define-pipeline docbook-xhtml (sitemap env file . args)
  +       (transform sitemap env
   		  (list (cons 'type "xslt")
   			(cons 'stylesheet "docbook2html.xsl")
   			(cons 'params
   			      (list (cons 'view-source
   					  (string-append "docs/samples/" file))
   				    (cons 'arg "some-arg"))))
  -		  (generate cm env (list (cons "src" file)))))
  -    (define-pipeline docbook-xhtml (cm env file . args)
  -	(generate cm env file)
  +		  (generate sitemap env (list (cons "src" file)))))
  +    (define-pipeline docbook-xhtml (sitemap env file . args)
  +	(generate sitemap env file)
   	(transform '((type xslt)
   		     (name "docbook2xhtml.xsl")
   		     (parameter "view-source" (concat "docs/samples/" file))))
   	(serialize (type xml)))
       
  -    (define-pipeline gif-image (cm env file . args)
  +    (define-pipeline gif-image (sitemap env file . args)
   	(read (concat "src/" file ".gif") "image/gif"))
       ))
   
   
   (define the-sitemap
     (define-sitemap
  -    (match "sql/(.*)" (cm env file . args)
  +    (match "sql/(.*)" (sitemap env file . args)
   	   (write (list 'call-pipeline 'docbook-xhtml file)))
   
  -    (match "generate/(.*)" (cm env file . args)
  -	   (display (sitemap:generate cm env (list (cons 'src "cocoon.xconf")))))
  +    (match "generate/(.*)" (sitemap env file . args)
  +	   (display (sitemap:generate sitemap env (list (cons 'src file)))))
   
  -    (match "slides/(.*)\.gif" (cm env file . rest)
  +    (match "sites/images/(.*)" (sitemap env file . args)
  +	   (sitemap:process sitemap env (list (cons 'mime-type "image/gif"))
  +	    (sitemap:read sitemap env (list (cons 'src (string-append file))))))
  +
  +    (match "slides/(.*)\.gif" (sitemap env file . rest)
   	   (write '(call-pipeline gif-image file)))
   
  -    (match "view-source/(.*)" (cm env file . rest)
  +    (match "view-source/(.*)" (sitemap env file . rest)
   	   (write '(generate file)) (newline)
   	   (write '(transform '((type xslt) (name "xsp"))))  (newline)
   	   (write '(serialize (type xml)))  (newline))
   
  -    (match "shopping-cart/(.*)" (cm env file . rest)
  +    (match "shopping-cart/(.*)" (sitemap env file . rest)
   	   (shopping-cart env file))
       ))
   
  @@ -50,8 +54,8 @@
       (display "shopping cart invoked ") (display env) (newline)
       #f))
   
  -(define (main url componentManager environment)
  +(define (main url sitemap environment)
   ;  (display "main invoked ") (display url) (newline)
   ;  (display environment) (newline)
  -  (the-sitemap url componentManager environment)
  +  (the-sitemap url sitemap environment)
   )
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org