A wise old hermit known only as Ara Abrahamian <[EMAIL PROTECTED]> once
said:
> Regarding [ #486505 ] Improve element:
> What's your suggestion?
>
> Here is the request with my comments inline:
>
> --------
> In its current form, the packageSubstition nested
> element for the ejbdoclet task isn't quite flexible
> enough for how I've got my packages arranged. It's
> fine if the packages are one the same level e.g.
> com.foobar.somebean.ejb ->
> com.foobar.somebean.interfaces, but if you want the
> interfaces stored at a different level it's cumbersome.
>
> We'd use com.foobar.somebean.impl ->
> com.foobar.somebean, but if I use <packageSubstitution
> packages="impl" substituteWith=""/> then choosePackage
> () will leave a trailing '.' on the end. Similarly,
>
> <ara>Is removing the trailing dot a good solution?</ara>
>
> someone else on the xdoclet-user was saying recently
> they'd use com.foobar.somebean ->
> com.foobar.somebean.interfaces, but if they tried
> <packageSubstitution packages=""
> substituteWith="interfaces"/> it would end up looking
> for packageName.endsWith("."), which I doubt would
> find many matches...
>
> <ara>Is interpreting packages="" as 'thepackage.substituteWithValue a
> good solution? "" should be interpreted as whatever package.</ara>
>
> It can be worked around with multiple entries like
> <packageSubstitution packages="bean1.impl"
> substituteWith="bean1"/>
> <packageSubstitution packages="bean2.impl"
> substituteWith="bean2"/>
> ...
> but that takes more maintenance and becomes unwieldy
> as the number of packages grows.
> --------
>
> The best solution is something like Ant's **/*.java blabla stuff of
> filesets. But what does <packageSubstitution packages="**.ejb.**"
> substituteWith="interfaces"/> mean?! Should it result in
> com.foo.ejb.subsystem.interfaces or com.foo.ejb.interfaces? I mean the
> "root" is not clear. So I propose something like this:
> "{1}" means current package minus last sub-package: com.foo->com
>
> So for com.foobar.somebean.ejb->com.foobar.somebean.interfaces:
> <packageSubstitution packages="" substituteWith="{1}.interfaces"/>
>
> And for com.foobar.somebean.impl->com.foobar.somebean:
> <packageSubstitution packages="" substituteWith="{1}"/>
>
> And for com.foobar.somebean.impl->com.foobar.intf:
> <packageSubstitution packages="" substituteWith="{2}.intf"/>
>
> And for com.foobar.somebean->com.foobar.interfaces.somebean:
> <packageSubstitution packages="" substituteWith="{1}.interfaces.{L0}"/>
> Where L0 mean Last sub-package.
>
> Or maybe a separate root=".." parameter where .. mean {2}?
>
> Ara.
How about just using something like
<packageSubstitution packages="{0}.impl" substituteWith="{0}"/>
<packageSubstitution packages="{0}" substituteWith="{0}.interfaces"/>
<packageSubstitution packages="{0}.ejb,{0}.beans"
substituteWith="{0}.interfaces"/>
i.e. don't worry about substituting different levels {1}, {2}, {LO} etc.
just have something there as a placeholder for the matched text so we
don't have an empty string for either of the parameters? That keeps it
relatively simple. It gets a bit ambiguous with packages="{0},{0}.impl",
but I guess we'd just take the first match and skip the rest.
Andrew.
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel