You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Jeremy Quinn <je...@media.demon.co.uk> on 2000/10/29 11:13:45 UTC

New TagLib, votes please

Hi All,

I am trying to get agreement on whether or how I should add my new Mailer
Taglib to Cocoon 1.

The issue is to do with two new JARs needed by the project (and
incidentally Donald's mail:taglib).


Options.

1. I add the project, integrating it into Cocoon 1

	cocoon/samples/mailer/ 7 files (15K)
	cocoon/src/org/apache/cocoon/processor/xsp/library/mailer/ 2 files (33K)
	cocoon/lib/ 2 files (279K)

	The JARs are :

		mail.jar						com.sun.mail, javax.mail
		activation.jar  		com.sun.activation, javax.activation

	In this scenario, the JARs would be required for Cocoon 1 to compile.

2. I provide the project as a standalone JAR in the "contrib" directory (it
exists?) or on my own site. People who want it's functionality, download
the JARs from SUN and do their own install.

3. I hack up the project so that the code that requires the two JARs from
Sun is supplied in the LogicSheet (as an inner class) instead of a Class in
the Cocoon package. This would allow the project to be pre-installed in
Cocoon, but would allow Cocoon to be compiled without the JARs. There is a
big downside though, it becomes a bloody nasty mess as there are already
302 lines of code in the LogicSheet and 431 lines of code comprising 33
methods in the XSPMailer Class. This may sound convenient, but it would not
be pretty!



Your votes please people.

Thanks

Jeremy
-- 
   ___________________________________________________________________

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <ma...@mac.com>     		 <http://www.media.demon.co.uk>
    <phone:+44.[0].20.7737.6831>        <pa...@sms.genie.co.uk>

Re: New TagLib, votes please

Posted by Paul Russell <pa...@luminas.co.uk>.
On Sun, Oct 29, 2000 at 07:06:33AM -0500, Kevin Sonney wrote:
> On Sun, 29 Oct 2000, Jeremy Quinn wrote:
> > Options.
> 
> You missed option 4 :
> 
> ant does some auto-detection, and will compile things based on what is and
> isn't present. So, if the proper classes are found, ant should compile the
> mail taglib in - like the LDAP processor. But if not, you shouldn't copy
> the taglib.

Can't vote officially, but a meta +1 for that from me.


Paul

-- 
Paul Russell                               <pa...@luminas.co.uk>
Technical Director,                   http://www.luminas.co.uk
Luminas Ltd.

Re: New TagLib, votes please

Posted by Stefano Mazzocchi <st...@apache.org>.
Jeremy Quinn wrote:
> 
> At 19:16 +0100 30/10/00, Giacomo Pati wrote:
> >> Option 1
> >>      Install as is, including two new Sun JARs in the distribution.
> >
> >+1 if the Sun JARs are distributable
> 
> How do I know? I am not a lawyer :)
> 
> Can anyone provide advice here?

Jon, it is ok to distribute javamail.jar and activation.jar with Apache
projects? do you do that for Turbine?

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------



Re: New TagLib, votes please

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
At 19:16 +0100 30/10/00, Giacomo Pati wrote:
>> Option 1
>> 	Install as is, including two new Sun JARs in the distribution.
>
>+1 if the Sun JARs are distributable

How do I know? I am not a lawyer :)

Can anyone provide advice here?

thanks

regards Jeremy
-- 
   ___________________________________________________________________

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <ma...@mac.com>     		 <http://www.media.demon.co.uk>
    <phone:+44.[0].20.7737.6831>        <pa...@sms.genie.co.uk>

Re: New TagLib, votes please

Posted by Stefan Bodewig <bo...@bost.de>.
Jeremy Quinn <je...@media.demon.co.uk> wrote:

> At 09:47 +0100 08/11/00, Stefan Bodewig wrote:

>>and make sure you are using Ant 1.2alpha2 or later.

> Robin, do you happen to know which version we have for Cocoon 1?

ant -version should tell you. Latest released version is Ant 1.2.

