cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stev...@outerthought.org
Subject [WIKI-UPDATE] YourCocoonBasedProject MarcPortier Mon Jun 30 09:00:05 2003
Date Mon, 30 Jun 2003 07:00:05 GMT
Page: http://wiki.cocoondev.org/Wiki.jsp?page=YourCocoonBasedProject , version: 7 on Mon Jun
30 06:48:21 2003 by MarcPortier

+ !About
+ 
- themselves are being build in the new build system.
+ themselves are being build in the new (as of cocoon 2.1) build system.
?                                       +++++++++++++++++++

- ''Disclaimer:'' Limited shelf life of this: investigating how this could be useful in a
2.0.x or even early 2.1 is TBD.  Most if not all of this will probably stop being relevant
when [Blocks] are getting what they are intended to be. (See [BlocksDefinition] for that)
?                                                                                        
     ------------------

+ ''Disclaimer:'' Limited shelf life of this: while the described ideas should work for anything
starting the 2.1M* releases, investigating how this could be useful in a 2.0.x is TBD.  Most
if not all of this will probably stop being relevant when [Blocks] are getting what they are
intended to be. (See [BlocksDefinition] for that)
?                                            ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

- \\Some suggestions:
- * Add Linux friendly versions of the simple batch files
- * Complete the list of <xpatch> tricks in [XPatchTaskUsage]
- * ... your own?
+ ----
+ !The works
-       +- etc
-          +- cocoon
? ---

+       +- cocoon
-            +- *.xconf:
-                 ! using xpatch-task syntax to augment the cocoon.xconf
-            +- local.blocks.properties
? --                    ^^^^

+          +- local.build.properties
?                    ++ ^

-                 ! block and build customization file as suggested in the cocoon
? --

+               ! block and build customization file as suggested in the cocoon
-                 ! install and readme files, to include only those blocks your
? --

+               ! install and readme files, to include only those blocks your
-                 ! project will need
? --

+               ! project will need
+          +- webapp
+          +- xconf
+            +- *.xconf, *.xweb, *.xmap, *.xlog:
+                 ! using xpatch-task syntax to augment the xml config files:
+                 ! cocoon.xconf, web.xml, sitemap.xmap resp. logkit.xconf
-    +- build.properties:
?       - ^^^

+    +- user.properties:
?        ^^^

-           ! specifies cocoon-dist.home of distribution to use
+           ! specifies cocoon-dist.home of distribution to use in your local case
?                                                              +++++++++++++++++++

- @echo off
+ @echo off	
?          +

-   <target name="get-cocoon">
?                 ----

+   <target name="cocoon.get">
?                       ++++

-   <target name="run-cocoon" >
?                 ----

+   <target name="cocoon.run" >
?                       ++++

- The remaining thing now is to actually create your own webapp based on the one that was
pulled in with the get_cocoon (you would typically only call this get_cocoon when you want
to upgrade / switch to another Cocoon distribution)
?                                                                                        
                   ^^ ^                                           ----                   
            ^

+ The remaining thing now is to actually create your own webapp based on the one that was
pulled in with the {{ant cocoon.get}} (you would typically only call this cocoon.get when
you want to upgrade or switch to another Cocoon distribution)
?                                                                                        
                   ^^^^ ^      ++++++                                           ++++     
                    ^^

