You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Berin Loritsch <bl...@apache.org> on 2001/02/21 18:23:51 UTC

[C2] Precompiled sites

The framework is in place for precompiled sites to work.

For some reason, Cocoon didn't like context filenames with
no parent directories.  I wish I new why.  The good news is,
we can specify a root package (defaults to "org.apache.cocoon")
which all classes are compiled into.

As a result of this change, I uncovered some bugs and redundant
code in the FileStore.  All is well.

Now if only I could get the GeneratorSelector to use the precompiled
classes....

Re: [C2] Precompiled sites

Posted by Berin Loritsch <bl...@apache.org>.
If you set your work directory to WEB-INF/classes, then you should be good
to go!

----- Original Message -----
From: Davanum Srinivas <di...@yahoo.com>
To: <co...@xml.apache.org>
Sent: Saturday, February 24, 2001 3:15 PM
Subject: Re: [C2] Precompiled sites


> Berin, Team,
>
> 1. Set the CLASSPATH to include all the jars in the xml-cocoon\lib
directory, cocoon.jar,
> tools.jar from JDK
>
> 2. Run the following sample command: (on one line :-)
> "java org.apache.cocoon.Main -c
D:\jakarta\xml-cocoon\build\cocoon\webapp -x
> docs/samples/xsp/simple.xsp docs/samples/forms/employee.xsp"
>
> This will create the following java files and corresponding classes in the
work directory:
> a. org\apache\cocoon\sitemap_xmap.java
> b. org\apache\cocoon\docs\samples\xsp\simple_xsp.java
> c. org\apache\cocoon\docs\samples\forms\employee_xsp.java
>
> Thanks,
> dims
>
> --- Berin Loritsch <bl...@apache.org> wrote:
> > Davanum Srinivas wrote:
> > >
> > > Berin,
> > >
> > > How do i pre-compile a site? Can you post the procedure?
> >
> > The procedure is not in place, the framework to allow for
> > consistent naming of generated classes accross installations
> > is in place.  The next step is to modify the command line
> > utility to compile the sitemap and XSP pages and set the
> > Work Directory to $context/WEB-INF/classes.  This has not
> > been done yet.
> >
> > We might be able to go hog wild and create an Ant Task,
> > but I have _no_ experience with that.
> >
> > >
> > > Thanks,
> > > dims
> > >
> > > --- Berin Loritsch <bl...@apache.org> wrote:
> > > > The framework is in place for precompiled sites to work.
> > > >
> > > > For some reason, Cocoon didn't like context filenames with
> > > > no parent directories.  I wish I new why.  The good news is,
> > > > we can specify a root package (defaults to "org.apache.cocoon")
> > > > which all classes are compiled into.
> > > >
> > > > As a result of this change, I uncovered some bugs and redundant
> > > > code in the FileStore.  All is well.
> > > >
> > > > Now if only I could get the GeneratorSelector to use the precompiled
> > > > classes....
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > > > For additional commands, email: cocoon-dev-help@xml.apache.org
> > > >
> > >
> > > =====
> > > Davanum Srinivas, JNI-FAQ Manager
> > > http://www.jGuru.com/faq/JNI
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Yahoo! Auctions - Buy the things you want at great prices!
http://auctions.yahoo.com/
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > > For additional commands, email: cocoon-dev-help@xml.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > For additional commands, email: cocoon-dev-help@xml.apache.org
> >
>
>
> =====
> Davanum Srinivas, JNI-FAQ Manager
> http://www.jGuru.com/faq/JNI
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [C2] Precompiled sites

Posted by Davanum Srinivas <di...@yahoo.com>.
Berin, Team,

1. Set the CLASSPATH to include all the jars in the xml-cocoon\lib directory, cocoon.jar,
tools.jar from JDK

2. Run the following sample command: (on one line :-)
"java org.apache.cocoon.Main -c D:\jakarta\xml-cocoon\build\cocoon\webapp -x
docs/samples/xsp/simple.xsp docs/samples/forms/employee.xsp"

This will create the following java files and corresponding classes in the work directory:
a. org\apache\cocoon\sitemap_xmap.java
b. org\apache\cocoon\docs\samples\xsp\simple_xsp.java
c. org\apache\cocoon\docs\samples\forms\employee_xsp.java

Thanks,
dims

--- Berin Loritsch <bl...@apache.org> wrote:
> Davanum Srinivas wrote:
> > 
> > Berin,
> > 
> > How do i pre-compile a site? Can you post the procedure?
> 
> The procedure is not in place, the framework to allow for
> consistent naming of generated classes accross installations
> is in place.  The next step is to modify the command line
> utility to compile the sitemap and XSP pages and set the
> Work Directory to $context/WEB-INF/classes.  This has not
> been done yet.
> 
> We might be able to go hog wild and create an Ant Task,
> but I have _no_ experience with that.
> 
> > 
> > Thanks,
> > dims
> > 
> > --- Berin Loritsch <bl...@apache.org> wrote:
> > > The framework is in place for precompiled sites to work.
> > >
> > > For some reason, Cocoon didn't like context filenames with
> > > no parent directories.  I wish I new why.  The good news is,
> > > we can specify a root package (defaults to "org.apache.cocoon")
> > > which all classes are compiled into.
> > >
> > > As a result of this change, I uncovered some bugs and redundant
> > > code in the FileStore.  All is well.
> > >
> > > Now if only I could get the GeneratorSelector to use the precompiled
> > > classes....
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > > For additional commands, email: cocoon-dev-help@xml.apache.org
> > >
> > 
> > =====
> > Davanum Srinivas, JNI-FAQ Manager
> > http://www.jGuru.com/faq/JNI
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > For additional commands, email: cocoon-dev-help@xml.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 


