Re: JXTG: invoke macro by name from expression

2004-12-09 Thread Leszek Gawron
Antonio Gallardo wrote:
On Mie, 8 de Diciembre de 2004, 15:17, Conal Tuohy dijo:
Leszek Gawron wrote:
Though I would suggest jx:call-macro name=fooBar/ which would make it
clear that the attribute is the NAME of the macro to be invoked, rather
than the macro itself.

+1 here.
But please keep in mind we need still support the old ways. We need to
deprecate and later remove the old support. That is the way to keep
contracts working with current users. :-D
I didn't even think about removing something.
--
Leszek Gawron  [EMAIL PROTECTED]
Project ManagerMobileBox sp. z o.o.
+48 (61) 855 06 67  http://www.mobilebox.pl
mobile: +48 (501) 720 812   fax: +48 (61) 853 29 65


Re: JXTG: invoke macro by name from expression

2004-12-09 Thread Daniel Fagerstrom
Leszek Gawron wrote:
snip/
That's good. If noone objects I will start tomorrow and hopefully commit 
 tomorrow.
I have not had time to evalute your proposal in detail, but from a first 
look it seem good, so please go ahead.

The syntax you proposed for invocation:
jx:invoke macro=superPrettyPrintedTable
   headerTemplate=addressHeaderTemplate
   elements=${addresses}
   rowTemplate=addressRowTemplate/
has the problem that headerTemplate and so on only are defined in the 
macro definition. Which means that you can't use a schema for checking 
the template. I would suggest that you use the ordinary verobose

jx:parameter  name=foo value=bar/
syntax instead. So that it can work together with common XML tools, if 
people want to use such.

And in another mail:
It does not seem that much coding is needed. I could also strip all inner
classes from JXTG at the same time as the first step for JXTG refactoring.
I'm working on refactoring JXTG, and will commit as soon as I have 
something commitable. I would suggest that you focus on implementing the 
invoke stuff, if its ok with you, so that we avoid doing the same work 
twice.

You should also be aware of that refactoring is somewhat more 
complicated than just stripping out the inner classes, as they have all 
sort of interdependencies based on using global variable in the main 
class and using public variables from each other :/

/Daniel


Re: JXTG: invoke macro by name from expression

2004-12-09 Thread Leszek Gawron
Daniel Fagerstrom wrote:
Leszek Gawron wrote:
snip/
That's good. If noone objects I will start tomorrow and hopefully 
commit  tomorrow.
I have not had time to evalute your proposal in detail, but from a first 
look it seem good, so please go ahead.

The syntax you proposed for invocation:
jx:invoke macro=superPrettyPrintedTable
   headerTemplate=addressHeaderTemplate
   elements=${addresses}
   rowTemplate=addressRowTemplate/

has the problem that headerTemplate and so on only are defined in the 
macro definition. Which means that you can't use a schema for checking 
the template. I would suggest that you use the ordinary verobose

jx:parameter  name=foo value=bar/

 syntax instead. So that it can work together with common XML tools, if
 people want to use such.

That would be good but looks like a bigger change while current macro 
call is done via
macroName param1=value param2=value/

so I would reuse the current logic. If you do not mind I'll commit my 
approach first and look for the way to achieve your syntax.

And in another mail:
It does not seem that much coding is needed. I could also strip all inner
classes from JXTG at the same time as the first step for JXTG 
refactoring.
I'm working on refactoring JXTG, and will commit as soon as I have 
something commitable. I would suggest that you focus on implementing the 
invoke stuff, if its ok with you, so that we avoid doing the same work 
twice.

You should also be aware of that refactoring is somewhat more 
complicated than just stripping out the inner classes, as they have all 
sort of interdependencies based on using global variable in the main 
class and using public variables from each other :/
I was able to strip 48 classes (almost all inner) removing all public 
variables and introducing getters. This was almost an identity 
transformation using eclipse so for 99% I haven't broken anything.

If you already have something I should not commit - maybe I would send 
you the source via email so you could use it if you wanted?

--
Leszek Gawron  [EMAIL PROTECTED]
Project ManagerMobileBox sp. z o.o.
+48 (61) 855 06 67  http://www.mobilebox.pl
mobile: +48 (501) 720 812   fax: +48 (61) 853 29 65


Re: JXTG: invoke macro by name from expression