Stefan

Re: New TagLib, votes please

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
At 09:47 +0100 08/11/00, Stefan Bodewig wrote:
>>>>>> "JQ" == Jeremy Quinn <je...@media.demon.co.uk> writes:
>
> JQ> Does anyone know if it is possible to set up a dual class
> JQ> dependency for conditional compilation in the version of Ant used
> JQ> for Cocoon1?
>
>Yes, use a dummy target in between

[snip]

Thanks for your replies

>and make sure you are using Ant 1.2alpha2 or later.

Robin, do you happen to know which version we have for Cocoon 1?

Thanks

regards Jeremy
-- 
   ___________________________________________________________________

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <ma...@mac.com>     		 <http://www.media.demon.co.uk>
    <phone:+44.[0].20.7737.6831>        <pa...@sms.genie.co.uk>

Re: New TagLib, votes please

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "JQ" == Jeremy Quinn <je...@media.demon.co.uk> writes:

 JQ> Does anyone know if it is possible to set up a dual class
 JQ> dependency for conditional compilation in the version of Ant used
 JQ> for Cocoon1?

Yes, use a dummy target in between

<target name="check1">
  <available property="package1.is.there" classname="package1.class" />
</target>

<target name="check2" depends="check1" if="package1.is.there">
  <available property="both.are.there" classname="package2.class" />
</target>

and make sure you are using Ant 1.2alpha2 or later.

We could start a discussion on whether the limitation inside Ant to
allow for only one property in if/unless is to hard, but I think this
is not the place to do so.

Stefan

Re: New TagLib, votes please

Posted by Ross Burton <ro...@lineone.net>.
On Tue, 7 Nov 2000, Jeremy Quinn wrote:
> Does anyone know if it is possible to set up a dual class dependency for
> conditional compilation in the version of Ant used for Cocoon1?
> 
> I need to test for two separate packages
> 
> 	javax.activation ...
> 	javax.mail ...
> 
> I can do something like this for one package dependency, but can't work out
> how to handle two.
> 
> 
> 	<available property="mail.present" classname="javax.mail.Message"/>
> 
>   <target name="prepare-mailer" depends="init" if="mail.present">
>     <copydir src="${src.dir}"
>              dest="${build.src}"
>              includes="**/mailer/**"
>              filtering="on"/>
>   </target>

I did make a patch to Ant way back when C2 was interpretting the pipeline
to make Ant deal with the if="" like it does with depends="" (i.e. as a
List, not a String) but it was rejected by developers.  I think the reason
was that the patch was the start of boolean expressions (in that case the
comma was an implicit AND), and if they started along that road then
somebody else would want OR and NOT...

I think the response was to make a dummy task which has if="mail.jar",
then prepare-mailer depends on dummy and also has if="activation.jar".  Or
wait until Ant 2...  I'm not sure about this however, so you may want to
search the Ant archives.  My only postings, so they should be easy to
find.

Ross Burton


Re: New TagLib, votes please

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
>> > Option 4
>> > 	Install as in Option 1, without Sun's JARs, using Ant to conditionally
>> > compile.


Does anyone know if it is possible to set up a dual class dependency for
conditional compilation in the version of Ant used for Cocoon1?

I need to test for two separate packages

	javax.activation ...
	javax.mail ...

I can do something like this for one package dependency, but can't work out
how to handle two.


	<available property="mail.present" classname="javax.mail.Message"/>

  <target name="prepare-mailer" depends="init" if="mail.present">
    <copydir src="${src.dir}"
             dest="${build.src}"
             includes="**/mailer/**"
             filtering="on"/>
  </target>


thanks for any help

regards Jeremy
-- 
   ___________________________________________________________________

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <ma...@mac.com>     		 <http://www.media.demon.co.uk>
    <phone:+44.[0].20.7737.6831>        <pa...@sms.genie.co.uk>

Re: New TagLib, votes please