=====
Davanum Srinivas, JNI-FAQ Manager
http://www.jGuru.com/faq/JNI

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

Re: [C2] Precompiled sites

Posted by Berin Loritsch <bl...@apache.org>.
Davanum Srinivas wrote:
> 
> Berin,
> 
> How do i pre-compile a site? Can you post the procedure?

The procedure is not in place, the framework to allow for
consistent naming of generated classes accross installations
is in place.  The next step is to modify the command line
utility to compile the sitemap and XSP pages and set the
Work Directory to $context/WEB-INF/classes.  This has not
been done yet.

We might be able to go hog wild and create an Ant Task,
but I have _no_ experience with that.

> 
> Thanks,
> dims
> 
> --- Berin Loritsch <bl...@apache.org> wrote:
> > The framework is in place for precompiled sites to work.
> >
> > For some reason, Cocoon didn't like context filenames with
> > no parent directories.  I wish I new why.  The good news is,
> > we can specify a root package (defaults to "org.apache.cocoon")
> > which all classes are compiled into.
> >
> > As a result of this change, I uncovered some bugs and redundant
> > code in the FileStore.  All is well.
> >
> > Now if only I could get the GeneratorSelector to use the precompiled
> > classes....
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > For additional commands, email: cocoon-dev-help@xml.apache.org
> >
> 
> =====
> Davanum Srinivas, JNI-FAQ Manager
> http://www.jGuru.com/faq/JNI
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org

Re: [C2] Precompiled sites

Posted by Berin Loritsch <bl...@apache.org>.
Stefano Mazzocchi wrote:
> 
> Davanum Srinivas wrote:
> >
> > Berin,
> >
> > How do i pre-compile a site? Can you post the procedure?
> 
> Yeah, I'm curious as well.
> 
> Also, I believe it would be a total win for Cocoon2 to be able to
> generate a 'fully precompiled' site. Not only compiled bytecode, but
> also compiled XML. It's pretty easy to come up with a SAX parser wrapper
> that understands if the XML is compiled or not. (just check for the
> first bytes to be "XMLC10", 'C' for 'compiled') this will reduce parsing
> time and improve performance.
> 
> But gives us another big win: production sites are untouchable!!!
> 
> In many situations, production sites are 'touched' and modified without
> back-porting the changes to the development trunk, this normally creates
> friction and overhead. By proposing a good practice of "build site" that
> generates the full 'war with precompiled everything' that can be
> deployed and forgotten.
> 
> A great thing would be to precompile the sitemap as well.

All possible--but not fully implemented.  Sitemaps are created with
the ProgramGeneratorImpl class as well as the XSP files.  There is
no problem with compiling the sitemap ahead of time.  The
GeneratorSelector needs to see if the class exists in the repository,
and then load it if it can't be found through normal channels.  I
have code that looks like it should work, but I still can't find
out why it isn't loading the precompiled class...

> 
> Oh, well, just food for thought.
> 
> --
> Stefano Mazzocchi      One must still have chaos in oneself to be
>                           able to give birth to a dancing star.
> <st...@apache.org>                             Friedrich Nietzsche
> --------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org

Re: [C2] Precompiled sites

Posted by Stefano Mazzocchi <st...@apache.org>.
Davanum Srinivas wrote:
> 
> Berin,
> 
> How do i pre-compile a site? Can you post the procedure?

Yeah, I'm curious as well.

Also, I believe it would be a total win for Cocoon2 to be able to
generate a 'fully precompiled' site. Not only compiled bytecode, but
also compiled XML. It's pretty easy to come up with a SAX parser wrapper
that understands if the XML is compiled or not. (just check for the
first bytes to be "XMLC10", 'C' for 'compiled') this will reduce parsing
time and improve performance.

But gives us another big win: production sites are untouchable!!!

In many situations, production sites are 'touched' and modified without
back-porting the changes to the development trunk, this normally creates
friction and overhead. By proposing a good practice of "build site" that
generates the full 'war with precompiled everything' that can be
deployed and forgotten.

A great thing would be to precompile the sitemap as well.

Oh, well, just food for thought.

-- 
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: [C2] Precompiled sites

Posted by Davanum Srinivas <di...@yahoo.com>.
Berin,

How do i pre-compile a site? Can you post the procedure?

Thanks,
dims

--- Berin Loritsch <bl...@apache.org> wrote:
> The framework is in place for precompiled sites to work.
> 
> For some reason, Cocoon didn't like context filenames with
> no parent directories.  I wish I new why.  The good news is,
> we can specify a root package (defaults to "org.apache.cocoon")
> which all classes are compiled into.
> 
> As a result of this change, I uncovered some bugs and redundant
> code in the FileStore.  All is well.
> 
> Now if only I could get the GeneratorSelector to use the precompiled
> classes....
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 


=====
Davanum Srinivas, JNI-FAQ Manager
http://www.jGuru.com/faq/JNI

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/