cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <br...@outerthought.org>
Subject Sharing the template block between 2.1 and 2.2 (was Re: Release 2.1.9 (again))
Date Fri, 10 Mar 2006 13:57:10 GMT
On Thu, 2006-03-09 at 14:49 -0700, Jason Johnston wrote:
> On Thu, 2006-03-09 at 21:10 +0000, Upayavira wrote:
> > Jason Johnston wrote:
> > > On Thu, 2006-03-09 at 08:46 -0800, Ralph Goers wrote:
> > >> Bruno Dumon wrote:
> > >>
> > >>> On Thu, 2006-03-09 at 06:35 -0800, Ralph Goers wrote:
> > >>>  
> > >>>
> > >>>> Hi. Its me again.
> > >>>>
> > >>>> Seriously, are we there yet?
> > >>>>    
> > >>>>
> > >>> I guess nothing changed since you last asked ;-)
> > >>>  
> > >>>
> > >> Not quite.  A few days passed, which is all Sylvain said he needed.  
> > >> AFAIK that is all we are waiting for.
> > > 
> > > 
> > > It gets mentioned every time someone asks about the 2.1.9 release, so to
> > > keep the pattern going: what about the Template block from trunk?  IIRC
> > > this was discussed and planned for inclusion in 2.1.9.
> > 
> > Could you make a patch? That could make it happen.
> 
> I would be glad to.  But I would need guidance, since I know nothing
> about what is required.  Is it just adding an svn:external to that
> block, or are there code changes involved?

I just gave this a try to see if it needs any special work.

Here's what I did or found out:

 * copied the java sources (src/main/java)

 * resources (src/main/resources):

   - 2.2 has imports for xconf and xroles, so for 2.1 I had to create a
set of patch files (similar as is done for forms): nothing special here

   - the resources also contained a file template-instructions.xml, I
copied this to the java sources

 * the template block needs the (new in 2.2) class
TemplateObjectModelHelper, which is outside of the template block. I
copied it in the sources of the template block

 * class JavascriptExpression and TemplateObjectModelHelper: require
changes due to changed rhino API. For JavascriptExpression I simply
commented out the code since it is not essential.

 * I got classcast exceptions when StringTemplateFactory and
ExpressionFactory were looked up from the ServiceManager. The cause is
that these classes don't have a "service interface" (their role is a
concrete class). I introduced interfaces for them.

 * Added block to gump.xml and block.properties

And then it worked. I tried it first with a simple test file and then
with the forms block, and everything seems ok.

                                    - o -

To  summarize: if we want to have a shared codebase for the template
block, things that need to handled:

 - introduce interface for StringTemplateFactory and ExpressionFactory
    ==> this is something I can do

 - don't make use of new rhino API features: I need someone else to look
into this

 - Move template_instructions.xml between the java sources instead of
the resources: I could do this, if nobody objects or knows a better way

 - TemplateObjectModelHelper: could duplicate it into 2.1 core

Opinions? Objections? Help?

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


Mime
View raw message