cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Melhem <micha...@fztig938.bank.dresdner.net>
Subject Re: [Flow] sendPage* params and jpath input modules?
Date Tue, 25 Mar 2003 13:50:55 GMT
On Mon, Mar 24, 2003 at 01:12:31PM -0800, Christopher Oliver wrote:

Hi Christopher,

> Michael,
> 
> Can you describe the use case(s) where you want to make flow values available to the
sitemap?

Well, as I outlined in the original mail, the basic use of this would be to help 
rid the sitemap of selectors (for example selectors which select which
stylesheet to use) and also eliminate the need for nested sitemap matchers.

Which stylesheet to use can be dynamically calculated in the flow and this 
information passed back to the sitemap.  This will abstract flow information 
from the sitemap into the flow layer where it belongs. 

There already exists a method for passing values into the flow functions via
map:paramater. However there appears to be no standard simple method to do
the reverse. The "jpath input module" would provide a neat way of
passing this information back to the sitemap. (Even though there does
currently exist crude ways to achieve the samething).

The following is an example of how a jpath input module could be used:

  <!-- route all mask urls to the flow -->
  <map:match type="regexp" pattern="client../(.*)-mask.xml">
    <map:call function="flow">
      <map:parameter name="mask-name" value="{2}"/>
     </map:call>
   </map:match>

 //inside the flow.js
 sendPage("mask-builder",{"mask_type": mask_type});

  <!-- generic internal mask builder -->
  <map:match pattern="mask-builder">
    <map:generate type="serverpages" src="context://client/common/mask/mask-xsp.xml" />
    <map:transform src="mask_stylesheets/{jpath_inputModule:mask_type}-mask.xsl" />
     <map:serialize />
   </map:match>

However, to write a jpath input module one would nead to access to the
FOM from inside the input module, which is not currenlty possible I dont
think.

Cheers,
Michael


> 
> Thanks,
> 
> Christopher
> 
> -----Original Message-----
> From: Michael Melhem [mailto:michaelm@fztig938.bank.dresdner.net]
> Sent: Monday, March 24, 2003 10:14 AM
> To: haul@informatik.tu-darmstadt.de
> Cc: cocoon-dev@xml.apache.org; michaelm@apache.org
> Subject: Re: [Flow] sendPage* params and jpath input modules?
> 
> 
> On Mon, Mar 24, 2003 at 05:54:14PM +0100, Christian Haul wrote:
> > On 24.Mar.2003 -- 03:58 PM, Michael Melhem wrote:
> > > Hi lads,
> > > 
> > > Is there a best practice for making flow values available at
> > > the sitemap level (instead of being directly sent to
> > > sitemap components)?
> > 
> > <snip/>
> > 
> > > However the above two solutions seem more like hacks. A more
> > > appropriate solution might the introduction of "jpath input module"
> > > as follows:
> > > 
> > > sendPage*("hello-world",{"value" : calculated_value})
> > > 
> > >   match pattern="hello-world"
> > >   generate...
> > >   transform src="client/stylesheet-{{jpath:value}}.xsl
> > > 
> > > So im thinking of implementing a jpath input module to facilitate the
> > > 3rd option.
> > 
> > Michael,
> > I'm not completly up-to-date with the discussion but AFAIR this is
> > about to be moved to the objectModel. From there it is POC to write a
> > new module drived from AbstractJXPathModule to access it. I think this
> > is a good suggestion.
> 
> Hi Chris,
> 
> Yes, without "FOM" being accessible (from ObjectModelHelper), it might be rather
> difficult to implement a "jpath input module". :)
> 
> Has there been agreement on adding the necessary extra methods to ObjectModelHelper 
> yet...Im not sure whats been decided...? 
> 
> Regards,
> Michael
> > 
> > Cheers.
> > 
> > 	Chris.
> > -- 
> > C h r i s t i a n       H a u l
> > haul@informatik.tu-darmstadt.de
> >     fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

Mime
View raw message