From dev-return-103852-apmail-cocoon-dev-archive=cocoon.apache.org@cocoon.apache.org Mon Aug 6 17:46:08 2012 Return-Path: X-Original-To: apmail-cocoon-dev-archive@www.apache.org Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9CBE6D1CC for ; Mon, 6 Aug 2012 17:46:08 +0000 (UTC) Received: (qmail 94611 invoked by uid 500); 6 Aug 2012 17:46:08 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 94563 invoked by uid 500); 6 Aug 2012 17:46:08 -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 List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 94556 invoked by uid 99); 6 Aug 2012 17:46:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Aug 2012 17:46:08 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of simone.tripodi@gmail.com designates 74.125.83.51 as permitted sender) Received: from [74.125.83.51] (HELO mail-ee0-f51.google.com) (74.125.83.51) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Aug 2012 17:46:03 +0000 Received: by eeke50 with SMTP id e50so876064eek.24 for ; Mon, 06 Aug 2012 10:45:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=TeGpw0h1owaHRurEToNFhnEnAgK5oPDRw003ngodxvo=; b=aN2qdj8aTqliQOm5ROOSbilHoARlFeTmkgOVg89Z2SNIMOx3MMJInXWKLimrlItbtQ oeSrFMd/mbynaBF07ZinW1xXjrFTZvN/8SIz9sjzFlvssF/3uNFWZofyLT61RQ7OosKN MtkE6dG1RlXiYy8XoLoSodgtbWbJEqE4C1303Coj+HrPiLVIsAKaxhXUHJwa+Y7CpFqX M1GWKj90Z82mU+BQFkdP2XHR6JlTu96/4nF4wIWe7cG4fzBE9poHlUNjtIXUoP3RApgZ v3vbD8rXhdwPnROl1ZvyEM3f+SElclaR0GSWZZlHWOblCSycPRgGf0EfpMangY09eTAu mfCw== MIME-Version: 1.0 Received: by 10.14.202.69 with SMTP id c45mr14144687eeo.4.1344275142126; Mon, 06 Aug 2012 10:45:42 -0700 (PDT) Sender: simone.tripodi@gmail.com Received: by 10.14.97.129 with HTTP; Mon, 6 Aug 2012 10:45:42 -0700 (PDT) In-Reply-To: References: Date: Mon, 6 Aug 2012 19:45:42 +0200 X-Google-Sender-Auth: iQqE0X5DEvP86fPmaTRF6XspW9M Message-ID: Subject: Re: [Discuss] Sitemap NG From: Simone Tripodi To: dev@cocoon.apache.org Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org Hi Peter! apologize for not having been more precise on explaining my idea: while they look similar, I would consider the Sitemap a superset of pure Pipeline fluent APIs. Indeed, while a Sitemap woud _describe_ an "action" would be performed if the current pattern matches against the input, the Pipeline APIs would _invoke_ a Pipeline. i.e. +-------------------------+ public class MySitemap implements Sitemap { public void configure( SitemapBinder binder ) { binder.when( "linkmap.xml" ) .newCachingPipeline() .setStarter( new XMLGenerator(new URL( "feed.xml" ) ) .addComponent( new XSLTTransformer(this.getClass().getResource("/trax.xslt") ) .setFinisher( XMLSerializer.createXMLSerializer ); binder.when( "atom.xml" ) .newCachingPipeline() .setStarter( new SQLTransformer( ... ) .addComponent( new XSLTTransformer(this.getClass().getResource("/atom.xslt") ) .setFinisher( XMLSerializer.createXMLSerializer ); } } +-------------------------+ would be different than direct pipeline executions +-------------------------+ newCachingPipeline() .setStarter( new XMLGenerator(new URL( "feed.xml" ) ) .addComponent( new XSLTTransformer(this.getClass().getResource("/trax.xslt") ) .setFinisher( XMLSerializer.createXMLSerializer ) .setup( System.out ) .execute(); newCachingPipeline() .setStarter( new SQLTransformer( ... ) .addComponent( new XSLTTransformer(this.getClass().getResource("/atom.xslt") ) .setFinisher( XMLSerializer.createXMLSerializer ) .setup( System.out ) .execute(); +-------------------------+ The setup-execute phases, in the pipeline, would be executed by the Sitemap framework. best, -Simo http://people.apache.org/~simonetripodi/ http://simonetripodi.livejournal.com/ http://twitter.com/simonetripodi http://www.99soft.org/ On Mon, Aug 6, 2012 at 5:40 PM, Peter Hunsberger wrote: > Hi Simone, > > I guess the part I'm missing is how would this differ from what is already > in Cocoon 3 as an API? I do get that part (most, all?) of you objective is > to get rid of the Spring layer, so maybe the end result is essentially the > same as the C3 API in the end? > > Peter Hunsberger > > > > On Mon, Aug 6, 2012 at 10:33 AM, Simone Tripodi > wrote: >> >> Hi Peter! >> >> My proposal is writing an intermediate layer to create sitemaps, it >> doesn't aim to replace the existing infrastructure but IMHO it could >> be used as the foundation to create sitemaps; while all textual >> configurations work fine, having a more expressive and type checking >> APIs could help - and users could still wrap them in their bigger >> picture, making the tree objects construction easier. >> >> You could have a look at the Apache Commons Digester binder[1] APIs, >> which are wrapped by the XML configuration[2] and annotated >> elements[3]. One expressive layer to create the sitemap, multiple way >> to bind them. >> >> I agree that building tree objects would still work, but Fluent >> Interfaces would help on respecting the configuration status, i.e. the >> first element of a Pipeline can only be a Starter, when using the "old >> way" users are still able to setup a pipeline with no starter and find >> the error only when executing it. >> >> I am sure there are cases I am not taking in consideration that would >> break my PoC as well :P >> >> what do you think? You would be still able to load a graph from Neo4j >> and setup the pipeline using directly native Java APIs - no parsing, >> no transforming, a little faster :P >> >> Many thanks in advance, all the best! >> -Simo >> >> [1] http://commons.apache.org/digester/guide/binder.html >> [2] http://commons.apache.org/digester/guide/xmlrules.html >> [3] http://commons.apache.org/digester/guide/annotations.html >> >> http://people.apache.org/~simonetripodi/ >> http://simonetripodi.livejournal.com/ >> http://twitter.com/simonetripodi >> http://www.99soft.org/ >> >> >> On Mon, Aug 6, 2012 at 4:21 PM, Peter Hunsberger