2004-12-09 Thread Leszek Gawron
Leszek Gawron wrote:
Daniel Fagerstrom wrote:
Leszek Gawron wrote:
snip/
That's good. If noone objects I will start tomorrow and hopefully 
commit  tomorrow.

I have not had time to evalute your proposal in detail, but from a 
first look it seem good, so please go ahead.

The syntax you proposed for invocation:
jx:invoke macro=superPrettyPrintedTable
   headerTemplate=addressHeaderTemplate
   elements=${addresses}
   rowTemplate=addressRowTemplate/

has the problem that headerTemplate and so on only are defined in 
the macro definition. Which means that you can't use a schema for 
checking the template. I would suggest that you use the ordinary verobose

jx:parameter  name=foo value=bar/
 
  syntax instead. So that it can work together with common XML tools, if
  people want to use such.
 
That would be good but looks like a bigger change while current macro 
call is done via
macroName param1=value param2=value/

so I would reuse the current logic. If you do not mind I'll commit my 
approach first and look for the way to achieve your syntax.

And in another mail:
It does not seem that much coding is needed. I could also strip all 
inner
classes from JXTG at the same time as the first step for JXTG 
refactoring.

I'm working on refactoring JXTG, and will commit as soon as I have 
something commitable. I would suggest that you focus on implementing 
the invoke stuff, if its ok with you, so that we avoid doing the same 
work twice.

You should also be aware of that refactoring is somewhat more 
complicated than just stripping out the inner classes, as they have 
all sort of interdependencies based on using global variable in the 
main class and using public variables from each other :/
I was able to strip 48 classes (almost all inner) removing all public 
variables and introducing getters. This was almost an identity 
transformation using eclipse so for 99% I haven't broken anything.

If you already have something I should not commit - maybe I would send 
you the source via email so you could use it if you wanted?
http://www.apache.org/~lgawron/jxtg-20041209.zip
Wasn't that hard with eclipse. Still took 4 hours so I'd appreciate if 
you looked at it :)

--
Leszek Gawron  [EMAIL PROTECTED]
Project ManagerMobileBox sp. z o.o.
+48 (61) 855 06 67  http://www.mobilebox.pl
mobile: +48 (501) 720 812   fax: +48 (61) 853 29 65


Re: JXTG: invoke macro by name from expression

2004-12-09 Thread Antonio Gallardo
On Jue, 9 de Diciembre de 2004, 3:01, Leszek Gawron dijo:
 If you already have something I should not commit - maybe I would send
 you the source via email so you could use it if you wanted?
 http://www.apache.org/~lgawron/jxtg-20041209.zip

 Wasn't that hard with eclipse. Still took 4 hours so I'd appreciate if
 you looked at it :)

I think you can commit the changes, if it is working. This way all of us
can review it.

WDYT?

Best Regards,

Antonio Gallardo.



Re: JXTG: invoke macro by name from expression

2004-12-09 Thread Leszek Gawron
Antonio Gallardo wrote:
On Jue, 9 de Diciembre de 2004, 3:01, Leszek Gawron dijo:
If you already have something I should not commit - maybe I would send
you the source via email so you could use it if you wanted?
http://www.apache.org/~lgawron/jxtg-20041209.zip
Wasn't that hard with eclipse. Still took 4 hours so I'd appreciate if
you looked at it :)

I think you can commit the changes, if it is working. This way all of us
can review it.
WDYT?
The problem is that it will make all Daniel's changes uncommitable as my 
changes are massive. Daniel - how many changes have you done already?

--
Leszek Gawron  [EMAIL PROTECTED]
Project ManagerMobileBox sp. z o.o.
+48 (61) 855 06 67  http://www.mobilebox.pl
mobile: +48 (501) 720 812   fax: +48 (61) 853 29 65


Re: JXTG: invoke macro by name from expression

2004-12-09 Thread Daniel Fagerstrom
Leszek Gawron wrote:
Daniel Fagerstrom wrote: 
snip/
  syntax instead. So that it can work together with common XML tools, if
 people want to use such.

That would be good but looks like a bigger change while current macro 
call is done via
macroName param1=value param2=value/

so I would reuse the current logic. If you do not mind I'll commit my 
approach first and look for the way to achieve your syntax. 
I don't mind, do it as you find suitable.
/Daniel



RE: JXTG: invoke macro by name from expression

