Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 13613 invoked from network); 29 Jul 2004 07:20:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 29 Jul 2004 07:20:40 -0000 Received: (qmail 4668 invoked by uid 500); 29 Jul 2004 07:20:36 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 4432 invoked by uid 500); 29 Jul 2004 07:20:35 -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 4419 invoked by uid 99); 29 Jul 2004 07:20:35 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [195.28.83.3] (HELO fwlin.asset.sk) (195.28.83.3) by apache.org (qpsmtpd/0.27.1) with ESMTP; Thu, 29 Jul 2004 00:20:30 -0700 Received: from localhost (fwlin [127.0.0.1]) by fwlin.asset.sk (Postfix) with ESMTP id D690E5A176 for ; Thu, 29 Jul 2004 09:22:01 +0200 (CEST) Received: from fwlin.asset.sk ([127.0.0.1]) by localhost (fwlin [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18945-05 for ; Thu, 29 Jul 2004 09:22:01 +0200 (CEST) Received: from s2-ba.asset-internal (s2-ba.asset-internal [172.16.51.1]) by fwlin.asset.sk (Postfix) with ESMTP id 9BDA25A089 for ; Thu, 29 Jul 2004 09:22:01 +0200 (CEST) X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Disposition-Notification-To: =?iso-8859-2?Q?=CFURDINA_Michal?= Subject: Design of unmarshaling sitemap component Date: Thu, 29 Jul 2004 09:20:23 +0200 Message-ID: <4C47FFB0CC6A2E4D92550B89B68FC7830170C74D@s2-ba.asset-internal> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Design of unmarshaling sitemap component Thread-Index: AcR1PINxnpxdiThqRxG1zyJuY/UR0A== From: =?iso-8859-2?Q?=CFURDINA_Michal?= To: X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi, I would like to discuss the design problem of the sitemap component. My = plan is to develop special let's call it transformer for transforming = sources for pages written or generated by analysts (model) to dynamic = pages generating required results (implementation). The form of model is = custom XML according to given XMLSchema and the implementation pages = should be in form of jxtemplates (or xsp). The transformation should go like this: pipeline: additional data | modelXML -> populated modelXML -> computed model -> jxtemplate source The intent of the pipeline is to generate executable source from model = that will generate required dynamic page. The trick is that the computed = modelXML is not trivial and should be implemented as Java OM. What I = need to involve is conversion from XML to Java Object, make the = computation in Java and go back with the results to XML in form of = jxtemplate source. I have two alternatives of implementation. Both are involving castor for = converting XML to Java object. A.) make the XML2Java conversion in transformer pipeline: file(modelXML) -> cinclude(aditionaldata) -> = castortransformer(modelClass, template) -> -> jxtemplatetransformer -> jxtemplate (or xsp) source | modelInstance This starts with reading modelXML from file, including additional data = (i.e. in form of another xml document). Populated XML is then the source = for Castor unmarshaling, the intermediate result is the instance of = modelClass placed on request attribute. The transformer then emits the = template given in second parameter. The modelInstance is used in = template and jxtemplatetransformer is used to generate required page = source (jxtemplate again or xsp). B.) make the XML2Java conversion in action: pipeline1: action(cocoon:/pipeline2, modelClass) { jxtemplategenerator(template) -> jxtemplate (or xsp) source=20 | modelInstance } pipeline2: file(modelXML) -> cinclude(aditionaldata) -> XML This is simmilar to A.) but with the exception that this does not break = the SAX stream in castortransformer and XML2Java conversion is done = between two pipelines. On the other hand there is useless serialization = and deserialization between both pipelines. There is question about which approach is better from the design point = of view. Additional questions include: - in case of A.) is it better to have modelXML on the start of the = pipeline and template as the parameter or to have template at the start = of the pipeline and modelXML as the parameter?=20 - are there any other viable and simple alternatives? Thank you for your comments. Michal