From dev-return-67563-apmail-cocoon-dev-archive=cocoon.apache.org@cocoon.apache.org Tue Nov 09 10:34:40 2004 Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 71038 invoked from network); 9 Nov 2004 10:34:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 9 Nov 2004 10:34:38 -0000 Received: (qmail 44107 invoked by uid 500); 9 Nov 2004 10:34:20 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 43984 invoked by uid 500); 9 Nov 2004 10:34:19 -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 43950 invoked by uid 99); 9 Nov 2004 10:34:19 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from [84.96.21.10] (HELO mail.anyware-tech.com) (84.96.21.10) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 09 Nov 2004 02:34:18 -0800 Received: from [10.0.0.27] (unknown [10.0.0.27]) by mail.anyware-tech.com (Postfix) with ESMTP id 0A2175EB11 for ; Tue, 9 Nov 2004 11:34:16 +0100 (CET) Message-ID: <41909D2A.4050808@apache.org> Date: Tue, 09 Nov 2004 11:34:18 +0100 From: Sylvain Wallez Organization: Anyware Technologies User-Agent: Mozilla Thunderbird 0.8 (Macintosh/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: [RT] Attribute Rendering and CForms Convertors References: <5E091A68F794974CAF431CA31F5AF2CC11E99F@server.bizzdesign.nl> <4187D02F.9090209@nada.kth.se> <418A3C62.7020800@apache.org> <418B4E93.5050808@nada.kth.se> <418B53C3.9020000@mobilebox.pl> <418B79CA.9000805@nada.kth.se> <1099663265.5116.25.camel@localhost.localdomain> In-Reply-To: <1099663265.5116.25.camel@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Jonas Ekstedt wrote: >On Fri, 2004-11-05 at 14:02 +0100, Daniel Fagerstrom wrote: > > >>>If I would be able to choose convertors I might decide IN VIEW ITSELF >>>that that specific model value should be coloured/pretty >>>printed/rendered according to some specific logic. As long as this >>>logic has read-only access to model and performs steps to produce some >>>rendering I do not find it SoC break. >>> >>> >>Seem like an excelent idea to me. I think it could be analog to the use >>of the class attribute in HTML to give hints to CSS about styling. >> >>We could have something like: >> >> ${month/balance?class=financialValue} >> >>then the finacialValue rule for convertion is used if there is one >>otherwise the default rule is used. There is no doubt room for >>improvement of the syntax ;) >> >>A functional syntax as Sylvain prpoposed would also be possible: >> >> ${convert(month/balance, 'financialValue')} >> >>but I percieve the convertor as something that not is part of the >>expression language (EL). The convertor is applied to the object that is >>returned from the EL engine, and the default convertor should always be >>applied on the object, so one shoudn't need to write >> >> ${convert(month/balance)} >> >>to get the default conversion. >> >> > >Couldn't the above example be done better with tags instead? For >example: > > > > Good idea. Actually, I even already used it that way (but just made the connection now with this discussions) by implementing complex formattings as JX macros. The use case was presenting an object part of a tree as the path from the tree root down to the object (i.e. "foo > bar > baz"), with links on each element. Something I definitely wouldn't want to do in the controller :-) So maybe the solution just consists in defining sets of reusable JX macros? Sylvain -- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }