<project name="ParaDM" default="compile" basedir=".">
<property environment="env" value="dummy"/>
<!-- Tomcat home directory -->
<property name="tomcat.home" value="${env.TOMCAT_HOME}"/>
<!-- WAR home directory -->
<property name="war.home" value="${basedir}/../build" />
<!-- Tomcat home directory -->
<property name="tomcat.service" value="Apache Tomcat 4.1"/>
<property name="webapp.locale" value="en_US"/>
<property name="webapp.temp.resources" value="../temp/resources"/>
<property name="webapp.temp.classes" value="../temp/classes"/>
<property name="webapp.temp.lib" value="../temp/lib"/>
<property name="webapp.temp.wsapi" value="../temp/wsapi"/>
<property name="webapp.temp.services" value="../temp/services"/>
<property name="webapp.temp.war" value="../temp"/>
<tstamp>
<format property="timestamp" pattern="yyyyMMdd" locale="en"/>
</tstamp>
<!-- ParaDM web context name -->
<property name="webapp.name" value="ParaDM"/>
<!-- ParaDM version number -->
<property name="webapp.version" value="3.1.8"/>
<!-- Source file location -->
<property name="java.src" value="${basedir}"/>
<!-- Web file location -->
<property name="webapp.src" value="${basedir}/../web"/>
<!-- Applicaton library location -->
<property name="webapp.lib" value="${webapp.src}/WEB-INF/lib"/>
<!-- Build result location -->
<property name="build.dir" value="${webapp.src}/WEB-INF/"/>
<!-- JavaDoc location -->
<property name="build.javadoc.dir" value="${basedir}/../doc/java"/>
<property name="build.tlddoc.dir" value="${basedir}/../doc/tld"/>
<property name="build.jsdoc.dir" value="${basedir}/../doc/js"/>
<property name="build.jsdoc.pl" value="D:/Projects/JSDoc-1.9.9.2/jsdoc.pl"/>
<!-- Database Administrator login-->
<property name="database.dba.login" value="root"/>
<!-- Database Administrator password-->
<property name="database.dba.password" value=""/>
<!-- Database ParaDM user login name -->
<property name="database.user.login" value="paradm"/>
<!-- Database ParaDM user password-->
<property name="database.user.password" value="paradm"/>
<!-- Database Location -->
<property name="database.location" value="localhost"/>
<!-- Database instance name -->
<property name="database.sid" value="ParaDM"/>
<!-- Directories to store the Web Service generated files -->
<property name="wsapi.dir" value="${webapp.temp.wsapi}"/>
<property name="wsapi.classes" value="${wsapi.dir}/build/classes"/>
<property name="wsapi.lib" value="${wsapi.dir}/build/lib"/>
<condition property="paradm.home.file" value="D:/ParaDM/file">
<os family="windows"/>
</condition>
<condition property="paradm.home.file" value="/usr/local/bin/ParaDM/file">
<os family="unix"/>
</condition>
<!-- Set classpath -->
<path id="build.classpath">
<fileset dir="../lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${webapp.lib}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcat.home}">
<include name="**/servlet.jar"/>
<include name="**/mail.jar"/>
<include name="**/activation.jar"/>
</fileset>
</path>
<taskdef name="foreach" classname="net.sf.antcontrib.logic.ForEach" classpath="../lib/ant-contrib-1.0b3.jar"/>
<taskdef name="if" classname="net.sf.antcontrib.logic.IfTask" classpath="../lib/ant-contrib-1.0b3.jar"/>
<!-- Command for compile source and resources files [DEFAULT] -->
<target name="compile">
<echo>Build Begin ... ${basedir}</echo>
<antcall target="compile_src"/>
<antcall target="compile_res"/>
<antcall target="copy_class"/>
<antcall target="copy_properties"/>
<antcall target="copy_others"/>
</target>
<!-- Command for compile java files -->
<target name="compile_src">
<!-- ========================================================================= -->
<!-- Compile the Axis2/XMLBeans generated classes into JAR file (paradm-ws-api.jar) -->
<!-- ========================================================================= -->
<antcall target="wsapi"/>
<copy todir="${webapp.temp.classes}">
<fileset dir="${java.src}">
<include name="*.properties"/>
<exclude name="generate.properties"/>
</fileset>
</copy>
<javac srcdir="${java.src}" destdir="${webapp.temp.classes}" debug="on" memoryInitialSize="128m" memoryMaximumSize="256m" fork="true">
<classpath refid="build.classpath"/>
<classpath location="${wsapi.lib}/paradm-ws-api.jar"/>
<exclude name="com/dcivision/customize/**"/>
</javac>
<!-- ========================================================================= -->
<!-- Compile and package different web services (WS-ParaDM.aar, WS-ParaDOC.aar, etc) -->
<!-- ========================================================================= -->
<antcall target="wsaar"/>
</target>
<!-- Command for compile resources files -->
<target name="compile_res" depends="res.chkUpToDate" unless="res.notRequired">
<mkdir dir="${webapp.temp.resources}"/>
<copy overwrite="true" todir="${webapp.temp.resources}">
<fileset dir="${java.src}">
<include name="**/*Resource*.properties"/>
</fileset>
</copy>
<copy overwrite="true" file="${webapp.temp.resources}/com/dcivision/resource/ApplicationResources.properties" tofile="${webapp.temp.resources}/com/dcivision/resource/ApplicationResources_${webapp.locale}.properties"/>
<copy overwrite="true" file="${webapp.temp.resources}/com/dcivision/resource/CustomizedResources.properties" tofile="${webapp.temp.resources}/com/dcivision/resource/CustomizedResources_${webapp.locale}.properties"/>
<native2ascii encoding="utf-8" src="${webapp.temp.resources}" dest="${build.dir}/classes" includes="**/*Resource*.properties" />
</target>
<target name="res.chkUpToDate">
<echo message="Checking resources bundles for update"/>
<uptodate property="res.notRequired">
<srcfiles dir="${java.src}" includes="**/*Resource*.properties"/>
<mapper type="glob" from="*.properties" to="${webapp.temp.resources}/*.properties" />
</uptodate>
<if>
<istrue value="${res.notRequired}"/>
<then><echo message="Resources bundles up to date: ${res.notRequired}"/></then>
</if>
</target>
<target name="copy_class">
<copy todir="${build.dir}/classes">
<fileset dir="${webapp.temp.classes}">
<exclude name="**/*Resource*.properties"/>
<exclude name="*.properties"/>
<exclude name="com/dcivision/ws/**/**"/>
</fileset>
</copy>
</target>
<target name="copy_properties">
<copy todir="${build.dir}/classes">
<fileset dir="${webapp.temp.classes}">
<include name="*.properties"/>
<exclude name="generate.properties"/>
</fileset>
</copy>
</target>
<target name="copy_others">
<copy file="${java.src}/com/dcivision/workflow/action/AutoTaskTemplate.java" todir="${build.dir}/classes/com/dcivision/workflow/action"/>
</target>
<!-- Build Web Application war package -->
<target name="buildwar" depends="compile">
<mkdir dir="${war.home}"/>
<war destfile="${war.home}/eip.war" webxml="${webapp.src}/WEB-INF/web.xml">
<fileset dir="${webapp.src}">
<exclude name="${webapp.src}/WEB-INF/web.xml"/>
</fileset>
</war>
</target>
<!-- Command for deployment -->
<target name="deploy" depends="compile">
<copy todir="${tomcat}">
<fileset dir="${classes}"/>
</copy>
<copy todir="${jsp}">
<fileset dir="${src}/com/dcivision/dms/web/jsp"/>
</copy>
</target>
<!-- Command for generation of JavaDoc -->
<target name="javadoc" depends="compile">
<javadoc packagenames="com.dcivision.alert,com.dcivision.alert.bean,com.dcivision.alert.core,com.dcivision.alert.dao,com.dcivision.alert.web,com.dcivision.audit,com.dcivision.audit.bean,com.dcivision.audit.core,com.dcivision.audit.dao,com.dcivision.calendar,com.dcivision.calendar.bean,com.dcivision.calendar.dao,com.dcivision.calendar.taglib,com.dcivision.calendar.web,com.dcivision.contact,com.dcivision.contact.bean,com.dcivision.contact.dao,com.dcivision.contact.web,com.dcivision.customize,com.dcivision.customize.workflow,com.dcivision.dms,com.dcivision.dms.bean,com.dcivision.dms.client,com.dcivision.dms.client.analyzer,com.dcivision.dms.client.parser,com.dcivision.dms.core,com.dcivision.dms.dao,com.dcivision.dms.extractor,com.dcivision.dms.taglib,com.dcivision.dms.web,com.dcivision.form,com.dcivision.form.bean,com.dcivision.form.core,com.dcivision.form.dao,com.dcivision.form.web,com.dcivision.forum,com.dcivision.forum.bean,com.dcivision.forum.core,com.dcivision.forum.dao,com.dcivision.forum.web,com.dcivision.framework,com.dcivision.framework.bean,com.dcivision.framework.dao,com.dcivision.framework.image,com.dcivision.framework.notification,com.dcivision.framework.taglib.bean,com.dcivision.framework.taglib.calendar,com.dcivision.framework.taglib.html,com.dcivision.framework.taglib.layout,com.dcivision.framework.taglib.logic,com.dcivision.framework.taglib.newCalender,com.dcivision.framework.web,com.dcivision.framework.xml,com.dcivision.ldap.core,com.dcivision.ldap.web,com.dcivision.mail.bean,com.dcivision.mail.core,com.dcivision.mail.dao,com.dcivision.mail.web,com.dcivision.setup,com.dcivision.setup.bean,com.dcivision.setup.dao,com.dcivision.setup.web,com.dcivision.staff,com.dcivision.staff.bean,com.dcivision.staff.dao,com.dcivision.staff.web,com.dcivision.upload.core,com.dcivision.upload.web,com.dcivision.user,com.dcivision.user.auth,com.dcivision.user.bean,com.dcivision.user.dao,com.dcivision.user.web,com.dcivision.webdav,com.dcivision.webdav.util,com.dcivision.workflow,com.dcivision.workflow.action,com.dcivision.workflow.applet,com.dcivision.workflow.applet.editor,com.dcivision.workflow.applet.editor.gif,com.dcivision.workflow.bean,com.dcivision.workflow.core,com.dcivision.workflow.dao,com.dcivision.workflow.layout,com.dcivision.workflow.taglib,com.dcivision.workflow.web"
sourcepath="${java.src}"
destdir="${build.javadoc.dir}"
windowtitle="DCIVISION ParaDM API"
author="Yes"
version="Yes"
use="Yes"
maxmemory="512M"
splitindex="Yes">
<classpath refid="build.classpath"/>
</javadoc>
</target>
<target name="tlddoc" depends="compile">
<java fork="true" jar="${build.dir}/lib/tlddoc.jar" failοnerrοr="true">
<arg line="-d ${build.tlddoc.dir}"/>
<arg value="${build.dir}/calendar.tld"/>
<arg value="${build.dir}/cewolf.tld"/>
<arg value="${build.dir}/dms.tld"/>
<arg value="${build.dir}/layout.tld"/>
<arg value="${build.dir}/newCalendar.tld"/>
<arg value="${build.dir}/schedule.tld"/>
<arg value="${build.dir}/struts-bean.tld"/>
<arg value="${build.dir}/struts-html.tld"/>
<arg value="${build.dir}/struts-logic.tld"/>
<arg value="${build.dir}/struts-nested.tld"/>
<arg value="${build.dir}/struts-template.tld"/>
<arg value="${build.dir}/struts-tiles.tld"/>
<arg value="${build.dir}/workflow.tld"/>
</java>
</target>
<target name="jsdoc" description="Document the JavaScript">
<exec executable="perl">
<arg value="${build.jsdoc.pl}"/>
<arg value="-r" />
<arg value="--package-naming" />
<arg value="--no-lexical-privates" />
<arg value="--project-name" />
<arg value="ParaDM Javascript" />
<arg value="--logo" />
<arg value="${webapp.src}/img/pref3/common/LayoutLogoDefault.gif" />
<arg value="--directory"/>
<arg value="${build.jsdoc.dir}"/>
<arg file="${webapp.src}/js/AnchorPosition.js"/>
<arg file="${webapp.src}/js/autoSuggest.js"/>
<arg file="${webapp.src}/js/ColorPicker.js"/>
<arg file="${webapp.src}/js/dojo.js"/>
<arg file="${webapp.src}/js/FloatingSelectionBox.js"/>
<arg file="${webapp.src}/js/FormFunction.js"/>
<arg file="${webapp.src}/js/Framework.js"/>
<arg file="${webapp.src}/js/NewCalendar.js"/>
<arg file="${webapp.src}/js/OverLib.js"/>
<arg file="${webapp.src}/js/OverLibHiddenForm.js"/>
<arg file="${webapp.src}/js/PermissionSetup.js"/>
<arg file="${webapp.src}/js/PopupCalendar.js"/>
<arg file="${webapp.src}/js/PopupWindow.js"/>
<arg file="${webapp.src}/js/Tree.js"/>
<arg file="${webapp.src}/js/dojo"/>
<arg file="${webapp.src}/js/dojo/dnd"/>
<arg file="${webapp.src}/js/dojo/event"/>
<arg file="${webapp.src}/js/dojo/html"/>
</exec>
</target>
<!-- Command for clean up classes files -->
<target name="clean">
<echo message="Cleanup ..."/>
<antcall target="stop"/>
<delete dir="${tomcat.home}/work/Standalone/localhost/${webapp.name}"/>
<delete dir="${build.dir}/classes"/>
<delete dir="${build.dir}/services"/>
<delete>
<fileset dir="${build.dir}/lib" includes="paradm-web*.jar"/>
</delete>
<delete dir="${webapp.temp.resources}"/>
<delete dir="${webapp.temp.classes}"/>
<delete dir="${webapp.temp.lib}"/>
<delete dir="${webapp.temp.wsapi}"/>
<delete dir="${webapp.temp.services}"/>
<antcall target="wsapi-clean"/>
</target>
<!-- Command for build -->
<target name="build" depends="compile_src, compile_res, copy_properties">
<jar jarfile="${build.dir}/lib/paradm-web-${webapp.version}.jar" basedir="${webapp.temp.classes}" excludes="*.properties,log4j.xml,com/dcivision/resource/**"/>
<jar jarfile="${build.dir}/lib/paradm-client.jar" basedir="${webapp.temp.classes}" includes="com/dcivision/dms/client/**"/>
<move file="${build.dir}/lib/paradm-client.jar" todir="${java.src}/../client/"/>
<copy file="${java.src}/dms.conf" todir="${java.src}/../client/"/>
<copy file="${java.src}/clientrun.bat" todir="${java.src}/../client/"/>
<delete includeemptydirs="true">
<fileset dir="${build.dir}/classes">
<include name="com/**"/>
<include name="*.class"/>
<exclude name="*.xml"/>
<exclude name="com/dcivision/resource/**"/>
</fileset>
</delete>
</target>
<!-- Command for parascan client build -->
<target name="client" depends="compile">
<jar jarfile="${build.dir}/lib/paradm-client.jar" basedir="${build.dir}/classes" includes="com/dcivision/dms/client/**"/>
<move file="${build.dir}/lib/paradm-client.jar" todir="${java.src}/../client/"/>
</target>
<!-- Command for parsing JSP -->
<target name="parsejsp" depends="compile">
<echo message="${tomcat.home}"/>
<copy todir="${basedir}/../temp">
<fileset dir="${webapp.src}">
<exclude name="**/*.db"/>
<exclude name="**/*.txt"/>
<exclude name="**/*.gif"/>
<exclude name="**/*.class"/>
<exclude name="**/*.jpg"/>
</fileset>
<mapper type="glob" from="*.jsp" to="*.jsp"/>
</copy>
<copy todir="${basedir}/../temp">
<fileset dir="${webapp.src}">
<exclude name="**/*.db"/>
<exclude name="**/*.txt"/>
<exclude name="**/*.gif"/>
<exclude name="**/*.jpg"/>
<exclude name="**/*.jsp"/>
</fileset>
</copy>
<mkdir dir="${tomcat.home}/work/Standalone/localhost/${webapp.name}"/>
<jspc srcdir="${basedir}/../temp" destdir="${tomcat.home}/work/Standalone/localhost/${webapp.name}" uriroot="${basedir}/../temp" failοnerrοr="No">
<classpath refid="build.classpath"/>
<include name="**/*.jsp"/>
<webapp basedir="${basedir}/../temp"/>
</jspc>
<replaceregexp byline="true">
<regexp pattern="package (.*)" />
<substitution expression="package org.apache.jsp;" />
<fileset dir="${tomcat.home}/work/Standalone/localhost/${webapp.name}">
<include name="**/*.java" />
</fileset>
</replaceregexp>
<deltree dir="${basedir}/../temp"/>
</target>
<!-- Command for compiling JSP -->
<target name="jspc">
<taskdef classname="org.apache.jasper.JspC" name="jasper2" >
<classpath id="jspc.classpath">
<pathelement location="${java.home}/../lib/tools.jar"/>
<fileset dir="${tomcat.home}/server/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/common/lib">
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>
<taskdef name="foreach"
classname="net.sf.antcontrib.logic.ForEach"
classpath="${ant}/ant-contrib.jar" />
<jasper2
validateXml="false"
uriroot="${webapp.src}"
webXmlFragment="${webapp.src}/WEB-INF/generated_web.xml"
outputDir="${webapp.src}/WEB-INF/src"
package="some.unique.string.asd34sad">
</jasper2>
<replaceregexp match="^package some.unique.string.asd34sad.*;"
replace="package org.apache.jsp;"
byline="true">
<fileset dir="${webapp.src}/WEB-INF/src">
<include name="**/*.*"/>
</fileset>
</replaceregexp>
<echo>Compiling generated classes from JSPC</echo>
<foreach target="do-jsp-compile" param="dir-path">
<path>
<dirset dir="${webapp.src}/WEB-INF/src"/>
</path>
</foreach>
<move todir="${tomcat.home}/work/Standalone/localhost/${webapp.name}">
<fileset dir="${webapp.src}/WEB-INF/src">
<include name="**/*.*"/>
</fileset>
</move>
<delete dir="${webapp.src}/WEB-INF/src"/>
</target>
<target name="do-jsp-compile">
<echo>Compile JSP in: ${dir-path}</echo>
<javac destdir="${dir-path}"
optimize="off"
debug="on"
failοnerrοr="false"
srcdir="${dir-path}">
<classpath>
<pathelement location="${webapp.src}/WEB-INF/classes"/>
<fileset dir="${webapp.src}/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
<pathelement location="${tomcat.home}/common/classes"/>
<fileset dir="${tomcat.home}/common/lib">
<include name="*.jar"/>
</fileset>
<pathelement location="${tomcat.home}/shared/classes"/>
<fileset dir="${tomcat.home}/shared/lib">
<include name="*.jar"/>
</fileset>
</classpath>
<include name="*.java" />
</javac>
<mkdir dir="${dir-path}/org/apache/jsp"/>
<move todir="${dir-path}" failοnerrοr="false">
<fileset dir="${dir-path}/org/apache/jsp">
<include name="*.*"/>
</fileset>
</move>
<delete dir="${dir-path}/org" failοnerrοr="false"/>
</target>
<!--
Task to initialize mysql connection settings
-->
<target name="db_init_mysql">
</target>
<!--
Task to mysql deployment, it can:
1) checkout the latest source from db/mysql folder
2) create a new database instance
3) deploy default ParaDM configuration data
4) create a databaes user (paradm) for ParaDM application access
5) grant privileges to this database user (paradm)
6) update the ParaDM system parameter and storage location path for ParaDOC (DMS_LOC_MASTER.LOC_PATH)
You need to fill in the correct parameters to make it works:
${database.location} : Location of your database, default is "localhost"
${database.dba.login} : Database administrator login, default is "root"
${database.dba.password} : Database administrator password
${database.user.login} : Database user login, default is "paradm"
${database.user.password} : Database user password, default is "paradm"
${database.sid} : Database instance you want to create, default is "ParaDM"
-->
<target name="db_deploy_mysql" depends="db_cvsupdate_mysql">
<property name="database.driver" value="com.mysql.jdbc.Driver"/>
<property name="database.url" value="jdbc:mysql://${database.location}:3306/mysql?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true"/>
<sql
driver="${database.driver}"
url="${database.url}"
userid="${database.dba.login}"
password="${database.dba.password}"
οnerrοr="continue">
<classpath refid="build.classpath"/>
<transaction>
CREATE DATABASE ${database.sid};
USE ${database.sid};
GRANT ALL PRIVILEGES ON ${database.sid}.* TO '${database.user.login}'@'${database.location}' IDENTIFIED BY '${database.user.password}'
</transaction>
<transaction src="../db/mysql/structure.sql"/>
<transaction src="../db/mysql/data.sql"/>
</sql>
<antcall target="db_configure" inheritAll="true"/>
</target>
<!--
Task to auto apply db patch to your database
Comment out the db_cvsupdate_mysql task if you don't want to update source before apply the db patch.
-->
<target name="db_patch_mysql" depends="db_cvsupdate_mysql">
<property name="database.driver" value="com.mysql.jdbc.Driver"/>
<property name="database.url" value="jdbc:mysql://${database.location}:3306/${database.sid}?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true"/>
<property name="database.type" value="mysql"/>
<antcall target="db_patch" inheritAll="true"/>
</target>
<!--
Task called by db_patch_{database_type} to apply SQL patch
-->
<target name="db_patch">
<sql
driver="${database.driver}"
url="${database.url}"
userid="${database.user.login}"
password="${database.user.password}"
οnerrοr="continue">
<classpath refid="build.classpath"/>
<transaction src="../db/${database.type}/alter3.2.0.sql"/>
</sql>
</target>
<!--
Task called by db_deploy_{database_type} to update ParaDM system parameters and ParaDOC root location path
-->
<target name="db_configure">
<sql
driver="${database.driver}"
url="${database.url}"
userid="${database.dba.login}"
password="${database.dba.password}"
οnerrοr="continue">
<classpath refid="build.classpath"/>
<transaction>
UPDATE ${database.sid}.DMS_LOC_MASTER SET LOC_PATH='${paradm.home.file}/ParaDOC';
UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/ParaDOC' WHERE PARAMETER_CODE='dms.archive_file_path';
UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/ParaDOC/cache/' WHERE PARAMETER_CODE='dms.emailArchive.cachefolder.path';
UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/ParaFORM' WHERE PARAMETER_CODE='form.attachment_physical_path';
UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/KB' WHERE PARAMETER_CODE='rules.kb_file_path';
UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/Index' WHERE PARAMETER_CODE='system.index_base_path';
UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/ParaFLOW' WHERE PARAMETER_CODE='workflow.attachment_physical_path';
UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/ParaFlow/AutomaticTask/bin' WHERE PARAMETER_CODE='workflow.automatic_task_bindir';
UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/ParaFlow/AutomaticTask/src' WHERE PARAMETER_CODE='workflow.automatic_task_srcdir';
</transaction>
</sql>
</target>
<!-- Task to update the CVS MySQL db script folder -->
<target name="db_cvsupdate_mysql">
<cvs dest="../db/mysql/" command="update"/>
</target>
<target name="restart">
<antcall target="stop"/>
<delete dir="${tomcat.home}/work/Standalone/localhost/${webapp.name}"/>
<antcall target="start"/>
</target>
<target name="stop">
<exec executable="cmd.exe" os="Windows XP">
<arg line="/c net stop "${tomcat.service}""/>
</exec>
</target>
<target name="start">
<exec executable="cmd.exe" os="Windows XP">
<arg line="/c net start "${tomcat.service}""/>
</exec>
</target>
<target name="war" depends="build">
<war destfile="${webapp.temp.war}/${webapp.name}-${timestamp}.war" webxml="D:\Projects\${webapp.name}\Source\web\WEB-INF\web.xml">
<fileset dir="D:\Projects\${webapp.name}\Source\web">
<exclude name="**/*.rar"/>
<exclude name="**/*.zip"/>
<exclude name="**/.#*"/>
<exclude name="temp/**"/>
<exclude name="viewer/**"/>
<exclude name="WEB-INF/web.xml"/>
<exclude name="WEB-INF/classes/**"/>
<exclude name="WEB-INF/lib/**"/>
</fileset>
<lib dir="D:\Projects\${webapp.name}\Source\web\WEB-INF\lib">
<exclude name="ant.jar"/>
</lib>
<classes dir="D:\Projects\${webapp.name}\Source\web\WEB-INF\classes"/>
</war>
</target>
<target name="wsapi-clean">
<!-- <delete dir="${wsapi.dir}"/>-->
</target>
<target name="wsapi">
<antcall target="wsapi-clean"/>
<mkdir dir="${wsapi.dir}"/>
<foreach target="wsapi-module" param="wsapi.module.dir" inheritall="true">
<path>
<dirset dir="${java.src}/com/dcivision/resource/services">
<include name="*"/>
<exclude name="schemas"/>
</dirset>
</path>
</foreach>
<mkdir dir="${wsapi.lib}"/>
<jar jarfile="${wsapi.lib}/paradm-ws-api.jar" basedir="${wsapi.classes}"/>
</target>
<target name="wsapi-module" depends="wsapi.chkUpToDate" unless="wsapi.notRequired">
<foreach target="wsapi-service" param="wsapi.service.wsdl" inheritall="true">
<path>
<fileset dir="${java.src}/com/dcivision/resource/services/${wsapi.module.name}">
<include name="*.wsdl"/>
</fileset>
</path>
</foreach>
<mkdir dir="${wsapi.classes}"/>
<copy todir="${wsapi.classes}/schemaorg_apache_xmlbeans">
<fileset dir="${wsapi.dir}/resources/schemaorg_apache_xmlbeans"/>
</copy>
<javac srcdir="${wsapi.dir}/src" destdir="${wsapi.classes}" debug="on" memoryInitialSize="128m" memoryMaximumSize="256m" fork="true">
<classpath refid="build.classpath"/>
</javac>
</target>
<target name="wsapi.chkUpToDate">
<basename property="wsapi.module.name" file="${wsapi.module.dir}"/>
<echo message="Checking WS-${wsapi.module.name} for update"/>
<uptodate property="wsapi.notRequired" targetfile="${wsapi.lib}/paradm-ws-api.jar" >
<srcfiles dir= "${java.src}/com/dcivision/resource/services">
<include name="schemas/*.xsd"/>
<include name="${wsaar.module.name}/*.wsdl"/>
<include name="${wsaar.module.name}/*.xsd"/>
<!-- No need to generate the API even services.xml is modified -->
<exclude name="${wsaar.module.name}/services.xml"/>
</srcfiles>
</uptodate>
<if>
<istrue value="${wsapi.notRequired}"/>
<then><echo message="Web Service ${wsapi.module.name} up to date: ${wsapi.notRequired}"/></then>
</if>
</target>
<target name="wsapi-service">
<basename property="wsapi.service.name" file="${wsapi.service.wsdl}" suffix=".wsdl"/>
<echo message=" Parsing ${wsapi.service.name}"/>
<antcall target="wsdl2java" inheritAll="true"/>
<move file="${wsapi.dir}/resources/services.xml" tofile="${wsapi.dir}/services/${wsapi.module.name}/${wsapi.service.name}-service.xml" />
<move todir="${wsapi.dir}/services/${wsapi.module.name}">
<fileset dir="${wsapi.dir}/resources">
<include name="*.wsdl"/>
<include name="*.xsd"/>
</fileset>
</move>
</target>
<target name="wsdl2java">
<taskdef name="codegen" classname="org.apache.axis2.tool.ant.AntCodegenTask" classpathref="build.classpath"/>
<echo message="${java.src}/com/dcivision/resource/services/${wsapi.module.name}/${wsapi.service.name}.wsdl"/>
<codegen
wsdlVersion="1.1"
wsdlfilename="${java.src}/com/dcivision/resource/services/${wsapi.module.name}/${wsapi.service.name}.wsdl"
serviceName="${wsapi.service.name}"
portName="${wsapi.service.name}SOAP12Port"
databindingName="xmlbeans"
generateAllClasses="true"
serverSide="true"
serverSideInterface="true"
generateServiceXml="true"
output="${wsapi.dir}"
/>
</target>
<target name="wsdl2java2">
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
<classpath refid="build.classpath"/>
<arg value="-uri"/>
<arg file="${java.src}/com/dcivision/resource/services/${wsapi.module.name}/${wsapi.service.name}.wsdl"/>
<arg value="-d"/>
<arg value="none"/>
<arg value="-ss"/>
<arg value="-g"/>
<arg value="-sd"/>
<arg value="-o"/>
<arg file="${wsapi.dir}"/>
</java>
</target>
<target name="wsaar">
<copy todir="${build.dir}/services/lib" file="${wsapi.lib}/paradm-ws-api.jar"/>
<foreach target="wsaar-module" param="wsaar.module.dir" inheritall="true">
<path>
<dirset dir="${java.src}/com/dcivision/resource/services">
<include name="*"/>
<exclude name="schemas"/>
</dirset>
</path>
</foreach>
</target>
<target name="wsaar-module" depends="wsaar.chkUpToDate" unless="wsaar.notRequired">
<property name="services.xml.dir" value="${webapp.temp.services}/WS-${wsaar.module.name}/META-INF"/>
<antcall target="services.xml" inheritAll="true"/>
<copy todir="${webapp.temp.services}/WS-${wsaar.module.name}/META-INF">
<fileset dir="${java.src}/com/dcivision/resource/services/${wsaar.module.name}">
<include name="*.wsdl"/>
<include name="*.xsd"/>
<include name="*.xml"/>
</fileset>
</copy>
<copy todir="${webapp.temp.services}/WS-${wsaar.module.name}/schemas">
<fileset dir="${java.src}/com/dcivision/resource/services/schemas">
<include name="*.xsd"/>
</fileset>
</copy>
<mkdir dir="${webapp.temp.services}/WS-${wsaar.module.name}/lib"/>
<jar jarfile="${webapp.temp.services}/WS-${wsaar.module.name}/lib/WS-${wsaar.module.name}-impl.jar" basedir="${webapp.temp.classes}" includes="com/dcivision/ws/**"/>
<jar jarfile="${webapp.temp.services}/WS-${wsaar.module.name}.aar" basedir="${webapp.temp.services}/WS-${wsaar.module.name}"/>
<mkdir dir="${build.dir}/services"/>
<copy todir="${build.dir}/services/" file="${webapp.temp.services}/WS-${wsaar.module.name}.aar"/>
</target>
<target name="wsaar.chkUpToDate">
<basename property="wsaar.module.name" file="${wsaar.module.dir}"/>
<echo message="Checking WS-${wsaar.module.name} for update"/>
<uptodate property="wsaar.notRequired" targetfile="${webapp.temp.services}/WS-${wsaar.module.name}.aar" >
<srcfiles dir= "${java.src}/com/dcivision/resource/services">
<include name="schemas/*.xsd"/>
<include name="${wsaar.module.name}/*.wsdl"/>
<include name="${wsaar.module.name}/*.xsd"/>
<!-- If services.xml is modified, need to generate a new .aar file -->
<include name="${wsaar.module.name}/services.xml"/>
</srcfiles>
</uptodate>
<if>
<istrue value="${wsaar.notRequired}"/>
<then><echo message="Web Service ${wsaar.module.name} up to date: ${wsaar.notRequired}"/></then>
</if>
</target>
<!-- ========================================================================= -->
<!-- TODO: Dynamically merge each generated services.xml into one within the same module -->
<!-- ========================================================================= -->
<target name="services.xml">
</target>
</project>
<property environment="env" value="dummy"/>
<!-- Tomcat home directory -->
<property name="tomcat.home" value="${env.TOMCAT_HOME}"/>
<!-- WAR home directory -->
<property name="war.home" value="${basedir}/../build" />
<!-- Tomcat home directory -->
<property name="tomcat.service" value="Apache Tomcat 4.1"/>
<property name="webapp.locale" value="en_US"/>
<property name="webapp.temp.resources" value="../temp/resources"/>
<property name="webapp.temp.classes" value="../temp/classes"/>
<property name="webapp.temp.lib" value="../temp/lib"/>
<property name="webapp.temp.wsapi" value="../temp/wsapi"/>
<property name="webapp.temp.services" value="../temp/services"/>
<property name="webapp.temp.war" value="../temp"/>
<tstamp>
<format property="timestamp" pattern="yyyyMMdd" locale="en"/>
</tstamp>
<!-- ParaDM web context name -->
<property name="webapp.name" value="ParaDM"/>
<!-- ParaDM version number -->
<property name="webapp.version" value="3.1.8"/>
<!-- Source file location -->
<property name="java.src" value="${basedir}"/>
<!-- Web file location -->
<property name="webapp.src" value="${basedir}/../web"/>
<!-- Applicaton library location -->
<property name="webapp.lib" value="${webapp.src}/WEB-INF/lib"/>
<!-- Build result location -->
<property name="build.dir" value="${webapp.src}/WEB-INF/"/>
<!-- JavaDoc location -->
<property name="build.javadoc.dir" value="${basedir}/../doc/java"/>
<property name="build.tlddoc.dir" value="${basedir}/../doc/tld"/>
<property name="build.jsdoc.dir" value="${basedir}/../doc/js"/>
<property name="build.jsdoc.pl" value="D:/Projects/JSDoc-1.9.9.2/jsdoc.pl"/>
<!-- Database Administrator login-->
<property name="database.dba.login" value="root"/>
<!-- Database Administrator password-->
<property name="database.dba.password" value=""/>
<!-- Database ParaDM user login name -->
<property name="database.user.login" value="paradm"/>
<!-- Database ParaDM user password-->
<property name="database.user.password" value="paradm"/>
<!-- Database Location -->
<property name="database.location" value="localhost"/>
<!-- Database instance name -->
<property name="database.sid" value="ParaDM"/>
<!-- Directories to store the Web Service generated files -->
<property name="wsapi.dir" value="${webapp.temp.wsapi}"/>
<property name="wsapi.classes" value="${wsapi.dir}/build/classes"/>
<property name="wsapi.lib" value="${wsapi.dir}/build/lib"/>
<condition property="paradm.home.file" value="D:/ParaDM/file">
<os family="windows"/>
</condition>
<condition property="paradm.home.file" value="/usr/local/bin/ParaDM/file">
<os family="unix"/>
</condition>
<!-- Set classpath -->
<path id="build.classpath">
<fileset dir="../lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${webapp.lib}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${tomcat.home}">
<include name="**/servlet.jar"/>
<include name="**/mail.jar"/>
<include name="**/activation.jar"/>
</fileset>
</path>
<taskdef name="foreach" classname="net.sf.antcontrib.logic.ForEach" classpath="../lib/ant-contrib-1.0b3.jar"/>
<taskdef name="if" classname="net.sf.antcontrib.logic.IfTask" classpath="../lib/ant-contrib-1.0b3.jar"/>
<!-- Command for compile source and resources files [DEFAULT] -->
<target name="compile">
<echo>Build Begin ... ${basedir}</echo>
<antcall target="compile_src"/>
<antcall target="compile_res"/>
<antcall target="copy_class"/>
<antcall target="copy_properties"/>
<antcall target="copy_others"/>
</target>
<!-- Command for compile java files -->
<target name="compile_src">
<!-- ========================================================================= -->
<!-- Compile the Axis2/XMLBeans generated classes into JAR file (paradm-ws-api.jar) -->
<!-- ========================================================================= -->
<antcall target="wsapi"/>
<copy todir="${webapp.temp.classes}">
<fileset dir="${java.src}">
<include name="*.properties"/>
<exclude name="generate.properties"/>
</fileset>
</copy>
<javac srcdir="${java.src}" destdir="${webapp.temp.classes}" debug="on" memoryInitialSize="128m" memoryMaximumSize="256m" fork="true">
<classpath refid="build.classpath"/>
<classpath location="${wsapi.lib}/paradm-ws-api.jar"/>
<exclude name="com/dcivision/customize/**"/>
</javac>
<!-- ========================================================================= -->
<!-- Compile and package different web services (WS-ParaDM.aar, WS-ParaDOC.aar, etc) -->
<!-- ========================================================================= -->
<antcall target="wsaar"/>
</target>
<!-- Command for compile resources files -->
<target name="compile_res" depends="res.chkUpToDate" unless="res.notRequired">
<mkdir dir="${webapp.temp.resources}"/>
<copy overwrite="true" todir="${webapp.temp.resources}">
<fileset dir="${java.src}">
<include name="**/*Resource*.properties"/>
</fileset>
</copy>
<copy overwrite="true" file="${webapp.temp.resources}/com/dcivision/resource/ApplicationResources.properties" tofile="${webapp.temp.resources}/com/dcivision/resource/ApplicationResources_${webapp.locale}.properties"/>
<copy overwrite="true" file="${webapp.temp.resources}/com/dcivision/resource/CustomizedResources.properties" tofile="${webapp.temp.resources}/com/dcivision/resource/CustomizedResources_${webapp.locale}.properties"/>
<native2ascii encoding="utf-8" src="${webapp.temp.resources}" dest="${build.dir}/classes" includes="**/*Resource*.properties" />
</target>
<target name="res.chkUpToDate">
<echo message="Checking resources bundles for update"/>
<uptodate property="res.notRequired">
<srcfiles dir="${java.src}" includes="**/*Resource*.properties"/>
<mapper type="glob" from="*.properties" to="${webapp.temp.resources}/*.properties" />
</uptodate>
<if>
<istrue value="${res.notRequired}"/>
<then><echo message="Resources bundles up to date: ${res.notRequired}"/></then>
</if>
</target>
<target name="copy_class">
<copy todir="${build.dir}/classes">
<fileset dir="${webapp.temp.classes}">
<exclude name="**/*Resource*.properties"/>
<exclude name="*.properties"/>
<exclude name="com/dcivision/ws/**/**"/>
</fileset>
</copy>
</target>
<target name="copy_properties">
<copy todir="${build.dir}/classes">
<fileset dir="${webapp.temp.classes}">
<include name="*.properties"/>
<exclude name="generate.properties"/>
</fileset>
</copy>
</target>
<target name="copy_others">
<copy file="${java.src}/com/dcivision/workflow/action/AutoTaskTemplate.java" todir="${build.dir}/classes/com/dcivision/workflow/action"/>
</target>
<!-- Build Web Application war package -->
<target name="buildwar" depends="compile">
<mkdir dir="${war.home}"/>
<war destfile="${war.home}/eip.war" webxml="${webapp.src}/WEB-INF/web.xml">
<fileset dir="${webapp.src}">
<exclude name="${webapp.src}/WEB-INF/web.xml"/>
</fileset>
</war>
</target>
<!-- Command for deployment -->
<target name="deploy" depends="compile">
<copy todir="${tomcat}">
<fileset dir="${classes}"/>
</copy>
<copy todir="${jsp}">
<fileset dir="${src}/com/dcivision/dms/web/jsp"/>
</copy>
</target>
<!-- Command for generation of JavaDoc -->
<target name="javadoc" depends="compile">
<javadoc packagenames="com.dcivision.alert,com.dcivision.alert.bean,com.dcivision.alert.core,com.dcivision.alert.dao,com.dcivision.alert.web,com.dcivision.audit,com.dcivision.audit.bean,com.dcivision.audit.core,com.dcivision.audit.dao,com.dcivision.calendar,com.dcivision.calendar.bean,com.dcivision.calendar.dao,com.dcivision.calendar.taglib,com.dcivision.calendar.web,com.dcivision.contact,com.dcivision.contact.bean,com.dcivision.contact.dao,com.dcivision.contact.web,com.dcivision.customize,com.dcivision.customize.workflow,com.dcivision.dms,com.dcivision.dms.bean,com.dcivision.dms.client,com.dcivision.dms.client.analyzer,com.dcivision.dms.client.parser,com.dcivision.dms.core,com.dcivision.dms.dao,com.dcivision.dms.extractor,com.dcivision.dms.taglib,com.dcivision.dms.web,com.dcivision.form,com.dcivision.form.bean,com.dcivision.form.core,com.dcivision.form.dao,com.dcivision.form.web,com.dcivision.forum,com.dcivision.forum.bean,com.dcivision.forum.core,com.dcivision.forum.dao,com.dcivision.forum.web,com.dcivision.framework,com.dcivision.framework.bean,com.dcivision.framework.dao,com.dcivision.framework.image,com.dcivision.framework.notification,com.dcivision.framework.taglib.bean,com.dcivision.framework.taglib.calendar,com.dcivision.framework.taglib.html,com.dcivision.framework.taglib.layout,com.dcivision.framework.taglib.logic,com.dcivision.framework.taglib.newCalender,com.dcivision.framework.web,com.dcivision.framework.xml,com.dcivision.ldap.core,com.dcivision.ldap.web,com.dcivision.mail.bean,com.dcivision.mail.core,com.dcivision.mail.dao,com.dcivision.mail.web,com.dcivision.setup,com.dcivision.setup.bean,com.dcivision.setup.dao,com.dcivision.setup.web,com.dcivision.staff,com.dcivision.staff.bean,com.dcivision.staff.dao,com.dcivision.staff.web,com.dcivision.upload.core,com.dcivision.upload.web,com.dcivision.user,com.dcivision.user.auth,com.dcivision.user.bean,com.dcivision.user.dao,com.dcivision.user.web,com.dcivision.webdav,com.dcivision.webdav.util,com.dcivision.workflow,com.dcivision.workflow.action,com.dcivision.workflow.applet,com.dcivision.workflow.applet.editor,com.dcivision.workflow.applet.editor.gif,com.dcivision.workflow.bean,com.dcivision.workflow.core,com.dcivision.workflow.dao,com.dcivision.workflow.layout,com.dcivision.workflow.taglib,com.dcivision.workflow.web"
sourcepath="${java.src}"
destdir="${build.javadoc.dir}"
windowtitle="DCIVISION ParaDM API"
author="Yes"
version="Yes"
use="Yes"
maxmemory="512M"
splitindex="Yes">
<classpath refid="build.classpath"/>
</javadoc>
</target>
<target name="tlddoc" depends="compile">
<java fork="true" jar="${build.dir}/lib/tlddoc.jar" failοnerrοr="true">
<arg line="-d ${build.tlddoc.dir}"/>
<arg value="${build.dir}/calendar.tld"/>
<arg value="${build.dir}/cewolf.tld"/>
<arg value="${build.dir}/dms.tld"/>
<arg value="${build.dir}/layout.tld"/>
<arg value="${build.dir}/newCalendar.tld"/>
<arg value="${build.dir}/schedule.tld"/>
<arg value="${build.dir}/struts-bean.tld"/>
<arg value="${build.dir}/struts-html.tld"/>
<arg value="${build.dir}/struts-logic.tld"/>
<arg value="${build.dir}/struts-nested.tld"/>
<arg value="${build.dir}/struts-template.tld"/>
<arg value="${build.dir}/struts-tiles.tld"/>
<arg value="${build.dir}/workflow.tld"/>
</java>
</target>
<target name="jsdoc" description="Document the JavaScript">
<exec executable="perl">
<arg value="${build.jsdoc.pl}"/>
<arg value="-r" />
<arg value="--package-naming" />
<arg value="--no-lexical-privates" />
<arg value="--project-name" />
<arg value="ParaDM Javascript" />
<arg value="--logo" />
<arg value="${webapp.src}/img/pref3/common/LayoutLogoDefault.gif" />
<arg value="--directory"/>
<arg value="${build.jsdoc.dir}"/>
<arg file="${webapp.src}/js/AnchorPosition.js"/>
<arg file="${webapp.src}/js/autoSuggest.js"/>
<arg file="${webapp.src}/js/ColorPicker.js"/>
<arg file="${webapp.src}/js/dojo.js"/>
<arg file="${webapp.src}/js/FloatingSelectionBox.js"/>
<arg file="${webapp.src}/js/FormFunction.js"/>
<arg file="${webapp.src}/js/Framework.js"/>
<arg file="${webapp.src}/js/NewCalendar.js"/>
<arg file="${webapp.src}/js/OverLib.js"/>
<arg file="${webapp.src}/js/OverLibHiddenForm.js"/>
<arg file="${webapp.src}/js/PermissionSetup.js"/>
<arg file="${webapp.src}/js/PopupCalendar.js"/>
<arg file="${webapp.src}/js/PopupWindow.js"/>
<arg file="${webapp.src}/js/Tree.js"/>
<arg file="${webapp.src}/js/dojo"/>
<arg file="${webapp.src}/js/dojo/dnd"/>
<arg file="${webapp.src}/js/dojo/event"/>
<arg file="${webapp.src}/js/dojo/html"/>
</exec>
</target>
<!-- Command for clean up classes files -->
<target name="clean">
<echo message="Cleanup ..."/>
<antcall target="stop"/>
<delete dir="${tomcat.home}/work/Standalone/localhost/${webapp.name}"/>
<delete dir="${build.dir}/classes"/>
<delete dir="${build.dir}/services"/>
<delete>
<fileset dir="${build.dir}/lib" includes="paradm-web*.jar"/>
</delete>
<delete dir="${webapp.temp.resources}"/>
<delete dir="${webapp.temp.classes}"/>
<delete dir="${webapp.temp.lib}"/>
<delete dir="${webapp.temp.wsapi}"/>
<delete dir="${webapp.temp.services}"/>
<antcall target="wsapi-clean"/>
</target>
<!-- Command for build -->
<target name="build" depends="compile_src, compile_res, copy_properties">
<jar jarfile="${build.dir}/lib/paradm-web-${webapp.version}.jar" basedir="${webapp.temp.classes}" excludes="*.properties,log4j.xml,com/dcivision/resource/**"/>
<jar jarfile="${build.dir}/lib/paradm-client.jar" basedir="${webapp.temp.classes}" includes="com/dcivision/dms/client/**"/>
<move file="${build.dir}/lib/paradm-client.jar" todir="${java.src}/../client/"/>
<copy file="${java.src}/dms.conf" todir="${java.src}/../client/"/>
<copy file="${java.src}/clientrun.bat" todir="${java.src}/../client/"/>
<delete includeemptydirs="true">
<fileset dir="${build.dir}/classes">
<include name="com/**"/>
<include name="*.class"/>
<exclude name="*.xml"/>
<exclude name="com/dcivision/resource/**"/>
</fileset>
</delete>
</target>
<!-- Command for parascan client build -->
<target name="client" depends="compile">
<jar jarfile="${build.dir}/lib/paradm-client.jar" basedir="${build.dir}/classes" includes="com/dcivision/dms/client/**"/>
<move file="${build.dir}/lib/paradm-client.jar" todir="${java.src}/../client/"/>
</target>
<!-- Command for parsing JSP -->
<target name="parsejsp" depends="compile">
<echo message="${tomcat.home}"/>
<copy todir="${basedir}/../temp">
<fileset dir="${webapp.src}">
<exclude name="**/*.db"/>
<exclude name="**/*.txt"/>
<exclude name="**/*.gif"/>
<exclude name="**/*.class"/>
<exclude name="**/*.jpg"/>
</fileset>
<mapper type="glob" from="*.jsp" to="*.jsp"/>
</copy>
<copy todir="${basedir}/../temp">
<fileset dir="${webapp.src}">
<exclude name="**/*.db"/>
<exclude name="**/*.txt"/>
<exclude name="**/*.gif"/>
<exclude name="**/*.jpg"/>
<exclude name="**/*.jsp"/>
</fileset>
</copy>
<mkdir dir="${tomcat.home}/work/Standalone/localhost/${webapp.name}"/>
<jspc srcdir="${basedir}/../temp" destdir="${tomcat.home}/work/Standalone/localhost/${webapp.name}" uriroot="${basedir}/../temp" failοnerrοr="No">
<classpath refid="build.classpath"/>
<include name="**/*.jsp"/>
<webapp basedir="${basedir}/../temp"/>
</jspc>
<replaceregexp byline="true">
<regexp pattern="package (.*)" />
<substitution expression="package org.apache.jsp;" />
<fileset dir="${tomcat.home}/work/Standalone/localhost/${webapp.name}">
<include name="**/*.java" />
</fileset>
</replaceregexp>
<deltree dir="${basedir}/../temp"/>
</target>
<!-- Command for compiling JSP -->
<target name="jspc">
<taskdef classname="org.apache.jasper.JspC" name="jasper2" >
<classpath id="jspc.classpath">
<pathelement location="${java.home}/../lib/tools.jar"/>
<fileset dir="${tomcat.home}/server/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/common/lib">
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>
<taskdef name="foreach"
classname="net.sf.antcontrib.logic.ForEach"
classpath="${ant}/ant-contrib.jar" />
<jasper2
validateXml="false"
uriroot="${webapp.src}"
webXmlFragment="${webapp.src}/WEB-INF/generated_web.xml"
outputDir="${webapp.src}/WEB-INF/src"
package="some.unique.string.asd34sad">
</jasper2>
<replaceregexp match="^package some.unique.string.asd34sad.*;"
replace="package org.apache.jsp;"
byline="true">
<fileset dir="${webapp.src}/WEB-INF/src">
<include name="**/*.*"/>
</fileset>
</replaceregexp>
<echo>Compiling generated classes from JSPC</echo>
<foreach target="do-jsp-compile" param="dir-path">
<path>
<dirset dir="${webapp.src}/WEB-INF/src"/>
</path>
</foreach>
<move todir="${tomcat.home}/work/Standalone/localhost/${webapp.name}">
<fileset dir="${webapp.src}/WEB-INF/src">
<include name="**/*.*"/>
</fileset>
</move>
<delete dir="${webapp.src}/WEB-INF/src"/>
</target>
<target name="do-jsp-compile">
<echo>Compile JSP in: ${dir-path}</echo>
<javac destdir="${dir-path}"
optimize="off"
debug="on"
failοnerrοr="false"
srcdir="${dir-path}">
<classpath>
<pathelement location="${webapp.src}/WEB-INF/classes"/>
<fileset dir="${webapp.src}/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
<pathelement location="${tomcat.home}/common/classes"/>
<fileset dir="${tomcat.home}/common/lib">
<include name="*.jar"/>
</fileset>
<pathelement location="${tomcat.home}/shared/classes"/>
<fileset dir="${tomcat.home}/shared/lib">
<include name="*.jar"/>
</fileset>
</classpath>
<include name="*.java" />
</javac>
<mkdir dir="${dir-path}/org/apache/jsp"/>
<move todir="${dir-path}" failοnerrοr="false">
<fileset dir="${dir-path}/org/apache/jsp">
<include name="*.*"/>
</fileset>
</move>
<delete dir="${dir-path}/org" failοnerrοr="false"/>
</target>
<!--
Task to initialize mysql connection settings
-->
<target name="db_init_mysql">
</target>
<!--
Task to mysql deployment, it can:
1) checkout the latest source from db/mysql folder
2) create a new database instance
3) deploy default ParaDM configuration data
4) create a databaes user (paradm) for ParaDM application access
5) grant privileges to this database user (paradm)
6) update the ParaDM system parameter and storage location path for ParaDOC (DMS_LOC_MASTER.LOC_PATH)
You need to fill in the correct parameters to make it works:
${database.location} : Location of your database, default is "localhost"
${database.dba.login} : Database administrator login, default is "root"
${database.dba.password} : Database administrator password
${database.user.login} : Database user login, default is "paradm"
${database.user.password} : Database user password, default is "paradm"
${database.sid} : Database instance you want to create, default is "ParaDM"
-->
<target name="db_deploy_mysql" depends="db_cvsupdate_mysql">
<property name="database.driver" value="com.mysql.jdbc.Driver"/>
<property name="database.url" value="jdbc:mysql://${database.location}:3306/mysql?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true"/>
<sql
driver="${database.driver}"
url="${database.url}"
userid="${database.dba.login}"
password="${database.dba.password}"
οnerrοr="continue">
<classpath refid="build.classpath"/>
<transaction>
CREATE DATABASE ${database.sid};
USE ${database.sid};
GRANT ALL PRIVILEGES ON ${database.sid}.* TO '${database.user.login}'@'${database.location}' IDENTIFIED BY '${database.user.password}'
</transaction>
<transaction src="../db/mysql/structure.sql"/>
<transaction src="../db/mysql/data.sql"/>
</sql>
<antcall target="db_configure" inheritAll="true"/>
</target>
<!--
Task to auto apply db patch to your database
Comment out the db_cvsupdate_mysql task if you don't want to update source before apply the db patch.
-->
<target name="db_patch_mysql" depends="db_cvsupdate_mysql">
<property name="database.driver" value="com.mysql.jdbc.Driver"/>
<property name="database.url" value="jdbc:mysql://${database.location}:3306/${database.sid}?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true"/>
<property name="database.type" value="mysql"/>
<antcall target="db_patch" inheritAll="true"/>
</target>
<!--
Task called by db_patch_{database_type} to apply SQL patch
-->
<target name="db_patch">
<sql
driver="${database.driver}"
url="${database.url}"
userid="${database.user.login}"
password="${database.user.password}"
οnerrοr="continue">
<classpath refid="build.classpath"/>
<transaction src="../db/${database.type}/alter3.2.0.sql"/>
</sql>
</target>
<!--
Task called by db_deploy_{database_type} to update ParaDM system parameters and ParaDOC root location path
-->
<target name="db_configure">
<sql
driver="${database.driver}"
url="${database.url}"
userid="${database.dba.login}"
password="${database.dba.password}"
οnerrοr="continue">
<classpath refid="build.classpath"/>
<transaction>
UPDATE ${database.sid}.DMS_LOC_MASTER SET LOC_PATH='${paradm.home.file}/ParaDOC';
UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/ParaDOC' WHERE PARAMETER_CODE='dms.archive_file_path';
UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/ParaDOC/cache/' WHERE PARAMETER_CODE='dms.emailArchive.cachefolder.path';
UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/ParaFORM' WHERE PARAMETER_CODE='form.attachment_physical_path';
UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/KB' WHERE PARAMETER_CODE='rules.kb_file_path';
UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/Index' WHERE PARAMETER_CODE='system.index_base_path';
UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/ParaFLOW' WHERE PARAMETER_CODE='workflow.attachment_physical_path';
UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/ParaFlow/AutomaticTask/bin' WHERE PARAMETER_CODE='workflow.automatic_task_bindir';
UPDATE ${database.sid}.SYS_PARAMETER SET PARAMETER_VALUE='${paradm.home.file}/ParaFlow/AutomaticTask/src' WHERE PARAMETER_CODE='workflow.automatic_task_srcdir';
</transaction>
</sql>
</target>
<!-- Task to update the CVS MySQL db script folder -->
<target name="db_cvsupdate_mysql">
<cvs dest="../db/mysql/" command="update"/>
</target>
<target name="restart">
<antcall target="stop"/>
<delete dir="${tomcat.home}/work/Standalone/localhost/${webapp.name}"/>
<antcall target="start"/>
</target>
<target name="stop">
<exec executable="cmd.exe" os="Windows XP">
<arg line="/c net stop "${tomcat.service}""/>
</exec>
</target>
<target name="start">
<exec executable="cmd.exe" os="Windows XP">
<arg line="/c net start "${tomcat.service}""/>
</exec>
</target>
<target name="war" depends="build">
<war destfile="${webapp.temp.war}/${webapp.name}-${timestamp}.war" webxml="D:\Projects\${webapp.name}\Source\web\WEB-INF\web.xml">
<fileset dir="D:\Projects\${webapp.name}\Source\web">
<exclude name="**/*.rar"/>
<exclude name="**/*.zip"/>
<exclude name="**/.#*"/>
<exclude name="temp/**"/>
<exclude name="viewer/**"/>
<exclude name="WEB-INF/web.xml"/>
<exclude name="WEB-INF/classes/**"/>
<exclude name="WEB-INF/lib/**"/>
</fileset>
<lib dir="D:\Projects\${webapp.name}\Source\web\WEB-INF\lib">
<exclude name="ant.jar"/>
</lib>
<classes dir="D:\Projects\${webapp.name}\Source\web\WEB-INF\classes"/>
</war>
</target>
<target name="wsapi-clean">
<!-- <delete dir="${wsapi.dir}"/>-->
</target>
<target name="wsapi">
<antcall target="wsapi-clean"/>
<mkdir dir="${wsapi.dir}"/>
<foreach target="wsapi-module" param="wsapi.module.dir" inheritall="true">
<path>
<dirset dir="${java.src}/com/dcivision/resource/services">
<include name="*"/>
<exclude name="schemas"/>
</dirset>
</path>
</foreach>
<mkdir dir="${wsapi.lib}"/>
<jar jarfile="${wsapi.lib}/paradm-ws-api.jar" basedir="${wsapi.classes}"/>
</target>
<target name="wsapi-module" depends="wsapi.chkUpToDate" unless="wsapi.notRequired">
<foreach target="wsapi-service" param="wsapi.service.wsdl" inheritall="true">
<path>
<fileset dir="${java.src}/com/dcivision/resource/services/${wsapi.module.name}">
<include name="*.wsdl"/>
</fileset>
</path>
</foreach>
<mkdir dir="${wsapi.classes}"/>
<copy todir="${wsapi.classes}/schemaorg_apache_xmlbeans">
<fileset dir="${wsapi.dir}/resources/schemaorg_apache_xmlbeans"/>
</copy>
<javac srcdir="${wsapi.dir}/src" destdir="${wsapi.classes}" debug="on" memoryInitialSize="128m" memoryMaximumSize="256m" fork="true">
<classpath refid="build.classpath"/>
</javac>
</target>
<target name="wsapi.chkUpToDate">
<basename property="wsapi.module.name" file="${wsapi.module.dir}"/>
<echo message="Checking WS-${wsapi.module.name} for update"/>
<uptodate property="wsapi.notRequired" targetfile="${wsapi.lib}/paradm-ws-api.jar" >
<srcfiles dir= "${java.src}/com/dcivision/resource/services">
<include name="schemas/*.xsd"/>
<include name="${wsaar.module.name}/*.wsdl"/>
<include name="${wsaar.module.name}/*.xsd"/>
<!-- No need to generate the API even services.xml is modified -->
<exclude name="${wsaar.module.name}/services.xml"/>
</srcfiles>
</uptodate>
<if>
<istrue value="${wsapi.notRequired}"/>
<then><echo message="Web Service ${wsapi.module.name} up to date: ${wsapi.notRequired}"/></then>
</if>
</target>
<target name="wsapi-service">
<basename property="wsapi.service.name" file="${wsapi.service.wsdl}" suffix=".wsdl"/>
<echo message=" Parsing ${wsapi.service.name}"/>
<antcall target="wsdl2java" inheritAll="true"/>
<move file="${wsapi.dir}/resources/services.xml" tofile="${wsapi.dir}/services/${wsapi.module.name}/${wsapi.service.name}-service.xml" />
<move todir="${wsapi.dir}/services/${wsapi.module.name}">
<fileset dir="${wsapi.dir}/resources">
<include name="*.wsdl"/>
<include name="*.xsd"/>
</fileset>
</move>
</target>
<target name="wsdl2java">
<taskdef name="codegen" classname="org.apache.axis2.tool.ant.AntCodegenTask" classpathref="build.classpath"/>
<echo message="${java.src}/com/dcivision/resource/services/${wsapi.module.name}/${wsapi.service.name}.wsdl"/>
<codegen
wsdlVersion="1.1"
wsdlfilename="${java.src}/com/dcivision/resource/services/${wsapi.module.name}/${wsapi.service.name}.wsdl"
serviceName="${wsapi.service.name}"
portName="${wsapi.service.name}SOAP12Port"
databindingName="xmlbeans"
generateAllClasses="true"
serverSide="true"
serverSideInterface="true"
generateServiceXml="true"
output="${wsapi.dir}"
/>
</target>
<target name="wsdl2java2">
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
<classpath refid="build.classpath"/>
<arg value="-uri"/>
<arg file="${java.src}/com/dcivision/resource/services/${wsapi.module.name}/${wsapi.service.name}.wsdl"/>
<arg value="-d"/>
<arg value="none"/>
<arg value="-ss"/>
<arg value="-g"/>
<arg value="-sd"/>
<arg value="-o"/>
<arg file="${wsapi.dir}"/>
</java>
</target>
<target name="wsaar">
<copy todir="${build.dir}/services/lib" file="${wsapi.lib}/paradm-ws-api.jar"/>
<foreach target="wsaar-module" param="wsaar.module.dir" inheritall="true">
<path>
<dirset dir="${java.src}/com/dcivision/resource/services">
<include name="*"/>
<exclude name="schemas"/>
</dirset>
</path>
</foreach>
</target>
<target name="wsaar-module" depends="wsaar.chkUpToDate" unless="wsaar.notRequired">
<property name="services.xml.dir" value="${webapp.temp.services}/WS-${wsaar.module.name}/META-INF"/>
<antcall target="services.xml" inheritAll="true"/>
<copy todir="${webapp.temp.services}/WS-${wsaar.module.name}/META-INF">
<fileset dir="${java.src}/com/dcivision/resource/services/${wsaar.module.name}">
<include name="*.wsdl"/>
<include name="*.xsd"/>
<include name="*.xml"/>
</fileset>
</copy>
<copy todir="${webapp.temp.services}/WS-${wsaar.module.name}/schemas">
<fileset dir="${java.src}/com/dcivision/resource/services/schemas">
<include name="*.xsd"/>
</fileset>
</copy>
<mkdir dir="${webapp.temp.services}/WS-${wsaar.module.name}/lib"/>
<jar jarfile="${webapp.temp.services}/WS-${wsaar.module.name}/lib/WS-${wsaar.module.name}-impl.jar" basedir="${webapp.temp.classes}" includes="com/dcivision/ws/**"/>
<jar jarfile="${webapp.temp.services}/WS-${wsaar.module.name}.aar" basedir="${webapp.temp.services}/WS-${wsaar.module.name}"/>
<mkdir dir="${build.dir}/services"/>
<copy todir="${build.dir}/services/" file="${webapp.temp.services}/WS-${wsaar.module.name}.aar"/>
</target>
<target name="wsaar.chkUpToDate">
<basename property="wsaar.module.name" file="${wsaar.module.dir}"/>
<echo message="Checking WS-${wsaar.module.name} for update"/>
<uptodate property="wsaar.notRequired" targetfile="${webapp.temp.services}/WS-${wsaar.module.name}.aar" >
<srcfiles dir= "${java.src}/com/dcivision/resource/services">
<include name="schemas/*.xsd"/>
<include name="${wsaar.module.name}/*.wsdl"/>
<include name="${wsaar.module.name}/*.xsd"/>
<!-- If services.xml is modified, need to generate a new .aar file -->
<include name="${wsaar.module.name}/services.xml"/>
</srcfiles>
</uptodate>
<if>
<istrue value="${wsaar.notRequired}"/>
<then><echo message="Web Service ${wsaar.module.name} up to date: ${wsaar.notRequired}"/></then>
</if>
</target>
<!-- ========================================================================= -->
<!-- TODO: Dynamically merge each generated services.xml into one within the same module -->
<!-- ========================================================================= -->
<target name="services.xml">
</target>
</project>