Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 75217 invoked from network); 3 Mar 2005 20:27:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 3 Mar 2005 20:27:52 -0000 Received: (qmail 61242 invoked by uid 500); 3 Mar 2005 20:27:50 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 61177 invoked by uid 500); 3 Mar 2005 20:27:50 -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 61164 invoked by uid 99); 3 Mar 2005 20:27:50 -0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from netblock-66-51-199-82.dslextreme.com (HELO va1.dslextreme.com) (66.51.199.82) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 03 Mar 2005 12:27:48 -0800 Received: from mail5.dslextreme.com (unknown [192.168.7.93]) by va1.dslextreme.com (Postfix) with SMTP id AE3147C4151 for ; Thu, 3 Mar 2005 12:27:48 -0800 (PST) Received: (qmail 18862 invoked from network); 3 Mar 2005 20:27:45 -0000 Received: from unknown (HELO belagio) (66.51.196.164) by mail5.dslextreme.com with SMTP; Thu, 03 Mar 2005 12:27:45 -0800 Message-ID: <42277341.5040101@dslextreme.com> Date: Thu, 03 Mar 2005 12:27:45 -0800 From: Ralph Goers User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: [RT] A Unified Environment Model? References: <42239FC2.3020503@nada.kth.se> <422444FC.4040207@nada.kth.se> <4225F490.4000805@nada.kth.se> <42261931.5060703@nada.kth.se> <42264C8E.9010207@nada.kth.se> <4226C0C3.6010501@apache.org> <42272E3E.4040308@dslextreme.com> <42273556.2090707@apache.org> <422743F4.6030702@dslextreme.com> <42274C83.7080800@apache.org> In-Reply-To: <42274C83.7080800@apache.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-yoursite-MailGate-Information: Please contact the ISP for more information X-yoursite-MailGate: Found to be clean X-MailGate-From: ralph.goers@dslextreme.com X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Carsten Ziegeler wrote: >Ralph Goers wrote: > > >>Carsten Ziegeler wrote: >> >> >>OK. I'm not sure I'd try to solve the problem that way though. I'd >>probably just use the existing object model. Since its a Map I can put >>anything I want into it. To get at things I'd just put objects in the >>map to get them like: >>objectModel.put("systemproperties", System.getProperties()); >> >> >> >Sure, and this will of course still be possible. But where do you do >this put operation? > Actually, in the implementation that followed, you wouldn't. The caller would do: SytemProperties.getProperties(); Mind you, this example is pretty stupid since one could just do System.getProperties(), but I think it illustrated the point. >Imagine you want to access these systemproperties in > your template, in order to access them in your template someone has to >put them there beforehand. > No. I code {SystemProperties}. To make things standardized the class could just be expected to implement a static method named getInstance(). Then that method gets called to locate it. >If you do this by hand, *you* have to take >care about this and either do this in flow or somewhere else. >So the basic idea is to provide an automatic way for such things - you >once configure that you might want to use the "systemproperties" stored >in the object model somewhere - and as soon as you access them, they're >available. >I see real use cases for the authentication-fw and the portal. For >example the portal "enhances" the object model with a portal object, so >you can do something like objectModel.get("portal").getPortalUser() in >Java or ${cocoon.portal.user} in your template. > > I'd prefer PortalUser.getInstance() in Java or {PortalUser} in a template. >Obviously not everyone needs this portal axis in the object model and >this portal object is not available with every request - just every >request targetted at the portal. > >Of course, if you're using plain java there are other ways of getting >this information. But we want to have a unified way, so the same "paths" >work in Java, in flow and in your template. > >Carsten > > >