You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by gi...@locus.apache.org on 2000/06/01 00:42:33 UTC
cvs commit: xml-cocoon/xdocs installing.xml
giacomo 00/05/31 15:42:32
Modified: . Tag: xml-cocoon2 build.xml
conf/WEB-INF Tag: xml-cocoon2 web.xml
src/org/apache/cocoon/servlet Tag: xml-cocoon2
CocoonServlet.java
xdocs Tag: xml-cocoon2 installing.xml
Log:
Extending the build system to create a cocoon.war file. Reflecting these changes to the install docs and changing CocoonServlet.java to read from the Context root to get the cocoon.xconf file.
PR
Revision Changes Path
No revision
No revision
1.6.2.7 +27 -2 xml-cocoon/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/xml-cocoon/build.xml,v
retrieving revision 1.6.2.6
retrieving revision 1.6.2.7
diff -u -r1.6.2.6 -r1.6.2.7
--- build.xml 2000/05/24 23:06:43 1.6.2.6
+++ build.xml 2000/05/31 22:42:31 1.6.2.7
@@ -93,6 +93,7 @@
These are the meaningful targets for this build file:
- package [default] -> creates ./build/cocoon.jar
+ - war -> creates ./build/cocoon.war
- docs -> generates the HTML documentation in ./build/docs
- javadocs -> generates the API documentation in ./build/javadocs
- dist-zip -> generates the Cocoon distribution
@@ -142,6 +143,8 @@
<property name="build.dest" value="./build/classes"/>
<property name="build.docs" value="./build/docs"/>
<property name="build.javadocs" value="./build/javadocs"/>
+ <property name="build.war" value="./build/war"/>
+ <property name="build.war.samples" value="./build/war/samples"/>
<property name="dist.root" value="./dist"/>
<property name="dist.dir" value="${dist.root}/${name}-${version}"/>
@@ -172,6 +175,7 @@
<echo message=" javadocs --> generates the API documentation (java 1.2 only)"/>
<echo message=" dist-zip --> generates the Cocoon distribution as .zip"/>
<echo message=" dist-tgz --> generates the Cocoon distribution as .tar.gz"/>
+ <echo message=" war --> generates the cocoon.war file"/>
<echo message=" clean --> cleans up the directory"/>
<echo message=" site --> generates the Cocoon web site"/>
<echo message=""/>
@@ -189,6 +193,21 @@
</target>
<!-- =================================================================== -->
+ <!-- Creates the war file -->
+ <!-- =================================================================== -->
+ <target name="war" depends="prepare">
+ <mkdir dir="${build.war}"/>
+ <mkdir dir="${build.war.samples}"/>
+ <copydir src="${conf.dir}" dest="${build.war}" filtering="on"/>
+ <copydir src="${samples.dir}" dest="${build.war.samples}" filtering="on"/>
+ <delete file="${build.dir}/${name}.war"/>
+ <jar jarfile="${build.dir}/${name}.war"
+ basedir="${build.war}"
+ includes="**"/>
+ <deltree dir="${build.war}"/>
+ </target>
+
+ <!-- =================================================================== -->
<!-- Prepares the source code -->
<!-- =================================================================== -->
<target name="prepare-src" depends="prepare">
@@ -213,13 +232,19 @@
</target>
<!-- =================================================================== -->
- <!-- Creates the class package -->
+ <!-- Creates the jar file -->
<!-- =================================================================== -->
- <target name="package" depends="compile">
+ <target name="jar" depends="compile">
<jar jarfile="${build.dir}/${name}.jar"
basedir="${build.dest}"
manifest="${build.src}/Manifest.mf"
includes="org/**"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Creates the class package -->
+ <!-- =================================================================== -->
+ <target name="package" depends="jar,war">
</target>
<!-- =================================================================== -->
No revision
No revision
1.1.2.2 +6 -1 xml-cocoon/conf/WEB-INF/Attic/web.xml
Index: web.xml
===================================================================
RCS file: /home/cvs/xml-cocoon/conf/WEB-INF/Attic/web.xml,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- web.xml 2000/05/24 22:39:59 1.1.2.1
+++ web.xml 2000/05/31 22:42:31 1.1.2.2
@@ -17,7 +17,12 @@
<init-param>
<param-name>configurations</param-name>
<!-- CHANGE PATH BELOW -->
- <param-value>../webapps/cocoon2/cocoon.xconf</param-value>
+ <param-value>/cocoon.xconf</param-value>
</init-param>
</servlet>
+ <servlet-mapping>
+ <servlet-name>Cocoon2</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
</web-app>
+
No revision
No revision
1.1.4.9 +11 -3 xml-cocoon/src/org/apache/cocoon/servlet/Attic/CocoonServlet.java
Index: CocoonServlet.java
===================================================================
RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/servlet/Attic/CocoonServlet.java,v
retrieving revision 1.1.4.8
retrieving revision 1.1.4.9
diff -u -r1.1.4.8 -r1.1.4.9
--- CocoonServlet.java 2000/03/21 18:23:50 1.1.4.8
+++ CocoonServlet.java 2000/05/31 22:42:32 1.1.4.9
@@ -28,7 +28,7 @@
*
* @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
* (Apache Software Foundation, Exoffice Technologies)
- * @version CVS $Revision: 1.1.4.8 $ $Date: 2000/03/21 18:23:50 $
+ * @version CVS $Revision: 1.1.4.9 $ $Date: 2000/05/31 22:42:32 $
*/
public class CocoonServlet extends HttpServlet {
private Cocoon cocoon=null;
@@ -44,10 +44,18 @@
throws ServletException {
super.init(conf);
this.context=conf.getServletContext();
- this.configurationFile=conf.getInitParameter("configurations");
- if (this.configurationFile==null) {
+ String configFile=conf.getInitParameter("configurations");
+ this.context.log ("this.configurationFile: "+this.configurationFile);
+ if (configFile==null) {
throw new ServletException("Servlet initialization argument "+
"'configurations' not specified");
+ }
+ try {
+ this.configurationFile=this.context.getResource(configFile).getFile();
+ this.context.log ("this.configurationFile: "+this.configurationFile);
+ } catch (java.net.MalformedURLException mue) {
+ throw new ServletException("Servlet initialization argument "+
+ "'configurations' not found at "+this.configurationFile);
}
this.cocoon=this.create();
}
No revision
No revision
1.8.2.5 +24 -44 xml-cocoon/xdocs/installing.xml
Index: installing.xml
===================================================================
RCS file: /home/cvs/xml-cocoon/xdocs/installing.xml,v
retrieving revision 1.8.2.4
retrieving revision 1.8.2.5
diff -u -r1.8.2.4 -r1.8.2.5
--- installing.xml 2000/05/24 23:07:34 1.8.2.4
+++ installing.xml 2000/05/31 22:42:32 1.8.2.5
@@ -63,7 +63,7 @@
</note>
</s1>
- <s1 title="Installing Cocoon 2">
+ <s1 title="Installing Cocoon2">
<p>
Being Cocoon a servlet, you should be able to install it on every compliant
servlet engine by associating the "org.apache.cocoon.servlet.CocoonServlet"
@@ -163,58 +163,38 @@
or another web server, you will most probably have to edit the
configuration of that server as well.</note>
<p>
- First, create the directory path <code>[path-to-Cocoon2]/WEB-INF/lib</code>.
- Copy all jar archives from <code>[path-to-Cocoon2]/lib</code>
- to <code>[path-to-Cocoon2]/WEB-INF/lib</code>. Copy cocoon.jar to
- <code>[path-to-Cocoon2]/WEB-INF/lib</code>, as well. Note that because
- all of these jars are in the lib subdirectory of the WEB-INF directory,
- Tomcat will automatically handle the loading of these classes, and they
- don't need to be placed in the classpath.
+ First copy all jar archives from <code>[path-to-Cocoon2]/lib</code>
+ to <code>[path-to-Tomcat]/lib</code> except ant.jar, servlet_2_2.jar
+ and stylebook-1.0-b2.jar.
+ Copy <code>[path-to-Cocoon2]/build/cocoon.jar</code> to
+ <code>[path-to-Tomcat]/lib</code>, as well. Note that if you are running
+ Tomcat on a Windows operating system you have to adjust the classpath to
+ include all jar files copied so far in the
+ <code>[path-to-Tomcat]/bin/tomcat.bat</code> file. On unix like operating
+ systems Tomcat will automatically handle the loading of these classes, and
+ they don't need to be placed in a classpath. If you use a newer version of Tomcat
+ (i.e. current CVS version) that requires jaxp.jar and parser.jar instead
+ of xml.jar make sure parser.jar comes last in the classpath (on unix OS
+ simply rename it to zparser.jar).
</p>
- <p>Create a new context for the Cocoon2 servlet to run within by appending a
- new Context node to <code>[path-to-Tomcat]/conf/server.xml</code>. The new
- Context should look like the following:
+ <p>Copy <code>[path-to-Cocoon]/build/cocoon.war</code> to
+ <code>[path-to-Tomcat]/webapps</code>. The new Context for Cocoon2 will be
+ created out of the cocoon.war file as soon as you restart Tomcat.
</p>
- <source><![CDATA[
- [...]
- <Context path="/cocoon" docBase="[path-to-Cocoon2]" debug="0" reloadable="true" >
- </Context>]]></source>
- <note>FIXME: Oddly enough, the docBase doesn't appear to do anything for Cocoon2 at this time,
- and the base appears to be determined based off of the location of the Cocoon2 configuration
- file.</note>
- <p>Tomcat looks in the path pointed to by docBase for a WEB-INF directory and will load
- the web application information from that directory from the web.xml file.
- </p>
- <p>Now, create the file <code>[path-to-Cocoon2]/WEB-INF/web.xml</code>.
- It should contain the following:</p>
- <source><![CDATA[
- <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
- "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
-
- <web-app>
- <servlet>
- <servlet-name>cocoon</servlet-name>
- <servlet-class>org.apache.cocoon.servlet.CocoonServlet</servlet-class>
- <init-param>
- <param-name>configurations</param-name>
- <param-value>[path-to-Cocoon2]/conf/cocoon.xconf</param-value>
- </init-param>
- </servlet>
- <servlet-mapping>
- <servlet-name>cocoon</servlet-name>
- <url-pattern>/</url-pattern>
- </servlet-mapping>
- </web-app>]]></source>
<p>Finally, restart Tomcat, point your
browser to the following URI...
- </p>.
+ </p>
- <source>http://localhost/cocoon/hello</source>
+ <source>http://localhost:8080/cocoon/hello</source>
<p>
... and say "Hello!" to Cocoon2.
</p>
-
+ <p>Use the following URI to browse the samples...
+ </p>
+
+ <source>http://localhost:8080/cocoon/samples/</source>
+
</s2>
</s1>
</body>