Show
Ignore:
Timestamp:
02/08/12 13:16:13 (12 years ago)
Author:
František Kučera <franta-hg@…>
Branch:
default
Message:

drobnosti, netbeans, entity

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • java/sql-vyuka/nbproject/ant-deploy.xml

    r74 r79  
    44        <property file="${deploy.ant.properties.file}" /> 
    55        <available file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" property="sun.web.present"/> 
     6        <available file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" property="glassfish.web.present"/> 
    67        <available file="${deploy.ant.resource.dir}" property="has.setup"/> 
    78        <tempfile prefix="gfv3" property="gfv3.password.file" destdir="${java.io.tmpdir}"/>  <!-- do not forget to delete this! --> 
     
    2425        </xmlproperty>     
    2526        <delete file="${temp.sun.web}"/> 
    26         <property name="deploy.ant.client.url" value="${gfv3.url}${sun-web-app.context-root}"/> 
    27         <property name="deploy.context.root.argument" value="?contextroot=${sun-web-app.context-root}"/> 
     27        <condition property="deploy.ant.client.url" value="${gfv3.url}${sun-web-app.context-root}" else="${gfv3.url}/${ant.project.name}"> 
     28            <isset property="sun-web-app.context-root"/> 
     29        </condition> 
     30        <condition property="deploy.context.root.argument" value="&amp;contextroot=${sun-web-app.context-root}" else="/${ant.project.name}"> 
     31            <isset property="sun-web-app.context-root"/> 
     32        </condition> 
     33    </target> 
     34    <target name="-parse-glassfish-web" depends="-init-cl-deployment-env" if="glassfish.web.present"> 
     35        <tempfile prefix="gfv3" property="temp.gf.web" destdir="${java.io.tmpdir}"/> 
     36        <copy file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" tofile="${temp.gf.web}"/> 
     37        <!-- The doctype triggers resolution which can fail --> 
     38        <replace file="${temp.gf.web}"> 
     39            <replacetoken><![CDATA[<!DOCTYPE]]></replacetoken> 
     40            <replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue> 
     41        </replace> 
     42        <replace file="${temp.gf.web}"> 
     43            <replacetoken><![CDATA[<glassfish-web-app]]></replacetoken> 
     44            <replacevalue><![CDATA[--> <glassfish-web-app]]></replacevalue> 
     45        </replace> 
     46        <xmlproperty file="${temp.gf.web}" validate="false"> 
     47        </xmlproperty> 
     48        <delete file="${temp.gf.web}"/> 
     49        <condition property="deploy.ant.client.url" value="${gfv3.url}${glassfish-web-app.context-root}" else="${gfv3.url}/${ant.project.name}"> 
     50            <isset property="glassfish-web-app.context-root"/> 
     51        </condition> 
     52        <condition property="deploy.context.root.argument" value="&amp;contextroot=${glassfish-web-app.context-root}" else="/${ant.project.name}"> 
     53            <isset property="glassfish-web-app.context-root"/> 
     54        </condition> 
    2855    </target> 
    2956    <target name="-no-parse-sun-web" depends="-init-cl-deployment-env" unless="sun.web.present"> 
     
    3461        <mkdir dir="${gfv3.resources.dir}"/> 
    3562        <mkdir dir="${gfv3.resources.dir}/META-INF"/> 
    36         <property name="gfv3.resources.file" value="${gfv3.resources.dir}/META-INF/sun-resources.xml"/> 
    3763        <copy todir="${gfv3.resources.dir}/META-INF"> 
    3864            <fileset dir="${deploy.ant.resource.dir}"/> 
     
    4369        <delete dir="${gfv3.resources.dir}"/> 
    4470    </target> 
    45     <target name="-deploy-ant" depends="-parse-sun-web,-no-parse-sun-web,-add-resources" if="deploy.ant.enabled"> 
     71    <target name="-deploy-ant" depends="-parse-glassfish-web, -parse-sun-web, -no-parse-sun-web,-add-resources" if="deploy.ant.enabled"> 
     72        <antcall target="-deploy-without-pw"/> 
     73        <antcall target="-deploy-with-pw"/> 
     74    </target> 
     75 
     76    <target name="-deploy-without-pw" unless="gfv3.password"> 
    4677        <echo message="Deploying ${deploy.ant.archive}"/> 
    4778        <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/>  <!-- do not forget to delete this! --> 
    4879        <property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/> 
    49         <get src="${gfv3.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}?force=true?name=${ant.project.name}" 
     80        <get src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&amp;force=true&amp;name=${ant.project.name}" 
    5081            dest="${gfv3.results.file}"/> 
    5182        <delete file="${gfv3.results.file}"/>     
    5283    </target> 
     84    <target name="-deploy-with-pw" if="gfv3.password"> 
     85        <echo message="Deploying ${deploy.ant.archive}"/> 
     86        <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/>  <!-- do not forget to delete this! --> 
     87        <property name="full.deploy.ant.archive" location="${deploy.ant.archive}"/> 
     88        <get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/deploy?path=${full.deploy.ant.archive}${deploy.context.root.argument}&amp;force=true&amp;name=${ant.project.name}" 
     89            dest="${gfv3.results.file}"/> 
     90        <delete file="${gfv3.results.file}"/> 
     91    </target> 
    5392    <target name="-undeploy-ant" depends="-init-cl-deployment-env" if="deploy.ant.enabled"> 
     93        <antcall target="-undeploy-without-pw"/> 
     94        <antcall target="-undeploy-with-pw"/> 
     95    </target> 
     96 
     97    <target name="-undeploy-without-pw" unless="gfv3.password"> 
    5498        <echo message="Undeploying ${deploy.ant.archive}"/> 
    5599        <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/>  <!-- do not forget to delete this! --> 
    56         <get src="${gfv3.url}/__asadmin/undeploy?name=${ant.project.name}" 
     100        <get src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}" 
    57101            dest="${gfv3.results.file}"/> 
    58102        <delete file="${gfv3.results.file}"/>     
    59103    </target> 
     104    <target name="-undeploy-with-pw" if="gfv3.password"> 
     105        <echo message="Undeploying ${deploy.ant.archive}"/> 
     106        <tempfile prefix="gfv3" property="gfv3.results.file" destdir="${java.io.tmpdir}"/>  <!-- do not forget to delete this! --> 
     107        <get username="${gfv3.username}" password="${gfv3.password}" src="${gfv3.admin.url}/__asadmin/undeploy?name=${ant.project.name}" 
     108            dest="${gfv3.results.file}"/> 
     109        <delete file="${gfv3.results.file}"/> 
     110    </target> 
    60111</project>