Sylvain Wallez wrote:
Hi all,
While working on some new CForms stuff (Ajax suggest lists and
fi:styling as attributes), I felt more and more limited by the reduced
enviromnent that JXTG offers to macros.
Put it clearly, here's what I need to be accessible in macros:
- the service manager: I need to get a continuations knowing its ID
Don't like it, would prefer the accessor stuff that we discussed (and I
started to implement). But as my focus will be on blocks for the near
future I shouldn't block other peoples work, so go ahead.
- knowing and changing the XMLConsumer to which the template is
sending SAX events. I need this to cleanly implement fi:styling as
attributes and ensure no fi:styling element exists if attributes are
used.
Like it even less, it breaks SoC and I have some optimiztion ideas that
I would to work on in the future that not would work together direct
access to the XMLConsumer.
Could you give some example of what you need to do, so that we can see
if there could be some more dclarative solution of it that we could add
to JXTG?
Since this opens the door to many things, and therefore potential
abuse, this should not be generally accessible to template
expressions, but only accessible from within macros through additional
properties of the "macro" object.
Also, attributes that exist on macro elements are passed as
"macro.arguments" which is a Map associating the _local_ name of
attributes to their value. This means that a macro cannot distinguish
between @type and @fi:type. I therefore would like to add a
"macro.attributes" that will be a SAX Attributes object.
Seem reasonable.
Finally, I'm a bit fed up with maintaining the historical JXTG in the
2.1 branch. I think it's time to make the template block available in
2.1 as well.
Absolutely, I don't think that there is anything 2.2 specific in it, so
it might work right away.
We may want to keep the old generator in
o.a.c.generation.JXTemplateGenerator
2.1.x is supposed to be just a maintainance release ;) so that might be
the safest bet, but I don't care.
and use the new version only through
o.a.c.template.JXTemplateGenerator. Macros that make use of the new
features will have a means to know which one they're using to be able
to throw meaningful exceptions if needed.
/Daniel