Index: greenstone3/trunk/build.xml
===================================================================
--- greenstone3/trunk/build.xml	(revision 20940)
+++ greenstone3/trunk/build.xml	(revision 20942)
@@ -1700,84 +1700,8 @@
   </target>
 
-  <!-- ======================== FLAX Targets ========================= -->
-  <target name="prepare-flax" description="check out flax source code from another repository" if="install.flax">
-    <echo>checking out flax ...</echo>
-    <mkdir dir="${basedir}/src/java/org/flax"/>
-    <mkdir dir="${basedir}/src/java/org/greenstone/gsdl3/flax"/>
-    <mkdir dir="${web.home}/WEB-INF/classes/flax"/>
-    <mkdir dir="${web.home}/interfaces/flax"/>
-    <mkdir dir="${web.home}/interfaces/flaxmodule"/>
-    <mkdir dir="${web.home}/sites/flax"/>
-    <mkdir dir="${basedir}/flax-resources"/>
-    <mkdir dir="${basedir}/flax-lib"/>
-
-    <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/src/java/org/flax"/>
-      <arg value="src/java/org/flax"/></exec>
-    <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/src/java/org/greenstone/gsdl3/flax"/>
-      <arg value="src/java/org/greenstone/gsdl3/flax"/></exec>
-    <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/WEB-INF/classes/flax"/>
-      <arg value="${web.home}/WEB-INF/classes/flax"/></exec>
-    <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/interfaces/flax"/>
-      <arg value="${web.home}/interfaces/flax"/></exec>
-    <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/interfaces/flaxmodule"/>
-      <arg value="${web.home}/interfaces/flax"/></exec>
-    <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/web/sites/flax"/>
-      <arg value="${web.home}/sites/flax"/></exec>
-    <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/flax-resources"/>
-      <arg value="flax-resources"/></exec>
-    <exec executable="svn"><arg value="checkout"/><arg value="${flax.checkout.path}/lib"/>
-      <arg value="flax-lib"/></exec>
-
-    <echo>prepare flax files...</echo>
-    <move file="${web.home}/WEB-INF/web.xml" tofile="${web.home}/WEB-INF/web.xml.greenstone3backup"/>
-    <antcall target="flax-copy-files" />
-    <antcall target="unzip-flax-resources" />
-  </target>
-
-  <target name="update-flax" description="update flax from repository">
-    <echo>updating flax ...</echo>
-    <exec executable="svn"><arg value="update"/><arg value="src/java/org/flax"/></exec>
-
-    <exec executable="svn"><arg value="update"/><arg value="src/java/org/flax"/></exec>
-    <exec executable="svn"><arg value="update"/><arg value="src/java/org/greenstone/gsdl3/flax"/></exec>
-    <exec executable="svn"><arg value="update"/><arg value="${web.home}/WEB-INF/classes/flax"/></exec>
-    <exec executable="svn"><arg value="update"/><arg value="${web.home}/interfaces/flax"/></exec>
-    <exec executable="svn"><arg value="update"/><arg value="${web.home}/sites/flax"/></exec>
-    <antcall target="flax-copy-files" />
-  </target>
-
-  <target name="unzip-flax-resources" >
-    <property name="classes.dir" value="${web.home}/WEB-INF/classes/flax"/>
-    <unzip dest="${classes.dir}">  
-      <fileset dir="${classes.dir}">
-        <include name="*.zip"/>
-      </fileset>    
-    </unzip>    
-    <delete>
-      <fileset dir="${classes.dir}" includes="*.zip"/>
-    </delete>
-  </target>
-  
-  <target name="flax-copy-files" description="copy some flax files into the appropriate greenstone3 directories">
-    <echo>copying flax files ...</echo>
-    <copy file="${web.home}/WEB-INF/classes/flax/web.xml" todir="${web.home}/WEB-INF" overwrite="true" />
-    <!-- A configuration file containing web service binding information for the axis engine -->
-    <copy file="${web.home}/WEB-INF/classes/flax/server-config.wsdd" todir="${web.home}/WEB-INF" overwrite="true" />
-    <!-- A static web service wsdl file which is queried by soap client. The reason this file is used (instead of the dynamically generated version) is in case any redirects are used in the Apache configuration (e.g., flax.nzdl.org:80 redirects to harakeke:8080) -->
-    <copy file="${basedir}/flax-resources/FlaxWebService.wsdl" tofile="${web.home}/FlaxWebService.wsdl" filtering="true" overwrite="true">
-    	<filterset>
-            <filter token="flaxpublicserver" value="${tomcat.server}"/>
-            <filter token="flaxpublicport" value="${tomcat.port}"/>
-    	</filterset>	
-    </copy>
-    <copy file="${basedir}/flax-resources/flax-build.xml" todir="${basedir}" overwrite="true" />
-    <copy file="${basedir}/flax-lib/opennlp-tools-1.3.0.jar" todir="${web.home}/WEB-INF/lib" overwrite="true" />    
-    <copy todir="${web.home}/interfaces/flaxmodule/transform" overwrite="true">
-        <fileset dir="${web.home}/interfaces/flaxmodule/transformmodule" excludes="**/.svn" />        
-    </copy>
-  </target>
-
-
-
+  <!-- ======================== Targets for FLAX ========================= -->
+  <import file="flax-resources/build.xml"/>
+  <target name="prepare-flax" description="Install flax extension" depends="build-flax.main" if="install.flax"/>
+  <target name="update-flax" description="Update flax extension" depends="build-flax.update-flax" if="install.flax"/>
 
   <target name="compile-javadocs">