+   <target name="-cocoon.patch">
+     <echo>
+       Patching ${cocoon.patch.target} with 
+       ${cocoon-xconf.dir}/*.${cocoon.patch.src-extension} ...
+     </echo>
+     <xpatch file="${cocoon.patch.target}"
+             srcdir="${cocoon-xconf.dir}" 
+             includes="**/*.${cocoon.patch.src-extension}"/>
+   </target>
- 	<target name="webapp" depends="check_cocoon, jar">
- 		<taskdef 
- 		    name="xpatch" 
- 		    classname="XConfToolTask" 
- 		    classpath="${cocoon.tasks}"/>	
- 		<echo>Patching webapp..</echo>
- 		<xpatch 
- 		    configuration="${cocoon.webapp}/WEB-INF/cocoon.xconf"
- 		    directory="${src.cocoon}" 
- 		    extension="xconf" />
- 		<echo>Building webapp..</echo>
- 		<copy todir="${cocoon.lib}" >
- 			<fileset dir="${build}" includes="*.jar" />
- 		</copy>
- 		<copy todir="${cocoon.webapp}" >
- 			<fileset dir="${src.cocoon}" includes="${name}/**" />
- 		</copy>
+   <target name="cocoon.xconf" depends="-cocoon.check">
+     <path id="cocoon-tasks.cp">
+       <pathelement path="${cocoon.tasks}" />
+       <path>
+         <fileset dir="${cocoon.lib}">
+           <include name="xalan*.jar" />
+           <include name="xerces*.jar" />
+           <include name="xml*.jar" />
+         </fileset>
+       </path>
+     </path>
+ 
+     <taskdef name="xpatch" 
+              classname="XConfToolTask" 
+              classpathref="cocoon-tasks.cp"/>	
+ 
+     <antcall target="-cocoon.patch" >
+       <param name="cocoon.patch.target" 
+              value="${cocoon.webapp}/WEB-INF/cocoon.xconf" />
+       <param name="cocoon.patch.src-extension" 
+              value="xconf" />
+     </antcall>
+ 
+     <antcall target="-cocoon.patch" >
+       <param name="cocoon.patch.target" 
+              value="${cocoon.webapp}/WEB-INF/logkit.xconf" />
+       <param name="cocoon.patch.src-extension" 
+              value="xlog" />
+     </antcall>
+ 
+     <antcall target="-cocoon.patch" >
+       <param name="cocoon.patch.target" 
+              value="${cocoon.webapp}/sitemap.xmap" />
+       <param name="cocoon.patch.src-extension" 
+              value="xmap" />
+     </antcall>
+ 
+     <antcall target="-cocoon.patch" >
+       <param name="cocoon.patch.target" 
+              value="${cocoon.webapp}/WEB-INF/web.xml" />
+       <param name="cocoon.patch.src-extension" 
+              value="xweb" />
+     </antcall>
+ 
- 	</target>
? ^

+   </target>
? ^^

- In combination with the xconf-patch-file in the ${src.cocoon} directory.
?                                                   ----

+ In combination with the xconf-patch-files in the ${cocoon-xconf.dir} directory.
?                                         +                ++++++++++

+ 
- For more advanced usage of this patching mechanism there is a separate Wiki page foreseen:
[XPatchTaskUsage]
+ 
+ For a more complete usage of this patching mechanism see [XPatchTaskUsage] --  ''(thx to
[GeoffHoward])''
- Some people have asked how to do the patching based on values of system properties, haven't
really tried this myself but you might consider creating your xconf files on the fly with
a trick like this
?                                                                                   ^ -------
 -----------      -----------    ^^^^^

+ Some people have asked how to do the patching based on values of system properties.  For
this you can consider creating your xconf files on the fly with a trick like this:
?                                                                                   ^  ++
          ^^^                                                                     +

-         <target name="make-xpatchfile">
? ----

+     <target name="make-xpatchfile">
-             <echo file="myfile.xconf"><![CDATA[<?xml version="1.0"?>
? ----

+         <echo file="myfile.xconf"><![CDATA[<?xml version="1.0"?>
-         </target>
? ----

+     </target>
- Completion: (as checked with Geoff) this works allright, but you have to make sure that
the property to be substituted has a value set. If not the property-substitution will stay
unchanged.  And then Geoff is very right in saying that the xpatch task will not be doing
that
?                                                        ^ ^^^

+ Completion: (as checked with Geoff) this works allright.  However: you have to make sure
that the property to be substituted has a value set. If not the property-substitution will
stay unchanged.  And then Geoff is very right in saying that the xpatch task will not be doing
that
?                                                        ^ ^^^^^^^^^

- a file mypatch.xconf in the directory ${src.xconf}
+ Have a @token@ inside your file mypatch.xconf
- together with copy-token-filtering support of ant:
? ^^^    ------

+ and use the copy-token-filtering support of ant:
? ^^^^^^ +

- I recently automated some more of this in a set of ant-tasks that you can include in your
own project's build.xml.
+ I recently automated some more of this in a packaged set of ant-tasks that you can include
in your own project's build.xml.
?                                            +++++++++

- It defers with the above only in details (and it should work for linux as well)
+ It defers with the above only in details (and it should work for linux as well, please fix/comment
if it doesn't)
?                                                                               ++++++++++++++++++++++++++++++++++



Page: http://wiki.cocoondev.org/Wiki.jsp?page=MarcPortier , version: 10 on Mon Jun 30 06:51:05
2003 by MarcPortier

+ * [YourCocoonBasedProject]
- * [YourCocoonBasedProject]
+ * none ATM
+ * [XPatchTaskUsage] -- added by [GeoffHoward]
- * [XPatchTaskUsage]
+ * [Woody]



Mime
View raw message