Changeset 82
- Timestamp:
- 04/11/07 15:06:49 (2 years ago)
- Files:
-
- AcmeIdp/trunk/build.xml (modified) (1 diff)
- AcmeIdp/trunk/nbproject/build-impl.xml (modified) (26 diffs)
- AcmeIdp/trunk/nbproject/genfiles.properties (modified) (1 diff)
- AcmeIdp/trunk/nbproject/project.properties (modified) (1 diff)
- AcmeIdp/trunk/nbproject/project.xml (modified) (1 diff)
- AcmeIdp/trunk/web/recv-authnrequest.jsp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
AcmeIdp/trunk/build.xml
r56 r82 25 25 -post-dist: called after jar building 26 26 -post-clean: called after cleaning build products 27 -pre-run-deploy: called before deploying 28 -post-run-deploy: called after deploying 27 29 28 30 Example of pluging an obfuscator after the compilation could look like AcmeIdp/trunk/nbproject/build-impl.xml
r68 r82 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <!-- 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 *** 5 5 6 For the purpose of easier reading the script7 is divided into following sections:8 - initialization9 - compilation10 - dist11 - execution12 - debugging13 - javadoc14 - junit compilation15 - junit execution16 - junit debugging17 - cleanup6 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 18 18 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"/> 21 22 <target name="default" depends="dist,javadoc" description="Build whole project."/> 22 23 <!-- 23 ====================== 24 INITIALIZATION SECTION 25 ====================== 26 --> 24 INITIALIZATION SECTION 25 --> 27 26 <target name="-pre-init"> 28 27 <!-- Empty placeholder for easier customization. --> … … 86 85 </condition> 87 86 <available file="${conf.dir}/MANIFEST.MF" property="has.custom.manifest"/> 87 <available file="${conf.dir}/persistence.xml" property="has.persistence.xml"/> 88 88 <condition property="do.war.package.with.custom.manifest"> 89 89 <and> … … 103 103 <property name="build.classes.dir.real" value="${build.classes.dir}"/> 104 104 <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> 105 113 </target> 106 114 <target name="-post-init"> … … 214 222 <attribute name="classname" default="${main.class}"/> 215 223 <attribute name="classpath" default="${debug.classpath}"/> 216 <attribute name="args" default="${application.args }"/>224 <attribute name="args" default="${application.args.param}"/> 217 225 <sequential> 218 226 <java fork="true" classname="@{classname}"> … … 239 247 <attribute name="propname"/> 240 248 <sequential> 241 <property name="temp.dirname" value="${dist.ear.dir}/temp"/>242 <mkdir dir="${dist.ear.dir}/temp"/>243 249 <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> 250 255 <condition value="${build.web.dir.real}/WEB-INF/lib" property="copy.to.dir_@{propname}"> 251 256 <isset property="hastlds_@{propname}"/> … … 265 270 <isset property="hastlds_@{propname}"/> 266 271 </condition> 267 <delete dir="${dist.ear.dir}/temp"/>268 272 </sequential> 269 273 </macrodef> … … 271 275 <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"/> 272 276 <!-- 273 ====================== 274 COMPILATION SECTION 275 ====================== 276 --> 277 COMPILATION SECTION 278 --> 277 279 <target name="deps-module-jar" depends="init" if="no.dist.ear.dir" unless="no.deps"/> 278 280 <target name="deps-ear-jar" depends="init" if="dist.ear.dir" unless="no.deps"/> … … 290 292 </copy> 291 293 </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"> 293 295 <webproject2:javac destdir="${build.classes.dir.real}"/> 294 296 <copy todir="${build.classes.dir.real}"> … … 300 302 <copy todir="${build.meta.inf.dir}"> 301 303 <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"/> 302 310 </copy> 303 311 </target> … … 318 326 </customize> 319 327 </webproject2:javac> 328 <copy todir="${build.classes.dir.real}"> 329 <fileset dir="${src.dir}" excludes="${build.classes.excludes}"/> 330 </copy> 320 331 </target> 321 332 <target name="-post-compile-single"> … … 362 373 </target> 363 374 <!-- 364 ====================== 365 DIST BUILDING SECTION 366 ====================== 367 --> 375 DIST BUILDING SECTION 376 --> 368 377 <target name="-pre-dist"> 369 378 <!-- Empty placeholder for easier customization. --> … … 398 407 <basename property="included.lib.libs.Javolution.classpath" file="${libs.Javolution.classpath}"/> 399 408 <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}"/>401 409 <basename property="included.lib.libs.OpenSAML.classpath.6" file="${libs.OpenSAML.classpath.libfile.6}"/> 402 410 <basename property="included.lib.libs.OpenSAML.classpath.5" file="${libs.OpenSAML.classpath.libfile.5}"/> … … 405 413 <basename property="included.lib.libs.OpenSAML.classpath.2" file="${libs.OpenSAML.classpath.libfile.2}"/> 406 414 <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"/>408 415 <copy-ear-war file="${libs.OpenSAML.classpath.libfile.6}" propname="included.lib.libs.OpenSAML.classpath.6.X"/> 409 416 <copy-ear-war file="${libs.OpenSAML.classpath.libfile.5}" propname="included.lib.libs.OpenSAML.classpath.5.X"/> … … 412 419 <copy-ear-war file="${libs.OpenSAML.classpath.libfile.2}" propname="included.lib.libs.OpenSAML.classpath.2.X"/> 413 420 <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"/> 414 423 <mkdir dir="${build.web.dir.real}/META-INF"/> 415 424 <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} "/> 417 426 </manifest> 418 427 <delete dir="${dist.ear.dir}/temp"/> … … 425 434 <copy file="${libs.ApacheCommons.classpath.libfile.1}" todir="${build.web.dir.real}/WEB-INF/lib"/> 426 435 <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"/>428 436 <copy file="${libs.OpenSAML.classpath.libfile.6}" todir="${build.web.dir.real}/WEB-INF/lib"/> 429 437 <copy file="${libs.OpenSAML.classpath.libfile.5}" todir="${build.web.dir.real}/WEB-INF/lib"/> … … 432 440 <copy file="${libs.OpenSAML.classpath.libfile.2}" todir="${build.web.dir.real}/WEB-INF/lib"/> 433 441 <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"/> 434 443 </target> 435 444 <target name="do-ear-dist" depends="init,compile,compile-jsps,-pre-dist,library-inclusion-in-manifest"> … … 447 456 <target name="dist-ear" depends="init,compile,-pre-dist,do-ear-dist,-post-dist" description="Build distribution (WAR) to be packaged into an EAR."/> 448 457 <!-- 449 ====================== 450 EXECUTION SECTION 451 ====================== 452 --> 458 EXECUTION SECTION 459 --> 453 460 <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"> 455 482 <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"/> 456 493 </target> 457 494 <target name="verify" depends="init,dist"> 458 495 <nbverify file="${dist.war}"/> 459 496 </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"> 461 507 <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> 462 557 </target> 463 558 <target name="run-main" depends="init,compile-single"> … … 466 561 </target> 467 562 <!-- 468 ====================== 469 DEBUGGING SECTION 470 ====================== 471 --> 563 DEBUGGING SECTION 564 --> 472 565 <target name="debug" description="Debug project in IDE." depends="init,compile,compile-jsps,-do-compile-single-jsp,dist" if="netbeans.home"> 473 566 <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"> 474 571 <nbjpdaconnect name="${name}" host="${jpda.host}" address="${jpda.address}" transport="${jpda.transport}"> 475 572 <classpath> … … 480 577 </sourcepath> 481 578 </nbjpdaconnect> 482 <antcall target="debug-display-browser"/>483 579 </target> 484 580 <target name="debug-display-browser" if="do.display.browser"> … … 503 599 <target name="debug-fix" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix"/> 504 600 <!-- 505 ====================== 506 JAVADOC SECTION 507 ====================== 508 --> 601 JAVADOC SECTION 602 --> 509 603 <target name="javadoc-build" depends="init"> 510 604 <mkdir dir="${dist.javadoc.dir}"/> … … 525 619 <target name="javadoc" depends="init,javadoc-build,javadoc-browse" description="Build Javadoc."/> 526 620 <!-- 527 528 ========================= 529 JUNIT COMPILATION SECTION 530 ========================= 531 --> 621 622 JUNIT COMPILATION SECTION 623 --> 532 624 <target name="-pre-pre-compile-test" if="have.tests" depends="init,compile"> 533 625 <mkdir dir="${build.test.classes.dir}"/> … … 559 651 </customize> 560 652 </webproject2:javac> 653 <copy todir="${build.test.classes.dir}"> 654 <fileset dir="${test.src.dir}" excludes="**/*.java"/> 655 </copy> 561 656 </target> 562 657 <target name="-post-compile-test-single"> … … 566 661 <target name="compile-test-single" depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single"/> 567 662 <!-- 568 569 ======================= 570 JUNIT EXECUTION SECTION 571 ======================= 572 --> 663 664 JUNIT EXECUTION SECTION 665 --> 573 666 <target name="-pre-test-run" if="have.tests" depends="init"> 574 667 <mkdir dir="${build.test.results.dir}"/> … … 595 688 <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."/> 596 689 <!-- 597 598 ======================= 599 JUNIT DEBUGGING SECTION 600 ======================= 601 --> 690 691 JUNIT DEBUGGING SECTION 692 --> 602 693 <target name="-debug-start-debuggee-test" if="have.tests" depends="init,compile-test"> 603 694 <fail unless="test.class">Must select one file in the IDE or set test.class</fail> … … 613 704 <target name="debug-fix-test" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix-test"/> 614 705 <!-- 615 616 ====================== 617 CLEANUP SECTION 618 ====================== 619 --> 706 707 CLEANUP SECTION 708 --> 620 709 <target name="deps-clean" depends="init" if="no.dist.ear.dir" unless="no.deps"/> 621 710 <target name="do-clean" depends="init"> … … 627 716 <fileset dir="${build.dir.to.clean}/WEB-INF/lib"/> 628 717 </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}"/> 635 719 <available file="${build.dir.to.clean}/WEB-INF/lib" type="dir" property="status.clean-failed"/> 636 720 <delete dir="${dist.dir}"/> AcmeIdp/trunk/nbproject/genfiles.properties
r72 r82 1 build.xml.data.CRC32= facf2cc92 build.xml.script.CRC32= ff870e9f3 build.xml.stylesheet.CRC32= b4cea8bf1 build.xml.data.CRC32=79b90a1a 2 build.xml.script.CRC32=6ed50798 3 build.xml.stylesheet.CRC32=95be3570 4 4 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 5 # 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= facf2cc97 nbproject/build-impl.xml.script.CRC32= a1bd25668 nbproject/build-impl.xml.stylesheet.CRC32= 8b52d23f6 nbproject/build-impl.xml.data.CRC32=79b90a1a 7 nbproject/build-impl.xml.script.CRC32=655cfe10 8 nbproject/build-impl.xml.stylesheet.CRC32=ac43bae1 AcmeIdp/trunk/nbproject/project.properties
r72 r82 26 26 ${libs.ApacheCommons.classpath}:\ 27 27 ${libs.Javolution.classpath}:\ 28 ${libs.OpenSAML.classpath} 28 ${libs.OpenSAML.classpath}:\ 29 ${libs.Velocity1.4.classpath} 29 30 # Space-separated list of extra javac options 30 31 javac.compilerargs= AcmeIdp/trunk/nbproject/project.xml
r72 r82 15 15 <path-in-war>WEB-INF/lib</path-in-war> 16 16 </library> 17 <library files=" 7">17 <library files="6"> 18 18 <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> 19 23 <path-in-war>WEB-INF/lib</path-in-war> 20 24 </library> AcmeIdp/trunk/web/recv-authnrequest.jsp
r72 r82 13 13 <%@ page import="org.opensaml.saml2.core.impl.*" %> 14 14 <%@ page import="org.opensaml.xml.*" %> 15 <%@ page import="org.opensaml.xml.parse.ParserPool" %> 15 16 <%@ page import="org.opensaml.xml.io.*" %> 16 17 <%@ page import="org.opensaml.xml.util.Base64" %> … … 22 23 String relayState; 23 24 24 relayState = request.getParameter("RelayState"); // grab the Base64 value25 relayState = new String(Base64.decode(relayState));26 27 28 25 // first bootstrap the entire opensaml library 29 26 org.opensaml.DefaultBootstrap.bootstrap(); 30 27 31 28 HTTPPostDecoder decode = new HTTPPostDecoder(); 29 decode.setParserPool( new ParserPool() ); 30 decode.setRequest(request); 31 decode.decode(); 32 relayState = decode.getRelayState(); 32 33 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(); 48 40 49 auth = (AuthnRequestImpl) decode.getSAMLMessage();41 auth = (AuthnRequestImpl) decode.getSAMLMessage(); 50 42 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); 91 51 */ 92 relayState = relayState.replace("<", "<");93 relayState = relayState.replace(">", ">");94 52 messageXML = messageXML.replace("<", "<"); 53 messageXML = messageXML.replace(">", ">"); 54 95 55 %> 96 56 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" … … 109 69 <h1>ACME Idp AuthnRequest Received</h1> 110 70 <table> 111 <tr><td><% out.println( relayState);%></td></tr>71 <tr><td><% out.println( messageXML );%></td></tr> 112 72 113 73 </table> 114 74 115 <p>12 March 2007</p>116 75 </body> 117 76 </html>
