Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 27545 invoked from network); 27 Jun 2004 02:01:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 27 Jun 2004 02:01:02 -0000 Received: (qmail 25314 invoked by uid 500); 27 Jun 2004 02:01:01 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 25186 invoked by uid 500); 27 Jun 2004 02:00:57 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 25153 invoked by uid 99); 27 Jun 2004 02:00:57 -0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=HTML_40_50,HTML_MESSAGE X-Spam-Check-By: apache.org Received: from [219.88.190.21] (HELO arjan) (219.88.190.21) by apache.org (qpsmtpd/0.27.1) with ESMTP; Sat, 26 Jun 2004 19:00:57 -0700 Received: from arjan ([127.0.0.1]) by arjan with Microsoft SMTPSVC(6.0.2600.1106); Sun, 27 Jun 2004 13:58:58 +1200 From: "Adam Ratcliffe" To: Subject: Best practice for database access in flow layer Date: Sun, 27 Jun 2004 13:58:57 +1200 Message-ID: <006401c45bea$4f6b1830$0201a8c0@arjan> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0065_01C45C4E.E49FF830" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-OriginalArrivalTime: 27 Jun 2004 01:58:58.0631 (UTC) FILETIME=[4F6E2570:01C45BEA] X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_0065_01C45C4E.E49FF830 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I'm looking for a little direction on the most appropriate way to access a database from the flow layer. function searchCategories(locType, class1, class2) { var categories = Search.searchCategories(locType, class1, class2); if(categories != null) { // if search returned categories, search again on expanded categories cocoon.sendPageAndWait("page/showCategories.xml", {"categories" : categories} ); // when user request arrives class1 = cocoon.request.getParameter("class1"); class2 = cocoon.request.getParameter("class2"); // recursively calls itself with searchCategories(locType, class1, class2); } } ------=_NextPart_000_0065_01C45C4E.E49FF830 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Message

I'm = looking for a=20 little direction on the most appropriate way to access a database from = the flow=20 layer.

function searchCategories(locType, = class1, class2)=20 {
    var categories =3D = Search.searchCategories(locType,=20 class1, class2);
    if(categories !=3D null) = {
 // if=20 search returned categories, search again on expanded=20 categories
 cocoon.sendPageAndWait("page/showCategories.xml",=20 {"categories" : categories} );
 
 // when user request=20 arrives
 class1 =3D = cocoon.request.getParameter("class1");
 class2=20 =3D cocoon.request.getParameter("class2");
 
 // = recursively calls=20 itself with
 searchCategories(locType, class1,=20 class2);
    }
}

------=_NextPart_000_0065_01C45C4E.E49FF830--