`
Huaqingfly
  • 浏览: 56033 次
社区版块
存档分类
最新评论

web service build.xml

    博客分类:
  • WS
阅读更多
<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" failonerror="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" failonerror="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"
         failonerror="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}" failonerror="false">
      <fileset dir="${dir-path}/org/apache/jsp">
        <include name="*.*"/>
      </fileset>
    </move>
    <delete dir="${dir-path}/org" failonerror="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&amp;characterEncoding=UTF-8&amp;autoReconnect=true"/>         
    <sql
      driver="${database.driver}"
      url="${database.url}"
      userid="${database.dba.login}"
      password="${database.dba.password}"
      onerror="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&amp;characterEncoding=UTF-8&amp;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}"
      onerror="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}"
      onerror="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 &quot;${tomcat.service}&quot;"/>
    </exec>
  </target>

  <target name="start">
    <exec executable="cmd.exe" os="Windows XP">
      <arg line="/c net start &quot;${tomcat.service}&quot;"/>
    </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>
分享到:
评论
1 楼 explanation009 2012-06-28  
贴了一堆外星文上来。。一点注释也没!!!

相关推荐

    PHP.Web.Services.APIs.for.the.Modern.Web.2nd.Edition

    Whether you’re sharing data between two internal systems or building an API so users can access their data, this practical book provides everything you need to build web service APIs with PHP....

    Pro.RESTful.APIs.Design.Build.and.Integrate.with.REST.JSON.XML.and.JAX-RS.pdf

    Discover the RESTful technologies, including REST, JSON, XML, JAX-RS web services, SOAP and more, for building today's microservices, big data applications, and web service applications. This book is ...

    (原创)用Eclipse + Axis2+Tomcat创建Web Service

    二、 Web Service服务器端的发布。 2.1 创建java类。 2.2 创建services.xml。 2.3 发布服务。 2.4 在浏览器上测试服务。 三、 Web Service 客户端的创建。 3.1 创建WSDL文件。 3.2 利用WSDL创建stub。 3.3 利用stub...

    soccerLeague

    ............\build.xml ............\dist ............\....\web ............\....\...\admin ............\....\...\.....\create_league.jsp ............\....\...\.....\select_title.jsp ..............

    mybatis-framework修改生成

    1.创建一个utf-8的数据库,数据库名根据自己...8.生成好并刷新工程后注意修改spring-common.xml与spring-servlet.xml和web.xml 修改其中的数据库信息以及扫描包等信息 9.启动项目 访问:http://localhost:8080/项目名

    ssh框架搭建实例源码

    eclips版本:Eclipse Java EE IDE for Web Developers.Version: Helios Service Release 2 Build id: 20110218-0911。采用mysql数据库,服务器为tomcat6.0,jdk1.6.0_18。测试连接:http://localhost:8080/ssh/ 资源...

    PHP Web 2.0 Mashup Projects.pdf

    we create an extensible object-oriented parser for XML. The mashup covered in this chapter integrates information taken from Amazon's E-commerce Service (ECS) with the Internet UPC database. In ...

    spring-boot-reference.pdf

    15.2. Importing XML Configuration 16. Auto-configuration 16.1. Gradually Replacing Auto-configuration 16.2. Disabling Specific Auto-configuration Classes 17. Spring Beans and Dependency Injection 18. ...

    源码 Dr.Bob’s Delphi Prism XE Development Essentials June 2011

    IDE: Build and Debug ............................................................... 12 Strings.................................................................................... 13 For-Loops ..........

    Developing .NET Web Services with XML(syngress安全图书)

    Readers will be given a thorough introduction to .NET and its XML building blocks while acquiring a firm grasp of how those blocks can be used to build any Web site or service so that it will ...

    ASP.NET 微软培训

    XML Web services enable you to build and operate Web services that deliver software as a service. XML Web services are today’s best-of-breed business integration since they allow customer centricity ...

    Programming Excel With Vba And .net.chm

    Lists Web Service Members Section 14.8. Resources Chapter 15. Working with XML Section 15.1. Understand XML Section 15.2. Save Workbooks as XML Section 15.3. Use XML Maps Section 15.4. ...

    idea使用教程2017-06-01.pdf

    Build Execution Deployment(构建执行部署)............................................................ 48 Languages&Frameworks.............................................................................

    电子拍卖系统java 源码

    将AuctionQueue-service.xml文件复制到%JBOSS_HOME%\server\default\deploy目录下,该文件在JBoss服务器上配置消息目的 4. 启动Dos或shell窗口,进入auction\WEB-INF路径下,输入 ant build 该命令用于编译、...

    ice:适用于AWS CodeStar Java Spring Web Service Ice的GitHub存储库

    buildspec.yml-AWS CodeBuild使用此文件来构建Web服务 pom.xml-该文件是Web服务的Maven项目对象模型 src / main-此目录包含您的Java服务源文件 src / test-此目录包含您的Java服务单元测试文件 template.yml-该文件...

    IDEA 教程 2017

    Build Execution Deployment(构建执行部署)............................................................ 48 Languages&Frameworks;............................................................................

    scheduler:适用于AWS CodeStar Java Spring Web Service调度程序的GitHub存储库

    这是什么该示例包括: README.md-此文件.ebextensions /-此目录包含配置文件,允许AWS Elastic Beanstalk部署您的Java服务buildspec.yml-AWS CodeBuild使用此文件来构建Web服务pom.xml-该文件是Web服务的Maven项目...

    网络架构师148讲视频课程

    │ │ │ │ repositories.xml.zip │ │ │ │ tasks.xml.zip │ │ │ │ │ │ │ └─contexts │ │ └─.plugins │ │ ├─org.eclipse.core.resources │ │ │ ├─.history │ │ │ │ ├─0 │ │ │ ...

    将 Flex 集成到 Java EE 应用程序的最佳实践(完整源代码)

    由于 BlazeDS 需要将 Java 接口 FlexService 暴露给 Flex 前端,因此,我们在配置文件 remoting-config.xml 中将 FlexService 接口声明为一个服务: 清单 6. 定义 flexService 服务 &lt;destination id="flex...

Global site tag (gtag.js) - Google Analytics