From user-return-1721-apmail-forrest-user-archive=forrest.apache.org@forrest.apache.org Wed Feb 16 13:49:42 2005 Return-Path: Delivered-To: apmail-forrest-user-archive@www.apache.org Received: (qmail 57057 invoked from network); 16 Feb 2005 13:49:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 16 Feb 2005 13:49:42 -0000 Received: (qmail 22902 invoked by uid 500); 16 Feb 2005 13:49:42 -0000 Delivered-To: apmail-forrest-user-archive@forrest.apache.org Received: (qmail 22750 invoked by uid 500); 16 Feb 2005 13:49:41 -0000 Mailing-List: contact user-help@forrest.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: user@forrest.apache.org Delivered-To: mailing list user@forrest.apache.org Received: (qmail 22736 invoked by uid 99); 16 Feb 2005 13:49:41 -0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=PRIORITY_NO_NAME,SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de) (212.227.126.191) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 16 Feb 2005 05:49:39 -0800 Received: from [212.227.126.162] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1D1PYe-0002ha-00 for user@forrest.apache.org; Wed, 16 Feb 2005 14:49:36 +0100 Received: from a212-59-55-36.net-htp.de ([212.59.55.36] helo=localhost) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1D1PYc-0002SD-00 for user@forrest.apache.org; Wed, 16 Feb 2005 14:49:35 +0100 Date: Wed, 16 Feb 2005 14:49:31 +0100 From: Ferdinand Soethe X-Priority: 3 (Normal) Message-ID: <1607104803.20050216144931@soethe.net> To: Ross Gardler Subject: Re: Reusing legacy HTML In-Reply-To: <421312CF.2060604@apache.org> References: <1873729091.20050212161631@soethe.net> <4212048B.7030801@apache.org> <421312CF.2060604@apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:f75f2bd431147ec08213cc5cdb6cedb7 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi David, RG> Yes. Please everyone, it is a big problem when committers (and other RG> developers) are contacted off-list. One-to-one discussions reduce our RG> effectiveness and could even lead to burn-out. My fault. Sorry. I was trying to understand a mechanism and didn't want to clog the list with a lengthy discussion on my rather low level of understanding. The goal was to document this and put it up for discussion as soon as I knew what I was talking about. Well anyway, Ross - after being very helpful in understanding it - also pointed this out and asked that I post this early version to the list for comments. So here it is. Your comments much appreciated before I format it for inclusion in the Forrest documention? I was going to use document.dtd and write a second shorter and more to the point how-to on the specifics of processing your own legacy html. OK? Thanks, Ferdinand Soethe ------------------------------- So this tries to explain what happens internally when a clients asks Forrest to serve "mytests/mybad.html", a legacy html-file with lots of junk in it. 0. Clients asks Forrest to serve ".../xdocs/mytests/mybad.html" 1. Forrest looks for a matching pipeline in "...\forrest\main\webapp\sitemap.xmap". 2. This Pattern would in fact match the request but generates no xml since the map:parts match no cocoon pipeline and thus no xml is generated. {0}=mytests/mybad.html => cocoon:/tab-mytests/mybad.html => cocoon:/menu-mytests/mybad.html => cocoon:/body-mytests/mybad.html => mytests/mybad.html 3. This pattern also matches the request and is used to continue processing {0}= mytests/mybad.html {1}= mytests {2}= mybad adds skin info adds meta data creates tabs =>cocoon:/mytests/tab-mybad.html creates menus =>cocoon:/mytests/menu-mybad.html Below a cocoon pipeline is called to generate the body =>cocoon:/mytests/body-mybad.html return here for the rest of this pipeline in step 9 4. This is the pipeline called in step 3 Check if there is an ehtml-file (deprecated embedded html) {0}= mytests/body-mybad.html {1}= mytests/ {2}= mybad =>.../xdocs/mytests/mybad.ehtml =>.../xdocs/mytests/mybad.ehtml =>cocoon://mytests/linkmap-mybad.html Since file does not exist, pipeline generates nothing so Forrest keeps looking for next matching pipeline ... 5. ... and finds another pipeline for the same matches {0}= mytests/body-mybad.html {1}= mytests/ {2}= mybad In the following step we ask Forrest to call the pipeline for mybad.xml. This triggers a new matching attempt starting from the top of the pipeline section. =>cocoon:/mytests/mybad.xml Return here for the rest of this pipeline in step 6. This below is relevant now as it loads the project sitemap and inserts it right at this position of the main sitemap. (This project sitemap was also loaded before, but was irrelevant since there were no matches in the project sitemap) 4t!!!h step patterns above first 7. In the project sitemap we find this match for our call for an XML-file! {0}= mytests/mybad.xml {1}= mytests Load my file with the html-generator. This generator internally uses jtidy to clean up the html and make it xhtml. Now we call my special stylesheet to remove all elements that I don't want in the forrest page. I place it in the same directory as the source document as it is very specific. Finally call the existing stylesheet to convert html to document1.1 Serialize result as xml (it is now the body of my Forrest page and uses in document.dtd) 8. Return to calling routine in step 5 and execute the rest of the pipeline to finalize the body of my Forrest page. {0}= mytests/body-mybad.html {1}= mytests/ {2}= mybad ??? ??? Adjust links => cocoon:/mytests/linkmap-mybad.html => mytests/mybad.html At the end of the pipeline this is the page body in Html with all links adjusted. 9. Return to the calling routine in step 3 and finish processing {0}= mytests/mybad.html {1}= mytests {2}= mybad At this point the body (as html) is aggregated with the menus and tabs and the next part just adds the final touches to the presentation. => mytests/mybad.html At the end, the result is delivered to the browser.