Posted by Donald Ball <ba...@webslingerZ.com>.
On Mon, 30 Oct 2000, Giacomo Pati wrote:

> > Option 1
> > 	Install as is, including two new Sun JARs in the distribution.
> 
> +1 if the Sun JARs are distributable

+1 for that option from me as well.

> > Option 2
> > 	Provide as a standalone in the contrib directory
> > 
> > Option 3
> > 	Put all code in the LogicSheet, so JARs only required if someone runs it.
> > 
> > Option 4
> > 	Install as in Option 1, without Sun's JARs, using Ant to conditionally
> > compile.
> 
> +1

and +1 for option 4 if we can't redistribute the jars.

- donald


Re: New TagLib, votes please

Posted by Giacomo Pati <Gi...@pwr.ch>.
On Mon, Oct 30, 2000 at 09:24:04AM +0000, Jeremy Quinn wrote:
> At 07:06 -0500 29/10/00, Kevin Sonney wrote:
> >On Sun, 29 Oct 2000, Jeremy Quinn wrote:
> >> Options.
> >
> >You missed option 4 :
> >
> >ant does some auto-detection, and will compile things based on what is and
> >isn't present. So, if the proper classes are found, ant should compile the
> >mail taglib in - like the LDAP processor. But if not, you shouldn't copy
> >the taglib.
> >
> >Is this possible?
> 
> Thanks Kevin, I thought I'd forgotten something :)
> 
> So, let's try again ....
> 
> Option 1
> 	Install as is, including two new Sun JARs in the distribution.

+1 if the Sun JARs are distributable

> 
> Option 2
> 	Provide as a standalone in the contrib directory
> 
> Option 3
> 	Put all code in the LogicSheet, so JARs only required if someone runs it.
> 
> Option 4
> 	Install as in Option 1, without Sun's JARs, using Ant to conditionally
> compile.

+1

Giacomo

-- 
PWR GmbH, Organisation & Entwicklung      Tel:   +41 (0)1  856 2202
Giacomo Pati, CTO/CEO                     Fax:   +41 (0)1  856 2201
Hintereichenstrasse 7                     Mobil: +41 (0)78 759 7703
CH-8166 Niederweningen                    Mailto:Giacomo.Pati@pwr.ch
                                          Web:   http://www.pwr.ch

Re: Classpath-based optional compilation (Re: New TagLib, votes please)

Posted by Jeff Turner <je...@socialchange.net.au>.

On 31 Oct 2000, Brian May wrote:

> >>>>> "Jeff" == Jeff Turner <je...@socialchange.net.au> writes:
> 
>     Jeff>  "It was a design error in JDK 1.0 that programmers had to
>     Jeff> set the CLASSPATH environment variable. This should have
>     Jeff> been set in a property file" --
>     Jeff> http://java.sun.com/people/linden/faq_b2.html#I/O
> 
> I think the problem with CLASSPATH is:
> 
> a) it contains information specific to each computer. Where is Java
> installed? What version is installed? Or, perhaps several different
> versions of Java are installed on the one computer.  In this case,
> which one should be used? Same Java environments set the CLASSPATH for
> this case automatically, however, not all do.

Well at some stage this info has to be known. As a user of a system that
DOES have the notion of env variables, I'm glad they did use CLASSPATHs
instead of properties files.

> b) it contains information specific to each project.
> 
> So, the user typically has to manually setup the CLASSPATH for each
> project, with the system specific stuff. I don't think a properties
> file will help this...

Exactly :) This is why I really like the notion of self-contained
projects. Where I work, there's a rule that every Ant-based project must
compile with an empty CLASSPATH.

But to get back to the topic, tying the build process to the build
environment seems wrong to me. It doesn't matter whether that build
environment is set via a CLASSPATH or a properties file. Make the build
process depend on the build *options*, but not the build *environment*. 

--Jeff

> -- 
> Brian May <ba...@snoopy.apana.org.au>
> 



Re: Classpath-based optional compilation (Re: New TagLib, votes please)

