[Xweb-developers] Re:Changes to XWeb
Brought to you by:
peterbecker
|
From: Hendrik L. <hen...@gm...> - 2003-11-06 10:11:23
|
Thursday, November 6, 2003, 10:18:03 AM, you wrote:
> for (int j =3D 1; j <=3D matcher.groupCount(); j++) {
> targetName =3D targetName.replaceAll("\\$"+ String.valueOf(j)=
,=20
> matcher.group(j));
> }
Hmm. Better do it backwards, otherwise $10 and $1 would get mixed (I'm no=
t
sure how to specify a '0' after a '$1', though...)
> Maybe at the moment, but I think the "official" API might take over qui=
ckly.
Don't think so. log4j is _really_ widespread. All larger projects I know
are using it (sometimes hidden behind an own logging layer to make easy
replacement possible).
> How do you configure log4j?
Depends: if I have a XML config file already there for the application, t=
he
log4j config is just part of it (using a <log4j:configuration>
element). If not, I just specify a properties file containing the
configuration. In the most simple cases, I configure everything
programatically.
> The plain and XML output the JDK produces seems good enough for me -- I
> don't see why we need to log into a database or an IM network in XWeb.=20
Think about someone integrating XWeb into a larger application - maybe th=
ey
need such a thing. And if someone runs XWeb via a cron job, IM or mail
notification would be handy...
Log4j also allows for very flexible output formatting (on the screen, kee=
p
everything short, but be verbose in the debug log). I also like the
'appender additivity' - the debug log should contain all application log
messages, but not vice versa.
> And I don't think that would be hard to do with the JDK logging=20
> framework. I'd actually write a custom one anyway since I want to log=20
> into a frontend with output that allows interaction.
I try to never re-invent the whell...
> What exactly do the 345kb give me in comparison to util.logging? Don't
> get we wrong -- I don't say log4j is not an option at all, I just want=20
> to know what it gives me, since I don't know much about it.
- it does not force me to JDK 1.4
- it is complete
- appender additivity
- flexible output formatting
- flexbile configuration
- widely used, and very stable
- many tools and enhancement available
- the de-facto standard for logging
I think I could live with the java.util.logging, as long as it allows for=
a
flexible logging scheme and easy configuration.
> if (!"regex".equals(child.getAttributeValue("mode"))) {
> // @todo we probably need more escaped here
> sourceFilesAttrib =3D=20
> sourceFilesAttrib.replaceAll("\\.", "\\.");
> sourceFilesAttrib =3D=20
> sourceFilesAttrib.replaceAll("\\*", "(.*)");
> sourceFilesAttrib =3D=20
> sourceFilesAttrib.replaceAll("\\?", "(.)");
> }
> I have to add the other regexp special characters for the escapes.
Maybe you can look into the ORO class transforming the glob into a regula=
r
expression... As I said - why re-invent the wheel? It is hard to do it
right, and easy to make the same mistakes again...
> Are there any good ideas around how to determine order for the
> corresponding <entryset>s? I want to do something like this:
> <entryset sourceFiles=3D"*.xhtml" targetFiles=3D"$1.html" names=3D"$1=
"=20
> ids=3D"$1" type=3D"XHTML"/>
> Which should fill up a whole section with XHTML documents, using the=20
> file names as part of the navigation. In that case order is somehow=20
> relevant, and it is neither alphabetical nor chronological.
I would skip this feature. If a users wants a specifiy order, he should
specify it explicitly.
Maybe your regex solution could be optional, but only for advanced users.
Another idea: add a 'order' attribut, like:
<entryset mode=3D"transform" order=3D"number" sourceFiles=3D"*.xhtml"
targetFiles=3D"*.html" names=3D"*" ids=3D"*" type=3D"XHTML"/>
=20
where the 'order' attribute specifies how to determine the navigation
order. It could map to plugin-classes / predefined classes.
hli
--=20
M=F8=F8se trained to mix concrete and Hen=
drik Lipka
sign complicated insurance forms hendrik.lipka@=
gmx.de
www.hendrikli=
pka.de
|