Re: [c3] Log*Transformer

2011-02-21 Thread Simone Tripodi
Hi all,
I'd tend agree with Reinhard if the CloseShield functionality is not
simple (and I mean very simple, almost silly) to replicate into our
module.
I'm sure the CloseShield in the IO takes care of more general
PrintStream use cases rather then just the sysout, so I'm worried that
the proposed patch is not enough...
Just my 0.02 cents,
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



2011/2/18 Francesco Chicchiriccò francesco.chicchiri...@tirasa.net:
 On 18/feb/2011, at 20.28, Reinhard Pötz wrote:

 I had to comment the usage of the Log*Transformers in the sample sitemap 
 because they break the integration tests (run it.sh or it.bat from C3's root 
 directory). The problem is that the logfile is written to the file system 
 which doesn't work in a multi-module build (map:parameter name=logfile 
 value=target/logasxml.log / - there is no target directory at the base 
 directory).

 IMO the best idea would be changing the transformer configurations to use 
 System.out but the current implementations close the output stream in their 
 finish methods. That's of course useful for FileOutputStreams but mustn't 
 happen for System.out.

 IMO the best solution would be wrapping the usage of System.out with Commons 
 IO's CloseShieldOutputStream 
 (http://s.apache.org/commons-io-close-shield-outputstream). However, this 
 would introduce a dependency of cocoon-sax on commons-io which should be 
 avoided for a minor use case like this.

 I see two possible solutions:

 a) move the Log*Transformers to cocoon-optional and wrap the usage
   of System.out with the CloseShieldOutputStream

 b) implement the CloseShield functionality ourselves and leave them
   where they are.

 I would prefer option a) because it's the simpler solution and leads to less 
 code.

 WDYT?

 What if we choose a third option, like changing

                this.outputStream.close();

 to

                if (System.out.equals(this.outputStream)) {
                    this.outputStream.flush();
                } else {
                    this.outputStream.close();
                }

 in the finish() body, for both transformers?

 I made these simple modifications (in the attached patch) and, at least on my 
 machine, the integration tests are running successfully.

 Let me know if this solution is acceptable, thanks.

 Regards.




Re: [c3] Log*Transformer

2011-02-21 Thread Francesco Chicchiriccò
On 21/feb/2011, at 10.56, Simone Tripodi wrote:

 Hi all,
 I'd tend agree with Reinhard if the CloseShield functionality is not
 simple (and I mean very simple, almost silly) to replicate into our
 module.
 I'm sure the CloseShield in the IO takes care of more general
 PrintStream use cases rather then just the sysout, so I'm worried that
 the proposed patch is not enough...

For the sake of clarity: I've proposed that naive patch mainly because I think 
that Log*Transformers are there to be used only for dev purpose, where 
System.out or FileOutpuStream are the only viable candidates.

Anyway, I've taken a quick look to 
http://s.apache.org/commons-io-close-shield-outputstream and its parent class 
http://bit.ly/h7AolY: it seems to me that it would be quite easy to embed these 
two classes in order to have a CloseShield functionality in cocoon3-sax.

If you think that it could be useful to have such functionality there (also for 
usage by other classes than just Log*Transformers), please let me know.

Cheers.

 2011/2/18 Francesco Chicchiriccò francesco.chicchiri...@tirasa.net:
 On 18/feb/2011, at 20.28, Reinhard Pötz wrote:
 
 I had to comment the usage of the Log*Transformers in the sample sitemap 
 because they break the integration tests (run it.sh or it.bat from C3's 
 root directory). The problem is that the logfile is written to the file 
 system which doesn't work in a multi-module build (map:parameter 
 name=logfile value=target/logasxml.log / - there is no target 
 directory at the base directory).
 
 IMO the best idea would be changing the transformer configurations to use 
 System.out but the current implementations close the output stream in their 
 finish methods. That's of course useful for FileOutputStreams but mustn't 
 happen for System.out.
 
 IMO the best solution would be wrapping the usage of System.out with 
 Commons IO's CloseShieldOutputStream 
 (http://s.apache.org/commons-io-close-shield-outputstream). However, this 
 would introduce a dependency of cocoon-sax on commons-io which should be 
 avoided for a minor use case like this.
 
 I see two possible solutions:
 
 a) move the Log*Transformers to cocoon-optional and wrap the usage
   of System.out with the CloseShieldOutputStream
 
 b) implement the CloseShield functionality ourselves and leave them
   where they are.
 
 I would prefer option a) because it's the simpler solution and leads to 
 less code.
 
 WDYT?
 
 What if we choose a third option, like changing
 
this.outputStream.close();
 
 to
 
if (System.out.equals(this.outputStream)) {
this.outputStream.flush();
} else {
this.outputStream.close();
}
 
 in the finish() body, for both transformers?
 
 I made these simple modifications (in the attached patch) and, at least on 
 my machine, the integration tests are running successfully.
 
 Let me know if this solution is acceptable, thanks.
 
 Regards.


Welcome Francesco Chicchiriccò as new Cocoon Committer

2011-02-21 Thread Simone Tripodi
Hi all,
Francesco's nomination has been accepted. He got 7 positive votes and
no negative one. Congratulations Francesco and welcome!
Francesco, it's a good tradition here to introduce yourself.
Thanks in advance, have a nice day!
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/


Re: Welcome Francesco Chicchiriccò as new Cocoon Committer

2011-02-21 Thread Francesco Chicchiriccò
On 21/feb/2011, at 15.25, Simone Tripodi wrote:

 Hi all,
 Francesco's nomination has been accepted. He got 7 positive votes and
 no negative one. Congratulations Francesco and welcome!
 Francesco, it's a good tradition here to introduce yourself.

My name is Francesco Chicchiriccò, and my surname has been a tricky challenge 
since I was born in 1977, every time that I had to get in touch with any public 
office; the advent of Internet made things even more cumbersome, despite of 
Unicode effort :-)

Linux addict since 1997, I am Italian (and proud to be), married with a lovely 
wife called Cinzia, father of a wonderful boy called Davide. Since I was a 
child I've always loved comics and music, playing bass guitar in a few metal 
rock bands with some friends.

About Computer Science, I got a master degree in 2001 in L'Aquila, after six 
months spent at Nokia Research Center in Heksinki.
Since then I've been working as developer, analyst and architect for some 
companies until I've established in 2004 my first IT company (ePOSSE, now 
Everett Italia - http://www.everett.it). In these days I am about to start a 
brand new Open Source based company, Tirasa - http://www.tirasa.net, aiming to 
speed up the development and the adoption of Syncope Open Source IdM - 
http://syncope.googlecode.com.

In 2006 I had the chance to meet Gianugo Rabellino, at a common customer's 
place, that introduced to me the word of Apache Software Foundation in general 
and Cocoon in particular. Given the fact that Cocoon 2.1 had an almost vertical 
learning curve, I've been fascinated by the upsetting beauty of its 
architecture and potential.

Besides Cocoon, I've been contributing to some other projects like Sync4j (now 
Funambol), OpenAM - http://forgerock.com/openam.html and Hippo CMS - 
http://www.hippocms.org/.

 Thanks in advance, have a nice day!

My personal thanks to Simone for trying to involve me in the development of 
Cocoon 3, the latest evolution of concepts and principles I've been loving for 
years.

As I've already told to PCM members, it is an honor for me to join the 
development of this project.
I wish I'll be able to contribute at best of my capabilities.

Cheers.



Re: Welcome Francesco Chicchiriccò as new Cocoon Committer

2011-02-21 Thread David Crossley
Thanks Francesco, and welcome.

-David