Posted by Brian May <ba...@snoopy.apana.org.au>.
>>>>> "Jeff" == Jeff Turner <je...@socialchange.net.au> writes:

    Jeff>  "It was a design error in JDK 1.0 that programmers had to
    Jeff> set the CLASSPATH environment variable. This should have
    Jeff> been set in a property file" --
    Jeff> http://java.sun.com/people/linden/faq_b2.html#I/O

I think the problem with CLASSPATH is:

a) it contains information specific to each computer. Where is Java
installed? What version is installed? Or, perhaps several different
versions of Java are installed on the one computer.  In this case,
which one should be used? Same Java environments set the CLASSPATH for
this case automatically, however, not all do.

b) it contains information specific to each project.

So, the user typically has to manually setup the CLASSPATH for each
project, with the system specific stuff. I don't think a properties
file will help this...
-- 
Brian May <ba...@snoopy.apana.org.au>

Classpath-based optional compilation (Re: New TagLib, votes please)

Posted by Jeff Turner <je...@socialchange.net.au>.
On Mon, 30 Oct 2000, Jeremy Quinn wrote:
> So, let's try again ....
> 
> Option 1
> 	Install as is, including two new Sun JARs in the distribution.
> 
> Option 2
> 	Provide as a standalone in the contrib directory
> 
> Option 3
> 	Put all code in the LogicSheet, so JARs only required if someone runs it.
> 
> Option 4
> 	Install as in Option 1, without Sun's JARs, using Ant to conditionally
> compile.

Just wondering.. does this optional compilation based on the contents of a
CLASSPATH variable seem a bit.. wrong?

IMHO it would be nicer is there was an explicit flag for each optional
component.

Using the presence of a class in the classpath as an implied flag is
pretty non-intuitive. As a consequence, it's very easy to forget.
Remember when Robin Green was creating the 1.8 distribution, and left out
some xt classes? IMHO, that's a symptom. It's happened to me too, many
times, and I'm sure lots of other people.

What happens when the builder wants some optional modules, but does not
have the requisite jars at hand. Who's to say the build environment is the
same as the deploy environment? Frequently it's not.

Classpaths are inherently evil anyway. Java doesn't allow access to any
other environment variables, for the good reason that many systems (like
Macs) don't have them. To quote from the Java FAQ:

 "It was a design error in JDK 1.0 that programmers had to set the
CLASSPATH environment variable. This should have been set in a property
file"
 -- http://java.sun.com/people/linden/faq_b2.html#I/O

How do people with Macs currently compile optional stuff into Cocoon?

So basically, I think it's wrong to tie Cocoon's build system to an
environment variable, and especially not for non-intuitive uses such as
flagging the inclusion of optional components.

But then I'm frequently wrong ;)

--Jeff

> 
> Back to you Ladies and Gentlemen.
> 
> regards Jeremy
> -- 
>    ___________________________________________________________________
> 
>    Jeremy Quinn                                           Karma Divers
>                                                        webSpace Design
>                                             HyperMedia Research Centre
> 
>    <ma...@mac.com>     		 <http://www.media.demon.co.uk>
>     <phone:+44.[0].20.7737.6831>        <pa...@sms.genie.co.uk>
> 




Re: New TagLib, votes please

Posted by Kevin Sonney <ke...@webslingerz.com>.
On Mon, 30 Oct 2000, Jeremy Quinn wrote:
> Thanks Kevin, I thought I'd forgotten something :)

No Problem. *grin*

> Option 4
> 	Install as in Option 1, without Sun's JARs, using Ant to conditionally
> compile.

+1 to this option....

-- 
+-------------------------------------------+
| Kevin Sonney        kevin@webslingerZ.com |
| Systems Programmer    www.webslingerZ.com |
+-------------------------------------------+

"The weakest link in any civil rights case is always the
defendant. Imagine being a lawyer and getting a call from me. That's why I
try to, uh, behave myself." - Hunter S. Thompson



