Changeset 82

Show
Ignore:
Timestamp:
04/11/07 15:06:49 (2 years ago)
Author:
paulhethmon
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • AcmeIdp/trunk/build.xml

    r56 r82  
    2525      -post-dist:                called after jar building  
    2626      -post-clean:               called after cleaning build products  
     27      -pre-run-deploy:           called before deploying 
     28      -post-run-deploy:          called after deploying 
    2729 
    2830    Example of pluging an obfuscator after the compilation could look like  
  • AcmeIdp/trunk/nbproject/build-impl.xml

    r68 r82  
    11<?xml version="1.0" encoding="UTF-8"?> 
    22<!-- 
    3 *** GENERATED FROM project.xml - DO NOT EDIT  *** 
    4 ***         EDIT ../build.xml INSTEAD         *** 
     3        *** GENERATED FROM project.xml - DO NOT EDIT  *** 
     4        ***         EDIT ../build.xml INSTEAD         *** 
    55 
    6 For the purpose of easier reading the script 
    7 is divided into following sections: 
    8   - initialization 
    9   - compilation 
    10   - dist 
    11   - execution 
    12   - debugging 
    13   - javadoc 
    14   - junit compilation 
    15   - junit execution 
    16   - junit debugging 
    17   - cleanup 
     6        For the purpose of easier reading the script 
     7        is divided into following sections: 
     8        - initialization 
     9        - compilation 
     10        - dist 
     11        - execution 
     12        - debugging 
     13        - javadoc 
     14        - junit compilation 
     15        - junit execution 
     16        - junit debugging 
     17        - cleanup 
    1818 
    19 --> 
    20 <project name="AcmeIdp-impl" default="build" basedir=".." xmlns:webproject3="http://www.netbeans.org/ns/web-project/3" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:webproject1="http://www.netbeans.org/ns/web-project/1"> 
     19        --> 
     20<project name="AcmeIdp-impl" default="build" basedir=".." xmlns:webproject3="http://www.netbeans.org/ns/web-project/3" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:jaxws="http://www.netbeans.org/ns/jax-ws/1" xmlns:webproject1="http://www.netbeans.org/ns/web-project/1"> 
     21    <import file="ant-deploy.xml"/> 
    2122    <target name="default" depends="dist,javadoc" description="Build whole project."/> 
    2223    <!-- 
    23     ====================== 
    24     INITIALIZATION SECTION 
    25     ====================== 
    26     --> 
     24                INITIALIZATION SECTION 
     25            --> 
    2726    <target name="-pre-init"> 
    2827        <!-- Empty placeholder for easier customization. --> 
     
    8685        </condition> 
    8786        <available file="${conf.dir}/MANIFEST.MF" property="has.custom.manifest"/> 
     87        <available file="${conf.dir}/persistence.xml" property="has.persistence.xml"/> 
    8888        <condition property="do.war.package.with.custom.manifest"> 
    8989            <and> 
     
    103103        <property name="build.classes.dir.real" value="${build.classes.dir}"/> 
    104104        <property name="build.web.dir.real" value="${build.web.dir}"/> 
     105        <condition property="application.args.param" value="${application.args}" else=""> 
     106            <and> 
     107                <isset property="application.args"/> 
     108                <not> 
     109                    <equals arg1="${application.args}" arg2="" trim="true"/> 
     110                </not> 
     111            </and> 
     112        </condition> 
    105113    </target> 
    106114    <target name="-post-init"> 
     
    214222            <attribute name="classname" default="${main.class}"/> 
    215223            <attribute name="classpath" default="${debug.classpath}"/> 
    216             <attribute name="args" default="${application.args}"/> 
     224            <attribute name="args" default="${application.args.param}"/> 
    217225            <sequential> 
    218226                <java fork="true" classname="@{classname}"> 
     
    239247            <attribute name="propname"/> 
    240248            <sequential> 
    241                 <property name="temp.dirname" value="${dist.ear.dir}/temp"/> 
    242                 <mkdir dir="${dist.ear.dir}/temp"/> 
    243249                <basename property="base_@{propname}" file="@{file}"/> 
    244                 <unzip src="@{file}" dest="${temp.dirname}"> 
    245                     <patternset> 
    246                         <include name="META-INF/tlds/*.tld"/> 
    247                     </patternset> 
    248                 </unzip> 
    249                 <available file="${temp.dirname}/META-INF/tlds" type="dir" property="hastlds_@{propname}"/> 
     250                <zipfileset id="tld.files_@{propname}" src="@{file}" includes="META-INF/*.tld META-INF/tlds/*.tld"/> 
     251                <pathconvert property="tld.files.path_@{propname}" refid="tld.files_@{propname}"/> 
     252                <condition value="yes" property="hastlds_@{propname}"> 
     253                    <contains string="${tld.files.path_@{propname}}" substring=".tld" casesensitive="false"/> 
     254                </condition> 
    250255                <condition value="${build.web.dir.real}/WEB-INF/lib" property="copy.to.dir_@{propname}"> 
    251256                    <isset property="hastlds_@{propname}"/> 
     
    265270                    <isset property="hastlds_@{propname}"/> 
    266271                </condition> 
    267                 <delete dir="${dist.ear.dir}/temp"/> 
    268272            </sequential> 
    269273        </macrodef> 
     
    271275    <target name="init" depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-java,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-copy-ear-war"/> 
    272276    <!-- 
    273     ====================== 
    274     COMPILATION SECTION 
    275     ====================== 
    276     --> 
     277                COMPILATION SECTION 
     278            --> 
    277279    <target name="deps-module-jar" depends="init" if="no.dist.ear.dir" unless="no.deps"/> 
    278280    <target name="deps-ear-jar" depends="init" if="dist.ear.dir" unless="no.deps"/> 
     
    290292        </copy> 
    291293    </target> 
    292     <target name="-do-compile" depends="init, deps-jar, -pre-pre-compile, -pre-compile, -copy-manifest, -copy-webdir, library-inclusion-in-archive,library-inclusion-in-manifest" if="have.sources"> 
     294    <target name="-do-compile" depends="init, deps-jar, -pre-pre-compile, -pre-compile, -copy-manifest, -copy-persistence-xml, -copy-webdir, library-inclusion-in-archive,library-inclusion-in-manifest" if="have.sources"> 
    293295        <webproject2:javac destdir="${build.classes.dir.real}"/> 
    294296        <copy todir="${build.classes.dir.real}"> 
     
    300302        <copy todir="${build.meta.inf.dir}"> 
    301303            <fileset dir="${conf.dir}" includes="MANIFEST.MF"/> 
     304        </copy> 
     305    </target> 
     306    <target name="-copy-persistence-xml" if="has.persistence.xml"> 
     307        <mkdir dir="${build.web.dir.real}/WEB-INF/classes/META-INF"/> 
     308        <copy todir="${build.web.dir.real}/WEB-INF/classes/META-INF"> 
     309            <fileset dir="${conf.dir}" includes="persistence.xml"/> 
    302310        </copy> 
    303311    </target> 
     
    318326            </customize> 
    319327        </webproject2:javac> 
     328        <copy todir="${build.classes.dir.real}"> 
     329            <fileset dir="${src.dir}" excludes="${build.classes.excludes}"/> 
     330        </copy> 
    320331    </target> 
    321332    <target name="-post-compile-single"> 
     
    362373    </target> 
    363374    <!-- 
    364     ====================== 
    365     DIST BUILDING SECTION 
    366     ====================== 
    367     --> 
     375                DIST BUILDING SECTION 
     376            --> 
    368377    <target name="-pre-dist"> 
    369378        <!-- Empty placeholder for easier customization. --> 
     
    398407        <basename property="included.lib.libs.Javolution.classpath" file="${libs.Javolution.classpath}"/> 
    399408        <copy-ear-war file="${libs.Javolution.classpath}" propname="included.lib.libs.Javolution.classpath.X"/> 
    400         <basename property="included.lib.libs.OpenSAML.classpath.7" file="${libs.OpenSAML.classpath.libfile.7}"/> 
    401409        <basename property="included.lib.libs.OpenSAML.classpath.6" file="${libs.OpenSAML.classpath.libfile.6}"/> 
    402410        <basename property="included.lib.libs.OpenSAML.classpath.5" file="${libs.OpenSAML.classpath.libfile.5}"/> 
     
    405413        <basename property="included.lib.libs.OpenSAML.classpath.2" file="${libs.OpenSAML.classpath.libfile.2}"/> 
    406414        <basename property="included.lib.libs.OpenSAML.classpath.1" file="${libs.OpenSAML.classpath.libfile.1}"/> 
    407         <copy-ear-war file="${libs.OpenSAML.classpath.libfile.7}" propname="included.lib.libs.OpenSAML.classpath.7.X"/> 
    408415        <copy-ear-war file="${libs.OpenSAML.classpath.libfile.6}" propname="included.lib.libs.OpenSAML.classpath.6.X"/> 
    409416        <copy-ear-war file="${libs.OpenSAML.classpath.libfile.5}" propname="included.lib.libs.OpenSAML.classpath.5.X"/> 
     
    412419        <copy-ear-war file="${libs.OpenSAML.classpath.libfile.2}" propname="included.lib.libs.OpenSAML.classpath.2.X"/> 
    413420        <copy-ear-war file="${libs.OpenSAML.classpath.libfile.1}" propname="included.lib.libs.OpenSAML.classpath.1.X"/> 
     421        <basename property="included.lib.libs.Velocity1.4.classpath" file="${libs.Velocity1.4.classpath}"/> 
     422        <copy-ear-war file="${libs.Velocity1.4.classpath}" propname="included.lib.libs.Velocity1.4.classpath.X"/> 
    414423        <mkdir dir="${build.web.dir.real}/META-INF"/> 
    415424        <manifest file="${build.web.dir.real}/META-INF/MANIFEST.MF" mode="update"> 
    416             <attribute name="Class-Path" value="${included.lib.libs.ApacheCommons.classpath.1.X} ${included.lib.libs.ApacheCommons.classpath.2.X} ${included.lib.libs.ApacheCommons.classpath.3.X} ${included.lib.libs.ApacheCommons.classpath.4.X} ${included.lib.libs.ApacheCommons.classpath.5.X} ${included.lib.libs.Javolution.classpath} ${included.lib.libs.OpenSAML.classpath.1.X} ${included.lib.libs.OpenSAML.classpath.2.X} ${included.lib.libs.OpenSAML.classpath.3.X} ${included.lib.libs.OpenSAML.classpath.4.X} ${included.lib.libs.OpenSAML.classpath.5.X} ${included.lib.libs.OpenSAML.classpath.6.X} ${included.lib.libs.OpenSAML.classpath.7.X} "/> 
     425            <attribute name="Class-Path" value="${included.lib.libs.ApacheCommons.classpath.1.X} ${included.lib.libs.ApacheCommons.classpath.2.X} ${included.lib.libs.ApacheCommons.classpath.3.X} ${included.lib.libs.ApacheCommons.classpath.4.X} ${included.lib.libs.ApacheCommons.classpath.5.X} ${included.lib.libs.Javolution.classpath} ${included.lib.libs.OpenSAML.classpath.1.X} ${included.lib.libs.OpenSAML.classpath.2.X} ${included.lib.libs.OpenSAML.classpath.3.X} ${included.lib.libs.OpenSAML.classpath.4.X} ${included.lib.libs.OpenSAML.classpath.5.X} ${included.lib.libs.OpenSAML.classpath.6.X} ${included.lib.libs.Velocity1.4.classpath} "/> 
    417426        </manifest> 
    418427        <delete dir="${dist.ear.dir}/temp"/> 
     
    425434        <copy file="${libs.ApacheCommons.classpath.libfile.1}" todir="${build.web.dir.real}/WEB-INF/lib"/> 
    426435        <copy file="${libs.Javolution.classpath}" todir="${build.web.dir.real}/WEB-INF/lib"/> 
    427         <copy file="${libs.OpenSAML.classpath.libfile.7}" todir="${build.web.dir.real}/WEB-INF/lib"/> 
    428436        <copy file="${libs.OpenSAML.classpath.libfile.6}" todir="${build.web.dir.real}/WEB-INF/lib"/> 
    429437        <copy file="${libs.OpenSAML.classpath.libfile.5}" todir="${build.web.dir.real}/WEB-INF/lib"/> 
     
    432440        <copy file="${libs.OpenSAML.classpath.libfile.2}" todir="${build.web.dir.real}/WEB-INF/lib"/> 
    433441        <copy file="${libs.OpenSAML.classpath.libfile.1}" todir="${build.web.dir.real}/WEB-INF/lib"/> 
     442        <copy file="${libs.Velocity1.4.classpath}" todir="${build.web.dir.real}/WEB-INF/lib"/> 
    434443    </target> 
    435444    <target name="do-ear-dist" depends="init,compile,compile-jsps,-pre-dist,library-inclusion-in-manifest"> 
     
    447456    <target name="dist-ear" depends="init,compile,-pre-dist,do-ear-dist,-post-dist" description="Build distribution (WAR) to be packaged into an EAR."/> 
    448457    <!-- 
    449     ====================== 
    450     EXECUTION SECTION 
    451     ====================== 
    452     --> 
     458                EXECUTION SECTION 
     459            --> 
    453460    <target name="run" depends="run-deploy,run-display-browser" description="Deploy to server and show in browser."/> 
    454     <target name="run-deploy" depends="init,compile,compile-jsps,-do-compile-single-jsp,dist"> 
     461    <target name="-pre-run-deploy"> 
     462        <!-- Empty placeholder for easier customization. --> 
     463        <!-- You can override this target in the ../build.xml file. --> 
     464    </target> 
     465    <target name="-post-run-deploy"> 
     466        <!-- Empty placeholder for easier customization. --> 
     467        <!-- You can override this target in the ../build.xml file. --> 
     468    </target> 
     469    <target name="-pre-nbmodule-run-deploy"> 
     470        <!-- Empty placeholder for easier customization. --> 
     471        <!-- This target can be overriden by NetBeans modules. Don't override it directly, use -pre-run-deploy task instead. --> 
     472    </target> 
     473    <target name="-post-nbmodule-run-deploy"> 
     474        <!-- Empty placeholder for easier customization. --> 
     475        <!-- This target can be overriden by NetBeans modules. Don't override it directly, use -post-run-deploy task instead. --> 
     476    </target> 
     477    <target name="-run-deploy-am"> 
     478        <!-- Task to deploy to the Access Manager runtime. --> 
     479    </target> 
     480    <target name="run-deploy" depends="init,compile,compile-jsps,-do-compile-single-jsp,dist,-pre-run-deploy,-pre-nbmodule-run-deploy,-run-deploy-nb,-init-deploy-ant,-deploy-ant,-run-deploy-am,-post-nbmodule-run-deploy,-post-run-deploy"/> 
     481    <target name="-run-deploy-nb" if="netbeans.home"> 
    455482        <nbdeploy debugmode="false" clientUrlPart="${client.urlPart}" forceRedeploy="${forceRedeploy}"/> 
     483    </target> 
     484    <target name="-init-deploy-ant" unless="netbeans.home"> 
     485        <property name="deploy.ant.archive" value="${dist.war}"/> 
     486        <property name="deploy.ant.docbase.dir" value="${web.docbase.dir}"/> 
     487        <property name="deploy.ant.resource.dir" value="${resource.dir}"/> 
     488        <property name="deploy.ant.enabled" value="true"/> 
     489    </target> 
     490    <target name="run-undeploy" depends="dist,-run-undeploy-nb,-init-deploy-ant,-undeploy-ant"/> 
     491    <target name="-run-undeploy-nb" if="netbeans.home"> 
     492        <fail message="Undeploy is not supported from within the IDE"/> 
    456493    </target> 
    457494    <target name="verify" depends="init,dist"> 
    458495        <nbverify file="${dist.war}"/> 
    459496    </target> 
    460     <target name="run-display-browser" if="do.display.browser" depends="run-deploy"> 
     497    <target name="run-display-browser" depends="run-deploy,-init-display-browser,-display-browser-nb,-display-browser-cl"/> 
     498    <target name="-init-display-browser" if="do.display.browser"> 
     499        <condition property="do.display.browser.nb"> 
     500            <isset property="netbeans.home"/> 
     501        </condition> 
     502        <condition property="do.display.browser.cl"> 
     503            <isset property="deploy.ant.enabled"/> 
     504        </condition> 
     505    </target> 
     506    <target name="-display-browser-nb" if="do.display.browser.nb"> 
    461507        <nbbrowse url="${client.url}"/> 
     508    </target> 
     509    <target name="-get-browser" if="do.display.browser.cl" unless="browser"> 
     510        <condition property="browser" value="rundll32"> 
     511            <os family="windows"/> 
     512        </condition> 
     513        <condition property="browser.args" value="url.dll,FileProtocolHandler" else=""> 
     514            <os family="windows"/> 
     515        </condition> 
     516        <condition property="browser" value="/usr/bin/open"> 
     517            <os family="mac"/> 
     518        </condition> 
     519        <property environment="env"/> 
     520        <condition property="browser" value="${env.BROWSER}"> 
     521            <isset property="env.BROWSER"/> 
     522        </condition> 
     523        <condition property="browser" value="/usr/bin/firefox"> 
     524            <available file="/usr/bin/firefox"/> 
     525        </condition> 
     526        <condition property="browser" value="/usr/local/firefox/firefox"> 
     527            <available file="/usr/local/firefox/firefox"/> 
     528        </condition> 
     529        <condition property="browser" value="/usr/bin/mozilla"> 
     530            <available file="/usr/bin/mozilla"/> 
     531        </condition> 
     532        <condition property="browser" value="/usr/local/mozilla/mozilla"> 
     533            <available file="/usr/local/mozilla/mozilla"/> 
     534        </condition> 
     535        <condition property="browser" value="/usr/sfw/lib/firefox/firefox"> 
     536            <available file="/usr/sfw/lib/firefox/firefox"/> 
     537        </condition> 
     538        <condition property="browser" value="/opt/csw/bin/firefox"> 
     539            <available file="/opt/csw/bin/firefox"/> 
     540        </condition> 
     541        <condition property="browser" value="/usr/sfw/lib/mozilla/mozilla"> 
     542            <available file="/usr/sfw/lib/mozilla/mozilla"/> 
     543        </condition> 
     544        <condition property="browser" value="/opt/csw/bin/mozilla"> 
     545            <available file="/opt/csw/bin/mozilla"/> 
     546        </condition> 
     547    </target> 
     548    <target name="-display-browser-cl" depends="-get-browser" if="do.display.browser.cl"> 
     549        <fail unless="browser"> 
     550                    Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable. 
     551                </fail> 
     552        <property name="browse.url" value="${deploy.ant.client.url}${client.urlPart}"/> 
     553        <echo>Launching ${browse.url}</echo> 
     554        <exec executable="${browser}" spawn="true"> 
     555            <arg line="${browser.args} ${browse.url}"/> 
     556        </exec> 
    462557    </target> 
    463558    <target name="run-main" depends="init,compile-single"> 
     
    466561    </target> 
    467562    <!-- 
    468     ====================== 
    469     DEBUGGING SECTION 
    470     ====================== 
    471     --> 
     563                DEBUGGING SECTION 
     564            --> 
    472565    <target name="debug" description="Debug project in IDE." depends="init,compile,compile-jsps,-do-compile-single-jsp,dist" if="netbeans.home"> 
    473566        <nbdeploy debugmode="true" clientUrlPart="${client.urlPart}"/> 
     567        <antcall target="connect-debugger"/> 
     568        <antcall target="debug-display-browser"/> 
     569    </target> 
     570    <target name="connect-debugger" unless="is.debugged"> 
    474571        <nbjpdaconnect name="${name}" host="${jpda.host}" address="${jpda.address}" transport="${jpda.transport}"> 
    475572            <classpath> 
     
    480577            </sourcepath> 
    481578        </nbjpdaconnect> 
    482         <antcall target="debug-display-browser"/> 
    483579    </target> 
    484580    <target name="debug-display-browser" if="do.display.browser"> 
     
    503599    <target name="debug-fix" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix"/> 
    504600    <!-- 
    505     ====================== 
    506     JAVADOC SECTION 
    507     ====================== 
    508     --> 
     601                JAVADOC SECTION 
     602            --> 
    509603    <target name="javadoc-build" depends="init"> 
    510604        <mkdir dir="${dist.javadoc.dir}"/> 
     
    525619    <target name="javadoc" depends="init,javadoc-build,javadoc-browse" description="Build Javadoc."/> 
    526620    <!-- 
    527  
    528     ========================= 
    529     JUNIT COMPILATION SECTION 
    530     ========================= 
    531     --> 
     621                 
     622                JUNIT COMPILATION SECTION 
     623            --> 
    532624    <target name="-pre-pre-compile-test" if="have.tests" depends="init,compile"> 
    533625        <mkdir dir="${build.test.classes.dir}"/> 
     
    559651            </customize> 
    560652        </webproject2:javac> 
     653        <copy todir="${build.test.classes.dir}"> 
     654            <fileset dir="${test.src.dir}" excludes="**/*.java"/> 
     655        </copy> 
    561656    </target> 
    562657    <target name="-post-compile-test-single"> 
     
    566661    <target name="compile-test-single" depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single"/> 
    567662    <!-- 
    568  
    569     ======================= 
    570     JUNIT EXECUTION SECTION 
    571     ======================= 
    572     --> 
     663                 
     664                JUNIT EXECUTION SECTION 
     665            --> 
    573666    <target name="-pre-test-run" if="have.tests" depends="init"> 
    574667        <mkdir dir="${build.test.results.dir}"/> 
     
    595688    <target name="test-single" depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test."/> 
    596689    <!-- 
    597  
    598     ======================= 
    599     JUNIT DEBUGGING SECTION 
    600     ======================= 
    601     --> 
     690                 
     691                JUNIT DEBUGGING SECTION 
     692            --> 
    602693    <target name="-debug-start-debuggee-test" if="have.tests" depends="init,compile-test"> 
    603694        <fail unless="test.class">Must select one file in the IDE or set test.class</fail> 
     
    613704    <target name="debug-fix-test" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix-test"/> 
    614705    <!-- 
    615  
    616     ====================== 
    617     CLEANUP SECTION 
    618     ====================== 
    619     --> 
     706                 
     707                CLEANUP SECTION 
     708            --> 
    620709    <target name="deps-clean" depends="init" if="no.dist.ear.dir" unless="no.deps"/> 
    621710    <target name="do-clean" depends="init"> 
     
    627716            <fileset dir="${build.dir.to.clean}/WEB-INF/lib"/> 
    628717        </delete> 
    629         <delete includeEmptyDirs="true"> 
    630             <fileset dir="."> 
    631                 <include name="${build.dir}/**"/> 
    632                 <exclude name="${build.dir.to.clean}/WEB-INF/lib/**"/> 
    633             </fileset> 
    634         </delete> 
     718        <delete dir="${build.dir}"/> 
    635719        <available file="${build.dir.to.clean}/WEB-INF/lib" type="dir" property="status.clean-failed"/> 
    636720        <delete dir="${dist.dir}"/> 
  • AcmeIdp/trunk/nbproject/genfiles.properties

    r72 r82  
    1 build.xml.data.CRC32=facf2cc9 
    2 build.xml.script.CRC32=ff870e9f 
    3 build.xml.stylesheet.CRC32=b4cea8bf 
     1build.xml.data.CRC32=79b90a1a 
     2build.xml.script.CRC32=6ed50798 
     3build.xml.stylesheet.CRC32=95be3570 
    44# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 
    55# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 
    6 nbproject/build-impl.xml.data.CRC32=facf2cc9 
    7 nbproject/build-impl.xml.script.CRC32=a1bd2566 
    8 nbproject/build-impl.xml.stylesheet.CRC32=8b52d23f 
     6nbproject/build-impl.xml.data.CRC32=79b90a1a 
     7nbproject/build-impl.xml.script.CRC32=655cfe10 
     8nbproject/build-impl.xml.stylesheet.CRC32=ac43bae1 
  • AcmeIdp/trunk/nbproject/project.properties

    r72 r82  
    2626    ${libs.ApacheCommons.classpath}:\ 
    2727    ${libs.Javolution.classpath}:\ 
    28     ${libs.OpenSAML.classpath} 
     28    ${libs.OpenSAML.classpath}:\ 
     29    ${libs.Velocity1.4.classpath} 
    2930# Space-separated list of extra javac options 
    3031javac.compilerargs= 
  • AcmeIdp/trunk/nbproject/project.xml

    r72 r82  
    1515                    <path-in-war>WEB-INF/lib</path-in-war> 
    1616                </library> 
    17                 <library files="7"> 
     17                <library files="6"> 
    1818                    <file>${libs.OpenSAML.classpath}</file> 
     19                    <path-in-war>WEB-INF/lib</path-in-war> 
     20                </library> 
     21                <library files="1"> 
     22                    <file>${libs.Velocity1.4.classpath}</file> 
    1923                    <path-in-war>WEB-INF/lib</path-in-war> 
    2024                </library> 
  • AcmeIdp/trunk/web/recv-authnrequest.jsp

    r72 r82  
    1313<%@ page import="org.opensaml.saml2.core.impl.*" %> 
    1414<%@ page import="org.opensaml.xml.*" %> 
     15<%@ page import="org.opensaml.xml.parse.ParserPool" %> 
    1516<%@ page import="org.opensaml.xml.io.*" %> 
    1617<%@ page import="org.opensaml.xml.util.Base64" %> 
     
    2223  String relayState; 
    2324   
    24   relayState = request.getParameter("RelayState"); // grab the Base64 value 
    25   relayState = new String(Base64.decode(relayState)); 
    26   
    27   
    2825  // first bootstrap the entire opensaml library 
    2926  org.opensaml.DefaultBootstrap.bootstrap(); 
    3027   
    3128  HTTPPostDecoder decode = new HTTPPostDecoder(); 
     29  decode.setParserPool( new ParserPool() ); 
     30  decode.setRequest(request); 
     31  decode.decode(); 
     32  relayState = decode.getRelayState(); 
    3233   
    33   try { 
    34     decode.setRequest(request); 
    35     decode.decode(); 
    36     relayState = decode.getRelayState(); 
    37   } catch (BindingException be) { 
    38     response.sendError(500, "No valid SAML 2.0 RelayState found in the request. [" + be.getMessage() + "]"); 
    39 //    response.sendError(500, "No valid SAML 2.0 RelayState found in the request. [" + be.getMessage() + "] [" + be.getCause().getMessage() + "]"); 
    40     return; 
    41   } 
    42     // Use the OpenSAML Configuration singleton to get a builder factory object 
    43     XMLObjectBuilderFactory builderFactory = org.opensaml.Configuration.getBuilderFactory(); 
    44     // First get a builder for AuthnRequest 
    45     AuthnRequestBuilder arb = (AuthnRequestBuilder) builderFactory.getBuilder(AuthnRequest.DEFAULT_ELEMENT_NAME); 
    46     // build an AuthnRequest object 
    47     AuthnRequestImpl auth = (AuthnRequestImpl) arb.buildObject(); 
     34  // Use the OpenSAML Configuration singleton to get a builder factory object 
     35  XMLObjectBuilderFactory builderFactory = org.opensaml.Configuration.getBuilderFactory(); 
     36  // First get a builder for AuthnRequest 
     37  AuthnRequestBuilder arb = (AuthnRequestBuilder) builderFactory.getBuilder(AuthnRequest.DEFAULT_ELEMENT_NAME); 
     38  // build an AuthnRequest object 
     39  AuthnRequestImpl auth = (AuthnRequestImpl) arb.buildObject(); 
    4840 
    49     auth = (AuthnRequestImpl) decode.getSAMLMessage(); 
     41  auth = (AuthnRequestImpl) decode.getSAMLMessage(); 
    5042   
    51    
    52    
    53 //  UnmarshallerFactory unmarshallerFactory = org.opensaml.Configuration.getUnmarshallerFactory(); 
    54      
    55 //  Unmarshaller unmarshaller = unmarshallerFactory.getUnmarshaller(doc); 
    56    
    57    
    58 /* 
    59 //    Configuration.getConfiguration(); 
    60     // And one for Issuer 
    61     IssuerBuilder ib = (IssuerBuilder) builderFactory.getBuilder(Issuer.DEFAULT_ELEMENT_NAME); 
    62     // And one for Subject 
    63     SubjectBuilder sb = (SubjectBuilder) builderFactory.getBuilder(Subject.DEFAULT_ELEMENT_NAME); 
    64     // Build the Issuer object 
    65 //    Issuer newIssuer = ib.buildObject(SAMLConstants.SAML20_NS, "AcmeMLS", SAMLConstants.SAML20_PREFIX); 
    66     Issuer newIssuer = ib.buildObject(); 
    67     newIssuer.setValue("AcmeMLS"); 
    68     auth.setIssuer(newIssuer); 
    69     auth.setProviderName("AcmeProviderName"); 
    70     auth.setAssertionConsumerServiceURL("http://www.acmemls.com"); 
    71     auth.setDestination("http://www.acmeidp.com"); 
    72     //auth.setAssertionConsumerServiceIndex(0); 
    73     //auth.setAttributeConsumingServiceIndex(0); 
    74     auth.setID("someuniqueidhere"); 
    75     auth.setVersion(org.opensaml.common.SAMLVersion.VERSION_20); 
    76     DateTime dt = new DateTime(); 
    77     auth.setIssueInstant(dt); 
    78      
    79      
    80     MarshallerFactory marshallerFactory = org.opensaml.Configuration.getMarshallerFactory(); 
    81      
    82     Marshaller marshaller = marshallerFactory.getMarshaller(auth); 
    83      
    84     String msg = ""; 
    85     Element authElement = null; 
    86     if (marshaller == null) { 
    87       msg = "unable to locate marshaller for [" + newIssuer.getElementQName() + "]"; 
    88     } else { 
    89       authElement = marshaller.marshall(auth); 
    90     } 
     43  Marshaller marshaller = org.opensaml.Configuration.getMarshallerFactory().getMarshaller(auth); 
     44  Element authDOM = marshaller.marshall(auth); 
     45  String messageXML = XMLHelper.nodeToString(authDOM); 
     46/*   
     47  UnmarshallerFactory unmarshallerFactory = org.opensaml.Configuration.getUnmarshallerFactory(); 
     48  Unmarshaller unmarshaller = unmarshallerFactory.getUnmarshaller(auth); 
     49  Element authDOM = unmarshaller.unmarshall(auth); 
     50  String messageXML = XMLHelper.nodeToString(authDOM); 
    9151*/ 
    92   relayState = relayState.replace("<", "&lt;"); 
    93   relayState = relayState.replace(">", "&gt;"); 
    94      
     52  messageXML = messageXML.replace("<", "&lt;"); 
     53  messageXML = messageXML.replace(">", "&gt;"); 
     54 
    9555%>     
    9656<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
     
    10969    <h1>ACME Idp AuthnRequest Received</h1> 
    11070    <table> 
    111       <tr><td><% out.println( relayState );%></td></tr> 
     71      <tr><td><% out.println( messageXML );%></td></tr> 
    11272 
    11373    </table> 
    11474     
    115     <p>12 March 2007</p> 
    11675    </body> 
    11776</html>