vladimir 2002/11/27 00:33:39
Modified: . build.xml java/examples/Addressbook README Added: java/examples build.xml java/examples/Addressbook/config web.xml Removed: java/examples/Addressbook build.xml web.xml Log: reorganized the examples so that : 1) they are compiled/released when you're in the java/examples directory 2) they are compiled/released when you compile/release xindice They idea is that the example code must be in sync with the core code Revision Changes Path 1.34 +14 -50 xml-xindice/build.xml Index: build.xml =================================================================== RCS file: /home/cvs/xml-xindice/build.xml,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- build.xml 26 Nov 2002 01:14:38 -0000 1.33 +++ build.xml 27 Nov 2002 08:33:39 -0000 1.34 @@ -33,7 +33,7 @@ <property environment="ENVIRONMENT"/> <!-- =================================================================== --> - <!-- Initializes the build process --> + <!-- Build definitions --> <!-- =================================================================== --> <!-- Project's properties --> @@ -45,18 +45,16 @@ <property name="webapp.name" value="Xindice"/> <!-- source directories --> - <property name="root.dir" value="./java"/> + <property name="root.dir" value="java"/> <property name="jar.dir" value="${root.dir}/lib"/> <property name="src.dir" value="${root.dir}/src"/> <property name="config.dir" value="config"/> <property name="test.src.dir" value="${root.dir}/tests/src"/> - <property name="examples.dir" value="${root.dir}/examples"/> <!-- destination directories --> <property name="build.dir" value="build"/> <property name="src.build.dir" value="${build.dir}/classes"/> <property name="test.build.dir" value="${build.dir}/classes-tests"/> - <property name="examples.build.dir" value="${build.dir}/classes-examples"/> <property name="api.dir" value="${build.dir}/api"/> <property name="dist.dir" value="dist"/> @@ -88,7 +86,6 @@ <tstamp/> <mkdir dir="${src.build.dir}"/> <mkdir dir="${test.build.dir}"/> - <mkdir dir="${examples.build.dir}"/> <mkdir dir="${api.dir}"/> <mkdir dir="${dist.dir}"/> </target> @@ -98,17 +95,22 @@ <!-- =================================================================== --> <target name="build" - depends="init, src-build, test-build, examples-build" - description="Compiles the source and test code"/> + depends="init, src-build, test-build" + description="Compiles the source and test code"> + <ant antfile="build.xml" dir="java/examples" inheritAll="false" target="build"/> + </target> <target name="release" - depends="jar-release, war-release, examples-release" - description="Generates the jar and war releases into the dist directory"/> + depends="jar-release, war-release" + description="Generates the jar and war releases into the dist directory"> + <ant antfile="build.xml" dir="java/examples" inheritAll="false" target="release"/> + </target> <target name="clean" description="Removes all generates files"> <delete dir="${build.dir}"/> <delete dir="${dist.dir}"/> + <ant antfile="build.xml" dir="java/examples" inheritAll="false" target="clean"/> </target> <!-- =================================================================== --> @@ -204,7 +206,7 @@ <!-- =================================================================== --> <target name="jar-release" - depends="build"> + depends="src-build, test-build"> <jar jarfile="${dist.dir}/${project.filename}-${project.version}.jar" basedir="${src.build.dir}"> <manifest> @@ -221,7 +223,7 @@ </target> <target name="war-release" - depends="build"> + depends="jar-release"> <copy file="${config.dir}/xindice.xml" toFile="${dist.dir}/xindice-${project.version}.xml"> <filterset> @@ -289,41 +291,6 @@ </target> <!-- =================================================================== --> - <!-- Compiles the example sources --> - <!-- =================================================================== --> - - <target name="examples-build" depends="init, src-build"> - <javac srcdir="${examples.dir}/guide/src/" - destdir="${examples.build.dir}" - debug="${compile.debug}" - optimize="${compile.optimize}" - nowarn="${compile.nowarn}" - deprecation="${compile.deprecation}" - verbose="${compile.verbose}"> - <classpath> - <path refid="project.class.path"/> - </classpath> - </javac> - </target> - - <target name="examples-release" depends="examples-build"> - <jar jarfile="${dist.dir}/${project.filename}-${project.version}-examples.jar" - basedir="${examples.build.dir}"> - <manifest> - <attribute name="Built-By" value="${user.name}"/> - <section name="org/apache/xindice"> - <attribute name="Sealed" value="false"/> - </section> - </manifest> - </jar> - </target> - - <target name="examples-clean"> - <delete file="${dist.dir}/${project.filename}-${project.version}-examples.jar"/> - <delete dir="${examples.build.dir}"/> - </target> - - <!-- =================================================================== --> <!-- Documentation Build Targets --> <!-- =================================================================== --> @@ -349,9 +316,6 @@ <group title="Tools packages" packages="org.apache.xindice.tools*"/> <sourcepath> <pathelement location="${src.dir}" /> - <!-- - <pathelement location="${xmldb-api.src}" /> - --> </sourcepath> <classpath> <pathelement location="${jar.dir}/ant-1.5.1.jar" /> 1.1 xml-xindice/java/examples/build.xml Index: build.xml =================================================================== <!-- Xindice Addressbook Ant build file --> <project name="xindice-examples" default="release" basedir="."> <!-- =================================================================== --> <!-- Build definitions --> <!-- =================================================================== --> <!-- source directories --> <property name="root.dir" value="../.."/> <property name="jar.dir" value="${root.dir}/java/lib"/> <property name="dist.dir" value="${root.dir}/dist"/> <!-- destination directories --> <property name="build.dir" value="${root.dir}/build"/> <!-- Compilation properties --> <property name="compile.debug" value="on"/> <property name="compile.optimize" value="off"/> <property name="compile.nowarn" value="off"/> <property name="compile.deprecation" value="on"/> <property name="compile.verbose" value="off"/> <!-- classpath to use within project --> <path id="project.class.path"> <!-- all jars in jar and dist directory --> <fileset dir="${jar.dir}"> <include name="*.jar"/> </fileset> <fileset dir="${dist.dir}"> <include name="*.jar"/> </fileset> </path> <target name="init" description="Initializes the build"> <tstamp/> <mkdir dir="${build.dir}"/> <mkdir dir="${dist.dir}"/> </target> <!-- =================================================================== --> <!-- Definition of the main targets --> <!-- =================================================================== --> <target name="build" depends="addressbook-build, guide-build"/> <target name="release" depends="addressbook-release, guide-release"/> <target name="clean" depends="addressbook-clean, guide-clean"/> <!-- =================================================================== --> <!-- Addressbook example --> <!-- =================================================================== --> <!-- Addressbook property definitions --> <property name="addressbook.app.name" value="Addressbook"/> <property name="addressbook.build.dir" value="${build.dir}/addressbook-classes"/> <property name="addressbook.src.dir" value="Addressbook/src/java"/> <property name="addressbook.jsp.dir" value="Addressbook/src/jsp"/> <property name="addressbook.config.dir" value="config"/> <target name="addressbook-init" depends="init"> <mkdir dir="${addressbook.build.dir}"/> </target> <target name="addressbook-build" depends="addressbook-init"> <javac srcdir="${addressbook.src.dir}" destdir="${addressbook.build.dir}" debug="${compile.debug}" optimize="${compile.optimize}" nowarn="${compile.nowarn}" deprecation="${compile.deprecation}" verbose="${compile.verbose}"> <classpath> <path refid="project.class.path"/> </classpath> </javac> </target> <target name="addressbook-release" depends="addressbook-build"> <war destfile="${dist.dir}/${addressbook.app.name}.war" update="false" webxml="Addressbook/config/web.xml"> <fileset dir="${addressbook.jsp.dir}"/> <classes dir="${addressbook.build.dir}"/> <lib dir="${jar.dir}"> <include name="commons-logging-1.0.1.jar" /> <include name="xmldb-api-20021118.jar"/> <include name="xmldb-api-sdk-20021118.jar"/> <include name="xmldb-xupdate.jar"/> <include name="infozone-tools.jar"/> <include name="xalan-2.4.0.jar"/> <include name="xercesImpl-2.1.0.jar"/> <include name="xmlrpc-1.1.jar"/> <include name="xml-apis-1.0b3.jar"/> </lib> <manifest> <attribute name="Built-By" value="${user.name}"/> <section name="org/apache/xindice"> <attribute name="Sealed" value="false"/> </section> </manifest> </war> </target> <target name="addressbook-clean"> <delete file="${dist.dir}/${addressbook.app.name}.war"/> <delete dir="${addressbook.build.dir}"/> </target> <!-- =================================================================== --> <!-- Guide examples --> <!-- =================================================================== --> <!-- Guide property definitions --> <property name="guide.jar.name" value="xindice-guide"/> <property name="guide.build.dir" value="${build.dir}/guide-classes"/> <property name="guide.src.dir" value="guide/src"/> <target name="guide-init" depends="init"> <mkdir dir="${guide.build.dir}"/> </target> <target name="guide-build" depends="guide-init"> <javac srcdir="${guide.src.dir}" destdir="${guide.build.dir}" debug="${compile.debug}" optimize="${compile.optimize}" nowarn="${compile.nowarn}" deprecation="${compile.deprecation}" verbose="${compile.verbose}"> <classpath> <path refid="project.class.path"/> </classpath> </javac> </target> <target name="guide-release" depends="guide-build"> <jar jarfile="${dist.dir}/${guide.jar.name}.jar" basedir="${guide.build.dir}"> <manifest> <attribute name="Built-By" value="${user.name}"/> <section name="org/apache/xindice"> <attribute name="Sealed" value="false"/> </section> </manifest> </jar> </target> <target name="guide-clean"> <delete file="${dist.dir}/${guide.jar.name}.jar"/> <delete dir="${guide.build.dir}"/> </target> </project> 1.4 +0 -59 xml-xindice/java/examples/Addressbook/README Index: README =================================================================== RCS file: /home/cvs/xml-xindice/java/examples/Addressbook/README,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- README 5 Feb 2002 07:30:52 -0000 1.3 +++ README 27 Nov 2002 08:33:39 -0000 1.4 @@ -3,65 +3,6 @@ This code is an example application using Xindice and the XML:DB api with jsp and servlets to provide an online address book. -NOTE: These instructions assume that you already have the Xindice Server - up and running. - -Installation for Tomcat ------------------------ - -Tomcat is available from http://jakarta.apache.org/tomcat/ - -In the following instructions we assume that XINDICE_HOME is set to the directory -where Xindice is installed and TOMCAT_HOME is set to the directory where Tomcat is -installed. - -Tomcat 4.0 or above. - -1. Make sure your current working directory is the directory where this README - file resides. If not, type. - - (on UNIX) - cd $XINDICE_HOME/java/examples/Addressbook - - (on Windows) - cd %XINDICE_HOME%\java\examples\Addressbook - -2. Add the servlet.jar file from Tomcat to your classpath. - - CLASSPATH=path_to_your_tomcat_install/common/lib/servlet.jar - export CLASSPATH - -3. Build the Addressbook.war. The file is built by the ant script - - (on UNIX) - $XINDICE_HOME/bin/ant - - (on Windows) - %XINDICE_HOME%\bin\ant - -4. You should find the file Addressbook.war in the current directory. This file - should be copied into the webapps directory of your tomcat installation. - - (on UNIX) - cp Addressbook.war $TOMCAT_HOME/webapps - - (on Windows) - copy Addressbook.war %TOMCAT_HOME%\webapps - -5. Make sure Xindice is running, follow the INSTALL instructions to start it if - it isn't. - -6. Start tomcat, - - (on UNIX) - $TOMCAT_HOME/bin/startup.sh - - (on Windows) - %TOMCAT_HOME%\bin\startup.bat - -6. If you used the default tomcat configuration the Addressbook should be - accessible from http://127.0.0.1:8080/Addressbook. - Tomcat 3.2 If at all possible you should use Tomcat 4 as installation is much simpler, but 1.1 xml-xindice/java/examples/Addressbook/config/web.xml Index: web.xml =================================================================== <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"> <!-- - Version: $Revision: 1.1 $ $Date: 2002/11/27 08:33:39 $ - Authors: Kimbro Staken ([EMAIL PROTECTED]) - Vladimir R. Bossicard ([EMAIL PROTECTED]) --> <web-app> <servlet> <servlet-name>Task</servlet-name> <servlet-class>Addressbook.Task</servlet-class> </servlet> <servlet-mapping> <servlet-name>Task</servlet-name> <url-pattern>/Task</url-pattern> </servlet-mapping> <security-constraint> <web-resource-collection> <web-resource-name>Protected Area</web-resource-name> <!-- Define the context-relative URL(s) to be protected --> <url-pattern>/jsp/security/protected/*</url-pattern> <!-- If you list http methods, only those methods are protected --> <http-method>DELETE</http-method> <http-method>GET</http-method> <http-method>POST</http-method> <http-method>PUT</http-method> </web-resource-collection> <auth-constraint> <!-- Anyone with one of the listed roles may access this area --> <role-name>tomcat</role-name> <role-name>role1</role-name> </auth-constraint> </security-constraint> <!-- Default login configuration uses BASIC authentication --> <!-- <login-config> <auth-method>BASIC</auth-method> <realm-name>Example Basic Authentication Area</realm-name> </login-config> --> <!-- Form-based login is enabled by default. If you wish to try Basic authentication, comment out the <login-config> section below and uncomment the one above. --> <login-config> <auth-method>FORM</auth-method> <realm-name>Example Form-Based Authentication Area</realm-name> <form-login-config> <form-login-page>/jsp/security/login/login.jsp</form-login-page> <form-error-page>/jsp/security/login/error.jsp</form-error-page> </form-login-config> </login-config> </web-app>