Hello Derek,

Have a look at 
http://cocoon.apache.org/2.1/userdocs/offline/ant.html 

I will notice what I have done to give some help about issues I had
with cocoon 2.1.8.
I work with windows and Java 1.4.2

Step 1:
Somewhere I found, that cocoon should use the same ant version it is
shipped with.
so for Cocoon 2.1.8 this is Ant 1.6.5
extract Ant 1.6.5 to D:\ and set my environmet variable "ANT_HOME" to
"D:\apache-ant-1.6.5"
extend the environment variable "PATH" with ";%ANT_HOME%\bin;"

Copy the file D:\apache-ant-1.6.5\bin\ant.bat to myant.bat
and insert somewhere in the beginning of that file 
SET ANT_OPTS="-Djava.endorsed.dirs=D:\cocoon-2.1.8\lib\endorsed"
-Xms64m *Xmx512m
This one forces the JAVA VM Ant uses to use the xml Stuff from cocoon
and will give the JAVA VM 
some extra RAM-Memory.

Step 2:
extract Cocoon 2.1.8 to "D:\cocoon-2.1.8"

copy blocks.properties to local.blocks.properties 
and exclude all blocks you do not need.
(have a look at
http://wiki.apache.org/cocoon-data/attachments/BlockDescriptions/attachments/blocks-218.ppt
for dependencies)

Important: the block "portal" must be excluded from the build.

Build Cocoon with "build" on commandline 

Step 3:
There are three configuration issuses

1.)configure Log4J :
Create a file named " log4j.properties" at
"D:\cocoon-2.1.8\build\webapp\WEB-INF\classes".
Content of this file: 
#**********************************************************************
# Root log4j appender
log4j.rootCategory = INFO, root
log4j.appender.root = org.apache.log4j.FileAppender
log4j.appender.root.File = ../logs/my.log
log4j.appender.root.layout = org.apache.log4j.PatternLayout
log4j.appender.root.layout.ConversionPattern = %-5r %-5p [%t] %c{2} -
%m%n
log4j.appender.root.Append = false
# Apache JCS cache
log4j.category.org.apache.jcs = INFO, jcs
log4j.appender.jcs = org.apache.log4j.FileAppender
log4j.appender.jcs.File = ../logs/jcs.log
log4j.appender.jcs.layout = org.apache.log4j.PatternLayout
log4j.appender.jcs.layout.ConversionPattern = %-5r %-5p [%t] %c{2} -
%m%n
log4j.appender.jcs.Append = false
#**********************************************************************

End of file.
With this done an error message will not occure on cocoon startup.

2.) Delete the entry
<logging log-kit="${cocoon.context}/WEB-INF/logkit.xconf" logger="cli"
level="ERROR"/>
in the ant build file from the official docs. I will give an example
later.
I suppose this must be done, cause Cocoon 2.1.8 default Logging is now
log4j and no longer logkit.?

3.) Copy the file "servlet_2_2.jar" from "D:\cocoon-2.1.8\lib\core" to
"D:\cocoon-2.1.8\build\webapp\WEB-INF\lib"


Step 4:
Run an Ant example.

Place the following ant build file to "D:\cocoon-2.1.8\build" name it
"test.xml"

<?xml version="1.0"?>
<project default="cocoon" basedir=".">
  <property name="cocoon.context" value="webapp"/>
  <path id="cocoon.classpath">
    <dirset dir="${cocoon.context}/WEB-INF/classes"/>
    <fileset dir="${cocoon.context}/WEB-INF/lib" includes="*.jar"/>
  </path>
  <taskdef name="cocoon" classname="org.apache.cocoon.CocoonTask"
classpathref="cocoon.classpath"/>
  <target name="cocoon">
    <cocoon verbose="false" 
    classpathref="cocoon.classpath" 
    follow-links="false" precompile-only="false" 
    confirm-extensions="false" context-dir="${cocoon.context}" 
    config-file="WEB-INF/cocoon.xconf" 
    work-dir="build/work" 
    dest-dir="build/dest" 
    default-filename="index.html" 
    accept="*/*">
      <broken-links type="xml" file="brokenlinks.xml" generate="false"
extension=".error"/>
      <uris name="samples" follow-links="false">
        <uri type="append" src-prefix=""
src="samples/blocks/fop/hello.pdf" dest="build/dest/"/>
        <uri type="append" src-prefix=""
src="samples/hello-world/hello.html" dest="build/dest/"/>
      </uris>
    </cocoon>
  </target>
</project>

from commandline call:
"myant -f test.xml"


After t
hat there will be a hello.pdf file at:
"D:\cocoon-2.1.8-ant\build\build\dest\samples\blocks\fop"

Done.

You can also use an Ant copy Task to copy the generated file(s) to your
live cocoon webapp:
  <target name="copy">
   <copy todir="../../intranet/cocoon/intranet/mysamples"><!-- my
cocoon webapp location-->
    <fileset dir="build/dest/intranet/samples/blocks/fop">
      <include name="*.pdf"/>
    </fileset>
  </copy>
In the live cocoon webapp I have a <map:read /> to serve the pdf file.

Some more tricks:

With Ant you can run cocoon several times after each other.
e.g. 
1. Run cocoon to generate a huge.xml file.
2. Run cocoon another time to use the generated huge.xml file to create
several pdf's
...

<uri type="append" src-prefix="" src="samples/hello-world/hello.html"
dest="webapp/"/>
with dest="webapp/" the generated file is written to the sorce ant
webapp.

<uris name="samples" follow-links="true">
with  follow-links="true" cocoon will follow the links of a HTML File

Try to design sitemap map:match patterns with parameter names in the
filename and not as parameter.
e.g:
use test*-*.pdf instead of test.pdf?param1=test&param2=test2

Hope this helps ;-)

Martin





>>> [EMAIL PROTECTED] Montag, 12. Dezember 2005 07:20:57 >>>
Martin
 
Do you know of any examples that demo this capability: ie use
of  "coocon ant task" to run an overnight transform?  I am 
looking to create graphics from a database at fixed intervals
and had been wondring how to do this?
 
Thanks
Derek

>>> [EMAIL PROTECTED] 2005/12/10 04:25:10 PM >>>
hello,
I create my heavy wight pdf files over night per coocon ant task.
So in my webapp there is only a reader to the pdf file and
no progress bar is needed.

Sorry, but I have no idea about a progress bar.

Martin

>>> [EMAIL PROTECTED] >>>
I have a PDF that takes some time to be created and I want to show some

kind of progress. Maybe using page redirection and somehow when its
done

redirect to the completed PDF. The problem is I have no idea where to 
start. Anyone has any samples or idea on how to do this?




-- 
This message is subject to the CSIR's copyright, terms and conditions
and
e-mail legal notice. Views expressed herein do not necessarily
represent the
views of the CSIR.
 
CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html 
 
CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html 
 
For electronic copies of the CSIR Copyright, Terms and Conditions and
the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject
line to
[EMAIL PROTECTED]


This message has been scanned for viruses and dangerous content by
MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for
their support.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]