2004-12-08 Thread Conal Tuohy
Leszek Gawron wrote:

 I would like to add one feature to JXTG that would allow not 
 to promote 
 hacks like [1]. Example:
 
 jx:macro name=fooBar
somecontent/some
 /jx:macro
 
 you can only invoke it by fooBar/
 
 If I were able to do jx:invoke macro=fooBar/ I would be 
 able to pass 
 macro name as a parameter to other macro which allows quite powerful 
 data injection technique:

Yes! Functional programming! 
+100

Though I would suggest jx:call-macro name=fooBar/ which would make it clear 
that the attribute is the NAME of the macro to be invoked, rather than the 
macro itself.


Re: JXTG: invoke macro by name from expression

2004-12-08 Thread Leszek Gawron
Conal Tuohy wrote:
Leszek Gawron wrote:

I would like to add one feature to JXTG that would allow not 
to promote 
hacks like [1]. Example:

jx:macro name=fooBar
  somecontent/some
/jx:macro
you can only invoke it by fooBar/
If I were able to do jx:invoke macro=fooBar/ I would be 
able to pass 
macro name as a parameter to other macro which allows quite powerful 
data injection technique:

Yes! Functional programming! 
+100

Though I would suggest jx:call-macro name=fooBar/ which would make it clear that the attribute is the NAME of the macro to be invoked, rather than the macro itself.
That's good. If noone objects I will start tomorrow and hopefully commit 
 tomorrow.

--
Leszek Gawron  [EMAIL PROTECTED]
Project ManagerMobileBox sp. z o.o.
+48 (61) 855 06 67  http://www.mobilebox.pl
mobile: +48 (501) 720 812   fax: +48 (61) 853 29 65


RE: JXTG: invoke macro by name from expression

2004-12-08 Thread Antonio Gallardo
On Mie, 8 de Diciembre de 2004, 15:17, Conal Tuohy dijo:
 Leszek Gawron wrote:
 Though I would suggest jx:call-macro name=fooBar/ which would make it
 clear that the attribute is the NAME of the macro to be invoked, rather
 than the macro itself.

+1 here.

But please keep in mind we need still support the old ways. We need to
deprecate and later remove the old support. That is the way to keep
contracts working with current users. :-D

Best Regards,

Antonio Gallardo



Re: JXTG: invoke macro by name from expression

2004-12-08 Thread Glen Ezkovich
On Dec 8, 2004, at 3:04 PM, Leszek Gawron wrote:
I would like to add one feature to JXTG that would allow not to 
promote hacks like [1]. Example:

jx:macro name=fooBar
  somecontent/some
/jx:macro
you can only invoke it by fooBar/
If I were able to do jx:invoke macro=fooBar/ I would be able to 
pass macro name as a parameter to other macro which allows quite 
powerful data injection technique:

jx:macro name=superPrettyPrintedTable
  jx:parameter name=headerTemplate/
  jx:parameter name=elements/
  jx:parameter name=rowTemplate/
  !-- fancy code with lots of graphics here --
  table
tr
  jx:invoke macro=${headerTemplate}/
/tr
jx:forEach var=currentElement
items=elements
varStatus=status
  tr
td${status.index}/td
jx:invoke macro=${rowTemplate} element=${currentElement}/
  /tr
/jx:forEach
  /table
  !-- fancy code with lots of graphics there --
/jx:macro
then use the macro like this:
jx:macro name=addressesHeaderTemplate
  thCity/ththStreet/th
/jx:macro
jx:macro name=addressRowTemplate
  jx:parameter name=address/
  td${address.city}/td
  td${address.street}/td
/jx:macro
jx:invoke macro=superPrettyPrintedTable
   headerTemplate=addressHeaderTemplate
   elements=${addresses}
   rowTemplate=addressRowTemplate/
WDYT? We could deprecate jx:eval then which is not fully supported as 
additional Map structure has to be used as [1] shows.

It does not seem that much coding is needed. I could also strip all 
inner classes from JXTG at the same time as the first step for JXTG 
refactoring.
Sounds good to me. a non-voting +1
Glen Ezkovich
HardBop Consulting
glen at hard-bop.com
http://www.hard-bop.com

A Proverb for Paranoids:
If they can get you asking the wrong questions, they don't have to 
worry about answers.
- Thomas Pynchon Gravity's Rainbow