Re: New TagLib, votes please

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
At 07:06 -0500 29/10/00, Kevin Sonney wrote:
>On Sun, 29 Oct 2000, Jeremy Quinn wrote:
>> Options.
>
>You missed option 4 :
>
>ant does some auto-detection, and will compile things based on what is and
>isn't present. So, if the proper classes are found, ant should compile the
>mail taglib in - like the LDAP processor. But if not, you shouldn't copy
>the taglib.
>
>Is this possible?

Thanks Kevin, I thought I'd forgotten something :)

So, let's try again ....

Option 1
	Install as is, including two new Sun JARs in the distribution.

Option 2
	Provide as a standalone in the contrib directory

Option 3
	Put all code in the LogicSheet, so JARs only required if someone runs it.

Option 4
	Install as in Option 1, without Sun's JARs, using Ant to conditionally
compile.


Back to you Ladies and Gentlemen.

regards Jeremy
-- 
   ___________________________________________________________________

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <ma...@mac.com>     		 <http://www.media.demon.co.uk>
    <phone:+44.[0].20.7737.6831>        <pa...@sms.genie.co.uk>

Re: New TagLib, votes please

Posted by Kevin Sonney <ke...@webslingerz.com>.
On Sun, 29 Oct 2000, Giacomo Pati wrote:
> I'm sure the C1 build.xml is doing that already as well as C2. The are fully
> aware of such things and implements many "optional" classes which get compiled
> only if some resources are available at compile time. It's a simple matter of
> adding this to the build.xml file.

Er, I wasn't asking if it was possible to do it in general, but if it was
possible to use this feature, as it is already used for LDAP and a couple
of other things, fot he mail taglib that's being proposed.

Sorry if I didn't make that clear in my post...

-- 
+-------------------------------------------+
| Kevin Sonney        kevin@webslingerZ.com |
| Systems Programmer    www.webslingerZ.com |
+-------------------------------------------+

"The weakest link in any civil rights case is always the
defendant. Imagine being a lawyer and getting a call from me. That's why I
try to, uh, behave myself." - Hunter S. Thompson



Re: New TagLib, votes please

Posted by Giacomo Pati <Gi...@pwr.ch>.
Kevin Sonney wrote:
> 
> On Sun, 29 Oct 2000, Jeremy Quinn wrote:
> > Options.
> 
> You missed option 4 :
> 
> ant does some auto-detection, and will compile things based on what is and
> isn't present. So, if the proper classes are found, ant should compile the
> mail taglib in - like the LDAP processor. But if not, you shouldn't copy
> the taglib.
> 
> Is this possible?

I'm sure the C1 build.xml is doing that already as well as C2. The are fully
aware of such things and implements many "optional" classes which get compiled
only if some resources are available at compile time. It's a simple matter of
adding this to the build.xml file.

Giacomo

-- 
PWR GmbH, Organisation & Entwicklung      Tel:   +41 (0)1  856 2202
Giacomo Pati, CTO/CEO                     Fax:   +41 (0)1  856 2201
Hintereichenstrasse 7                     Mobil: +41 (0)78 759 7703
CH-8166 Niederweningen                    Mailto:Giacomo.Pati@pwr.ch
                                          Web:   http://www.pwr.ch

Re: New TagLib, votes please

Posted by Kevin Sonney <ke...@webslingerz.com>.
On Sun, 29 Oct 2000, Jeremy Quinn wrote:
> Options.

You missed option 4 :

ant does some auto-detection, and will compile things based on what is and
isn't present. So, if the proper classes are found, ant should compile the
mail taglib in - like the LDAP processor. But if not, you shouldn't copy
the taglib.

Is this possible? 

-- 
+-------------------------------------------+
| Kevin Sonney        kevin@webslingerZ.com |
| Systems Programmer    www.webslingerZ.com |
+-------------------------------------------+

"The weakest link in any civil rights case is always the
defendant. Imagine being a lawyer and getting a call from me. That's why I
try to, uh, behave myself." - Hunter S. Thompson