svnno****@sourc*****
svnno****@sourc*****
2008年 6月 11日 (水) 22:36:41 JST
Revision: 975 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=975 Author: shinsuke Date: 2008-06-11 22:36:41 +0900 (Wed, 11 Jun 2008) Log Message: ----------- ant installer beta0.8 Added Paths: ----------- pal-portal/modules/ant-installer/trunk/CHANGELOG.txt pal-portal/modules/ant-installer/trunk/antinstaller-icon.png pal-portal/modules/ant-installer/trunk/antlib/ pal-portal/modules/ant-installer/trunk/antlib/ant-antlr.jar pal-portal/modules/ant-installer/trunk/antlib/ant-apache-bcel.jar pal-portal/modules/ant-installer/trunk/antlib/ant-apache-bsf.jar pal-portal/modules/ant-installer/trunk/antlib/ant-apache-log4j.jar pal-portal/modules/ant-installer/trunk/antlib/ant-apache-oro.jar pal-portal/modules/ant-installer/trunk/antlib/ant-apache-regexp.jar pal-portal/modules/ant-installer/trunk/antlib/ant-apache-resolver.jar pal-portal/modules/ant-installer/trunk/antlib/ant-commons-logging.jar pal-portal/modules/ant-installer/trunk/antlib/ant-commons-net.jar pal-portal/modules/ant-installer/trunk/antlib/ant-jai.jar pal-portal/modules/ant-installer/trunk/antlib/ant-javamail.jar pal-portal/modules/ant-installer/trunk/antlib/ant-jdepend.jar pal-portal/modules/ant-installer/trunk/antlib/ant-jmf.jar pal-portal/modules/ant-installer/trunk/antlib/ant-jsch.jar pal-portal/modules/ant-installer/trunk/antlib/ant-junit.jar pal-portal/modules/ant-installer/trunk/antlib/ant-launcher.jar pal-portal/modules/ant-installer/trunk/antlib/ant-netrexx.jar pal-portal/modules/ant-installer/trunk/antlib/ant-nodeps.jar pal-portal/modules/ant-installer/trunk/antlib/ant-starteam.jar pal-portal/modules/ant-installer/trunk/antlib/ant-stylebook.jar pal-portal/modules/ant-installer/trunk/antlib/ant-swing.jar pal-portal/modules/ant-installer/trunk/antlib/ant-testutil.jar pal-portal/modules/ant-installer/trunk/antlib/ant-trax.jar pal-portal/modules/ant-installer/trunk/antlib/ant-weblogic.jar pal-portal/modules/ant-installer/trunk/antlib/ant.jar pal-portal/modules/ant-installer/trunk/antlib/junit-3.8.jar pal-portal/modules/ant-installer/trunk/antlib/xercesImpl.jar pal-portal/modules/ant-installer/trunk/antlib/xml-apis.jar pal-portal/modules/ant-installer/trunk/build/ pal-portal/modules/ant-installer/trunk/build/build.xml pal-portal/modules/ant-installer/trunk/demo/ pal-portal/modules/ant-installer/trunk/demo/DEMO-README.txt pal-portal/modules/ant-installer/trunk/demo/README.txt pal-portal/modules/ant-installer/trunk/demo/antinstaller-icon.ico pal-portal/modules/ant-installer/trunk/demo/artifacts/ pal-portal/modules/ant-installer/trunk/demo/artifacts/demo-installer.jar pal-portal/modules/ant-installer/trunk/demo/artifacts/installpack.zip pal-portal/modules/ant-installer/trunk/demo/bin/ pal-portal/modules/ant-installer/trunk/demo/bin/run.cmd pal-portal/modules/ant-installer/trunk/demo/bin/run.sh pal-portal/modules/ant-installer/trunk/demo/build-demo.xml pal-portal/modules/ant-installer/trunk/demo/checkConfig.sh pal-portal/modules/ant-installer/trunk/demo/classes/ pal-portal/modules/ant-installer/trunk/demo/classes/org/ pal-portal/modules/ant-installer/trunk/demo/classes/org/tp23/ pal-portal/modules/ant-installer/trunk/demo/classes/org/tp23/demo/ pal-portal/modules/ant-installer/trunk/demo/classes/org/tp23/demo/Demonstration.class pal-portal/modules/ant-installer/trunk/demo/classes/resources/ pal-portal/modules/ant-installer/trunk/demo/classes/resources/demo.png pal-portal/modules/ant-installer/trunk/demo/config/ pal-portal/modules/ant-installer/trunk/demo/config/demo.properties pal-portal/modules/ant-installer/trunk/demo/config/example-config.xml pal-portal/modules/ant-installer/trunk/demo/doc/ pal-portal/modules/ant-installer/trunk/demo/doc/allclasses-frame.html pal-portal/modules/ant-installer/trunk/demo/doc/allclasses-noframe.html pal-portal/modules/ant-installer/trunk/demo/doc/constant-values.html pal-portal/modules/ant-installer/trunk/demo/doc/deprecated-list.html pal-portal/modules/ant-installer/trunk/demo/doc/help-doc.html pal-portal/modules/ant-installer/trunk/demo/doc/index-all.html pal-portal/modules/ant-installer/trunk/demo/doc/index.html pal-portal/modules/ant-installer/trunk/demo/doc/org/ pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/ pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/ pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/Demonstration.html pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-frame.html pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-summary.html pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-tree.html pal-portal/modules/ant-installer/trunk/demo/doc/overview-tree.html pal-portal/modules/ant-installer/trunk/demo/doc/package-list pal-portal/modules/ant-installer/trunk/demo/doc/packages.html pal-portal/modules/ant-installer/trunk/demo/doc/resources/ pal-portal/modules/ant-installer/trunk/demo/doc/resources/inherit.gif pal-portal/modules/ant-installer/trunk/demo/doc/stylesheet.css pal-portal/modules/ant-installer/trunk/demo/install.cmd pal-portal/modules/ant-installer/trunk/demo/install.sh pal-portal/modules/ant-installer/trunk/demo/installclasspath/ pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/ pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/GPL.txt pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/gkmain_inv.png pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/greens.png pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/rockstiles.png pal-portal/modules/ant-installer/trunk/demo/installer/ pal-portal/modules/ant-installer/trunk/demo/installer/antinstall-config.xml pal-portal/modules/ant-installer/trunk/demo/installer/build.xml pal-portal/modules/ant-installer/trunk/demo/src/ pal-portal/modules/ant-installer/trunk/demo/src/org/ pal-portal/modules/ant-installer/trunk/demo/src/org/tp23/ pal-portal/modules/ant-installer/trunk/demo/src/org/tp23/demo/ pal-portal/modules/ant-installer/trunk/demo/src/org/tp23/demo/Demonstration.java pal-portal/modules/ant-installer/trunk/demo/src/resources/ pal-portal/modules/ant-installer/trunk/demo/src/resources/demo.png pal-portal/modules/ant-installer/trunk/icons/ pal-portal/modules/ant-installer/trunk/icons/128x128/ pal-portal/modules/ant-installer/trunk/icons/128x128/apps/ pal-portal/modules/ant-installer/trunk/icons/128x128/apps/AntInstaller.png pal-portal/modules/ant-installer/trunk/icons/16x16/ pal-portal/modules/ant-installer/trunk/icons/16x16/apps/ pal-portal/modules/ant-installer/trunk/icons/16x16/apps/AntInstaller.png pal-portal/modules/ant-installer/trunk/icons/22x22/ pal-portal/modules/ant-installer/trunk/icons/22x22/apps/ pal-portal/modules/ant-installer/trunk/icons/22x22/apps/AntInstaller.png pal-portal/modules/ant-installer/trunk/icons/24x24/ pal-portal/modules/ant-installer/trunk/icons/24x24/AntInstaller.ico pal-portal/modules/ant-installer/trunk/icons/24x24/apps/ pal-portal/modules/ant-installer/trunk/icons/24x24/apps/AntInstaller.png pal-portal/modules/ant-installer/trunk/icons/32x32/ pal-portal/modules/ant-installer/trunk/icons/32x32/apps/ pal-portal/modules/ant-installer/trunk/icons/32x32/apps/AntInstaller.png pal-portal/modules/ant-installer/trunk/icons/48x48/ pal-portal/modules/ant-installer/trunk/icons/48x48/AntInstaller.png pal-portal/modules/ant-installer/trunk/icons/48x48/apps/ pal-portal/modules/ant-installer/trunk/icons/48x48/apps/AntInstaller.png pal-portal/modules/ant-installer/trunk/icons/64x64/ pal-portal/modules/ant-installer/trunk/icons/64x64/apps/ pal-portal/modules/ant-installer/trunk/icons/64x64/apps/AntInstaller.png pal-portal/modules/ant-installer/trunk/images/ pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo-50.png pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo-bw.png pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo-onwhite.png pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo.png pal-portal/modules/ant-installer/trunk/images/README.txt pal-portal/modules/ant-installer/trunk/images/extract-images/ pal-portal/modules/ant-installer/trunk/images/extract-images/crystal/ pal-portal/modules/ant-installer/trunk/images/extract-images/crystal/extract-image.png pal-portal/modules/ant-installer/trunk/images/extract-images/crystal-images.txt pal-portal/modules/ant-installer/trunk/images/extract-images/crystal2/ pal-portal/modules/ant-installer/trunk/images/extract-images/crystal2/extract-image.png pal-portal/modules/ant-installer/trunk/images/extract-images/crystal3/ pal-portal/modules/ant-installer/trunk/images/extract-images/crystal3/extract-image.png pal-portal/modules/ant-installer/trunk/images/extract-images/default/ pal-portal/modules/ant-installer/trunk/images/extract-images/default/extract-image.png pal-portal/modules/ant-installer/trunk/images/extract-images/default-images.txt pal-portal/modules/ant-installer/trunk/images/navicons/ pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/ pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/ pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/ pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/LICENSE pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/back.png pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/cancel.png pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/finish.png pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/next.png pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/ok.png pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/showdetails.png pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/ pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/ pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/ pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/LICENSE pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/back.png pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/cancel.png pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/finish.png pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/next.png pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/ok.png pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/showdetails.png pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/ pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/ pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/ pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/LICENSE pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/back.png pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/cancel.png pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/finish.png pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/next.png pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/ok.png pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/showdetails.png pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/ pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/ pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/ pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/LICENSE pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/back.png pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/cancel.png pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/finish.png pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/next.png pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/ok.png pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/showdetails.png pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/ pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/ pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/ pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/LICENSE pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/back.png pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/cancel.png pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/finish.png pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/next.png pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/ok.png pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/showdetails.png pal-portal/modules/ant-installer/trunk/images/resources/ pal-portal/modules/ant-installer/trunk/images/resources/AntInstaller.png pal-portal/modules/ant-installer/trunk/images/resources/LICENSE-ant-install.txt pal-portal/modules/ant-installer/trunk/images/resources/antbar.png pal-portal/modules/ant-installer/trunk/images/resources/banner23.png pal-portal/modules/ant-installer/trunk/images/resources/extract-image.png pal-portal/modules/ant-installer/trunk/images/resources/gkmain_inv.png pal-portal/modules/ant-installer/trunk/images/resources/gothbar.gif pal-portal/modules/ant-installer/trunk/images/resources/greens.png pal-portal/modules/ant-installer/trunk/images/resources/icons/ pal-portal/modules/ant-installer/trunk/images/resources/makewavesdawn.png pal-portal/modules/ant-installer/trunk/images/resources/rockstiles.png pal-portal/modules/ant-installer/trunk/images/titlebars/ pal-portal/modules/ant-installer/trunk/images/titlebars/antbar.png pal-portal/modules/ant-installer/trunk/images/titlebars/banner23.png pal-portal/modules/ant-installer/trunk/images/titlebars/default-images.txt pal-portal/modules/ant-installer/trunk/images/titlebars/empty-template.png pal-portal/modules/ant-installer/trunk/images/titlebars/gothbar.gif pal-portal/modules/ant-installer/trunk/images/titlebars/greens.png pal-portal/modules/ant-installer/trunk/images/titlebars/makewavesdawn.png pal-portal/modules/ant-installer/trunk/images/titlebars/rockstiles.png pal-portal/modules/ant-installer/trunk/images/tool-credits.txt pal-portal/modules/ant-installer/trunk/kde-icons/ pal-portal/modules/ant-installer/trunk/kde-icons/AntInstaller.png pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-demo.desktop pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-docs.desktop pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-wizard.desktop pal-portal/modules/ant-installer/trunk/lib/ pal-portal/modules/ant-installer/trunk/lib/LICENSE-ant-install.txt pal-portal/modules/ant-installer/trunk/lib/LICENSE-ant.txt pal-portal/modules/ant-installer/trunk/lib/LICENSE-dom.txt pal-portal/modules/ant-installer/trunk/lib/LICENSE-jgoodies.txt pal-portal/modules/ant-installer/trunk/lib/LICENSE-sax.txt pal-portal/modules/ant-installer/trunk/lib/LICENSE-sysout.txt pal-portal/modules/ant-installer/trunk/lib/LICENSE-xerces.txt pal-portal/modules/ant-installer/trunk/lib/ai-icons-amaranth.jar pal-portal/modules/ant-installer/trunk/lib/ai-icons-bluecurve.jar pal-portal/modules/ant-installer/trunk/lib/ai-icons-crystalsvg.jar pal-portal/modules/ant-installer/trunk/lib/ai-icons-eclipse.jar pal-portal/modules/ant-installer/trunk/lib/ai-icons-krystaline.jar pal-portal/modules/ant-installer/trunk/lib/ant-installer-ext.jar pal-portal/modules/ant-installer/trunk/lib/ant-installer.jar pal-portal/modules/ant-installer/trunk/lib/jgoodies-edited-1_2_2.jar pal-portal/modules/ant-installer/trunk/lib/xercesImpl.jar pal-portal/modules/ant-installer/trunk/lib/xml-apis.jar pal-portal/modules/ant-installer/trunk/src/ pal-portal/modules/ant-installer/trunk/src/README.txt pal-portal/modules/ant-installer/trunk/src/org/ pal-portal/modules/ant-installer/trunk/src/org/tp23/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/DefaultPropertiesFileRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ExplicitPropertiesFileRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/InstallException.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/Installer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/InstallerContext.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/PropertiesFileRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ResourceBundleHelper.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ValidationException.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.2.dtd pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.3.dtd pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.4.dtd pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.5.dtd pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.6.dtd pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.7.dtd pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.8.dtd pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/FeedbackListener.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Jdk14RegexpMatcher.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Jdk14RegexpRegexp.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Launcher.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Main.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/ProjectHelper3.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/RegexpMatcherFactory.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/RuntimeLauncher.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/package.html pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/GetResourceTask.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/LogTask.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/MessageTask.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/PropertyTask.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/AppRootInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/CheckboxInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/CommentOutput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ConditionalField.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ConfirmPasswordTextInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/DateInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/DirectoryInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ExtValidatedTextInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/FileInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/HiddenPropertyInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/InputException.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/InputField.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/LargeSelectInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OSSpecific.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OutputField.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/PasswordTextInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ResultContainer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/SecretPropertyField.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/SelectInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/Target.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/TargetInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/TargetSelectInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/UnvalidatedTextInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ValidatedTextInput.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/Validator.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/package.html pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/LicensePage.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/Page.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/ProgressPage.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/SimpleInputPage.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/SplashPage.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/TextPage.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/package.html pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/AntOutputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/MessageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/PageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/RendererFactory.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res.properties pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_de.properties pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_es.properties pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_es_EU.properties pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/package.html pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIButton.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AICheckBox.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AILabel.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIPasswordField.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIRadioButton.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIShortTextField.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AITextfield.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AppRootInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/CheckboxInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ClasspathHTMLEditorKit.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/CommentOutputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ConditionalFieldRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ConfirmPasswordTextInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/DateInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/DirectoryInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ExtValidatedTextInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/FileInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/HiddenPropertyInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/LargeSelectInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/LicensePageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/PageCompletionListener.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/PasswordTextInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ProgressPageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ProgressPanel.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SelectInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SimpleInputPageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SizeConstants.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SplashPageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingInstallerContext.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingMessageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingOutputFieldRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingPageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TargetInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TargetSelectInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TextPageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/UnvalidatedTextInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ValidatedTextInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/package.html pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/LookAndFeelFactory.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ModMetalLookAndFeel.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ModMetalTheme.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/AbstractTextPageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/AppRootInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/CheckboxInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/CommentOutputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ConditionalFieldRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ConfirmPasswordTextInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/DateInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/DirectoryInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ExtValidatedTextInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/FileInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/HiddenPropertyInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LargeSelectInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LicensePageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Pager.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/PasswordTextInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ProgressPageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res.properties pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_de.properties pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_es.properties pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_es_EU.properties pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SelectInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SimpleInputPageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SplashPageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TargetInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TargetSelectInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextMessageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextOutputFieldRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextPageRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/UnvalidatedTextInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ValidatedTextInputRenderer.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/package.html pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AntRunner.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AutoSwingRunner.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AutoTextRunner.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ConfigurationException.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ConfigurationLoader.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ExecInstall.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/IfPropertyHelper.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/Logger.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/Runner.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/SimpleLogger.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/SwingRunner.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/TextRunner.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/VersionHelper.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/AntLauncherFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/AntProjectFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/CreateLoggerFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/CreateUIFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteRunnerFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FilterChain.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FilterFactory.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FinalizerFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/InputStreamLoadConfigFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/LoadConfigFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyLoaderFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyPrinterFilter.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/nonextractor.fconfig pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/script.fconfig pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/selfextractor.fconfig pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/CompoundExpression.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/EndsWithTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/EqualsTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/Expression.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ExpressionBuilder.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/GreaterThanOrEqualsTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LessThanOrEqualsTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LiteralValue.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalAndTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalOrTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/NotEqualsTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/SimpleExpression.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/SingleExpressionTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/StartsWithTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/StringLengthComparator.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/TestOperator.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/Value.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ValuesTest.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/VariableValue.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/NonExtractor.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ProgressIndicator.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ResourceExtractor.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/SelfExtractor.java pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/package.html pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/ pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/GBCF.java pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/ pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/DefaultingDirectoryChooser.java pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/FollowingJTextArea.java pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/JTextAreaPrintStream.java pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/SelectFileAction.java pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/SystemOutJTextArea.java pal-portal/modules/ant-installer/trunk/src/resources/ pal-portal/modules/ant-installer/trunk/src/resources/AntInstaller.png pal-portal/modules/ant-installer/trunk/src/resources/LICENSE-ant-install.txt pal-portal/modules/ant-installer/trunk/src/resources/antbar.png pal-portal/modules/ant-installer/trunk/src/resources/banner23.png pal-portal/modules/ant-installer/trunk/src/resources/extract-image.png pal-portal/modules/ant-installer/trunk/src/resources/gkmain_inv.png pal-portal/modules/ant-installer/trunk/src/resources/gothbar.gif pal-portal/modules/ant-installer/trunk/src/resources/greens.png pal-portal/modules/ant-installer/trunk/src/resources/icons/ pal-portal/modules/ant-installer/trunk/src/resources/icons/LICENSE pal-portal/modules/ant-installer/trunk/src/resources/icons/back.png pal-portal/modules/ant-installer/trunk/src/resources/icons/cancel.png pal-portal/modules/ant-installer/trunk/src/resources/icons/finish.png pal-portal/modules/ant-installer/trunk/src/resources/icons/next.png pal-portal/modules/ant-installer/trunk/src/resources/icons/ok.png pal-portal/modules/ant-installer/trunk/src/resources/icons/showdetails.png pal-portal/modules/ant-installer/trunk/src/resources/makewavesdawn.png pal-portal/modules/ant-installer/trunk/src/resources/rockstiles.png pal-portal/modules/ant-installer/trunk/src_ext/ pal-portal/modules/ant-installer/trunk/src_ext/org/ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ReleaseNotesFilter.java pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ReleaseNotesFrame.java pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/Installer.java pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/KdeIconTask.java pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/ValidateConfig.java pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/CreateLanguagePack.java pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/LangPackFileRenderer.java pal-portal/modules/ant-installer/trunk/templates/ pal-portal/modules/ant-installer/trunk/templates/defaultproject/ pal-portal/modules/ant-installer/trunk/templates/defaultproject/README.txt pal-portal/modules/ant-installer/trunk/templates/defaultproject/antinstall-config-template.xml pal-portal/modules/ant-installer/trunk/templates/defaultproject/antinstall-config.xml pal-portal/modules/ant-installer/trunk/templates/defaultproject/build-self-extractor-template.sh pal-portal/modules/ant-installer/trunk/templates/defaultproject/build-template.xml pal-portal/modules/ant-installer/trunk/templates/defaultproject/build.xml pal-portal/modules/ant-installer/trunk/templates/defaultproject/cp/ pal-portal/modules/ant-installer/trunk/templates/defaultproject/cp/resources/ pal-portal/modules/ant-installer/trunk/templates/defaultproject/cp/resources/makewavesdawn.png pal-portal/modules/ant-installer/trunk/templates/defaultproject/create-installer-template.xml pal-portal/modules/ant-installer/trunk/templates/defaultproject/runtemplate.cmd pal-portal/modules/ant-installer/trunk/templates/defaultproject/runtemplate.sh pal-portal/modules/ant-installer/trunk/windows-icons/ pal-portal/modules/ant-installer/trunk/windows-icons/AntInstaller.ico pal-portal/modules/ant-installer/trunk/windows-icons/installIcons-docs.cmd pal-portal/modules/ant-installer/trunk/windows-icons/installIcons-docs.inf pal-portal/modules/ant-installer/trunk/wizard.cmd pal-portal/modules/ant-installer/trunk/wizard.sh -------------- next part -------------- Added: pal-portal/modules/ant-installer/trunk/CHANGELOG.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/CHANGELOG.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/CHANGELOG.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,217 @@ +CHANGELOG + + +======================================== +version 0.2 +Fixed a bug with the ordering of targets. +Added app-root element. +Hid the passwords and added a new properties file renderer with more verbose output. +Fiddled with windoze script. (help wanted its not good scripting) + +======================================== +version 0.3 +Introduced fixed basedir for build.xml files to remove dependency on current + directory. +Introduced SelfExtractor code to deliver installers as a single Jar file. +Fixed some intermittent bugs in the sysout.jar library. +Improved feedback of running Ant tasks. +Added different default values for windows and Unix for directories and files. +Added an ifTarget attribute to conditionally show installation pages. +Added a Date input type. + +======================================== +version 0.4 +Fixed un-important error in the install-config.xml for the demo application. +Fixed more bugs in sysout.jar related to reusing the graphics buffer. +Added popup to save/clear in the sysout.jar. +Fixed double printing in sysout.jar. +Added corner button to sysout.jar to jump to final message. +UI improvements including focusing correct buttons and better layouts. +Changes to the way Properties are saved internally in preparation for allowing + ${prop.name} syntax in future versions. + +======================================== +version 0.5 +Fixed an introduced bug when an input page is skipped in text mode. +Added paging to the license page in text mode. +Fixed bug printing passwords to properties file. +Big internal changes to the way properties are stored and referenced + to allow ${refs}. +Other internal changes to the name of InputFields that do not actually + collect input to OutputField. +Allow the use of .. in file and directory references and display the + correct absolute path reference. + +======================================== +version 0.6 +The XML DTD should be upgraded to 0.6 to use some new features. +Added a modified version of JGoodies' (excelent) Look And Feel to reduce + the size of the installers and include and option for anti-aliased fonts + in the swing GUI. + - Anti-aliasing is resource intensive but good looking. + - The package name has been changed to maintain compatibility on the classpath + with the original JGoodies files, the new package is org.tp23.jgoodies. +Added a splash page feature to show an image. +Added an (optional) image to the extract progress window. +Added a new input type large-select for drop down lists. +Fixed errors from targets on the first page in the Swing UI. +Fixed errors if defaultValue is null. (however it should not be set to null) +Fixed a bug in the selfextractor when the jar is saved in a path with spaces + or other non text characters. +Added documents about the scrolling in license page. +Removed images from the default build of antinstaller.jar + - Any existing builds that are to be upgraded and use the default images, + should add the images to the classpath. The images are included in the + download in the /images directory. +The online manual has been updated, all the changes are included in the download. +Added some of the new features to the examples and the AnInstaller installer. + +======================================== +version 0.7 +File and Directory choosers will now show hidden files . + Thanks to Markus Dueringer for the tip. +Environment variables can now be accesses in default values with the + ${env.ProgramFiles} syntax. - thanks again to Markus Dueringer +Also the Java system properties can be accessed with the "java." prefix. + - e.g ${java.user.name} +Show details button was not big enough in some LAFs - thanks to Mike Watts. +There are known issues with the directory selector and the Metouia LAF, + I can't replicate the issues but if you have problems. + a) use the modified JGoodies which apparently does not have this problem. + b) keep the stack traces and report them please! + When using the selfextractor from windows or X users will probably not + see the errors anyway. +Better defaulting is included for the Directory chooser <page + type="text" + name="intro.1" + displayText="HTML page" + htmlResource="/resources/text.html" + textResource="/resources/text.txt" + overflow="true" /> + the home directory will be shown less often, it was particularly annoying + when the chooser is used to create a new directory + +======================================== +version 0.7.1 +Bug fix in Defaulting Directory Chooser that manifested in not being able to see + directories in app-root. +RFE-1154368 Can't install from a read only source fixed. + The log file is written to the temp dir if it cannot write to the current dir. + The ant.install.properties file is only written if it can be since it is + primarily for debug. + - There is no requirement to add <property file="ant.install.properties"/> + to the build file any more properties will be added directly to the + build as with secret properties. + +======================================== +version 0.7.2 +Changed the implementation of the Progress Details so selecting text is now possible. + This is more stable too. It has the side effect of keeping the whole System.out + and System.err in memory which is only an issue for veeerrry long builds on + machines with too little RAM. +Changed minor bug where directly edited (not via the chooser) file inputs were + replaced with defaults if the user when back. +Added TargetSelectInput by Mark Anderson providing the option of radio buttons + for targets instead of checkboxes. +Fixed an introduced bug launching from the root drive when ANT_HOME was not set. +Introduced a new "NonExtractor" this is a replacement mechanism to the SelfExtractor. + The Jar is still used to run the installer but the files are not extracted + by default. + In the build.xml files should be specifically extracted using unzip with + nested patternsets to specify the files to extract. + This provide opportunities to improve the performance of installers. + Unzipping can now be performed directly into the installation directories rather + than unzipping and then copying or moving. + Also the antinstaller classes and LookAndFeel and Xerces need no longer + be extracted. +Added an new feature to the ifProperty attribute so the property being tested can + come from the environment or the java system properties. + for example ifProperty="${env.SHELL}=/bin/bash thanks to Eddyrun. + The old syntax of property=value is deprecated in favour of ${property}=value + N.B. ${property}=${value} is NOT supported. +Big internal changes to the Execution class to use a filter pattern currently + hardcoded but with intent to allow pluggable pre and post install tasks. + +======================================== +version 0.7.3 +Added overflow="true" to simple input page. +GridBag Layout used instead of absolute positioning modified to support overflow size + difference. +More Images and Icons added to a separate download. +Added GUI tools for Quick start. +A Much more flexible ifProperty syntax supporting some standard operator with non +standard syntax (see the docs). +Fixed a fatal introduced bug in the console version installer + +======================================== +version 0.7.4 +Added an optional feature to hide password on the console. set textMask="true". + N.B. this does not work in eclipse's console and may not be a stable solution +Implemented plugable filter chains to add steps to the install process. + An example releaseNotes plugin is provided. +Added ext-validated type for pluggable field validation as yet unteset + and undocumented. +Added an Ant task to build installers using Ant. +Added a modified version of the MetalLookAndFeel to reduce download size and still + be able to get the required amount of text in labels and buttons. +Added LookAndFeel names : "default"|"jgoodies", "greymetal" or "null" . +Further testing to allow downloads without including xercesImpl.jar or xml-apis.jar +Added progress pane enhancements to show the targets running for visual feedback of + install progress without having to monitor the output logs which can be + ugly/confusing. +XMLValiation of test scripts and minor changes in the DTD. +Extended validation of config and integrated validation into the installer Ant task. +N.B. passing command line parameters to the build is an override of the detection + method, start scripts should be modified if the default behaviour is requried. + e.g. java -cp $CP org.tp23.antinstaller.runtime.ExecInstaller default . + will not override the default behaviour or trying X and falling back + to text/console +Added an untested feature for including arbitrary validation classes ExtValidated +Assorted fixes for i18n. +app-root no longer creates the directory if it is missing. + +======================================== +version 0.8 +Added features to load defaults from previous installs and perform almost silent + installs property names and targets must not end with the string -targets, + this is validated in the config checker. +Comments expand property values. +Multiline comments via use of explanatoryText and a null displayText value. +Fixed a display bug in the progress renderer if there were more than 5 + targets and none that were dependencies. +PropertyLoaderFilter added, any users with custom .fconfig files should + ensure thier custom versions are still compatible. +Added a release notes feature that is a tad tricky to install so + contact for details. +Added HTML page feature that allows using the Java HTML rendering to display + a page of HTML property references are expanded so the page can contain + ${property.name} syntax to give feed back of selected properties. + Images are loaded from the classpath so the following syntax will locate + and display an image <img src="/resources/temazo.png">. + Java HTML rendering is poor at best and only html3.2 , + so dont expect firefox quality rendering ;) + The java renderer handles PNG properly though so nice . + trancparency effects can be achieved. +Fixed bug in validation if only target-selects are used. +Extended i18n for antinstall-config.xml files using ResourceBundles + called LanguagePack +GUI tool for creating LanguagePack files. +Changes to the Expression code for ifProperty attributes + The original syntax is not 100% compatible e.g. my.property=value1 + will not work it should be converted to ${my.property}=value1. +Initial work on loading existing values if found to automate installs. + Not quite silent installs but save repeating entries. +Added ability to stretch the GUI horizontally, but still using fixed widths. + Set the wide attribute in the installer element to configure width + e.g. 600:275 +Added the ability to deliver different install types in the same Jar which + can be selected on the command line with -type [install type]. +Added icons to the buttons in the swing GUI, the installer Ant task now takes + a new attribute called icons to specify which icon pack to use. +Added ability to run special Ant tasks mid build, the same build-xml file is used + but the message rendering and logging is different in the antinstaller- tasks +Added icons for kde and windows to the AntInstaller SelfExtractor, lots of Ant + hacking to avoid extra dependencies. +Migrated classes from sysout.jar into the core src packages +Renamed ant-ext.jar to ant-installer-ext.jar + all build files will need to be updated \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/CHANGELOG.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/antinstaller-icon.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antinstaller-icon.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/antlib/ant-antlr.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-antlr.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-bcel.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-bcel.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-bsf.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-bsf.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-log4j.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-log4j.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-oro.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-oro.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-regexp.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-regexp.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-resolver.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-apache-resolver.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-commons-logging.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-commons-logging.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-commons-net.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-commons-net.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-jai.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-jai.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-javamail.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-javamail.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-jdepend.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-jdepend.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-jmf.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-jmf.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-jsch.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-jsch.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-junit.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-junit.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-launcher.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-launcher.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-netrexx.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-netrexx.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-nodeps.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-nodeps.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-starteam.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-starteam.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-stylebook.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-stylebook.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-swing.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-swing.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-testutil.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-testutil.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-trax.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-trax.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant-weblogic.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant-weblogic.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/ant.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/ant.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/junit-3.8.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/junit-3.8.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/xercesImpl.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/xercesImpl.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/antlib/xml-apis.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/antlib/xml-apis.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/build/build.xml =================================================================== --- pal-portal/modules/ant-installer/trunk/build/build.xml (rev 0) +++ pal-portal/modules/ant-installer/trunk/build/build.xml 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,147 @@ +<?xml version="1.0"?> +<!-- +This is a normal Ant build file to build the release for sourceforge +--> +<project name="Installation Build" default="build" basedir=".."> + + <!-- Project properties --> + <property name="prepareDir" value="artifacts/prepare"/> + + <!-- Classpaths - start --> + <!-- Classpaths for compilation - start --> + <path id="project.cp"> + <fileset dir="antlib" includes="ant.jar,ant-launcher.jar"/> + </path> + <path id="project.ext.cp"> + <fileset dir="lib"> + <include name="ant-installer.jar"/> + </fileset> + <fileset dir="antlib" includes="ant.jar,ant-launcher.jar"/> + </path> + <!-- Classpaths for compilation - end --> + + <path id="taskdef.cp"> + <fileset dir="./lib"> + <include name="ant-installer-ext.jar"/> + <include name="ant-installer.jar"/> + </fileset> + </path> + <!-- Classpaths - end --> + + + <!-- Task definitions - start --> + <!-- AntInstaller installer task definition. + Defined within target as it depends upon files that aren't + available at the start of a clean build --> + <target name="_set-installer-taskdef" unless="installer.taskdef.defined"> + <taskdef + name="installer" + classname="org.tp23.antinstaller.taskdefs.Installer" + classpathref="taskdef.cp"/> + <property name="installer.taskdef.defined" value="true"/> + </target> + <!-- Task definitions - end --> + + + <!-- =============================== --> + <!-- ==== Public Runnable Targets == --> + <!-- =============================== --> + + <target name="clean-build" depends="clean, _build-ai-jars, clean-demo, _build-demo"> + <!-- this build is pretty much everything other than the installers --> + </target> + + <target name="build" depends="_build-ai-jars, _build-demo"> + <!-- this build should be enough to run the unittests without having to build a release package --> + </target> + + <target name="clean" description="Clean out compiled and generated files"> + <echo message="*** *** Cleaning artifacts *** *** "/> + <echo message="*** ***"/> + <delete dir="${prepareDir}"/> + <delete file="./lib/ant-installer.jar"/> + <delete file="./lib/ant-installer-ext.jar"/> + </target> + + <target name="clean-demo" description="Clean out demo files"> + <ant dir="demo" antfile="build-demo.xml" target="clean"> + <property name="${installDir}" value="demo"/> + </ant> + </target> + + + <!-- =============================== --> + <!-- ======= Internal Targets ====== --> + <!-- =============================== --> + + <!-- + tests that the following has been run locally + This does not need to be run repeatedly but unittests depend on it + # ant -buildfile demo/build-demo.xml + --> + <target name="_check-demo"> + <condition property="installpack.missing"> + <not> + <available file="demo/artifacts/installpack.zip" type="file"/> + </not> + </condition> + </target> + + <target name="_build-demo" if="installpack.missing" depends="_check-demo"> + <echo message="requires demo build: ${installpack.missing}"/> + <ant dir="demo" antfile="build-demo.xml" target="selfextract"> + <property name="${installDir}" value="demo"/> + </ant> + </target> + + + <target name="_build-ai-jars" depends="_ant-installer.jar, _ant-installer-ext.jar"> + <!-- AntInstaller JARs are built in ./lib--> + <!-- (checked-in) JARs should not be used --> + </target> + + <target name="_ant-installer.jar"> + <echo message="*** *** Building ant-installer.jar *** *** "/> + <echo message="*** ***"/> + <echo message="Initing the build directory - ${prepareDir}"/> + <mkdir dir="${prepareDir}/classes"/> + + <echo message="*** Building ant-installer.jar ***"/> + <mkdir dir="./lib"/> + <javac destdir="${prepareDir}/classes" srcdir="src" classpathref="project.cp" debug="true"/> + <jar file="./lib/ant-installer.jar" whenempty="fail"> + <fileset dir="./src/resources"> + <include name="LICENSE-ant-install.txt"/> + </fileset> + <fileset dir="${prepareDir}/classes"/> + <fileset dir="./src"> + <include name="**/*.dtd"/> + <include name="**/*.properties"/> + <include name="**/*.fconfig"/> + <include name="resources/extract-image.png"/> + <include name="resources/gkmain_inv.png"/> + <include name="resources/antbar.png"/> + </fileset> + <manifest> + <attribute name="AntInstaller-Version" value="${ant.install.version}"/> + </manifest> + </jar> + </target> + + <target name="_ant-installer-ext.jar"> + <echo message="*** *** Building ant-installer-ext.jar *** *** "/> + <echo message="*** ***"/> + <mkdir dir="${prepareDir}/classes_ext"/> + <javac destdir="${prepareDir}/classes_ext" srcdir="src_ext" classpathref="project.ext.cp" debug="true"/> + <jar file="./lib/ant-installer-ext.jar" whenempty="fail"> + <fileset dir="./src/resources"> + <include name="LICENSE-ant-install.txt"/> + </fileset> + <fileset dir="${prepareDir}/classes_ext"/> + <manifest> + <attribute name="AntInstaller-Version" value="${ant.install.version}"/> + </manifest> + </jar> + </target> + +</project> Property changes on: pal-portal/modules/ant-installer/trunk/build/build.xml ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/DEMO-README.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/DEMO-README.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/DEMO-README.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,13 @@ +This Demo is a very simple example of what AntInstaller and Ant can do + +The installer performs the following tasks +extracts an installpack.zip pack of files to a temporary directory +install the selected components in the directory of the users choice +performs an ant replace operation on the config file in {installDir}/config/example-config.xml +deletes the temporary direcotry + +Clearly this is not a realworld example. + +The replace Ant task is a very usefull operation for installations, and of course the +full power of ant is at your disposal at the time the installation is performed. It is probably +best to be specific about the optional tasks that are included. Property changes on: pal-portal/modules/ant-installer/trunk/demo/DEMO-README.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/README.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/README.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/README.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1 @@ +This is an example readme file Property changes on: pal-portal/modules/ant-installer/trunk/demo/README.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/antinstaller-icon.ico =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/demo/antinstaller-icon.ico ___________________________________________________________________ Name: svn:mime-type + image/x-icon Added: pal-portal/modules/ant-installer/trunk/demo/artifacts/demo-installer.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/demo/artifacts/demo-installer.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/demo/artifacts/installpack.zip =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/demo/artifacts/installpack.zip ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/demo/bin/run.cmd =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/bin/run.cmd (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/bin/run.cmd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,19 @@ + @ echo off + +if "%JAVA_HOME%" == "" goto nojava + +set CLASSPATH=.\classes + +echo CLASSPATH:%CLASSPATH% +echo JAVA_HOME:%JAVA_HOME% + +%JAVA_HOME%\bin\java -cp %CLASSPATH% org.tp23.demo.Demonstration + +goto end + +:nojava +echo Set JAVA_HOME environment variable +goto end + + +:end \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/demo/bin/run.cmd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/bin/run.sh =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/bin/run.sh (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/bin/run.sh 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,26 @@ +#!/bin/sh + +if [ "$JAVA_HOME" = "" ] ; then + echo set JAVA_HOME; + exit 1; +fi + +# find the command called's root e.g. ./build/ +dir=`expr match "$0" '\(.*\)run.sh'` +echo command called $0 directory + +# if it we did not call ./ change to the directory we called +if [ "$dir" != "./" ] ; then + if [ "$dir" != "" ] ; then + echo changing to $dir + cd "$dir" ; + fi +fi +CLASSPATH=$CLASSPATH:./classes + +echo $CLASSPATH +echo $JAVA_HOME + +$JAVA_HOME/bin/java -cp $CLASSPATH org.tp23.demo.Demonstration + + Property changes on: pal-portal/modules/ant-installer/trunk/demo/bin/run.sh ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/build-demo.xml =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/build-demo.xml (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/build-demo.xml 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,103 @@ +<?xml version="1.0"?> +<!-- + +This Ant script is used to package parts of the demo app to create an installer + +the selfextract target shows an example of creating a self extracting jar for the demo app + +run with ... + +ant -buildfile build-demo.xml + +--> +<project name="Create Demo Installer Zip Build" default="selfextract" basedir="."> + + <!-- Default location in installed tree --> + <property name="installDir" location=".."/> + <!-- This file should either not exist or contain a property that points to a valid ./antlib${ant.lib.version} directory --> + <property file="${installDir}/build/version.properties"/> + + <path id="taskdef.cp"> + <fileset dir="${installDir}/lib"> + <include name="ant-installer-ext.jar"/> + <include name="ant-installer.jar"/> + </fileset> + </path> + + <target name="_set-version" if="antlib.missing" depends="_check-version"> + <property name="ant.lib.version" value=""/> + </target> + <target name="_check-version"> + <condition property="antlib.missing"> + <not><available file="${installDir}/antlib${ant.lib.version}"/></not> + </condition> + </target> + <target name="selfextract" depends="_set-version, build-resources"> + <echo message="*** *** Building demo-installer.jar *** *** "/> + <echo message="*** ***"/> + <taskdef + name="installer" + classname="org.tp23.antinstaller.taskdefs.Installer" + classpathref="taskdef.cp"/> + <installer file="${installDir}/demo/artifacts/demo-installer.jar" compress="true" + extractType="SelfExtractor" + installConfig="installer/antinstall-config.xml" + buildFile="installer/build.xml" + antInstallLib="${installDir}/lib" + antLib="${installDir}/antlib${ant.lib.version}" + validateConfig="true" + failOnError="true" + icons="eclipse"> + <fileset dir="${installDir}/demo/artifacts" includes="installpack.zip"/> + <fileset dir="installclasspath" includes="resources/*"/> + </installer> + <!-- old build jar file="./selfextractpack.jar" compress="true"> + <manifest> + <attribute name="Manifest-Version" value="1.0"/> + <attribute name="Main-Class" value="org.tp23.antinstaller.selfextract.SelfExtractor"/> + <attribute name="Look-And-Feel" value="org.tp23.jgoodies.plaf.plastic.PlasticXPLookAndFeel"/> + </manifest> + <fileset dir="selfextract"> + <include name="**/*"/> + </fileset> + <zipgroupfileset dir="installlib" includes="*.jar"/> + </jar--> + </target> + + <target name="clean"> + <echo message="*** *** Cleaning demo artifacts *** *** "/> + <echo message="*** ***"/> + <delete dir="${installDir}/demo/classes" failonerror="false"/> + <delete file="${installDir}/demo/artifacts/installpack.zip" failonerror="false"/> + <delete file="${installDir}/demo/artifacts/demo-installer.jar" failonerror="false"/> + </target> + + <target name="build-resources"> + <echo message="*** *** Creating demo resources ZIP *** *** "/> + <echo message="*** ***"/> + <mkdir dir="${installDir}/demo/classes"/> + <javac destdir="${installDir}/demo/classes" srcdir="src"/> + <copy + file="src/resources/demo.png" + tofile="${installDir}/demo/classes/resources/demo.png" + overwrite="true"/> + <mkdir dir="${installDir}/demo/artifacts"/> + <delete file="${installDir}/demo/artifacts/installpack.zip" failonerror="false"/> + <mkdir dir="${installDir}/demo/artifacts"/> + <zip file="${installDir}/demo/artifacts/installpack.zip"> + <zipfileset dir="." defaultexcludes="true"> + <include name="bin/**/*"/> + <include name="classes/**/*"/> + <include name="config/**/*"/> + <include name="doc/**/*"/> + <include name="src/**/*"/> + <include name="README.txt"/> + <include name="DEMO-README.txt"/> + </zipfileset> + <zipfileset dir="${installDir}/demo" defaultexcludes="true"> + <include name="classes/**/*"/> + </zipfileset> + </zip> + </target> + +</project> Property changes on: pal-portal/modules/ant-installer/trunk/demo/build-demo.xml ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/checkConfig.sh =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/checkConfig.sh (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/checkConfig.sh 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,35 @@ +#!/bin/sh + +# This script check the configuration in the scripts directory + +# find the command called's root e.g. ./build/ +dir=`expr match "$0" '\(.*\)checkConfig.sh'` +# if it we did not call ./ change to the directory we called +if [ "$dir" != "./" ] ; then + if [ "$dir" != "" ] ; then + echo changing to $dir + cd "$dir" ; + fi +fi + + +# Installer requires Java +if [ "$JAVA_HOME" = "" ] ; then + echo Installer requires Java available from http://java.sun.com + echo If you have Java installed you may just need to set the variable JAVA_HOME + exit 1; +fi + +# Installer from command line classpath +CLASSPATH=./installlib/xercesImpl.jar +CLASSPATH=$CLASSPATH:./installlib/xml-apis.jar +CLASSPATH=$CLASSPATH:./installlib/ant-installer.jar +CLASSPATH=$CLASSPATH:./installlib/ant-installer-ext.jar +CLASSPATH=$CLASSPATH:./antlib/ant.jar +CLASSPATH=$CLASSPATH:./antlib/ant-launcher.jar + +COMMAND=$JAVA_HOME/bin/java + +#echo $COMMAND -classpath $CLASSPATH org.tp23.antinstaller.runtime.ExecInstall $1 + +$COMMAND -classpath $CLASSPATH org.tp23.antinstaller.runtime.ConfigurationLoader . Property changes on: pal-portal/modules/ant-installer/trunk/demo/checkConfig.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/classes/org/tp23/demo/Demonstration.class =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/demo/classes/org/tp23/demo/Demonstration.class ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/demo/classes/resources/demo.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/demo/classes/resources/demo.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/demo/config/demo.properties =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/config/demo.properties (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/config/demo.properties 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,7 @@ +# +# Installtion properties +# +TextProperty=@TextProperty@ +BooleanProperty=@BooleanProperty@ +Colour=@Colour@ +SelectedFile=@SelectedFile@ Property changes on: pal-portal/modules/ant-installer/trunk/demo/config/demo.properties ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/config/example-config.xml =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/config/example-config.xml (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/config/example-config.xml 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,9 @@ +<?xml version="1.0"?> + +<configuration> + <static-property value="Made by AntInstaller, by TP23"/> + <dynamic-colour-property value="@Colour@"/> + <dynamic-selectedfile-property value="@SelectedFile@"/> + <dynamic-boolean-property value="@BooleanProperty@"/> + <dynamic-text-property value="@TextProperty@"/> +</configuration> Property changes on: pal-portal/modules/ant-installer/trunk/demo/config/example-config.xml ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/allclasses-frame.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/allclasses-frame.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/allclasses-frame.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,31 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.4.2_01) on Tue Nov 02 02:03:53 CET 2004 --> +<META http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<TITLE> +All Classes +</TITLE> + + +<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> + + +</HEAD> + +<BODY BGCOLOR="white"> +<FONT size="+1" CLASS="FrameHeadingFont"> +<B>All Classes</B></FONT> +<BR> + +<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> +<TR> +<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="org/tp23/demo/Demonstration.html" title="class in org.tp23.demo" target="classFrame">Demonstration</A> +<BR> +</FONT></TD> +</TR> +</TABLE> + +</BODY> +</HTML> Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/allclasses-frame.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/allclasses-noframe.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/allclasses-noframe.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/allclasses-noframe.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,31 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.4.2_01) on Tue Nov 02 02:03:53 CET 2004 --> +<META http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<TITLE> +All Classes +</TITLE> + + +<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> + + +</HEAD> + +<BODY BGCOLOR="white"> +<FONT size="+1" CLASS="FrameHeadingFont"> +<B>All Classes</B></FONT> +<BR> + +<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> +<TR> +<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="org/tp23/demo/Demonstration.html" title="class in org.tp23.demo">Demonstration</A> +<BR> +</FONT></TD> +</TR> +</TABLE> + +</BODY> +</HTML> Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/allclasses-noframe.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/constant-values.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/constant-values.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/constant-values.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,135 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.4.2_01) on Tue Nov 02 02:03:53 CET 2004 --> +<META http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<TITLE> +Constant Field Values +</TITLE> + + +<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + parent.document.title="Constant Field Values"; +} +</SCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/tp23/demo/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html" target="_top"><B>FRAMES</B></A> + <A HREF="constant-values.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<CENTER> +<H1> +Constant Field Values</H1> +</CENTER> +<HR SIZE="4" NOSHADE> +<B>Contents</B><UL> +</UL> + +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/tp23/demo/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html" target="_top"><B>FRAMES</B></A> + <A HREF="constant-values.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> + +</BODY> +</HTML> Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/constant-values.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/deprecated-list.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/deprecated-list.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/deprecated-list.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,131 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.4.2_01) on Tue Nov 02 02:03:53 CET 2004 --> +<META http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<TITLE> +Deprecated List +</TITLE> + + +<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + parent.document.title="Deprecated List"; +} +</SCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/tp23/demo/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Deprecated</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html" target="_top"><B>FRAMES</B></A> + <A HREF="deprecated-list.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<CENTER> +<H2> +<B>Deprecated API</B></H2> +</CENTER> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/tp23/demo/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Deprecated</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html" target="_top"><B>FRAMES</B></A> + <A HREF="deprecated-list.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> + +</BODY> +</HTML> Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/deprecated-list.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/help-doc.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/help-doc.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/help-doc.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,180 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.4.2_01) on Tue Nov 02 02:03:54 CET 2004 --> +<META http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<TITLE> +API Help +</TITLE> + + +<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + parent.document.title="API Help"; +} +</SCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/tp23/demo/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Help</B></FONT> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html" target="_top"><B>FRAMES</B></A> + <A HREF="help-doc.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<CENTER> +<H1> +How This API Document Is Organized</H1> +</CENTER> +This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.<H3> +Package</H3> +<BLOCKQUOTE> + +<P> +Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:<UL> +<LI>Interfaces (italic)<LI>Classes<LI>Exceptions<LI>Errors</UL> +</BLOCKQUOTE> +<H3> +Class/Interface</H3> +<BLOCKQUOTE> + +<P> +Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:<UL> +<LI>Class inheritance diagram<LI>Direct Subclasses<LI>All Known Subinterfaces<LI>All Known Implementing Classes<LI>Class/interface declaration<LI>Class/interface description +<P> +<LI>Nested Class Summary<LI>Field Summary<LI>Constructor Summary<LI>Method Summary +<P> +<LI>Field Detail<LI>Constructor Detail<LI>Method Detail</UL> +Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.</BLOCKQUOTE> +<H3> +Tree (Class Hierarchy)</H3> +<BLOCKQUOTE> +There is a <A HREF="overview-tree.html">Class Hierarchy</A> page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with <code>java.lang.Object</code>. The interfaces do not inherit from <code>java.lang.Object</code>.<UL> +<LI>When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.<LI>When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.</UL> +</BLOCKQUOTE> +<H3> +Deprecated API</H3> +<BLOCKQUOTE> +The <A HREF="deprecated-list.html">Deprecated API</A> page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.</BLOCKQUOTE> +<H3> +Index</H3> +<BLOCKQUOTE> +The <A HREF="index-all.html">Index</A> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</BLOCKQUOTE> +<H3> +Prev/Next</H3> +These links take you to the next or previous class, interface, package, or related page.<H3> +Frames/No Frames</H3> +These links show and hide the HTML frames. All pages are available with or without frames. +<P> +<H3> +Serialized Form</H3> +Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. +<P> +<FONT SIZE="-1"> +<EM> +This help file applies to API documentation generated using the standard doclet.</EM> +</FONT> +<BR> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/tp23/demo/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Help</B></FONT> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html" target="_top"><B>FRAMES</B></A> + <A HREF="help-doc.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> + +</BODY> +</HTML> Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/help-doc.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/index-all.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/index-all.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/index-all.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,147 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.4.2_01) on Tue Nov 02 02:03:53 CET 2004 --> +<META http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<TITLE> +Index +</TITLE> + + +<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + parent.document.title="Index"; +} +</SCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/tp23/demo/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html" target="_top"><B>FRAMES</B></A> + <A HREF="index-all.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<A HREF="#_D_">D</A> <A HREF="#_M_">M</A> <A HREF="#_O_">O</A> <HR> +<A NAME="_D_"><!-- --></A><H2> +<B>D</B></H2> +<DL> +<DT><A HREF="org/tp23/demo/Demonstration.html" title="class in org.tp23.demo"><B>Demonstration</B></A> - class org.tp23.demo.<A HREF="org/tp23/demo/Demonstration.html" title="class in org.tp23.demo">Demonstration</A>.<DD>Title: Example Application<DT><A HREF="org/tp23/demo/Demonstration.html#Demonstration()"><B>Demonstration()</B></A> - +Constructor for class org.tp23.demo.<A HREF="org/tp23/demo/Demonstration.html" title="class in org.tp23.demo">Demonstration</A> +<DD> +</DL> +<HR> +<A NAME="_M_"><!-- --></A><H2> +<B>M</B></H2> +<DL> +<DT><A HREF="org/tp23/demo/Demonstration.html#main(java.lang.String[])"><B>main(String[])</B></A> - +Static method in class org.tp23.demo.<A HREF="org/tp23/demo/Demonstration.html" title="class in org.tp23.demo">Demonstration</A> +<DD> +</DL> +<HR> +<A NAME="_O_"><!-- --></A><H2> +<B>O</B></H2> +<DL> +<DT><A HREF="org/tp23/demo/package-summary.html"><B>org.tp23.demo</B></A> - package org.tp23.demo<DD> </DL> +<HR> +<A HREF="#_D_">D</A> <A HREF="#_M_">M</A> <A HREF="#_O_">O</A> + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/tp23/demo/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html" target="_top"><B>FRAMES</B></A> + <A HREF="index-all.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> + +</BODY> +</HTML> Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/index-all.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/index.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/index.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/index.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,24 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc on Tue Nov 02 02:03:53 CET 2004--> +<META http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<TITLE> +Generated Documentation (Untitled) +</TITLE> +</HEAD> +<FRAMESET cols="20%,80%"> +<FRAME src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)"> +<FRAME src="org/tp23/demo/package-summary.html" name="classFrame" title="Package, class and interface descriptions"> +<NOFRAMES> +<H2> +Frame Alert</H2> + +<P> +This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +<BR> +Link to<A HREF="org/tp23/demo/package-summary.html">Non-frame version.</A> +</NOFRAMES> +</FRAMESET> +</HTML> Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/index.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/Demonstration.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/Demonstration.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/Demonstration.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,263 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.4.2_01) on Tue Nov 02 02:03:53 CET 2004 --> +<META http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<TITLE> +Demonstration +</TITLE> + +<META NAME="keywords" CONTENT="org.tp23.demo.Demonstration class"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + parent.document.title="Demonstration"; +} +</SCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV CLASS + NEXT CLASS</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> + <A HREF="Demonstration.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<!-- ======== START OF CLASS DATA ======== --> +<H2> +<FONT SIZE="-1"> +org.tp23.demo</FONT> +<BR> +Class Demonstration</H2> +<PRE> +java.lang.Object + <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><B>org.tp23.demo.Demonstration</B> +</PRE> +<HR> +<DL> +<DT>public class <B>Demonstration</B><DT>extends java.lang.Object</DL> + +<P> +<p>Title: Example Application</p> + <p>Description: Prints Hello World, trys to do it in a pop up box + if a Throwable is thrown (e.g. no X) it prints to System.out</p> + <p>Copyright: Copyright (c) 2004</p> + <p>Company: tp23</p> +<P> + +<P> +<DL> +<DT><B>Version:</B></DT> + <DD>1.0</DD> +<DT><B>Author:</B></DT> + <DD>Paul Hinds</DD> +</DL> +<HR> + +<P> +<!-- ======== NESTED CLASS SUMMARY ======== --> + + +<!-- =========== FIELD SUMMARY =========== --> + + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> + +<A NAME="constructor_summary"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TD COLSPAN=2><FONT SIZE="+2"> +<B>Constructor Summary</B></FONT></TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD><CODE><B><A HREF="../../../org/tp23/demo/Demonstration.html#Demonstration()">Demonstration</A></B>()</CODE> + +<BR> + </TD> +</TR> +</TABLE> + +<!-- ========== METHOD SUMMARY =========== --> + +<A NAME="method_summary"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TD COLSPAN=2><FONT SIZE="+2"> +<B>Method Summary</B></FONT></TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE>static void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/tp23/demo/Demonstration.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE> + +<BR> + </TD> +</TR> +</TABLE> + <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> +<TD><B>Methods inherited from class java.lang.Object</B></TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> +</TR> +</TABLE> + +<P> + +<!-- ============ FIELD DETAIL =========== --> + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> + +<A NAME="constructor_detail"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TD COLSPAN=1><FONT SIZE="+2"> +<B>Constructor Detail</B></FONT></TD> +</TR> +</TABLE> + +<A NAME="Demonstration()"><!-- --></A><H3> +Demonstration</H3> +<PRE> +public <B>Demonstration</B>()</PRE> +<DL> +</DL> + +<!-- ============ METHOD DETAIL ========== --> + +<A NAME="method_detail"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TD COLSPAN=1><FONT SIZE="+2"> +<B>Method Detail</B></FONT></TD> +</TR> +</TABLE> + +<A NAME="main(java.lang.String[])"><!-- --></A><H3> +main</H3> +<PRE> +public static void <B>main</B>(java.lang.String[] args)</PRE> +<DL> +<DD><DL> +</DL> +</DD> +</DL> +<!-- ========= END OF CLASS DATA ========= --> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV CLASS + NEXT CLASS</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> + <A HREF="Demonstration.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> + +</BODY> +</HTML> Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/Demonstration.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-frame.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-frame.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-frame.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,33 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.4.2_01) on Tue Nov 02 02:03:53 CET 2004 --> +<META http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<TITLE> +org.tp23.demo +</TITLE> + +<META NAME="keywords" CONTENT="org.tp23.demo package"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> + + +</HEAD> + +<BODY BGCOLOR="white"> +<FONT size="+1" CLASS="FrameTitleFont"> +<A HREF="../../../org/tp23/demo/package-summary.html" target="classFrame">org.tp23.demo</A></FONT> +<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> +<TR> +<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> +Classes</FONT> +<FONT CLASS="FrameItemFont"> +<BR> +<A HREF="Demonstration.html" title="class in org.tp23.demo" target="classFrame">Demonstration</A></FONT></TD> +</TR> +</TABLE> + + +</BODY> +</HTML> Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-frame.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-summary.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-summary.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-summary.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,145 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.4.2_01) on Tue Nov 02 02:03:53 CET 2004 --> +<META http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<TITLE> +org.tp23.demo +</TITLE> + +<META NAME="keywords" CONTENT="org.tp23.demo package"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + parent.document.title="org.tp23.demo"; +} +</SCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV PACKAGE + NEXT PACKAGE</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> + <A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<H2> +Package org.tp23.demo +</H2> + +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TD COLSPAN=2><FONT SIZE="+2"> +<B>Class Summary</B></FONT></TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD WIDTH="15%"><B><A HREF="../../../org/tp23/demo/Demonstration.html" title="class in org.tp23.demo">Demonstration</A></B></TD> +<TD>Title: Example Application</TD> +</TR> +</TABLE> + + +<P> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV PACKAGE + NEXT PACKAGE</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> + <A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> + +</BODY> +</HTML> Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-summary.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-tree.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-tree.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-tree.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,139 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.4.2_01) on Tue Nov 02 02:03:53 CET 2004 --> +<META http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<TITLE> +org.tp23.demo Class Hierarchy +</TITLE> + + +<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + parent.document.title="org.tp23.demo Class Hierarchy"; +} +</SCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> + <A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<CENTER> +<H2> +Hierarchy For Package org.tp23.demo +</H2> +</CENTER> +<H2> +Class Hierarchy +</H2> +<UL> +<LI TYPE="circle">class java.lang.Object<UL> +<LI TYPE="circle">class org.tp23.demo.<A HREF="../../../org/tp23/demo/Demonstration.html" title="class in org.tp23.demo"><B>Demonstration</B></A></UL> +</UL> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> + <A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> + +</BODY> +</HTML> Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/org/tp23/demo/package-tree.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/overview-tree.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/overview-tree.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/overview-tree.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,141 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.4.2_01) on Tue Nov 02 02:03:53 CET 2004 --> +<META http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<TITLE> +Class Hierarchy +</TITLE> + + +<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + parent.document.title="Class Hierarchy"; +} +</SCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html" target="_top"><B>FRAMES</B></A> + <A HREF="overview-tree.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<CENTER> +<H2> +Hierarchy For All Packages</H2> +</CENTER> +<DL> +<DT><B>Package Hierarchies:</B><DD><A HREF="org/tp23/demo/package-tree.html">org.tp23.demo</A></DL> +<HR> +<H2> +Class Hierarchy +</H2> +<UL> +<LI TYPE="circle">class java.lang.Object<UL> +<LI TYPE="circle">class org.tp23.demo.<A HREF="org/tp23/demo/Demonstration.html" title="class in org.tp23.demo"><B>Demonstration</B></A></UL> +</UL> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html" target="_top"><B>FRAMES</B></A> + <A HREF="overview-tree.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> + +</BODY> +</HTML> Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/overview-tree.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/package-list =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/package-list (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/package-list 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1 @@ +org.tp23.demo Added: pal-portal/modules/ant-installer/trunk/demo/doc/packages.html =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/packages.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/packages.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,32 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.4.2_01) on Tue Nov 02 02:03:53 CET 2004 --> +<META http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<TITLE> + +</TITLE> + + +<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> + + +</HEAD> + +<BODY BGCOLOR="white"> + +<BR> + +<BR> + +<BR> +<CENTER> +The front page has been relocated.Please see: +<BR> + <A HREF="index.html">Frame version</A> +<BR> + <A HREF="org/tp23/demo/package-summary.html">Non-frame version.</A></CENTER> + +</BODY> +</HTML> Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/packages.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/doc/resources/inherit.gif =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/resources/inherit.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/demo/doc/stylesheet.css =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/doc/stylesheet.css (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/doc/stylesheet.css 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,29 @@ +/* Javadoc style sheet */ + +/* Define colors, fonts and other style attributes here to override the defaults */ + +/* Page background color */ +body { background-color: #FFFFFF } + +/* Headings */ +h1 { font-size: 145% } + +/* Table colors */ +.TableHeadingColor { background: #CCCCFF } /* Dark mauve */ +.TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ +.TableRowColor { background: #FFFFFF } /* White */ + +/* Font used in left-hand frame lists */ +.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif } +.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } +.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } + +/* Navigation bar fonts and colors */ +.NavBarCell1 { background-color:#EEEEFF;} /* Light mauve */ +.NavBarCell1Rev { background-color:#00008B;} /* Dark Blue */ +.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} +.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} + +.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} +.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} + Property changes on: pal-portal/modules/ant-installer/trunk/demo/doc/stylesheet.css ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/install.cmd =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/install.cmd (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/install.cmd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,44 @@ + @ echo off +REM #!/bin/sh +if "%JAVA_HOME%" == "" goto nojava + +setlocal + +set AI_LIB=..\lib +set ANT_LIB=..\antlib +set CLASSPATH=%AI_LIB%\xercesImpl.jar;%AI_LIB%\xml-apis.jar;%AI_LIB%\ant-installer.jar +set CLASSPATH=%CLASSPATH%;%AI_LIB%\jgoodies-edited-1_2_2.jar +set CLASSPATH=%CLASSPATH%;%ANT_LIB%\ant.jar;%ANT_LIB%\ant-launcher.jar +set CLASSPATH=%CLASSPATH%;.\installclasspath + + + +REM set CLASSPATH=%CLASSPATH%;.\installlib\ant-weblogic.jar;.\installlib\ant-javamail.jar + +set INTERFACE=default +set COMMAND=%JAVA_HOME%\bin\java +if "%1" == "text" goto settext +if "%1" == "swing" goto setswing +goto install + +:settext +set COMMAND=%JAVA_HOME%\bin\java +set INTERFACE=text +goto install + +:setswing +set COMMAND=%JAVA_HOME%\bin\javaw +set INTERFACE=swing +goto install + +:install + +start "AntInstaller" "%COMMAND%" -classpath %CLASSPATH% org.tp23.antinstaller.runtime.ExecInstall %INTERFACE% . +goto end + +:nojava +echo you must install java to run this applicaiton +goto end + +endlocal +:end \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/demo/install.cmd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/install.sh =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/install.sh (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/install.sh 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,37 @@ +#!/bin/sh + +# find the command called's root e.g. ./build/ +dir=`expr match "$0" '\(.*\)install.sh'` +# if it we did not call ./ change to the directory we called +if [ "$dir" != "./" ] ; then + if [ "$dir" != "" ] ; then + echo changing to $dir + cd "$dir" ; + fi +fi + + + +if [ "$JAVA_HOME" = "" ] ; then + echo set JAVA_HOME; + exit 1; +fi + +AI_LIB=../lib +ANT_LIB=../antlib +CLASSPATH=${AI_LIB}/xercesImpl.jar:${AI_LIB}/xml-apis.jar:${AI_LIB}/ant-installer.jar +CLASSPATH=$CLASSPATH:${AI_LIB}/jgoodies-edited-1_2_2.jar +CLASSPATH=$CLASSPATH:${ANT_LIB}/ant.jar:${ANT_LIB}/ant-launcher.jar +CLASSPATH=$CLASSPATH:./installclasspath + + +### add other ant jars required here and add them to the install package +#CLASSPATH=$CLASSPATH:./installlib/ant-weblogic.jar:./installlib/ant-javamail.jar + +COMMAND=$JAVA_HOME/bin/java +INTERFACE=default +if [ "$1" != "" ] ; then + INTERFACE=$1; +fi + +$COMMAND -classpath $CLASSPATH org.tp23.antinstaller.runtime.ExecInstall $INTERFACE . Property changes on: pal-portal/modules/ant-installer/trunk/demo/install.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/GPL.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/GPL.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/GPL.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,148 @@ +GNU LESSER GENERAL PUBLIC LICENSE +Version 2.1, February 1999 + +Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] + +Preamble + +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. + +This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. + +When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. + +To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. + +For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. + +We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. + +To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. + +Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. + +Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. + +When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. + +We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. + +For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. + +In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. + +Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. + +The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. + +GNU LESSER GENERAL PUBLIC LICENSE +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". + +A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. + +The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) + +"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. + +1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + +a) The modified work must itself be a software library. + +b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. + +c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. + +d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. + +(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. + +Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. + +This option is useful when you wish to copy part of the code of the Library into a program that is not a library. + +4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. + +If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. + +5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. + +However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. + +When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. + +If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) + +Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. + +6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. + +You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: + +a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) + +b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. + +c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. + +d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. + +e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. + +For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. + +7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: + +a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. + +b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. + +8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. + +10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. + +11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. + +14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + Property changes on: pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/GPL.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/gkmain_inv.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/gkmain_inv.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/greens.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/greens.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/rockstiles.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/demo/installclasspath/resources/rockstiles.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/demo/installer/antinstall-config.xml =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/installer/antinstall-config.xml (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/installer/antinstall-config.xml 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,133 @@ +<?xml version="1.0"?> +<!DOCTYPE installer PUBLIC "-//tp23 //DTD Ant Installer Config//EN" "http://antinstaller.sf.net/dtd/antinstall-config-0.7.dtd"> +<!-- + +This is an example installer from which you can start a project +Edit this file to select the properties you want decided, at the end +of the installation screen the properties will be available in a file +in the current directory for your ant script + + +lookAndFeel="com.jgoodies.plaf.windows.ExtWindowsLookAndFeel" - not recommended since it is not linux compatible due to Micro$oft License restrictions + +lookAndFeel="net.sourceforge.mlf.metouia.MetouiaLookAndFeel" - good, and cross platform + +lookAndFeel="com.jgoodies.plaf.plastic.Plastic3DLookAndFeel" - good, and cross platform + +lookAndFeel="com.jgoodies.plaf.plastic.PlasticXPLookAndFeel" - good, and cross platform + +lookAndFeel="com.jgoodies.plaf.plastic.PlasticLookAndFeel" - good but flat, and cross platform +--> + +<!-- + +defaultImageResource,windowIcon,resource and imageResource load from the classpath +the installer script should put the locations of these resources on the classpath + +--> +<installer + ui="swing,text" + verbose="false" + lookAndFeel="org.tp23.jgoodies.plaf.plastic.PlasticXPLookAndFeel" + name="Demo Installer" + windowIcon="/resources/gkmain_inv.png" + defaultImageResource="/resources/greens.png" + minJavaVersion="1.4"> + <!-- each page element represents a page of the installer --> + <page + type="input" + name="intro" + displayText="Welcome to the example installer program" + imageResource="/resources/greens.png"> + <comment + displayText="This is a demo install" + title="true"/> + <comment + displayText="The application installed is yer typical Hello World" + bold="true"/> + <comment + displayText="There is not much more to be said really."/> + </page> + <!-- type="license" shows a license page to click through --> + <page + type="license" + name="license" + displayText="License conditions" + resource="/resources/GPL.txt" + imageResource="/resources/rockstiles.png"> + </page> + <!-- type="input" shows a list of editable options for the installer --> + <page + type="input" + name="properties" + displayText="Required install options"> + <directory + property="installDir" + defaultValue="/usr/local/demoapp" + defaultValueWin="${env.ProgramFiles}\demoapp" + displayText="Select an installation directory" + create="true"/> + </page> + <page + type="input" + name="selector" + displayText="Components to install"> + <comment + displayText="Choose the components you want to install" + bold="true"/> + <target + displayText="Core components" + target="default" + defaultValue="true" + force="true"/> + <target + displayText="Source code" + target="tgsrc" + defaultValue="false"/> + <target + displayText="Documentation" + target="tgdoc" + defaultValue="true"/> + </page> + <!-- These are some other input types --> + <page + type="input" + name="other-input-types" + displayText="Pointless install options"> + <text + property="TextProperty" + defaultValue="blah blah" + displayText="Enter any text"/> + <checkbox + property="BooleanProperty" + displayText="Make a boolean decision" + defaultValue="true" + force="false"/> + <select + property="Colour" + defaultValue="#FF0000" + displayText="Choose the option" + explanatoryText="This field can be used on any input field to render further descriptive text"> + <option text="Red" value="#FF0000"/> + <option text="Green" value="#00FF00"/> + <option text="Blue" value="#0000FF"/> + </select> + <file + property="SelectedFile" + defaultValue="/usr/tomcat/webapps/default/WEB-INF/web.xml" + defaultValueWin="C:\autoexec.bat" + displayText="Select a file" + checkExists="false"/> + </page> + <!-- page type="progress" shows a progress page with the install button + Its target is set to cleanuptarget since it is the last page this target will be run last--> + <page + type="progress" + name="progress" + showTargets="true" + displayText="Installation progress" + target="cleanuptarget"> + </page> +</installer> + + Property changes on: pal-portal/modules/ant-installer/trunk/demo/installer/antinstall-config.xml ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/installer/build.xml =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/installer/build.xml (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/installer/build.xml 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,107 @@ +<?xml version="1.0"?> +<!-- + +This is the build.xml run by AntInstaller for the demo app + +It is a normal Ant build script, but remember that it is run in a similar +way to running +> ant -buildfile build.xml default,tgdoc,tgsrc + +this is targets selected in the selector page have dependencies those +dependencies may be run once for each target selected +e.g. if tgdoc had depends="default" and the installer passed +default,tgdoc ant would run default then default again then tgdoc + +To avoid this problem targets can be forced in the gui using the following +input in the page to choose components to install + <input + type="target" + displayText="Core components" + target="default" + defaultValue="true" + force="true"/> + +--> + +<project name="Installation Build" default="" basedir="${basedir}"> + + <!-- this is required to pick up the properties generated during the install pages --> + <property file="${basedir}/ant.install.properties"/> + + + <target name="default" depends=""> + <echo message="Colour selected [${Colour}]"/> + <echo message="Installation Directory [${installDir}]"/> + <echo message="Entered Property [${TextProperty}]"/> + <echo message="Checkbox Property [${BooleanProperty}]"/> + <echo message="File [${SelectedFile}]"/> + <!-- this is an exagerated example + clearly + <unzip src="installpack.zip" dest="${basedir}/temp"/> + <replace ... + would be sufficient + --> + <mkdir dir="${basedir}/temp"/> + <unzip src="installpack.zip" dest="${basedir}/temp"/> + <mkdir dir="${installDir}"/> + <mkdir dir="${installDir}/classes"/> + <mkdir dir="${installDir}/config"/> + <mkdir dir="${installDir}/lib"/> + <copy + file="${basedir}/temp/bin/run.sh" + tofile="${installDir}/run.sh" + overwrite="true"/> + <copy + file="${basedir}/temp/bin/run.cmd" + tofile="${installDir}/run.cmd" + overwrite="true"/> + <chmod file="${installDir}/run.sh" perm="774"/> + <copy + file="${basedir}/temp/README.txt" + todir="${installDir}" + overwrite="true"/> + <copy + todir="${installDir}/classes" + overwrite="true"> + <fileset dir="${basedir}/temp/classes"/> + </copy> + <copy + todir="${installDir}/config" + overwrite="true"> + <fileset dir="${basedir}/temp/config"/> + </copy> + <replace file="${installDir}/config/example-config.xml"> + <replacefilter token="@TextProperty@" value="${TextProperty}"/> + <replacefilter token="@SelectedFile@" value="${SelectedFile}"/> + <replacefilter token="@Colour@" value="${Colour}"/> + <replacefilter token="@BooleanProperty@" value="${BooleanProperty}"/> + </replace> + <replace file="${installDir}/config/demo.properties"> + <replacefilter token="@TextProperty@" value="${TextProperty}"/> + <replacefilter token="@SelectedFile@" value="${SelectedFile}"/> + <replacefilter token="@Colour@" value="${Colour}"/> + <replacefilter token="@BooleanProperty@" value="${BooleanProperty}"/> + </replace> + </target> + + <target name="tgdoc" depends=""> + <echo message="Installing documentation files"/> + <mkdir dir="${installDir}/doc"/> + <copy todir="${installDir}/doc" overwrite="true"> + <fileset dir="${basedir}/temp/doc"/> + </copy> + </target> + + <target name="tgsrc" depends=""> + <echo message="Installing Source files"/> + <mkdir dir="${installDir}/src"/> + <copy todir="${installDir}/src" overwrite="true"> + <fileset dir="${basedir}/temp/src"/> + </copy> + </target> + + <target name="cleanuptarget" depends=""> + <delete dir="${basedir}/temp"> + </delete> + </target> +</project> Property changes on: pal-portal/modules/ant-installer/trunk/demo/installer/build.xml ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/src/org/tp23/demo/Demonstration.java =================================================================== --- pal-portal/modules/ant-installer/trunk/demo/src/org/tp23/demo/Demonstration.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/demo/src/org/tp23/demo/Demonstration.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,85 @@ +package org.tp23.demo; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.Iterator; +import java.util.Properties; + +import javax.swing.ImageIcon; +import javax.swing.JOptionPane; +import javax.swing.JFrame; + +/** + * + * <p>Title: Example Application</p> + * <p>Description: Prints Hello World, trys to do it in a pop up box +* if a Throwable is thrown (e.g. no X) it prints to System.out</p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version 1.0 + */ +public class Demonstration { + private static ImageIcon icon ; + static{ + try { + InputStream in = Demonstration.class.getResourceAsStream("/resources/demo.png"); + byte[] data = new byte[11437]; + for (int i = 0; i < data.length; i++) { + data[i]=(byte)in.read(); + } + icon = new ImageIcon(data); + } + catch (IOException e) { + e.printStackTrace(); + } + } + + public static void main(String[] args) { + try{ + JOptionPane.showMessageDialog(null, + "Demo Application \n\n" + + "Deployed with: "+ + "http://antinstaller.sourceforge.net \n" + + "Built by: "+ + "http://ant.apache.org \n" + + "See also: "+ + "http://httpfileserver.sourceforge.net \n\n" + + "This project is Apache licensed \n\n" + + "Properties selected while installing \n\n" + + initProps(), + "About - Demo App", + JOptionPane.INFORMATION_MESSAGE, + icon); + }catch(Throwable t){ + System.out.println("Hello World"); + } + System.exit(0); + } + private static String initProps() { + StringBuffer userProperties = new StringBuffer(); + try { + Properties props = new Properties(); + props.load(new FileInputStream(new File("./config/demo.properties"))); + Iterator iter = props.keySet().iterator(); + while(iter.hasNext()){ + String key = (String)iter.next(); + userProperties.append(key) + .append("=") + .append(props.getProperty(key)) + .append('\n'); + } + } + catch (FileNotFoundException e) { + e.printStackTrace(); + } + catch (IOException e) { + e.printStackTrace(); + } + return userProperties.toString(); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/demo/src/org/tp23/demo/Demonstration.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/demo/src/resources/demo.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/demo/src/resources/demo.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/icons/128x128/apps/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/icons/128x128/apps/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/icons/16x16/apps/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/icons/16x16/apps/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/icons/22x22/apps/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/icons/22x22/apps/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/icons/24x24/AntInstaller.ico =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/icons/24x24/AntInstaller.ico ___________________________________________________________________ Name: svn:mime-type + image/x-icon Added: pal-portal/modules/ant-installer/trunk/icons/24x24/apps/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/icons/24x24/apps/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/icons/32x32/apps/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/icons/32x32/apps/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/icons/48x48/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/icons/48x48/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/icons/48x48/apps/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/icons/48x48/apps/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/icons/64x64/apps/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/icons/64x64/apps/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo-50.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo-50.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo-bw.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo-bw.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo-onwhite.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo-onwhite.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/AntInstaller-text-logo.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/README.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/images/README.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/README.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,21 @@ +AntInstaller Image Readme + + +This pack is spearate from the main AntInstaller download +for two reasons +1) to keep the size of the ant-installer.jar down +2) to allow inclusion of the (excelent) crystal icons +licensed under LGPL + +All default Icons and images are licensed under Apache2.0 + by Paul Hinds + +Crystal Icons + http://www.everaldo.com/crystal.html + +N.B. everaldo produces comercial icons as well it should +not be assumed that everaldo icons are LGPL generally. +Icons in this pack are based on icons included with KDE +which are LGPL. +Personal/Business contact with everaldo send direct +e-mail to evera****@evera***** \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/images/README.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/images/extract-images/crystal/extract-image.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/extract-images/crystal/extract-image.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/extract-images/crystal-images.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/images/extract-images/crystal-images.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/extract-images/crystal-images.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,4 @@ +Crystal Icons from KDE install + +http://www.everaldo.com/crystal.html +License : LGPL \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/images/extract-images/crystal-images.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/images/extract-images/crystal2/extract-image.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/extract-images/crystal2/extract-image.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/extract-images/crystal3/extract-image.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/extract-images/crystal3/extract-image.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/extract-images/default/extract-image.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/extract-images/default/extract-image.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/extract-images/default-images.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/images/extract-images/default-images.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/extract-images/default-images.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,5 @@ +Default Icons: Paul Hinds + +http://java.riereta.net + +License: Apache 2.0 \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/images/extract-images/default-images.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/LICENSE =================================================================== --- pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/LICENSE (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/LICENSE 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,505 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + + Added: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/back.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/back.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/cancel.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/cancel.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/finish.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/finish.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/next.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/next.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/ok.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/ok.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/showdetails.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/amaranth/resources/icons/showdetails.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/LICENSE =================================================================== --- pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/LICENSE (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/LICENSE 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,56 @@ +The Fedora Project + +Individual Contributor License Agreement (CLA) + +[WWW] http://fedoraproject.org/wiki/Legal/Licenses/CLA + +Thank you for your interest in The Fedora Project (the "Project"). In order to clarify the intellectual property license granted with Contributions from any person or entity, Red Hat, Inc. ("Red Hat"), as maintainer of the Project, must have a Contributor License Agreement (CLA) on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for Your protection as a Contributor as well as the protection of the Project and its users; it does not change your rights to use your own Contributions for any other purpose. + +You and the Project hereby accept and agree to the following terms and conditions: + + * + + 1. Contributors and Contributions. + o + + A. The Project and any individual or legal entity that voluntarily submits to the Project a Contribution are collectively addressed herein as "Contributors". For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + o + + B. A "Contribution" is any original work, including any modification or addition to an existing work, that has been submitted for inclusion in, or documentation of, any of the products owned or managed by the Project, where such work originates from that particular Contributor or from some entity acting on behalf of that Contributor. + o + + C. A Contribution is "submitted" when any form of electronic, verbal, or written communication is sent to the Project, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Project for the purpose of discussing or improving software or documentation of the Project, but excluding communication that is conspicuously marked or otherwise designated in writing by you as "Not a Contribution." + o + + D. Any Contribution submitted by you to the Project shall be under the terms and conditions of this License, without any additional terms or conditions, unless you explicitly state otherwise in the submission. + * + + 2. Contributor Grant of License. You hereby grant to Red Hat, Inc., on behalf of the Project, and to recipients of software distributed by the Project: + o + + (a) a perpetual, non-exclusive, worldwide, fully paid-up, royalty free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute your Contribution and such derivative works; and, + o + + (b) a perpetual, non-exclusive, worldwide, fully paid-up, royalty free, irrevocable (subject to Section 3) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer your Contribution and derivative works thereof, where such license applies only to those patent claims licensable by you that are necessarily infringed by your Contribution alone or by combination of your Contribution with the work to which you submitted the Contribution. Except for the license granted in this section, you reserve all right, title and interest in and to your Contributions. + * + + 3. Reciprocity. As of the date any such litigation is filed, your patent grant shall immediately terminate with respect to any party that institutes patent litigation against you (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the work to which you have contributed, constitutes direct or contributory patent infringement. + * + + 4. You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to the Project, or that your employer has executed a separate Corporate CLA with the Project. + * + + 5. You represent that each of your Contributions is your original creation (see section 7 for submissions on behalf of others). You represent that your Contribution submission(s) include complete details of any third-party license or other restriction (including, but not limited to, related copyright, patents and trademarks) of which you are personally aware and which are associated with any part of your Contribution. + * + + 6. You are not expected to provide support for your Contributions, except to the extent you desire to provide support. You may provide support for free, for a fee, or not at all. Your Contributions are provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. + * + + 7. Should you wish to submit work that is not your original creation, you may submit it to the Project separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [named here]". + * + + 8. You agree to notify the Project of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect. + * + + 9. The Project is under no obligations to accept and include every contribution. + Added: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/back.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/back.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/cancel.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/cancel.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/finish.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/finish.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/next.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/next.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/ok.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/ok.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/showdetails.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/bluecurve/resources/icons/showdetails.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/LICENSE =================================================================== --- pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/LICENSE (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/LICENSE 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,12 @@ +This copyright and license notice covers the images in this directory. +Note the license notice contains an add-on. + +KDE Crystal theme icons. +Copyright (C) 2002 and following years KDE Artists +This library is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free +Software Foundation, version 2.1 of the License. + +This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. \ No newline at end of file Added: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/back.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/back.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/cancel.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/cancel.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/finish.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/finish.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/next.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/next.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/ok.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/ok.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/showdetails.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/crystalsvg/resources/icons/showdetails.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/LICENSE =================================================================== --- pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/LICENSE (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/LICENSE 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,86 @@ +Eclipse Public License - v 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENTâS ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + + a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and + b) in the case of each subsequent Contributor: + + i)changes to the Program, and + + ii)additions to the Program; + + where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributorâs behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. + +"Program" means the Contributions distributed in accordance with this Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. + +2. GRANT OF RIGHTS + +a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. + +b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipientâs responsibility to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: + + a) it complies with the terms and conditions of this Agreement; and + + b) its license agreement: + + i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; + + ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; + + iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and + + iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. + +When the Program is made available in source code form: + + a) it must be made available under this Agreement; and + + b) a copy of this Agreement must be included with each copy of the Program. + +Contributors may not remove or alter any copyright notices contained within the Program. + +Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributorâs responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipientâs patent(s), then such Recipientâs rights granted under Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipientâs rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipientâs rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipientâs obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. \ No newline at end of file Added: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/back.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/back.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/cancel.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/cancel.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/finish.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/finish.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/next.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/next.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/ok.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/ok.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/showdetails.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/eclipse/resources/icons/showdetails.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/LICENSE =================================================================== --- pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/LICENSE (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/LICENSE 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + Added: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/back.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/back.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/cancel.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/cancel.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/finish.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/finish.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/next.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/next.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/ok.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/ok.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/showdetails.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/navicons/krystaline/resources/icons/showdetails.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/resources/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/resources/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/resources/LICENSE-ant-install.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/images/resources/LICENSE-ant-install.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/resources/LICENSE-ant-install.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2005 Paul Hinds + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. Property changes on: pal-portal/modules/ant-installer/trunk/images/resources/LICENSE-ant-install.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/images/resources/antbar.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/resources/antbar.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/resources/banner23.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/resources/banner23.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/resources/extract-image.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/resources/extract-image.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/resources/gkmain_inv.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/resources/gkmain_inv.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/resources/gothbar.gif =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/resources/gothbar.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/images/resources/greens.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/resources/greens.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/resources/makewavesdawn.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/resources/makewavesdawn.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/resources/rockstiles.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/resources/rockstiles.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/titlebars/antbar.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/titlebars/antbar.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/titlebars/banner23.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/titlebars/banner23.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/titlebars/default-images.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/images/titlebars/default-images.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/titlebars/default-images.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,5 @@ +Default Icons: Paul Hinds + +http://java.riereta.net + +License: Apache 2.0 \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/images/titlebars/default-images.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/images/titlebars/empty-template.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/titlebars/empty-template.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/titlebars/gothbar.gif =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/titlebars/gothbar.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/images/titlebars/greens.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/titlebars/greens.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/titlebars/makewavesdawn.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/titlebars/makewavesdawn.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/titlebars/rockstiles.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/images/titlebars/rockstiles.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/images/tool-credits.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/images/tool-credits.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/images/tool-credits.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,17 @@ + + <ant-installer> + _-------_ + \ ()0o< / + \ /|\ / + \ / + \ / + 揃 +Default icons created with + + - inkscape - +http://www.inkscape.org + + - and the gimp - + http://www.gimp.org + + Property changes on: pal-portal/modules/ant-installer/trunk/images/tool-credits.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/kde-icons/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/kde-icons/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-demo.desktop =================================================================== --- pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-demo.desktop (rev 0) +++ pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-demo.desktop 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,14 @@ +[Desktop Entry] +Comment=AntInstaller Demo +Path=@installDir@ +Icon=@installDir@/kde-icons/AntInstaller.png +Exec=java -jar '@installDir@/demo/artifacts/demo-installer.jar' +Name=AntInstaller Demo +StartupNotify=true +Terminal=0 +TerminalOptions= +Type=Application +Encoding=UTF-8 +X-KDE-SubstituteUID=false +X-KDE-Username= +Categories=Development;Java \ No newline at end of file Added: pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-docs.desktop =================================================================== --- pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-docs.desktop (rev 0) +++ pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-docs.desktop 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,14 @@ +[Desktop Entry] +Comment=AntInstaller Docs +Path=@installDir@ +Icon=@installDir@/kde-icons/AntInstaller.png +Exec=kfmclient exec '@installDir@/web/index.html' +Name=AntInstaller Docs +StartupNotify=true +Terminal=0 +TerminalOptions= +Type=Application +Encoding=UTF-8 +X-KDE-SubstituteUID=false +X-KDE-Username= +Categories=Development;Java \ No newline at end of file Added: pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-wizard.desktop =================================================================== --- pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-wizard.desktop (rev 0) +++ pal-portal/modules/ant-installer/trunk/kde-icons/antinstaller-wizard.desktop 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,14 @@ +[Desktop Entry] +Comment=AntInstaller Project Wizard +Path=@installDir@ +Icon=@installDir@/kde-icons/AntInstaller.png +Exec='@installDir@/wizard.sh' +Name=AntInstaller Wizard +StartupNotify=true +Terminal=0 +TerminalOptions= +Type=Application +Encoding=UTF-8 +X-KDE-SubstituteUID=false +X-KDE-Username= +Categories=Development;Java \ No newline at end of file Added: pal-portal/modules/ant-installer/trunk/lib/LICENSE-ant-install.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/lib/LICENSE-ant-install.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/lib/LICENSE-ant-install.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. Property changes on: pal-portal/modules/ant-installer/trunk/lib/LICENSE-ant-install.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/lib/LICENSE-ant.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/lib/LICENSE-ant.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/lib/LICENSE-ant.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,203 @@ +/* + * Apache License + * Version 2.0, January 2004 + * http://www.apache.org/licenses/ + * + * TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + * + * 1. Definitions. + * + * "License" shall mean the terms and conditions for use, reproduction, + * and distribution as defined by Sections 1 through 9 of this document. + * + * "Licensor" shall mean the copyright owner or entity authorized by + * the copyright owner that is granting the License. + * + * "Legal Entity" shall mean the union of the acting entity and all + * other entities that control, are controlled by, or are under common + * control with that entity. For the purposes of this definition, + * "control" means (i) the power, direct or indirect, to cause the + * direction or management of such entity, whether by contract or + * otherwise, or (ii) ownership of fifty percent (50%) or more of the + * outstanding shares, or (iii) beneficial ownership of such entity. + * + * "You" (or "Your") shall mean an individual or Legal Entity + * exercising permissions granted by this License. + * + * "Source" form shall mean the preferred form for making modifications, + * including but not limited to software source code, documentation + * source, and configuration files. + * + * "Object" form shall mean any form resulting from mechanical + * transformation or translation of a Source form, including but + * not limited to compiled object code, generated documentation, + * and conversions to other media types. + * + * "Work" shall mean the work of authorship, whether in Source or + * Object form, made available under the License, as indicated by a + * copyright notice that is included in or attached to the work + * (an example is provided in the Appendix below). + * + * "Derivative Works" shall mean any work, whether in Source or Object + * form, that is based on (or derived from) the Work and for which the + * editorial revisions, annotations, elaborations, or other modifications + * represent, as a whole, an original work of authorship. For the purposes + * of this License, Derivative Works shall not include works that remain + * separable from, or merely link (or bind by name) to the interfaces of, + * the Work and Derivative Works thereof. + * + * "Contribution" shall mean any work of authorship, including + * the original version of the Work and any modifications or additions + * to that Work or Derivative Works thereof, that is intentionally + * submitted to Licensor for inclusion in the Work by the copyright owner + * or by an individual or Legal Entity authorized to submit on behalf of + * the copyright owner. For the purposes of this definition, "submitted" + * means any form of electronic, verbal, or written communication sent + * to the Licensor or its representatives, including but not limited to + * communication on electronic mailing lists, source code control systems, + * and issue tracking systems that are managed by, or on behalf of, the + * Licensor for the purpose of discussing and improving the Work, but + * excluding communication that is conspicuously marked or otherwise + * designated in writing by the copyright owner as "Not a Contribution." + * + * "Contributor" shall mean Licensor and any individual or Legal Entity + * on behalf of whom a Contribution has been received by Licensor and + * subsequently incorporated within the Work. + * + * 2. Grant of Copyright License. Subject to the terms and conditions of + * this License, each Contributor hereby grants to You a perpetual, + * worldwide, non-exclusive, no-charge, royalty-free, irrevocable + * copyright license to reproduce, prepare Derivative Works of, + * publicly display, publicly perform, sublicense, and distribute the + * Work and such Derivative Works in Source or Object form. + * + * 3. Grant of Patent License. Subject to the terms and conditions of + * this License, each Contributor hereby grants to You a perpetual, + * worldwide, non-exclusive, no-charge, royalty-free, irrevocable + * (except as stated in this section) patent license to make, have made, + * use, offer to sell, sell, import, and otherwise transfer the Work, + * where such license applies only to those patent claims licensable + * by such Contributor that are necessarily infringed by their + * Contribution(s) alone or by combination of their Contribution(s) + * with the Work to which such Contribution(s) was submitted. If You + * institute patent litigation against any entity (including a + * cross-claim or counterclaim in a lawsuit) alleging that the Work + * or a Contribution incorporated within the Work constitutes direct + * or contributory patent infringement, then any patent licenses + * granted to You under this License for that Work shall terminate + * as of the date such litigation is filed. + * + * 4. Redistribution. You may reproduce and distribute copies of the + * Work or Derivative Works thereof in any medium, with or without + * modifications, and in Source or Object form, provided that You + * meet the following conditions: + * + * (a) You must give any other recipients of the Work or + * Derivative Works a copy of this License; and + * + * (b) You must cause any modified files to carry prominent notices + * stating that You changed the files; and + * + * (c) You must retain, in the Source form of any Derivative Works + * that You distribute, all copyright, patent, trademark, and + * attribution notices from the Source form of the Work, + * excluding those notices that do not pertain to any part of + * the Derivative Works; and + * + * (d) If the Work includes a "NOTICE" text file as part of its + * distribution, then any Derivative Works that You distribute must + * include a readable copy of the attribution notices contained + * within such NOTICE file, excluding those notices that do not + * pertain to any part of the Derivative Works, in at least one + * of the following places: within a NOTICE text file distributed + * as part of the Derivative Works; within the Source form or + * documentation, if provided along with the Derivative Works; or, + * within a display generated by the Derivative Works, if and + * wherever such third-party notices normally appear. The contents + * of the NOTICE file are for informational purposes only and + * do not modify the License. You may add Your own attribution + * notices within Derivative Works that You distribute, alongside + * or as an addendum to the NOTICE text from the Work, provided + * that such additional attribution notices cannot be construed + * as modifying the License. + * + * You may add Your own copyright statement to Your modifications and + * may provide additional or different license terms and conditions + * for use, reproduction, or distribution of Your modifications, or + * for any such Derivative Works as a whole, provided Your use, + * reproduction, and distribution of the Work otherwise complies with + * the conditions stated in this License. + * + * 5. Submission of Contributions. Unless You explicitly state otherwise, + * any Contribution intentionally submitted for inclusion in the Work + * by You to the Licensor shall be under the terms and conditions of + * this License, without any additional terms or conditions. + * Notwithstanding the above, nothing herein shall supersede or modify + * the terms of any separate license agreement you may have executed + * with Licensor regarding such Contributions. + * + * 6. Trademarks. This License does not grant permission to use the trade + * names, trademarks, service marks, or product names of the Licensor, + * except as required for reasonable and customary use in describing the + * origin of the Work and reproducing the content of the NOTICE file. + * + * 7. Disclaimer of Warranty. Unless required by applicable law or + * agreed to in writing, Licensor provides the Work (and each + * Contributor provides its Contributions) on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied, including, without limitation, any warranties or conditions + * of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + * PARTICULAR PURPOSE. You are solely responsible for determining the + * appropriateness of using or redistributing the Work and assume any + * risks associated with Your exercise of permissions under this License. + * + * 8. Limitation of Liability. In no event and under no legal theory, + * whether in tort (including negligence), contract, or otherwise, + * unless required by applicable law (such as deliberate and grossly + * negligent acts) or agreed to in writing, shall any Contributor be + * liable to You for damages, including any direct, indirect, special, + * incidental, or consequential damages of any character arising as a + * result of this License or out of the use or inability to use the + * Work (including but not limited to damages for loss of goodwill, + * work stoppage, computer failure or malfunction, or any and all + * other commercial damages or losses), even if such Contributor + * has been advised of the possibility of such damages. + * + * 9. Accepting Warranty or Additional Liability. While redistributing + * the Work or Derivative Works thereof, You may choose to offer, + * and charge a fee for, acceptance of support, warranty, indemnity, + * or other liability obligations and/or rights consistent with this + * License. However, in accepting such obligations, You may act only + * on Your own behalf and on Your sole responsibility, not on behalf + * of any other Contributor, and only if You agree to indemnify, + * defend, and hold each Contributor harmless for any liability + * incurred by, or claims asserted against, such Contributor by reason + * of your accepting any such warranty or additional liability. + * + * END OF TERMS AND CONDITIONS + * + * APPENDIX: How to apply the Apache License to your work. + * + * To apply the Apache License to your work, attach the following + * boilerplate notice, with the fields enclosed by brackets "[]" + * replaced with your own identifying information. (Don't include + * the brackets!) The text should be enclosed in the appropriate + * comment syntax for the file format. We also recommend that a + * file or class name and description of purpose be included on the + * same "printed page" as the copyright notice for easier + * identification within third-party archives. + * + * Copyright [yyyy] [name of copyright owner] + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ Property changes on: pal-portal/modules/ant-installer/trunk/lib/LICENSE-ant.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/lib/LICENSE-dom.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/lib/LICENSE-dom.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/lib/LICENSE-dom.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,71 @@ +This license came from: +http://www.w3.org/Consortium/Legal/copyright-software-19980720 + + +W3C® SOFTWARE NOTICE AND LICENSE +Copyright © 1994-2001 World +Wide Web Consortium, <a href="http://www.w3.org/">World +Wide Web Consortium</a>, (<a href= +"http://www.lcs.mit.edu/">Massachusetts Institute of +Technology</a>, <a href="http://www.inria.fr/">Institut National de +Recherche en Informatique et en Automatique</a>, <a href= +"http://www.keio.ac.jp/">Keio University</a>). All Rights Reserved. +http://www.w3.org/Consortium/Legal/ + +This W3C work (including software, documents, or other related +items) is being provided by the copyright holders under the +following license. By obtaining, using and/or copying this work, +you (the licensee) agree that you have read, understood, and will +comply with the following terms and conditions: +Permission to use, copy, modify, and distribute this software +and its documentation, with or without modification, for any +purpose and without fee or royalty is hereby granted, provided that +you include the following on ALL copies of the software and +documentation or portions thereof, including modifications, that +you make: + +The full text of this NOTICE in a location viewable to users of +the redistributed or derivative work. + +Any pre-existing intellectual property disclaimers, notices, or +terms and conditions. If none exist, a short notice of the +following form (hypertext is preferred, text is permitted) should +be used within the body of any redistributed or derivative code: +"Copyright © [$date-of-software] World Wide Web Consortium, (Massachusetts Institute of +Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. +http://www.w3.org/Consortium/Legal/" + +Notice of any changes or modifications to the W3C files, +including the date changes were made. (We recommend you provide +URIs to the location from which the code is derived.) + +THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND +COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF +MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE +USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD +PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, +SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE +SOFTWARE OR DOCUMENTATION. + +The name and trademarks of copyright holders may NOT be used in +advertising or publicity pertaining to the software without +specific, written prior permission. Title to copyright in this +software and any associated documentation will at all times remain +with copyright holders. +____________________________________ +This formulation of W3C's notice and license became active on +August 14 1998 so as to improve compatibility with GPL. This +version ensures that W3C software licensing terms are no more +restrictive than GPL and consequently W3C software may be +distributed in GPL packages. See the older formulation for the +policy prior to this date. Please see our Copyright FAQ for common +questions about using materials from +our site, including specific terms and conditions for packages like +libwww, Amaya, and Jigsaw. +Other questions about this notice can be +directed to site-****@w3*****. + +webmaster Property changes on: pal-portal/modules/ant-installer/trunk/lib/LICENSE-dom.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/lib/LICENSE-jgoodies.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/lib/LICENSE-jgoodies.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/lib/LICENSE-jgoodies.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,31 @@ + + The BSD License for the JGoodies Looks + ====================================== + +Copyright (c) 2001-2004 JGoodies Karsten Lentzsch. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + o Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + o Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + o Neither the name of JGoodies Karsten Lentzsch nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Property changes on: pal-portal/modules/ant-installer/trunk/lib/LICENSE-jgoodies.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/lib/LICENSE-sax.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/lib/LICENSE-sax.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/lib/LICENSE-sax.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,20 @@ +This license came from: http://www.megginson.com/SAX/copying.html + However please note future versions of SAX may be covered + under http://saxproject.org/?selected=pd + + +This page is now out of date -- see the new SAX site at +http://www.saxproject.org/ for more up-to-date +releases and other information. Please change your bookmarks. + + +SAX2 is Free! + +I hereby abandon any property rights to SAX 2.0 (the Simple API for +XML), and release all of the SAX 2.0 source code, compiled code, and +documentation contained in this distribution into the Public Domain. +SAX comes with NO WARRANTY or guarantee of fitness for any +purpose. + +David Megginson, david****@meggi***** +2000-05-05 \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/lib/LICENSE-sax.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/lib/LICENSE-sysout.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/lib/LICENSE-sysout.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/lib/LICENSE-sysout.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. Property changes on: pal-portal/modules/ant-installer/trunk/lib/LICENSE-sysout.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/lib/LICENSE-xerces.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/lib/LICENSE-xerces.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/lib/LICENSE-xerces.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,56 @@ +/* + * The Apache Software License, Version 1.1 + * + * + * Copyright (c) 1999-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Xerces" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apach****@apach*****. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation and was + * originally based on software copyright (c) 1999, International + * Business Machines, Inc., http://www.ibm.com. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ Property changes on: pal-portal/modules/ant-installer/trunk/lib/LICENSE-xerces.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/lib/ai-icons-amaranth.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/lib/ai-icons-amaranth.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/lib/ai-icons-bluecurve.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/lib/ai-icons-bluecurve.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/lib/ai-icons-crystalsvg.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/lib/ai-icons-crystalsvg.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/lib/ai-icons-eclipse.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/lib/ai-icons-eclipse.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/lib/ai-icons-krystaline.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/lib/ai-icons-krystaline.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/lib/ant-installer-ext.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/lib/ant-installer-ext.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/lib/ant-installer.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/lib/ant-installer.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/lib/jgoodies-edited-1_2_2.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/lib/jgoodies-edited-1_2_2.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/lib/xercesImpl.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/lib/xercesImpl.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/lib/xml-apis.jar =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/lib/xml-apis.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/src/README.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/src/README.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/README.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,109 @@ + +This SelfExtracting archive should be run with Java to start the installation. +________________________________________________________________________________ + +If Java1.4 is installed correctly simply double click the .jar file in your +file browser. + + +To run the installer from the commandline +WINDOWS + C:\> javaw -jar [installer-file].jar +UNIX + > java -jar [installer-file].jar + + +If the .jar extension has been reregistered you will need to specify the Java +command + +WINDOWS + + Right mouse click on the file and select "Open with" then "javaw" + + +LINUX + + Konquerer (KDE) right mouse click and select "Open with" then "java" + + + + + +TROUBLESHOOTING +________________________________________________________________________________ + + +WINDOWS +________________________________________________________________________________ +If you do not have the "javaw" entry in the "Open with" list + Check that you have a current version of Java ( >1.4 ) installed. + The Sun Java installation process registers javaw with .jars in the + installation. + You can reinstall Java if you still have the original installer. + If you don't have the installer, or don't want to reinstall Java, you can + modify the registration of the .jar extension. + In Explorer select "Tools" then "Folder options" + Select the "File types" tab + First check to see if teh JAR Extension is in the list + JAR extension IS in the list + click the "Change" button + find javaw in the list of files + click OK + JAR extension NOT in list + click the New button + enter "jar" as the file extension + Enter <New> as the file type + + + + + +LINUX +________________________________________________________________________________ + +Using X + +Log in to the shell as the user that is running X +Ensure you have exported your DISPLAY variable (echo $DISPLAY) if not export it +> export DISPLAY=127.0.0.1:0 + +Check the default java is the correct version +> java -version + + If the java binary is not found, but you do have Java installed + Add the bin directory of the Java installation to your path + > export PATH=$PATH:[path to Java]/bin + run the installer with > java -jar [installer-file].jar + + If the default java version is below 1.4 + If you do NOT have a recent version installed anywhere on your system + install the Sun Java JRE or SDK for linux. + If/when you DO have a recent version of Java installed + find the location of the java installation + e.g /usr/java/j2sdk1.4.2_04 + export the JAVA_HOME variable of the installation + > export JAVA_HOME=/usr/java/j2sdk1.4.2_04 + run the following command + > $JAVA_HOME/bin/java -jar [installer-file].jar + You should consider adding the export JAVA_HOME entry to your profile + and/or ensure the location of the JAVA_HOME/bin directory for Java >1.4 + is in your PATH + + If the default java version IS above 1.4 + run the installer with > java -jar [installer-file].jar + + +Without X (command line) + +The installer will run on the command line with a text interface if it is not +possible to load the GUI. +running the following command without a DISPLAY variable or in runlevel 3 will +start the installer in text mode +> java -jar [installer-file].jar + + + + + + + \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/src/README.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/DefaultPropertiesFileRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/DefaultPropertiesFileRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/DefaultPropertiesFileRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,108 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller; + +import java.io.File; +import java.io.FileOutputStream; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; + +import org.tp23.antinstaller.input.ConditionalField; +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.SecretPropertyField; +import org.tp23.antinstaller.page.Page; + + + +/** + * + * <p>Outputs the completed Pages as a java Properties file. </p> + * @author Paul Hinds + * @version $Id: DefaultPropertiesFileRenderer.java,v 1.8 2007/01/09 22:41:41 teknopaul Exp $ + */ +public class DefaultPropertiesFileRenderer + implements PropertiesFileRenderer { + + public DefaultPropertiesFileRenderer() { + } + + public void renderProperties(InstallerContext ctx, File baseDir){ + Installer installer = ctx.getInstaller(); + Page[] completedPages = installer.getPages(); + Properties props = new Properties(); + props.put(FILE_ROOT_PROPERTY, baseDir.getAbsolutePath()); + props.setProperty(INSTALLER_VERSION_PROPERTY, + ctx.getInstaller().getVersion()); + + + for (int i = 0; i < completedPages.length; i++) { + OutputField[] fields = completedPages[i].getOutputField(); + + retrieveProperties( fields, props ); + + // print targets selected + List targets = completedPages[i].getTargets(ctx); + if(targets.size() > 0){ + Iterator iterator = targets.iterator(); + StringBuffer targetProperty = new StringBuffer(); + while (iterator.hasNext()) { + String target = (String) iterator.next(); + targetProperty.append(target).append(","); + } + props.put(completedPages[i].getName() + TARGETS_SUFFIX, targetProperty.toString()); + } + + } + try { + File antInstallProperties = new File(baseDir.getAbsolutePath(), PROPERTIES_FILE_NAME); + FileOutputStream fos = new FileOutputStream(antInstallProperties); + props.store(fos, + "Ant Installer - AutoGenerated properties"); + fos.close(); + } + catch (Throwable ex) { + if(ctx.getInstaller().isVerbose()) { + ctx.log(ex); + } + //swallow Exceptions as in contract for this method + } + } + + private void retrieveProperties( OutputField[] fields, Properties props ) { + for (int f = 0; f < fields.length; f++) { + if (fields[f] instanceof SecretPropertyField) { + //InputField field = (InputField)fields[f]; + //props.put(field.getProperty(), "XXXXXXXX"); + } + else if( fields[f] instanceof ConditionalField ) { + ConditionalField confField = (ConditionalField) fields[f]; + retrieveProperties( confField.getFields(), props ); + } + else if (fields[f] instanceof InputField) { + InputField field = (InputField)fields[f]; + + String result = field.getInputResult(); + //Temporary fix for PR 1353906 + if( result == null ) { + result = ""; + } + props.put(field.getProperty(), result); + } + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/DefaultPropertiesFileRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ExplicitPropertiesFileRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ExplicitPropertiesFileRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ExplicitPropertiesFileRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,218 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.util.Date; +import java.util.Iterator; +import java.util.List; + +import org.tp23.antinstaller.input.ConditionalField; +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.SecretPropertyField; +import org.tp23.antinstaller.page.Page; + +/** + * <p>Outputs the completed Pages as a Java Properties file. The file produced is compatible + * with java.util.Properties. </p> + * <p>Output is commented as it is printed to aid debugging</p> + * @see http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#100850 + * @author Paul Hinds + * @version $Id: ExplicitPropertiesFileRenderer.java,v 1.9 2007/01/09 22:41:41 teknopaul Exp $ + */ +public class ExplicitPropertiesFileRenderer + implements PropertiesFileRenderer { + + private static String newLine = System.getProperty("line.separator"); + private static final char[] hexidecimals = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + + public ExplicitPropertiesFileRenderer() { + } + + public void renderProperties(InstallerContext ctx, File baseDir){ + Installer installer = ctx.getInstaller(); + Page[] completedPages = installer.getPages(); + + StringBuffer propertiesData = new StringBuffer(); + propertiesData.append("### Ant Installer - properties auto generated on "); + propertiesData.append( convert(new Date().toString(), true) ); + propertiesData.append(newLine); + propertiesData.append(newLine); + + propertiesData.append(FILE_ROOT_PROPERTY); + propertiesData.append(" = "); + propertiesData.append( convert(baseDir.getAbsolutePath(), true) ); + propertiesData.append(newLine); + + propertiesData.append(INSTALLER_VERSION_PROPERTY); + propertiesData.append(" = "); + propertiesData.append( convert(ctx.getInstaller().getVersion(), true) ); + propertiesData.append(newLine); + + propertiesData.append(newLine); + String property = null; + String value = null; + + + for (int i = 0; i < completedPages.length; i++) { + OutputField[] fields = completedPages[i].getOutputField(); + + propertiesData.append(newLine); + propertiesData.append("## Properties from Page:" + completedPages[i].getName()); + propertiesData.append(newLine); + + retrievePropertiesData( fields, propertiesData ); + + // print targets selected + List targets = completedPages[i].getTargets(ctx); + if(targets.size() > 0){ + Iterator iterator = targets.iterator(); + StringBuffer targetProperty = new StringBuffer(); + while (iterator.hasNext()) { + String target = (String) iterator.next(); + targetProperty.append(target).append(","); + } + propertiesData.append("# Targets selected for page"); + propertiesData.append(newLine); + property = convert(completedPages[i].getName() + TARGETS_SUFFIX, true); + value = convert(targetProperty.toString(), true); + propertiesData.append(property + " = " + value); + propertiesData.append(newLine); + + } + } + try { + File antInstallProperties = new File(baseDir.getAbsolutePath(), PROPERTIES_FILE_NAME); + FileWriter fos = new FileWriter(antInstallProperties); + BufferedWriter writer = new BufferedWriter(fos); + writer.write(propertiesData.toString()); + writer.flush(); + fos.close(); + } + catch (Throwable ex) { + if(ctx.getInstaller().isVerbose()) { + ctx.log(ex); + } + //swallow Exceptions as in the contract for this method + } + } + private void retrievePropertiesData( OutputField[] fields, StringBuffer propertiesData ) { + String property = null; + String value = null; + + for (int f = 0; f < fields.length; f++) { + if (fields[f] instanceof SecretPropertyField) { + InputField field = (InputField) fields[f]; + //String result = field.getInputResult(); + propertiesData.append("# Property hidden " + printClass(fields[f].getClass())); + propertiesData.append(newLine); + property = convert(field.getProperty(), true); + propertiesData.append("#" + property + "=XXXXXXXX"); + propertiesData.append(newLine); + } + else if (fields[f] instanceof ConditionalField ) { + ConditionalField confField = (ConditionalField) fields[f]; + retrievePropertiesData( confField.getFields(), propertiesData ); + } + else if (fields[f] instanceof InputField) { + InputField field = (InputField) fields[f]; + String result = field.getInputResult(); + propertiesData.append("# " + printClass(fields[f].getClass())); + propertiesData.append(newLine); + + property = convert(field.getProperty(), true); + value = convert(result, false); + propertiesData.append(property + " = " + value); + propertiesData.append(newLine); + } + } + } + + private String printClass(Class clazz) { + String name = clazz.getName(); + int lastDot = name.lastIndexOf('.'); + return name.substring(lastDot, name.length()); + } + + private String convert(String input, boolean doSpaces) { + if (input == null) { + // this happens when a page is skipped in text mode + return ""; + } + int num = input.length(); + StringBuffer sb = new StringBuffer(num); + + for (int i = 0; i < num; i++) { + char c = input.charAt(i); + switch (c) { + case ' ': + if (i == 0 || doSpaces) { + sb.append('\\'); + } + sb.append(' '); + break; + case '\n': + sb.append("\\n"); + break; + case '\r': + sb.append("\\r"); + break; + case '\\': + sb.append("\\\\"); + break; + case '\t': + sb.append("\\t"); + break; + case '\f': + sb.append("\\f"); + break; + case '=': + sb.append("\\="); + break; + case ':': + sb.append("\\:"); + break; + case '#': + sb.append("\\#"); + break; + case '!': + sb.append("\\!"); + break; + + default: + if ( (c < 0x0020) || (c > 0x007e) ) { + sb.append("\\u") + .append(hex( (c >> 12) & 0xF)) + .append(hex( (c >> 8) & 0xF)) + .append(hex( (c >> 4) & 0xF)) + .append(hex(c & 0xF)); + } + else { + sb.append(c); + } + } + } + return sb.toString(); + } + + private char hex(int val) { + return hexidecimals[ (val & 0xF)]; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ExplicitPropertiesFileRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/InstallException.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/InstallException.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/InstallException.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,67 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller; + +import java.io.PrintStream; +import java.io.PrintWriter; + +/** + * + * <p>Custom Installation Exception, Hopefully compatible with JDK1.3 and 1.4</p> + * @author Paul Hinds + * @version $Id: InstallException.java,v 1.1.1.1 2005/10/18 18:20:51 teknopaul Exp $ + */ +public class InstallException extends Exception{ + + private Throwable cause; + + public InstallException() { + } + public InstallException(String message) { + super(message); + } + public InstallException(String message,Throwable cause) { + super(message); + this.cause = cause; + } + public Throwable getException() { + return cause; + } + public Throwable getCause() { + return getException(); + } + public void printStackTrace() { + printStackTrace(System.err); + } + public void printStackTrace(PrintStream ps) { + synchronized (ps) { + super.printStackTrace(ps); + if (cause != null) { + ps.println("--- Nested Exception ---"); + cause.printStackTrace(ps); + } + } + } + public void printStackTrace(PrintWriter pw) { + synchronized (pw) { + super.printStackTrace(pw); + if (cause != null) { + pw.println("--- Nested Exception ---"); + cause.printStackTrace(pw); + } + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/InstallException.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/Installer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/Installer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/Installer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,277 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller; + +import java.util.List; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +import java.util.Vector; + +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.ResultContainer; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.renderer.swing.SizeConstants; +import org.tp23.antinstaller.runtime.IfPropertyHelper; +import org.tp23.antinstaller.runtime.VersionHelper; +import org.tp23.antinstaller.runtime.exe.ExecuteRunnerFilter.AbortException; + + + +/** + * <p>Object representation of the Installer element in the config. </p> + * <p>This object holds the reference to all the Pages which in tern hold references + * to the InputFields, All the properties in the Installer element are held at this level + * as is the ResultContainer</p> + * @author Paul Hinds + * @version $Id: Installer.java,v 1.9 2007/01/28 08:44:41 teknopaul Exp $ + */ +public class Installer { + + + // i18n support + private static ResourceBundle langPack = null; + static{ + try { + langPack = ResourceBundle.getBundle("resources.LanguagePack"); + } catch (MissingResourceException e) { + // ignore, signifies no lang packs installed + } + } + + private String name; + private String minJavaVersion = "1.4"; + private String ui;// permitted UI override values + private boolean verbose; + private boolean debug; + private String lookAndFeel; + private String wide; + private String windowIcon; + private String defaultImageResource; + private String finishButtonText = "Install"; + private String antialiased; + private String loadDefaults; + private String version = "0.0"; + + private Page[] pages; + private ResultContainer resultContainer = new ResultContainer(); + + public Installer() { + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public String getMinJavaVersion() { + return minJavaVersion; + } + + public void setMinJavaVersion(String minJavaVersion) throws AbortException { + if(minJavaVersion != null && ! "".equals(minJavaVersion) ) { + VersionHelper helper = new VersionHelper(); + if( ! helper.equalOrHigher(System.getProperty("java.version"), minJavaVersion, true) ) { + throw new AbortException("Incorrect Java version, installer requires: " + minJavaVersion); + } + } + this.minJavaVersion = minJavaVersion; + } + + public Page[] getPages() { + return pages; + } + + public void setPages(Page[] pages) { + this.pages = pages; + } + + /** + * returns full ui attribute with spaces removed (the string is not parsed into tokens). + * e.g. "text,swint,swing-auto" + * @return + */ + public String getUi() { + return ui; + } + + /** + * Sets the ui attrribute removing any whitespace + * @param ui + */ + public void setUi(String ui) { + this.ui = ui.replaceAll("\\s", ""); + } + + public boolean supportsAutoBuild(){ + return ui != null && ui.indexOf("-auto") > -1; + } + + public boolean isVerbose() { + return verbose; + } + public void setVerbose(boolean verbose) { + this.verbose = verbose; + } + public void setVerbose(String strVerbose) { + this.verbose = OutputField.isTrue(strVerbose); + } + + public boolean isDebug() { + return debug; + } + public void setDebug(boolean debug) { + this.debug = debug; + } + public void setDebug(String strDebug) { + this.debug = OutputField.isTrue(strDebug); + } + + + public String getLookAndFeel() { + return lookAndFeel; + } + + public void setLookAndFeel(String lookAndFeel) { + this.lookAndFeel = lookAndFeel; + } + + public String getWindowIcon() { + return windowIcon; + } + + public void setWindowIcon(String windowIcon) { + this.windowIcon = windowIcon; + } + + public String getDefaultImageResource() { + return defaultImageResource; + } + + public void setDefaultImageResource(String defaultImageResource) { + this.defaultImageResource = defaultImageResource; + } + + public String getFinishButtonText() { + if(langPack != null){ + return langPack.getString("finishButtonText"); + } + return finishButtonText; + } + + public void setFinishButtonText(String finishButtonText) { + this.finishButtonText = finishButtonText; + } + + public ResultContainer getResultContainer() { + return resultContainer; + } + + public String getAntialiased() { + return antialiased; + } + + public void setAntialiased(String antialiased) { + this.antialiased = antialiased; + } + + public String getWide() { + return wide; + } + + public void setWide(String wide) { + try { + this.wide = wide; + parseWideValue(wide); + } catch (Exception e) { + // ignore use defaults + } + } + public void parseWideValue(String wide) throws NumberFormatException, StringIndexOutOfBoundsException{ + int pageWidth = Integer.parseInt(wide.substring(0, wide.indexOf(':'))); + int labelWidth = Integer.parseInt(wide.substring(wide.indexOf(':') + 1, wide.length())); + SizeConstants.PAGE_WIDTH = pageWidth; + SizeConstants.LABEL_WIDTH = labelWidth; + } + + public String getLoadDefaults() { + return loadDefaults; + } + + public void setLoadDefaults(String loadDefaults) { + this.loadDefaults = loadDefaults; + } + + /** + * Returns the list of selected targets from the installer obeying + * page order. This method is + * probably only usefull after the UI screens have finished. Using prior to that + * bear in mind that the user in the Swing GUI can go back and reselect + * targets that were not selected previously. + * Page targets for pages that were not shown are not returned in the list + * @return Returns a Vector since Ant requires this for the Project class (Should be a List) + * @throws InstallException + */ + public Vector getTargets(InstallerContext ctx){ + Vector argsList = new Vector(); + for (int i = 0; i < getPages().length; i++) { + Page page = getPages()[i]; + List pageTargets = page.getPageTargets(); + boolean shown = conditionalDisplay(page, ctx); + for (int pt = 0; pt < pageTargets.size(); pt++) { + Page.IndexedTarget target = (Page.IndexedTarget)pageTargets.get(pt); + if( ! argsList.contains(target.getTarget()) && + shown){ + argsList.add(target.getTarget()); + } + } + List elementTargets = page.getElementTargets(); + for (int pt = 0; pt < elementTargets.size(); pt++) { + Page.IndexedTarget target = (Page.IndexedTarget)elementTargets.get(pt); + if( ! argsList.contains(target.getTarget()) ){ + argsList.add(target.getTarget()); + } + } + } + return argsList; + } + + /** + * @return boolean true if the page was to be shown + * @throws InstallException + */ + private boolean conditionalDisplay(Page page, InstallerContext ctx){ + try { + IfPropertyHelper helper = new IfPropertyHelper(ctx); + return helper.ifProperty(page) && helper.ifTarget(page, ctx.getInstaller().getPages()); + } catch (InstallException e) { + throw new RuntimeException("ifProperty runtime exception"); + } + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/Installer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/InstallerContext.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/InstallerContext.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/InstallerContext.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,271 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller; + +import java.io.File; +import java.util.Enumeration; +import java.util.Iterator; +import java.util.Properties; +import java.util.Vector; + +import org.apache.tools.ant.BuildListener; +import org.apache.tools.ant.taskdefs.Execute; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.renderer.AntOutputRenderer; +import org.tp23.antinstaller.renderer.MessageRenderer; +import org.tp23.antinstaller.runtime.Logger; +import org.tp23.antinstaller.runtime.Runner; +import org.tp23.antinstaller.runtime.exe.AntLauncherFilter; +import org.tp23.antinstaller.runtime.exe.LoadConfigFilter; +/** + * + * <p>A single InstallerContext is created by the ExecInstall class and + * exist for the duration of the Install screens and the runing of + * the Ant Script. </p> + * @author Paul Hinds + * @version $Id: InstallerContext.java,v 1.10 2007/01/28 08:44:41 teknopaul Exp $ + */ +public class InstallerContext { + + /** + * This is the prefix for environment variables, unlike Ant this is fixed to + * the common prefix of "env". If you dont like this complain to the bug reports + * on sourceforge + */ + public static final String ENV_PREFIX = "env."; + /** + * This is the prefix for Java system property variables. + * This is fixed to "java." + */ + public static final String JAVA_PREFIX = "java."; + + private Logger logger = null; + private Installer installer = null; + private MessageRenderer messageRenderer = null; + private AntOutputRenderer antOutputRenderer = null; + private Runner runner = null; + private Page currentPage = null; + private java.io.File fileRoot = null; // ant basedir + private BuildListener buildListener = null; + private AntLauncherFilter antRunner = null; + private String uIOverride = null; + private String installerConfigFile = LoadConfigFilter.INSTALLER_CONFIG_FILE; + private String antBuildFile = "build.xml"; + private String configResource; + + + // called after the Ant part has been run + private boolean installedSucceded = false; + + public InstallerContext() { + } + + public void setInstallSucceded(boolean installedSucceded){ + this.installedSucceded=installedSucceded; + } + public boolean isInstallSucceded(){ + return installedSucceded; + } + + public void log(String message){ + if(logger != null) { + logger.log(message); + } + } + public void log(Throwable message){ + if(logger != null) { + logger.log(message); + } + } + public void log(boolean vebose, Throwable message){ + if(vebose && logger != null) { + logger.log(message); + } + } + + /** + * Check to see if the system is windoze to be able to return the correct prompted + * directories. This method should be IsNotWindows since it assumes anything + * that is not windows is Unix + * @return boolean true if not windows in the os.name System Property + */ + public static boolean isUnix(){ + return System.getProperty("os.name").toLowerCase().indexOf("windows") == -1; + } + + /** + * Use the standard Ant way to load the environment variables, this is not all inclusive + * (but will be come Java 1.5 I imagine) + * @return Properties + */ + public static Properties getEnvironment(){ + Properties props = new Properties(); + try { + Vector osEnv = Execute.getProcEnvironment(); + for (Enumeration e = osEnv.elements(); e.hasMoreElements(); ) { + String entry = (String) e.nextElement(); + int pos = entry.indexOf('='); + if (pos != -1) { + props.put(ENV_PREFIX + entry.substring(0, pos), + entry.substring(pos + 1)); + } + } + } + catch (Exception ex) { + // swallow exceptions so this can be loaded statically + // bit of a bugger if you need the environment on Mac OS 9 but not all apps + // do so we don't want to die inother situations + System.out.println("Can't load environment:"+ex.getClass()+","+ex.getMessage()); + } + Properties javaSysProps = System.getProperties(); + Iterator iter = javaSysProps.keySet().iterator(); + while (iter.hasNext()) { + Object key = (Object)iter.next(); + props.put(JAVA_PREFIX+key.toString(),javaSysProps.get(key)); + } + return props; + } + + // Bean methods + public Installer getInstaller() { + return installer; + } + + public String getMinJavaVersion() { + return installer.getMinJavaVersion(); + } + + public MessageRenderer getMessageRenderer() { + return messageRenderer; + } + + public void setMessageRenderer(MessageRenderer messageRenderer) { + this.messageRenderer = messageRenderer; + this.messageRenderer.setInstallerContext(this); + } + + public AntOutputRenderer getAntOutputRenderer() { + return antOutputRenderer; + } + + public void setAntOutputRenderer(AntOutputRenderer antOutputRenderer) { + this.antOutputRenderer = antOutputRenderer; + } + + public Page getCurrentPage() { + return currentPage; + } + + public void setCurrentPage(Page currentPage) { + this.currentPage = currentPage; + } + /** + * in SelfExtractor - the directory the install has extracted to <br/> + * in Scripted installs - the base directory of the install <br/> + * in NonExtractor - the temporary space created for the build <br/> + * @return + */ + public File getFileRoot() { + return fileRoot; + } + + public void setFileRoot(File fileRoot) { + this.fileRoot = fileRoot; + } + + public org.apache.tools.ant.BuildListener getBuildListener() { + return buildListener; + } + + public void setBuildListener(org.apache.tools.ant.BuildListener buildListener) { + this.buildListener = buildListener; + } + + public AntLauncherFilter getAntRunner() { + return antRunner; + } + + public void setAntRunner(AntLauncherFilter antRunner) { + this.antRunner = antRunner; + } + + public Logger getLogger() { + return logger; + } + + public void setLogger(Logger logger) { + this.logger = logger; + } + + public Runner getRunner() { + return runner; + } + + public void setRunner(Runner runner) { + this.runner = runner; + } + + public void setInstaller(Installer installer) { + this.installer = installer; + } + + public String getUIOverride() { + return uIOverride; + } + + public void setUIOverride(String override) { + uIOverride = override; + } + + public boolean isAutoBuild(){ + return uIOverride != null && uIOverride.indexOf("-auto") > -1; + } + + /** + * RFE 1569628, the antinstaller config file to use, defaults to antinstall-config.xml + * @return + */ + public String getInstallerConfigFile() { + return installerConfigFile; + } + + public void setInstallerConfigFile(String installerConfigFile) { + this.installerConfigFile = installerConfigFile; + } + /** + * RFE 1569628, the build file to use, defaults to build.xml + * There should never be any path info, that is derived elsewhere + * @return + */ + public String getAntBuildFile() { + return antBuildFile; + } + + public void setAntBuildFile(String antBuildFile) { + this.antBuildFile = antBuildFile; + } + + public String getConfigResource() { + return configResource; + } + + public void setConfigResource(String configResource) { + this.configResource = configResource; + } +} + + + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/InstallerContext.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/PropertiesFileRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/PropertiesFileRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/PropertiesFileRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,43 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller; + +import java.io.File; +/** + * + * <p>Renders a properties file in the base directory for Ant to use and + * available for viewing after for Debug</p> + * In earlier versions this was the only way to access properties it is now + * mostly redundant. + * @author Paul Hinds + * @version $Id: PropertiesFileRenderer.java,v 1.4 2006/12/23 04:07:23 teknopaul Exp $ + */ +public interface PropertiesFileRenderer { + + public static final String FILE_ROOT_PROPERTY = "basedir"; + public static final String INSTALLER_VERSION_PROPERTY = "ant.install.config.version"; + public static final String PROPERTIES_FILE_NAME = "ant.install.properties"; + public static final String TARGETS_SUFFIX = "-targets"; + + /** + * This method no longer throws IOException since the requirement to print properties + * has been removed. By default properties will be printed since they are usefull + * for debug but classes implementing this method should swallow all Exceptions + * @param ctx InstallerContext + * @param baseDir File + */ + public void renderProperties(InstallerContext ctx, File baseDir); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/PropertiesFileRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ResourceBundleHelper.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ResourceBundleHelper.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ResourceBundleHelper.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,111 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller; + +import java.text.MessageFormat; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +/** + * Helper class that will catch missing bundle entries and handle formatting + * of message strings + * + * @author mwilson + * @version $Id + * @since 0.7.4 patch 7 + */ +public class ResourceBundleHelper +{ + private String bundleName; + private ResourceBundle resourceBundle; + + private static final Object[] EMPTY_OBJ_ARRAY = new Object[0]; + private static final String EMPTY_STRING = ""; + + public ResourceBundleHelper( final String bundleName ) + { + this.bundleName = bundleName; + resourceBundle = ResourceBundle.getBundle( bundleName ); + } + + public String getMessage( final String key ) + { + return getMessage( key, EMPTY_OBJ_ARRAY ); + } + + public String getMessage( final String key, final Object obj ) + { + return getMessage( key, new Object[] { obj } ); + } + + /** + * Return a formatted message string. + * @param key resource bundle key + * @param objArray array of objects that will be used with formatting + * string + * @return formatted string or error message if the resource bundle + * entry is missing + */ + public String getMessage( String key, Object objArray[] ) + { + String message; + + //Replace null values with empty strings - safer + for( int i = 0; i < objArray.length; i++ ) + { + if( objArray[i] == null ) + { + objArray[i] = EMPTY_STRING; + } + } + + String formatStr = null; + + try + { + formatStr = resourceBundle.getString( key ); + } + catch( MissingResourceException missingResExc ) + { + //Handle missing resource below... + } + + if( formatStr == null ) + { + StringBuffer strBuffer = new StringBuffer( "Message entry with key " ); + strBuffer.append( key ); + strBuffer.append( " is missing from resource bundle " ); + strBuffer.append( bundleName ); + strBuffer.append( "\n" ); + strBuffer.append( bundleName ); + strBuffer.append( ":: " ); + strBuffer.append( key ); + for( int i = 0; i < objArray.length; i++ ) + { + strBuffer.append( " " ); + strBuffer.append( objArray[i].toString() ); + } + + message = strBuffer.toString(); + } + else + { + MessageFormat msgformat = new MessageFormat( formatStr ); + message = msgformat.format( ( (Object) ( objArray ) ) ); + } + + return message; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ResourceBundleHelper.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ValidationException.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ValidationException.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ValidationException.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,32 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller; +/** + * + * <p>Thrown if there is a failure during validation of human entered input. </p> + * @author Paul Hinds + * @version $Id: ValidationException.java,v 1.1.1.1 2005/10/18 18:20:52 teknopaul Exp $ + */ +public class ValidationException extends InstallException{ + public ValidationException() { + } + public ValidationException(String message) { + super(message); + } + public ValidationException(String message,Throwable cause) { + super(message,cause); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/ValidationException.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.2.dtd =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.2.dtd (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.2.dtd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,120 @@ +<!-- +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> +<!ELEMENT validated EMPTY > +<!ATTLIST validated defaultValue CDATA #REQUIRED > +<!ATTLIST validated regex CDATA #REQUIRED > +<!ATTLIST validated displayText CDATA #REQUIRED > +<!ATTLIST validated property NMTOKEN #REQUIRED > +<!ATTLIST validated explanatoryText CDATA #IMPLIED > + +<!ELEMENT file EMPTY > +<!ATTLIST file defaultValue CDATA #REQUIRED > +<!ATTLIST file defaultValueWin CDATA #IMPLIED > +<!ATTLIST file displayText CDATA #REQUIRED > +<!ATTLIST file property NMTOKEN #REQUIRED > +<!ATTLIST file checkExists (true | false) #IMPLIED > +<!ATTLIST file explanatoryText CDATA #IMPLIED > + +<!ELEMENT option EMPTY > +<!ATTLIST option value CDATA #REQUIRED > +<!ATTLIST option text CDATA #REQUIRED > + +<!ELEMENT comment EMPTY > +<!ATTLIST comment bold (true | false) #IMPLIED > +<!ATTLIST comment displayText CDATA #REQUIRED > +<!ATTLIST comment title NMTOKEN #IMPLIED > +<!ATTLIST comment explanatoryText CDATA #IMPLIED > + +<!ELEMENT checkbox EMPTY > +<!ATTLIST checkbox defaultValue NMTOKEN #REQUIRED > +<!ATTLIST checkbox force (true | false) #IMPLIED > +<!ATTLIST checkbox displayText CDATA #REQUIRED > +<!ATTLIST checkbox property NMTOKEN #REQUIRED > +<!ATTLIST checkbox explanatoryText CDATA #IMPLIED > + +<!ELEMENT installer ( page+ ) > +<!ATTLIST installer verbose (true | false) #IMPLIED > +<!ATTLIST installer name CDATA #REQUIRED > +<!ATTLIST installer windowIcon CDATA #IMPLIED > +<!ATTLIST installer lookAndFeel NMTOKEN #IMPLIED > +<!ATTLIST installer minJavaVersion NMTOKEN #IMPLIED > +<!ATTLIST installer ui CDATA #IMPLIED > +<!ATTLIST installer defaultImageResource CDATA #IMPLIED > + +<!ELEMENT directory EMPTY > +<!ATTLIST directory defaultValue CDATA #REQUIRED > +<!ATTLIST directory defaultValueWin CDATA #IMPLIED > +<!ATTLIST directory create (true | false) #IMPLIED > +<!ATTLIST directory displayText CDATA #REQUIRED > +<!ATTLIST directory property NMTOKEN #REQUIRED > +<!ATTLIST directory checkExists (true | false) #IMPLIED > +<!ATTLIST directory explanatoryText CDATA #IMPLIED > + +<!ELEMENT app-root EMPTY > +<!ATTLIST app-root defaultValue CDATA #REQUIRED > +<!ATTLIST app-root displayText CDATA #REQUIRED > +<!ATTLIST app-root property NMTOKEN #REQUIRED > +<!ATTLIST app-root explanatoryText CDATA #IMPLIED > +<!ATTLIST app-root checkFile1 CDATA #IMPLIED > +<!ATTLIST app-root checkFile2 CDATA #IMPLIED > +<!ATTLIST app-root checkDir1 CDATA #IMPLIED > +<!ATTLIST app-root checkDir2 CDATA #IMPLIED > + +<!ELEMENT target EMPTY > +<!ATTLIST target defaultValue NMTOKEN #REQUIRED > +<!ATTLIST target force (true | false) #IMPLIED > +<!ATTLIST target displayText CDATA #REQUIRED > +<!ATTLIST target target NMTOKEN #REQUIRED > +<!ATTLIST target explanatoryText CDATA #IMPLIED > + +<!ELEMENT page ( app-root | comment | text | checkbox | select | directory | file | target | validated | password | date )* > +<!ATTLIST page name NMTOKEN #REQUIRED > +<!ATTLIST page type NMTOKEN #REQUIRED > +<!ATTLIST page imageResource CDATA #IMPLIED > +<!ATTLIST page resource CDATA #IMPLIED > +<!ATTLIST page displayText CDATA #REQUIRED > +<!ATTLIST page target NMTOKEN #IMPLIED > +<!ATTLIST page ifTarget NMTOKEN #IMPLIED > + +<!ELEMENT select ( option+ ) > +<!ATTLIST select defaultValue CDATA #REQUIRED > +<!ATTLIST select explanatoryText CDATA #IMPLIED > +<!ATTLIST select displayText CDATA #REQUIRED > +<!ATTLIST select property NMTOKEN #REQUIRED > +<!ATTLIST select explanatoryText CDATA #IMPLIED > + +<!ELEMENT password EMPTY > +<!ATTLIST password defaultValue NMTOKEN #REQUIRED > +<!ATTLIST password regex CDATA #REQUIRED > +<!ATTLIST password displayText CDATA #REQUIRED > +<!ATTLIST password property NMTOKEN #REQUIRED > +<!ATTLIST password explanatoryText CDATA #IMPLIED > + +<!ELEMENT date EMPTY > +<!ATTLIST date defaultValue NMTOKEN #REQUIRED > +<!ATTLIST date dateFormat CDATA #REQUIRED > +<!ATTLIST date displayText CDATA #REQUIRED > +<!ATTLIST date property NMTOKEN #REQUIRED > +<!ATTLIST date explanatoryText CDATA #IMPLIED > + +<!ELEMENT text EMPTY > +<!ATTLIST text defaultValue CDATA #REQUIRED > +<!ATTLIST text displayText CDATA #REQUIRED > +<!ATTLIST text property NMTOKEN #REQUIRED > +<!ATTLIST text explanatoryText CDATA #IMPLIED > + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.2.dtd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.3.dtd =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.3.dtd (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.3.dtd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,121 @@ +<!-- +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> +<!ELEMENT validated EMPTY > +<!ATTLIST validated defaultValue CDATA #REQUIRED > +<!ATTLIST validated regex CDATA #REQUIRED > +<!ATTLIST validated displayText CDATA #REQUIRED > +<!ATTLIST validated property NMTOKEN #REQUIRED > +<!ATTLIST validated explanatoryText CDATA #IMPLIED > + +<!ELEMENT file EMPTY > +<!ATTLIST file defaultValue CDATA #REQUIRED > +<!ATTLIST file defaultValueWin CDATA #IMPLIED > +<!ATTLIST file displayText CDATA #REQUIRED > +<!ATTLIST file property NMTOKEN #REQUIRED > +<!ATTLIST file checkExists (true | false) #IMPLIED > +<!ATTLIST file explanatoryText CDATA #IMPLIED > + +<!ELEMENT option EMPTY > +<!ATTLIST option value CDATA #REQUIRED > +<!ATTLIST option text CDATA #REQUIRED > + +<!ELEMENT comment EMPTY > +<!ATTLIST comment bold (true | false) #IMPLIED > +<!ATTLIST comment displayText CDATA #REQUIRED > +<!ATTLIST comment title NMTOKEN #IMPLIED > +<!ATTLIST comment explanatoryText CDATA #IMPLIED > + +<!ELEMENT checkbox EMPTY > +<!ATTLIST checkbox defaultValue NMTOKEN #REQUIRED > +<!ATTLIST checkbox force (true | false) #IMPLIED > +<!ATTLIST checkbox displayText CDATA #REQUIRED > +<!ATTLIST checkbox property NMTOKEN #REQUIRED > +<!ATTLIST checkbox explanatoryText CDATA #IMPLIED > + +<!ELEMENT installer ( page+ ) > +<!ATTLIST installer verbose (true | false) #IMPLIED > +<!ATTLIST installer name CDATA #REQUIRED > +<!ATTLIST installer windowIcon CDATA #IMPLIED > +<!ATTLIST installer lookAndFeel NMTOKEN #IMPLIED > +<!ATTLIST installer minJavaVersion NMTOKEN #IMPLIED > +<!ATTLIST installer ui CDATA #IMPLIED > +<!ATTLIST installer defaultImageResource CDATA #IMPLIED > +<!ATTLIST installer finishButtonText CDATA #IMPLIED > + +<!ELEMENT directory EMPTY > +<!ATTLIST directory defaultValue CDATA #REQUIRED > +<!ATTLIST directory defaultValueWin CDATA #IMPLIED > +<!ATTLIST directory create (true | false) #IMPLIED > +<!ATTLIST directory displayText CDATA #REQUIRED > +<!ATTLIST directory property NMTOKEN #REQUIRED > +<!ATTLIST directory checkExists (true | false) #IMPLIED > +<!ATTLIST directory explanatoryText CDATA #IMPLIED > + +<!ELEMENT app-root EMPTY > +<!ATTLIST app-root defaultValue CDATA #REQUIRED > +<!ATTLIST app-root displayText CDATA #REQUIRED > +<!ATTLIST app-root property NMTOKEN #REQUIRED > +<!ATTLIST app-root explanatoryText CDATA #IMPLIED > +<!ATTLIST app-root checkFile1 CDATA #IMPLIED > +<!ATTLIST app-root checkFile2 CDATA #IMPLIED > +<!ATTLIST app-root checkDir1 CDATA #IMPLIED > +<!ATTLIST app-root checkDir2 CDATA #IMPLIED > + +<!ELEMENT target EMPTY > +<!ATTLIST target defaultValue NMTOKEN #REQUIRED > +<!ATTLIST target force (true | false) #IMPLIED > +<!ATTLIST target displayText CDATA #REQUIRED > +<!ATTLIST target target NMTOKEN #REQUIRED > +<!ATTLIST target explanatoryText CDATA #IMPLIED > + +<!ELEMENT page ( app-root | comment | text | checkbox | select | directory | file | target | validated | password | date )* > +<!ATTLIST page name NMTOKEN #REQUIRED > +<!ATTLIST page type NMTOKEN #REQUIRED > +<!ATTLIST page imageResource CDATA #IMPLIED > +<!ATTLIST page resource CDATA #IMPLIED > +<!ATTLIST page displayText CDATA #REQUIRED > +<!ATTLIST page target NMTOKEN #IMPLIED > +<!ATTLIST page ifTarget NMTOKEN #IMPLIED > + +<!ELEMENT select ( option+ ) > +<!ATTLIST select defaultValue CDATA #REQUIRED > +<!ATTLIST select explanatoryText CDATA #IMPLIED > +<!ATTLIST select displayText CDATA #REQUIRED > +<!ATTLIST select property NMTOKEN #REQUIRED > +<!ATTLIST select explanatoryText CDATA #IMPLIED > + +<!ELEMENT password EMPTY > +<!ATTLIST password defaultValue NMTOKEN #REQUIRED > +<!ATTLIST password regex CDATA #REQUIRED > +<!ATTLIST password displayText CDATA #REQUIRED > +<!ATTLIST password property NMTOKEN #REQUIRED > +<!ATTLIST password explanatoryText CDATA #IMPLIED > + +<!ELEMENT date EMPTY > +<!ATTLIST date defaultValue NMTOKEN #REQUIRED > +<!ATTLIST date dateFormat CDATA #REQUIRED > +<!ATTLIST date displayText CDATA #REQUIRED > +<!ATTLIST date property NMTOKEN #REQUIRED > +<!ATTLIST date explanatoryText CDATA #IMPLIED > + +<!ELEMENT text EMPTY > +<!ATTLIST text defaultValue CDATA #REQUIRED > +<!ATTLIST text displayText CDATA #REQUIRED > +<!ATTLIST text property NMTOKEN #REQUIRED > +<!ATTLIST text explanatoryText CDATA #IMPLIED > + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.3.dtd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.4.dtd =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.4.dtd (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.4.dtd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,122 @@ +<!-- +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> +<!ELEMENT validated EMPTY > +<!ATTLIST validated defaultValue CDATA #REQUIRED > +<!ATTLIST validated regex CDATA #REQUIRED > +<!ATTLIST validated displayText CDATA #REQUIRED > +<!ATTLIST validated property NMTOKEN #REQUIRED > +<!ATTLIST validated explanatoryText CDATA #IMPLIED > + +<!ELEMENT file EMPTY > +<!ATTLIST file defaultValue CDATA #REQUIRED > +<!ATTLIST file defaultValueWin CDATA #IMPLIED > +<!ATTLIST file displayText CDATA #REQUIRED > +<!ATTLIST file property NMTOKEN #REQUIRED > +<!ATTLIST file checkExists (true | false) #IMPLIED > +<!ATTLIST file explanatoryText CDATA #IMPLIED > + +<!ELEMENT option EMPTY > +<!ATTLIST option value CDATA #REQUIRED > +<!ATTLIST option text CDATA #REQUIRED > + +<!ELEMENT comment EMPTY > +<!ATTLIST comment bold (true | false) #IMPLIED > +<!ATTLIST comment displayText CDATA #REQUIRED > +<!ATTLIST comment title NMTOKEN #IMPLIED > +<!ATTLIST comment explanatoryText CDATA #IMPLIED > + +<!ELEMENT checkbox EMPTY > +<!ATTLIST checkbox defaultValue NMTOKEN #REQUIRED > +<!ATTLIST checkbox force (true | false) #IMPLIED > +<!ATTLIST checkbox displayText CDATA #REQUIRED > +<!ATTLIST checkbox property NMTOKEN #REQUIRED > +<!ATTLIST checkbox explanatoryText CDATA #IMPLIED > + +<!ELEMENT installer ( page+ ) > +<!ATTLIST installer verbose (true | false) #IMPLIED > +<!ATTLIST installer name CDATA #REQUIRED > +<!ATTLIST installer windowIcon CDATA #IMPLIED > +<!ATTLIST installer lookAndFeel NMTOKEN #IMPLIED > +<!ATTLIST installer minJavaVersion NMTOKEN #IMPLIED > +<!ATTLIST installer ui CDATA #IMPLIED > +<!ATTLIST installer defaultImageResource CDATA #IMPLIED > +<!ATTLIST installer finishButtonText CDATA #IMPLIED > + +<!ELEMENT directory EMPTY > +<!ATTLIST directory defaultValue CDATA #REQUIRED > +<!ATTLIST directory defaultValueWin CDATA #IMPLIED > +<!ATTLIST directory create (true | false) #IMPLIED > +<!ATTLIST directory displayText CDATA #REQUIRED > +<!ATTLIST directory property NMTOKEN #REQUIRED > +<!ATTLIST directory checkExists (true | false) #IMPLIED > +<!ATTLIST directory explanatoryText CDATA #IMPLIED > + +<!ELEMENT app-root EMPTY > +<!ATTLIST app-root defaultValue CDATA #REQUIRED > +<!ATTLIST app-root displayText CDATA #REQUIRED > +<!ATTLIST app-root property NMTOKEN #REQUIRED > +<!ATTLIST app-root explanatoryText CDATA #IMPLIED > +<!ATTLIST app-root checkFile1 CDATA #IMPLIED > +<!ATTLIST app-root checkFile2 CDATA #IMPLIED > +<!ATTLIST app-root checkDir1 CDATA #IMPLIED > +<!ATTLIST app-root checkDir2 CDATA #IMPLIED > + +<!ELEMENT target EMPTY > +<!ATTLIST target defaultValue NMTOKEN #REQUIRED > +<!ATTLIST target force (true | false) #IMPLIED > +<!ATTLIST target displayText CDATA #REQUIRED > +<!ATTLIST target target NMTOKEN #REQUIRED > +<!ATTLIST target explanatoryText CDATA #IMPLIED > + +<!ELEMENT page ( app-root | comment | text | checkbox | select | directory | file | target | validated | password | date )* > +<!ATTLIST page name NMTOKEN #REQUIRED > +<!ATTLIST page type NMTOKEN #REQUIRED > +<!ATTLIST page imageResource CDATA #IMPLIED > +<!ATTLIST page resource CDATA #IMPLIED > +<!ATTLIST page usePaging CDATA #IMPLIED > +<!ATTLIST page displayText CDATA #REQUIRED > +<!ATTLIST page target NMTOKEN #IMPLIED > +<!ATTLIST page ifTarget NMTOKEN #IMPLIED > + +<!ELEMENT select ( option+ ) > +<!ATTLIST select defaultValue CDATA #REQUIRED > +<!ATTLIST select explanatoryText CDATA #IMPLIED > +<!ATTLIST select displayText CDATA #REQUIRED > +<!ATTLIST select property NMTOKEN #REQUIRED > +<!ATTLIST select explanatoryText CDATA #IMPLIED > + +<!ELEMENT password EMPTY > +<!ATTLIST password defaultValue NMTOKEN #REQUIRED > +<!ATTLIST password regex CDATA #REQUIRED > +<!ATTLIST password displayText CDATA #REQUIRED > +<!ATTLIST password property NMTOKEN #REQUIRED > +<!ATTLIST password explanatoryText CDATA #IMPLIED > + +<!ELEMENT date EMPTY > +<!ATTLIST date defaultValue NMTOKEN #REQUIRED > +<!ATTLIST date dateFormat CDATA #REQUIRED > +<!ATTLIST date displayText CDATA #REQUIRED > +<!ATTLIST date property NMTOKEN #REQUIRED > +<!ATTLIST date explanatoryText CDATA #IMPLIED > + +<!ELEMENT text EMPTY > +<!ATTLIST text defaultValue CDATA #REQUIRED > +<!ATTLIST text displayText CDATA #REQUIRED > +<!ATTLIST text property NMTOKEN #REQUIRED > +<!ATTLIST text explanatoryText CDATA #IMPLIED > + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.4.dtd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.5.dtd =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.5.dtd (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.5.dtd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,125 @@ +<!-- +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> +<!ELEMENT validated EMPTY > +<!ATTLIST validated defaultValue CDATA #REQUIRED > +<!ATTLIST validated regex CDATA #REQUIRED > +<!ATTLIST validated displayText CDATA #REQUIRED > +<!ATTLIST validated property NMTOKEN #REQUIRED > +<!ATTLIST validated explanatoryText CDATA #IMPLIED > + +<!ELEMENT file EMPTY > +<!ATTLIST file defaultValue CDATA #REQUIRED > +<!ATTLIST file defaultValueWin CDATA #IMPLIED > +<!ATTLIST file displayText CDATA #REQUIRED > +<!ATTLIST file property NMTOKEN #REQUIRED > +<!ATTLIST file checkExists (true | false) #IMPLIED > +<!ATTLIST file explanatoryText CDATA #IMPLIED > + +<!ELEMENT option EMPTY > +<!ATTLIST option value CDATA #REQUIRED > +<!ATTLIST option text CDATA #REQUIRED > + +<!ELEMENT comment EMPTY > +<!ATTLIST comment bold (true | false) #IMPLIED > +<!ATTLIST comment displayText CDATA #REQUIRED > +<!ATTLIST comment title NMTOKEN #IMPLIED > +<!ATTLIST comment explanatoryText CDATA #IMPLIED > + +<!ELEMENT checkbox EMPTY > +<!ATTLIST checkbox defaultValue NMTOKEN #REQUIRED > +<!ATTLIST checkbox force (true | false) #IMPLIED > +<!ATTLIST checkbox displayText CDATA #REQUIRED > +<!ATTLIST checkbox property NMTOKEN #REQUIRED > +<!ATTLIST checkbox explanatoryText CDATA #IMPLIED > + +<!ELEMENT installer ( page+ ) > +<!ATTLIST installer verbose (true | false) #IMPLIED > +<!ATTLIST installer name CDATA #REQUIRED > +<!ATTLIST installer windowIcon CDATA #IMPLIED > +<!ATTLIST installer lookAndFeel NMTOKEN #IMPLIED > +<!ATTLIST installer minJavaVersion NMTOKEN #IMPLIED > +<!ATTLIST installer ui CDATA #IMPLIED > +<!ATTLIST installer defaultImageResource CDATA #IMPLIED > +<!ATTLIST installer finishButtonText CDATA #IMPLIED > +<!ATTLIST installer antialiased CDATA #IMPLIED > + +<!ELEMENT directory EMPTY > +<!ATTLIST directory defaultValue CDATA #REQUIRED > +<!ATTLIST directory defaultValueWin CDATA #IMPLIED > +<!ATTLIST directory create (true | false) #IMPLIED > +<!ATTLIST directory displayText CDATA #REQUIRED > +<!ATTLIST directory property NMTOKEN #REQUIRED > +<!ATTLIST directory checkExists (true | false) #IMPLIED > +<!ATTLIST directory explanatoryText CDATA #IMPLIED > + +<!ELEMENT app-root EMPTY > +<!ATTLIST app-root defaultValue CDATA #REQUIRED > +<!ATTLIST app-root displayText CDATA #REQUIRED > +<!ATTLIST app-root property NMTOKEN #REQUIRED > +<!ATTLIST app-root explanatoryText CDATA #IMPLIED > +<!ATTLIST app-root checkFile1 CDATA #IMPLIED > +<!ATTLIST app-root checkFile2 CDATA #IMPLIED > +<!ATTLIST app-root checkDir1 CDATA #IMPLIED > +<!ATTLIST app-root checkDir2 CDATA #IMPLIED > + +<!ELEMENT target EMPTY > +<!ATTLIST target defaultValue NMTOKEN #REQUIRED > +<!ATTLIST target force (true | false) #IMPLIED > +<!ATTLIST target displayText CDATA #REQUIRED > +<!ATTLIST target target NMTOKEN #REQUIRED > +<!ATTLIST target explanatoryText CDATA #IMPLIED > + +<!ELEMENT page ( app-root | comment | text | checkbox | select | directory | file | target | validated | password | date )* > +<!ATTLIST page name NMTOKEN #REQUIRED > +<!ATTLIST page type NMTOKEN #REQUIRED > +<!ATTLIST page imageResource CDATA #IMPLIED > +<!ATTLIST page resource CDATA #IMPLIED > +<!ATTLIST page usePaging CDATA #IMPLIED > +<!ATTLIST page displayText CDATA #REQUIRED > +<!ATTLIST page target NMTOKEN #IMPLIED > +<!ATTLIST page ifTarget NMTOKEN #IMPLIED > +<!ATTLIST page splashResource NMTOKEN #IMPLIED > +<!ATTLIST page altText NMTOKEN #IMPLIED > + +<!ELEMENT select ( option+ ) > +<!ATTLIST select defaultValue CDATA #REQUIRED > +<!ATTLIST select explanatoryText CDATA #IMPLIED > +<!ATTLIST select displayText CDATA #REQUIRED > +<!ATTLIST select property NMTOKEN #REQUIRED > +<!ATTLIST select explanatoryText CDATA #IMPLIED > + +<!ELEMENT password EMPTY > +<!ATTLIST password defaultValue NMTOKEN #REQUIRED > +<!ATTLIST password regex CDATA #REQUIRED > +<!ATTLIST password displayText CDATA #REQUIRED > +<!ATTLIST password property NMTOKEN #REQUIRED > +<!ATTLIST password explanatoryText CDATA #IMPLIED > + +<!ELEMENT date EMPTY > +<!ATTLIST date defaultValue NMTOKEN #REQUIRED > +<!ATTLIST date dateFormat CDATA #REQUIRED > +<!ATTLIST date displayText CDATA #REQUIRED > +<!ATTLIST date property NMTOKEN #REQUIRED > +<!ATTLIST date explanatoryText CDATA #IMPLIED > + +<!ELEMENT text EMPTY > +<!ATTLIST text defaultValue CDATA #REQUIRED > +<!ATTLIST text displayText CDATA #REQUIRED > +<!ATTLIST text property NMTOKEN #REQUIRED > +<!ATTLIST text explanatoryText CDATA #IMPLIED > + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.5.dtd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.6.dtd =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.6.dtd (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.6.dtd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,132 @@ +<!-- +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> +<!ELEMENT validated EMPTY > +<!ATTLIST validated defaultValue CDATA #REQUIRED > +<!ATTLIST validated regex CDATA #REQUIRED > +<!ATTLIST validated displayText CDATA #REQUIRED > +<!ATTLIST validated property NMTOKEN #REQUIRED > +<!ATTLIST validated explanatoryText CDATA #IMPLIED > + +<!ELEMENT file EMPTY > +<!ATTLIST file defaultValue CDATA #REQUIRED > +<!ATTLIST file defaultValueWin CDATA #IMPLIED > +<!ATTLIST file displayText CDATA #REQUIRED > +<!ATTLIST file property NMTOKEN #REQUIRED > +<!ATTLIST file checkExists (true | false) #IMPLIED > +<!ATTLIST file explanatoryText CDATA #IMPLIED > + +<!ELEMENT option EMPTY > +<!ATTLIST option value CDATA #REQUIRED > +<!ATTLIST option text CDATA #REQUIRED > + +<!ELEMENT comment EMPTY > +<!ATTLIST comment bold (true | false) #IMPLIED > +<!ATTLIST comment displayText CDATA #REQUIRED > +<!ATTLIST comment title NMTOKEN #IMPLIED > +<!ATTLIST comment explanatoryText CDATA #IMPLIED > + +<!ELEMENT checkbox EMPTY > +<!ATTLIST checkbox defaultValue NMTOKEN #REQUIRED > +<!ATTLIST checkbox force (true | false) #IMPLIED > +<!ATTLIST checkbox displayText CDATA #REQUIRED > +<!ATTLIST checkbox property NMTOKEN #REQUIRED > +<!ATTLIST checkbox explanatoryText CDATA #IMPLIED > + +<!ELEMENT installer ( page+ ) > +<!ATTLIST installer verbose (true | false) #IMPLIED > +<!ATTLIST installer name CDATA #REQUIRED > +<!ATTLIST installer windowIcon CDATA #IMPLIED > +<!ATTLIST installer lookAndFeel NMTOKEN #IMPLIED > +<!ATTLIST installer minJavaVersion NMTOKEN #IMPLIED > +<!ATTLIST installer ui CDATA #IMPLIED > +<!ATTLIST installer defaultImageResource CDATA #IMPLIED > +<!ATTLIST installer finishButtonText CDATA #IMPLIED > +<!ATTLIST installer antialiased CDATA #IMPLIED > + +<!ELEMENT directory EMPTY > +<!ATTLIST directory defaultValue CDATA #REQUIRED > +<!ATTLIST directory defaultValueWin CDATA #IMPLIED > +<!ATTLIST directory create (true | false) #IMPLIED > +<!ATTLIST directory displayText CDATA #REQUIRED > +<!ATTLIST directory property NMTOKEN #REQUIRED > +<!ATTLIST directory checkExists (true | false) #IMPLIED > +<!ATTLIST directory explanatoryText CDATA #IMPLIED > + +<!ELEMENT app-root EMPTY > +<!ATTLIST app-root defaultValue CDATA #REQUIRED > +<!ATTLIST app-root displayText CDATA #REQUIRED > +<!ATTLIST app-root property NMTOKEN #REQUIRED > +<!ATTLIST app-root explanatoryText CDATA #IMPLIED > +<!ATTLIST app-root checkFile1 CDATA #IMPLIED > +<!ATTLIST app-root checkFile2 CDATA #IMPLIED > +<!ATTLIST app-root checkDir1 CDATA #IMPLIED > +<!ATTLIST app-root checkDir2 CDATA #IMPLIED > + +<!ELEMENT target EMPTY > +<!ATTLIST target defaultValue NMTOKEN #REQUIRED > +<!ATTLIST target force (true | false) #IMPLIED > +<!ATTLIST target displayText CDATA #REQUIRED > +<!ATTLIST target target NMTOKEN #REQUIRED > +<!ATTLIST target explanatoryText CDATA #IMPLIED > + +<!ELEMENT page ( app-root | comment | text | checkbox | select | large-select | directory | file | target | validated | password | date )* > +<!ATTLIST page name NMTOKEN #REQUIRED > +<!ATTLIST page type NMTOKEN #REQUIRED > +<!ATTLIST page imageResource CDATA #IMPLIED > +<!ATTLIST page resource CDATA #IMPLIED > +<!ATTLIST page usePaging CDATA #IMPLIED > +<!ATTLIST page displayText CDATA #REQUIRED > +<!ATTLIST page target NMTOKEN #IMPLIED > +<!ATTLIST page ifTarget NMTOKEN #IMPLIED > +<!ATTLIST page splashResource NMTOKEN #IMPLIED > +<!ATTLIST page altText NMTOKEN #IMPLIED > + +<!ELEMENT select ( option+ ) > +<!ATTLIST select defaultValue CDATA #REQUIRED > +<!ATTLIST select explanatoryText CDATA #IMPLIED > +<!ATTLIST select displayText CDATA #REQUIRED > +<!ATTLIST select property NMTOKEN #REQUIRED > +<!ATTLIST select explanatoryText CDATA #IMPLIED > + +<!ELEMENT large-select ( option+ ) > +<!ATTLIST large-select defaultValue CDATA #REQUIRED > +<!ATTLIST large-select explanatoryText CDATA #IMPLIED > +<!ATTLIST large-select displayText CDATA #REQUIRED > +<!ATTLIST large-select property NMTOKEN #REQUIRED > +<!ATTLIST large-select explanatoryText CDATA #IMPLIED > + +<!ELEMENT password EMPTY > +<!ATTLIST password defaultValue NMTOKEN #REQUIRED > +<!ATTLIST password regex CDATA #REQUIRED > +<!ATTLIST password displayText CDATA #REQUIRED > +<!ATTLIST password property NMTOKEN #REQUIRED > +<!ATTLIST password explanatoryText CDATA #IMPLIED > + +<!ELEMENT date EMPTY > +<!ATTLIST date defaultValue NMTOKEN #REQUIRED > +<!ATTLIST date dateFormat CDATA #REQUIRED > +<!ATTLIST date displayText CDATA #REQUIRED > +<!ATTLIST date property NMTOKEN #REQUIRED > +<!ATTLIST date explanatoryText CDATA #IMPLIED > + +<!ELEMENT text EMPTY > +<!ATTLIST text defaultValue CDATA #REQUIRED > +<!ATTLIST text displayText CDATA #REQUIRED > +<!ATTLIST text property NMTOKEN #REQUIRED > +<!ATTLIST text explanatoryText CDATA #IMPLIED > + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.6.dtd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.7.dtd =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.7.dtd (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.7.dtd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,157 @@ +<!-- +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> +<!ELEMENT validated EMPTY > +<!ATTLIST validated defaultValue CDATA #REQUIRED > +<!ATTLIST validated regex CDATA #REQUIRED > +<!ATTLIST validated displayText CDATA #REQUIRED > +<!ATTLIST validated property NMTOKEN #REQUIRED > +<!ATTLIST validated explanatoryText CDATA #IMPLIED > + +<!ELEMENT file EMPTY > +<!ATTLIST file defaultValue CDATA #REQUIRED > +<!ATTLIST file defaultValueWin CDATA #IMPLIED > +<!ATTLIST file displayText CDATA #REQUIRED > +<!ATTLIST file property NMTOKEN #REQUIRED > +<!ATTLIST file checkExists (true | false) #IMPLIED > +<!ATTLIST file explanatoryText CDATA #IMPLIED > + +<!ELEMENT option EMPTY > +<!ATTLIST option value CDATA #REQUIRED > +<!ATTLIST option text CDATA #REQUIRED > + +<!ELEMENT comment EMPTY > +<!ATTLIST comment bold (true | false) #IMPLIED > +<!ATTLIST comment displayText CDATA #REQUIRED > +<!ATTLIST comment title NMTOKEN #IMPLIED > +<!ATTLIST comment explanatoryText CDATA #IMPLIED > + +<!ELEMENT checkbox EMPTY > +<!ATTLIST checkbox defaultValue NMTOKEN #REQUIRED > +<!ATTLIST checkbox force (true | false) #IMPLIED > +<!ATTLIST checkbox displayText CDATA #REQUIRED > +<!ATTLIST checkbox property NMTOKEN #REQUIRED > +<!ATTLIST checkbox explanatoryText CDATA #IMPLIED > + +<!ELEMENT installer ( page+ ) > +<!ATTLIST installer verbose (true | false) #IMPLIED > +<!ATTLIST installer debug (true | false) #IMPLIED > +<!ATTLIST installer name CDATA #REQUIRED > +<!ATTLIST installer windowIcon CDATA #IMPLIED > +<!ATTLIST installer lookAndFeel NMTOKEN #IMPLIED > +<!ATTLIST installer minJavaVersion NMTOKEN #IMPLIED > +<!ATTLIST installer ui CDATA #IMPLIED > +<!ATTLIST installer defaultImageResource CDATA #IMPLIED > +<!ATTLIST installer finishButtonText CDATA #IMPLIED > +<!ATTLIST installer antialiased CDATA #IMPLIED > + +<!ELEMENT directory EMPTY > +<!ATTLIST directory defaultValue CDATA #REQUIRED > +<!ATTLIST directory defaultValueWin CDATA #IMPLIED > +<!ATTLIST directory create (true | false) #IMPLIED > +<!ATTLIST directory displayText CDATA #REQUIRED > +<!ATTLIST directory property NMTOKEN #REQUIRED > +<!ATTLIST directory checkExists (true | false) #IMPLIED > +<!ATTLIST directory explanatoryText CDATA #IMPLIED > + +<!ELEMENT app-root EMPTY > +<!ATTLIST app-root defaultValue CDATA #REQUIRED > +<!ATTLIST app-root defaultValueWin CDATA #IMPLIED > +<!ATTLIST app-root create (true | false) #IMPLIED > +<!ATTLIST app-root displayText CDATA #REQUIRED > +<!ATTLIST app-root property NMTOKEN #REQUIRED > +<!ATTLIST app-root checkExists (true | false) #IMPLIED > +<!ATTLIST app-root explanatoryText CDATA #IMPLIED > +<!ATTLIST app-root checkFile1 CDATA #IMPLIED > +<!ATTLIST app-root checkFile2 CDATA #IMPLIED > +<!ATTLIST app-root checkDir1 CDATA #IMPLIED > +<!ATTLIST app-root checkDir2 CDATA #IMPLIED > + +<!ELEMENT target EMPTY > +<!ATTLIST target defaultValue NMTOKEN #REQUIRED > +<!ATTLIST target force (true | false) #IMPLIED > +<!ATTLIST target displayText CDATA #REQUIRED > +<!ATTLIST target target NMTOKEN #REQUIRED > +<!ATTLIST target explanatoryText CDATA #IMPLIED > +<!ATTLIST target osSpecific CDATA #IMPLIED > +<!ATTLIST target strict CDATA #IMPLIED > + +<!ELEMENT page ( app-root | comment | text | checkbox | select | large-select | target-select | directory | file | target | validated | password | date )* > +<!ATTLIST page name CDATA #REQUIRED > +<!ATTLIST page type NMTOKEN #REQUIRED > +<!ATTLIST page imageResource CDATA #IMPLIED > +<!ATTLIST page displayText CDATA #REQUIRED > +<!ATTLIST page target NMTOKEN #IMPLIED > + +<!-- License page attributes --> +<!ATTLIST page resource CDATA #IMPLIED > +<!ATTLIST page usePaging CDATA #IMPLIED > + +<!-- Splash page attributes --> +<!ATTLIST page splashResource CDATA #IMPLIED > +<!ATTLIST page altText CDATA #IMPLIED > + +<!-- Progress page attributes --> +<!ATTLIST page showTargets NMTOKEN #IMPLIED > + +<!-- Input page attributes --> +<!ATTLIST page ifTarget NMTOKEN #IMPLIED > +<!ATTLIST page ifProperty CDATA #IMPLIED > +<!ATTLIST page overflow CDATA #IMPLIED > + +<!ELEMENT select ( option+ ) > +<!ATTLIST select defaultValue CDATA #REQUIRED > +<!ATTLIST select explanatoryText CDATA #IMPLIED > +<!ATTLIST select displayText CDATA #REQUIRED > +<!ATTLIST select property NMTOKEN #REQUIRED > +<!ATTLIST select explanatoryText CDATA #IMPLIED > + +<!ELEMENT large-select ( option+ ) > +<!ATTLIST large-select defaultValue CDATA #REQUIRED > +<!ATTLIST large-select explanatoryText CDATA #IMPLIED > +<!ATTLIST large-select displayText CDATA #REQUIRED > +<!ATTLIST large-select property NMTOKEN #REQUIRED > +<!ATTLIST large-select explanatoryText CDATA #IMPLIED > + +<!ELEMENT target-select ( option+ ) > +<!ATTLIST target-select defaultValue CDATA #REQUIRED > +<!ATTLIST target-select explanatoryText CDATA #IMPLIED > +<!ATTLIST target-select displayText CDATA #REQUIRED > +<!ATTLIST target-select property NMTOKEN #REQUIRED > +<!ATTLIST target-select explanatoryText CDATA #IMPLIED > + +<!ELEMENT password EMPTY > +<!ATTLIST password defaultValue NMTOKEN #REQUIRED > +<!ATTLIST password regex CDATA #REQUIRED > +<!ATTLIST password displayText CDATA #REQUIRED > +<!ATTLIST password property NMTOKEN #REQUIRED > +<!ATTLIST password explanatoryText CDATA #IMPLIED > +<!ATTLIST password textMask CDATA #IMPLIED > + +<!ELEMENT date EMPTY > +<!ATTLIST date defaultValue CDATA #REQUIRED > +<!ATTLIST date dateFormat CDATA #REQUIRED > +<!ATTLIST date displayText CDATA #REQUIRED > +<!ATTLIST date property NMTOKEN #REQUIRED > +<!ATTLIST date explanatoryText CDATA #IMPLIED > + +<!ELEMENT text EMPTY > +<!ATTLIST text defaultValue CDATA #REQUIRED > +<!ATTLIST text displayText CDATA #REQUIRED > +<!ATTLIST text property NMTOKEN #REQUIRED > +<!ATTLIST text explanatoryText CDATA #IMPLIED > + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.7.dtd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.8.dtd =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.8.dtd (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.8.dtd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,205 @@ +<!-- +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> +<!ELEMENT validated EMPTY > +<!ATTLIST validated defaultValue CDATA #REQUIRED > +<!ATTLIST validated regex CDATA #REQUIRED > +<!ATTLIST validated displayText CDATA #REQUIRED > +<!ATTLIST validated property NMTOKEN #REQUIRED > +<!ATTLIST validated explanatoryText CDATA #IMPLIED > +<!ATTLIST validated name NMTOKEN #IMPLIED > + +<!ELEMENT file EMPTY > +<!ATTLIST file defaultValue CDATA #REQUIRED > +<!ATTLIST file defaultValueWin CDATA #IMPLIED > +<!ATTLIST file displayText CDATA #REQUIRED > +<!ATTLIST file property NMTOKEN #REQUIRED > +<!ATTLIST file checkExists (true | false) #IMPLIED > +<!ATTLIST file explanatoryText CDATA #IMPLIED > +<!ATTLIST file name NMTOKEN #IMPLIED > + +<!ELEMENT option EMPTY > +<!ATTLIST option value CDATA #REQUIRED > +<!ATTLIST option text CDATA #REQUIRED > +<!ATTLIST option name NMTOKEN #IMPLIED > + + +<!ELEMENT comment EMPTY > +<!ATTLIST comment bold (true | false) #IMPLIED > +<!ATTLIST comment displayText CDATA #IMPLIED > +<!ATTLIST comment title NMTOKEN #IMPLIED > +<!ATTLIST comment explanatoryText CDATA #IMPLIED > +<!ATTLIST comment name NMTOKEN #IMPLIED > + + +<!ELEMENT checkbox EMPTY > +<!ATTLIST checkbox defaultValue NMTOKEN #REQUIRED > +<!ATTLIST checkbox force (true | false) #IMPLIED > +<!ATTLIST checkbox displayText CDATA #REQUIRED > +<!ATTLIST checkbox property NMTOKEN #REQUIRED > +<!ATTLIST checkbox explanatoryText CDATA #IMPLIED > +<!ATTLIST checkbox name NMTOKEN #IMPLIED > + + +<!ELEMENT installer ( page+ ) > +<!ATTLIST installer verbose (true | false) #IMPLIED > +<!ATTLIST installer debug (true | false) #IMPLIED > +<!ATTLIST installer name CDATA #REQUIRED > +<!ATTLIST installer windowIcon CDATA #IMPLIED > +<!ATTLIST installer lookAndFeel NMTOKEN #IMPLIED > +<!ATTLIST installer minJavaVersion NMTOKEN #IMPLIED > +<!ATTLIST installer ui CDATA #IMPLIED > +<!ATTLIST installer defaultImageResource CDATA #IMPLIED > +<!ATTLIST installer finishButtonText CDATA #IMPLIED > +<!ATTLIST installer antialiased CDATA #IMPLIED > +<!ATTLIST installer wide CDATA #IMPLIED > +<!ATTLIST installer loadDefaults (true | prompt | false) #IMPLIED > +<!ATTLIST installer version CDATA #IMPLIED > + +<!ELEMENT directory EMPTY > +<!ATTLIST directory defaultValue CDATA #REQUIRED > +<!ATTLIST directory defaultValueWin CDATA #IMPLIED > +<!ATTLIST directory create (true | false) #IMPLIED > +<!ATTLIST directory displayText CDATA #REQUIRED > +<!ATTLIST directory property NMTOKEN #REQUIRED > +<!ATTLIST directory checkExists (true | false) #IMPLIED > +<!ATTLIST directory explanatoryText CDATA #IMPLIED > +<!ATTLIST directory name NMTOKEN #IMPLIED > + + +<!ELEMENT app-root EMPTY > +<!ATTLIST app-root defaultValue CDATA #REQUIRED > +<!ATTLIST app-root defaultValueWin CDATA #IMPLIED > +<!ATTLIST app-root create (true | false) #IMPLIED > +<!ATTLIST app-root displayText CDATA #REQUIRED > +<!ATTLIST app-root property NMTOKEN #REQUIRED > +<!ATTLIST app-root checkExists (true | false) #IMPLIED > +<!ATTLIST app-root explanatoryText CDATA #IMPLIED > +<!ATTLIST app-root checkFile1 CDATA #IMPLIED > +<!ATTLIST app-root checkFile2 CDATA #IMPLIED > +<!ATTLIST app-root checkDir1 CDATA #IMPLIED > +<!ATTLIST app-root checkDir2 CDATA #IMPLIED > +<!ATTLIST app-root name NMTOKEN #IMPLIED > + + +<!ELEMENT target EMPTY > +<!ATTLIST target defaultValue NMTOKEN #REQUIRED > +<!ATTLIST target force (true | false) #IMPLIED > +<!ATTLIST target displayText CDATA #REQUIRED > +<!ATTLIST target target NMTOKEN #REQUIRED > +<!ATTLIST target explanatoryText CDATA #IMPLIED > +<!ATTLIST target osSpecific CDATA #IMPLIED > +<!ATTLIST target strict CDATA #IMPLIED > +<!ATTLIST target name NMTOKEN #IMPLIED > + +<!ELEMENT conditional ( hidden+ ) > +<!ATTLIST conditional ifProperty CDATA #REQUIRED > +<!ELEMENT hidden EMPTY > +<!ATTLIST hidden property NMTOKEN #REQUIRED > +<!ATTLIST hidden value CDATA #REQUIRED > + +<!ELEMENT page ( app-root | comment | text | checkbox | select | large-select | target-select | directory | file | target | validated | password | password-confirm | date | hidden | conditional )* > +<!ATTLIST page name CDATA #REQUIRED > +<!ATTLIST page type NMTOKEN #REQUIRED > +<!ATTLIST page imageResource CDATA #IMPLIED > +<!ATTLIST page displayText CDATA #REQUIRED > +<!ATTLIST page target NMTOKEN #IMPLIED > +<!ATTLIST page postDisplayTarget NMTOKEN #IMPLIED > + + +<!-- License page attributes --> +<!ATTLIST page resource CDATA #IMPLIED > +<!ATTLIST page usePaging CDATA #IMPLIED > + +<!-- Splash page attributes --> +<!ATTLIST page splashResource CDATA #IMPLIED > +<!ATTLIST page altText CDATA #IMPLIED > + +<!-- Text page attributes --> +<!ATTLIST page htmlResource CDATA #IMPLIED > +<!ATTLIST page textResource CDATA #IMPLIED > + +<!-- Progress page attributes --> +<!ATTLIST page showTargets NMTOKEN #IMPLIED > + +<!-- Input page attributes --> +<!ATTLIST page ifTarget NMTOKEN #IMPLIED > +<!ATTLIST page ifProperty CDATA #IMPLIED > +<!ATTLIST page overflow CDATA #IMPLIED > + +<!ELEMENT select ( option+ ) > +<!ATTLIST select defaultValue CDATA #REQUIRED > +<!ATTLIST select explanatoryText CDATA #IMPLIED > +<!ATTLIST select displayText CDATA #REQUIRED > +<!ATTLIST select property NMTOKEN #REQUIRED > +<!ATTLIST select explanatoryText CDATA #IMPLIED > + + +<!ELEMENT large-select ( option+ ) > +<!ATTLIST large-select defaultValue CDATA #REQUIRED > +<!ATTLIST large-select explanatoryText CDATA #IMPLIED > +<!ATTLIST large-select displayText CDATA #REQUIRED > +<!ATTLIST large-select property NMTOKEN #REQUIRED > +<!ATTLIST large-select explanatoryText CDATA #IMPLIED > + + +<!ELEMENT target-select ( option+ ) > +<!ATTLIST target-select defaultValue CDATA #REQUIRED > +<!ATTLIST target-select explanatoryText CDATA #IMPLIED > +<!ATTLIST target-select displayText CDATA #REQUIRED > +<!ATTLIST target-select property NMTOKEN #REQUIRED > +<!ATTLIST target-select explanatoryText CDATA #IMPLIED > + + +<!ELEMENT password EMPTY > +<!ATTLIST password defaultValue NMTOKEN #REQUIRED > +<!ATTLIST password regex CDATA #REQUIRED > +<!ATTLIST password displayText CDATA #REQUIRED > +<!ATTLIST password property NMTOKEN #REQUIRED > +<!ATTLIST password explanatoryText CDATA #IMPLIED > +<!ATTLIST password textMask CDATA #IMPLIED > +<!ATTLIST password name NMTOKEN #IMPLIED > + + +<!ELEMENT password-confirm EMPTY > +<!ATTLIST password-confirm defaultValue NMTOKEN #REQUIRED > +<!ATTLIST password-confirm regex CDATA #IMPLIED > +<!ATTLIST password-confirm displayText CDATA #REQUIRED > +<!ATTLIST password-confirm property NMTOKEN #REQUIRED > +<!ATTLIST password-confirm explanatoryText CDATA #IMPLIED > +<!ATTLIST password-confirm textMask CDATA #IMPLIED > +<!ATTLIST password-confirm origField CDATA #REQUIRED > +<!ATTLIST password-confirm name NMTOKEN #IMPLIED > + + +<!ELEMENT date EMPTY > +<!ATTLIST date defaultValue CDATA #REQUIRED > +<!ATTLIST date dateFormat CDATA #REQUIRED > +<!ATTLIST date displayText CDATA #REQUIRED > +<!ATTLIST date property NMTOKEN #REQUIRED > +<!ATTLIST date explanatoryText CDATA #IMPLIED > +<!ATTLIST date name NMTOKEN #IMPLIED > + + +<!ELEMENT text EMPTY > +<!ATTLIST text defaultValue CDATA #REQUIRED > +<!ATTLIST text displayText CDATA #REQUIRED > +<!ATTLIST text property NMTOKEN #REQUIRED > +<!ATTLIST text explanatoryText CDATA #IMPLIED > +<!ATTLIST text name NMTOKEN #IMPLIED > + + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antinstall-config-0.8.dtd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/FeedbackListener.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/FeedbackListener.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/FeedbackListener.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,104 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.antmod; + +import java.util.ResourceBundle; + +import org.apache.tools.ant.BuildEvent; +import org.apache.tools.ant.BuildListener; +import org.tp23.antinstaller.renderer.swing.SwingInstallerContext; +/** + * + * <p>Reports a message in the swing UI this mesage is reported in the + * top of the window. </p> + * <p>The Listeners should apparently never uses System.out or System.err</p> + * This class is not really an Ant modification since it simply implements + * a public interface but is here on the offchance that one day Ant changes + * it's APIs + * @author Paul Hinds + * @version $Id: FeedbackListener.java,v 1.1.1.1 2005/10/18 18:20:52 teknopaul Exp $ + */ +public class FeedbackListener implements BuildListener{ + + private final SwingInstallerContext swingCtx; + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + public FeedbackListener(SwingInstallerContext swingCtx) { + this.swingCtx=swingCtx; + } + + /** + * buildStarted This event results in User notification + * + * @param buildEvent BuildEvent + */ + public void buildStarted(BuildEvent buildEvent) { + //swingCtx.provideAntFeedBack(buildEvent.getMessage()); + swingCtx.buildStarted(buildEvent); + } + + /** + * buildFinished This event results in User notification + * + * @param buildEvent BuildEvent + */ + public void buildFinished(BuildEvent buildEvent) { + swingCtx.provideAntFeedBack(res.getString("installFinished")); + swingCtx.buildFinished(buildEvent); + } + + /** + * targetStarted This event results in User notification + * + * @param buildEvent BuildEvent + */ + public void targetStarted(BuildEvent buildEvent) { + swingCtx.provideAntFeedBack(res.getString("running")+buildEvent.getTarget()); + swingCtx.targetStarted(buildEvent); + } + + /** + * targetFinished This event is ignored + * @param buildEvent BuildEvent + */ + public void targetFinished(BuildEvent buildEvent) { + swingCtx.targetFinished(buildEvent); + } + + /** + * taskStarted This event is ignored + * @param buildEvent BuildEvent + */ + public void taskStarted(BuildEvent buildEvent) { + //swingCtx.provideAntFeedBack(buildEvent.getMessage()); + } + + /** + * taskFinished This event is ignored + * @param buildEvent BuildEvent + */ + public void taskFinished(BuildEvent buildEvent) { + //swingCtx.provideAntFeedBack(buildEvent.getMessage()); + } + + /** + * messageLogged This event is ignored + * @param buildEvent BuildEvent + */ + public void messageLogged(BuildEvent buildEvent) { + //swingCtx.provideAntFeedBack(buildEvent.getMessage()); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/FeedbackListener.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Jdk14RegexpMatcher.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Jdk14RegexpMatcher.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Jdk14RegexpMatcher.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,139 @@ +/* + * Copyright 2001-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.tp23.antinstaller.antmod; + +import java.util.Vector; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.util.regexp.RegexpMatcher; +import org.apache.tools.ant.util.regexp.RegexpUtil; + +/** + * Implementation of RegexpMatcher for the built-in regexp matcher of + * JDK 1.4. UNIX_LINES option is enabled as a default. + * + */ +public class Jdk14RegexpMatcher implements RegexpMatcher { + + private String pattern; + + public Jdk14RegexpMatcher() { + } + + /** + * Set the regexp pattern from the String description. + */ + public void setPattern(String pattern) { + this.pattern = pattern; + } + + /** + * Get a String representation of the regexp pattern + */ + public String getPattern() { + return pattern; + } + + protected Pattern getCompiledPattern(int options) + throws BuildException { + int cOptions = getCompilerOptions(options); + try { + Pattern p = Pattern.compile(this.pattern, cOptions); + return p; + } catch (PatternSyntaxException e) { + throw new BuildException(e); + } + } + + /** + * Does the given argument match the pattern? + */ + public boolean matches(String argument) throws BuildException { + return matches(argument, MATCH_DEFAULT); + } + + /** + * Does the given argument match the pattern? + */ + public boolean matches(String input, int options) + throws BuildException { + try { + Pattern p = getCompiledPattern(options); + return p.matcher(input).find(); + } catch (Exception e) { + throw new BuildException(e); + } + } + + /** + * Returns a Vector of matched groups found in the argument. + * + * <p>Group 0 will be the full match, the rest are the + * parenthesized subexpressions</p>. + */ + public Vector getGroups(String argument) throws BuildException { + return getGroups(argument, MATCH_DEFAULT); + } + + /** + * Returns a Vector of matched groups found in the argument. + * + * <p>Group 0 will be the full match, the rest are the + * parenthesized subexpressions</p>. + */ + public Vector getGroups(String input, int options) + throws BuildException { + Pattern p = getCompiledPattern(options); + Matcher matcher = p.matcher(input); + if (!matcher.find()) { + return null; + } + Vector v = new Vector(); + int cnt = matcher.groupCount(); + for (int i = 0; i <= cnt; i++) { + String match = matcher.group(i); + // treat non-matching groups as empty matches + if (match == null) { + match = ""; + } + v.addElement(match); + } + return v; + } + + protected int getCompilerOptions(int options) { + // be strict about line separator + int cOptions = Pattern.UNIX_LINES; + + if (RegexpUtil.hasFlag(options, MATCH_CASE_INSENSITIVE)) { + cOptions |= Pattern.CASE_INSENSITIVE; + } + if (RegexpUtil.hasFlag(options, MATCH_MULTILINE)) { + cOptions |= Pattern.MULTILINE; + } + if (RegexpUtil.hasFlag(options, MATCH_SINGLELINE)) { + cOptions |= Pattern.DOTALL; + } + + return cOptions; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Jdk14RegexpMatcher.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Jdk14RegexpRegexp.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Jdk14RegexpRegexp.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Jdk14RegexpRegexp.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,92 @@ +/* + * Copyright 2001-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.tp23.antinstaller.antmod; + + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.util.regexp.Regexp; +import org.apache.tools.ant.util.regexp.RegexpUtil; + + +/*** + * Regular expression implementation using the JDK 1.4 regular expression package + */ +public class Jdk14RegexpRegexp extends Jdk14RegexpMatcher implements Regexp { + + public Jdk14RegexpRegexp() { + super(); + } + + protected int getSubsOptions(int options) { + int subsOptions = REPLACE_FIRST; + if (RegexpUtil.hasFlag(options, REPLACE_ALL)) { + subsOptions = REPLACE_ALL; + } + return subsOptions; + } + + public String substitute(String input, String argument, int options) + throws BuildException { + // translate \1 to $(1) so that the Matcher will work + StringBuffer subst = new StringBuffer(); + for (int i = 0; i < argument.length(); i++) { + char c = argument.charAt(i); + if (c == '$') { + subst.append('\\'); + subst.append('$'); + } else if (c == '\\') { + if (++i < argument.length()) { + c = argument.charAt(i); + int value = Character.digit(c, 10); + if (value > -1) { + subst.append("$").append(value); + } else { + subst.append(c); + } + } else { + // XXX - should throw an exception instead? + subst.append('\\'); + } + } else { + subst.append(c); + } + } + argument = subst.toString(); + + int sOptions = getSubsOptions(options); + Pattern p = getCompiledPattern(options); + StringBuffer sb = new StringBuffer(); + + Matcher m = p.matcher(input); + if (RegexpUtil.hasFlag(sOptions, REPLACE_ALL)) { + sb.append(m.replaceAll(argument)); + } else { + boolean res = m.find(); + if (res) { + m.appendReplacement(sb, argument); + m.appendTail(sb); + } else { + sb.append(input); + } + } + + return sb.toString(); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Jdk14RegexpRegexp.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Launcher.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Launcher.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Launcher.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,250 @@ +/* + * Copyright 2003-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.tp23.antinstaller.antmod; + +import java.io.File; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.StringTokenizer; + +import org.apache.tools.ant.launch.LaunchException; +import org.apache.tools.ant.launch.Locator; +import org.tp23.antinstaller.InstallerContext; + + + +/** + * This is a launcher for Ant. + * + * This file has been modified by Paul Hinds for Antinstaller and is not the same + * as the one delivered with Ant 1.6 + * + * @since Ant 1.6 + * @version $Id: Launcher.java,v 1.1.1.1 2005/10/18 18:20:54 teknopaul Exp $ + */ +public class Launcher { + /** The Ant Home property */ + public static final String ANTHOME_PROPERTY = "ant.home"; + + + /** The Ant Library Directory property */ + public static final String ANTLIBDIR_PROPERTY = "ant.library.dir"; + + + /** The location of a per-user library directory */ + public static final String USER_LIBDIR = ".ant/lib"; + + + /** The startup class that is to be run */ + public static final String MAIN_CLASS = "org.apache.tools.ant.Main"; + + private final Map allProperties; + + + +/** + * Addtional Constructor to pass password properties to Ant + * without saving them to a file. + * Added by Paul Hinds + * @param allProperties Properties + */ + public Launcher(Map allProperties) { + this.allProperties = allProperties; + } + + + +/** + * Run the launcher to launch Ant + * + * @param args the command line arguments + * + * @exception MalformedURLException if the URLs required for the classloader + * cannot be created. + */ + public int run(String[] args, InstallerContext cxt) throws LaunchException, MalformedURLException { + + try { + + String antHomeProperty = System.getProperty(ANTHOME_PROPERTY); + File antHome = null; + + File jarDir = null; + + File sourceJar = Locator.getClassSource(getClass()); + jarDir = sourceJar.getParentFile(); + + if (antHomeProperty != null) { + antHome = new File(antHomeProperty); + } + + if (antHome == null || !antHome.exists()) { + antHome = jarDir.getParentFile(); + System.setProperty(ANTHOME_PROPERTY, antHome.getAbsolutePath()); + } + + if (!antHome.exists()) { + throw new LaunchException("Ant home is set incorrectly or ant could not be located"); + } + + List libPaths = new ArrayList(); + List argList = new ArrayList(); + String[] newArgs; + + for (int i = 0; i < args.length; ++i) { + if (args[i].equals("-lib")) { + if (i == args.length - 1) { + throw new LaunchException("The -lib argument must be followed by a library location"); + } + libPaths.add(args[++i]); + } + else { + argList.add(args[i]); + } + } + + if (libPaths.size() == 0) { + newArgs = args; + } + else { + newArgs = (String[]) argList.toArray(new String[0]); + } + + List libPathURLs = new ArrayList(); + for (Iterator i = libPaths.iterator(); i.hasNext(); ) { + String libPath = (String) i.next(); + StringTokenizer myTokenizer + = new StringTokenizer(libPath, System.getProperty("path.separator")); + while (myTokenizer.hasMoreElements()) { + String elementName = myTokenizer.nextToken(); + File element = new File(elementName); + if (elementName.indexOf("%") != -1 && !element.exists()) { + continue; + } + if (element.isDirectory()) { + // add any jars in the directory + URL[] dirURLs = Locator.getLocationURLs(element); + for (int j = 0; j < dirURLs.length; ++j) { + libPathURLs.add(dirURLs[j]); + } + } + + libPathURLs.add(element.toURL()); + } + } + + URL[] libJars = (URL[]) libPathURLs.toArray(new URL[0]); + + // Now try and find JAVA_HOME + File toolsJar = Locator.getToolsJar(); + + // determine ant library directory for system jars: use property + // or default using location of ant-launcher.jar + File antLibDir = null; + String antLibDirProperty = System.getProperty(ANTLIBDIR_PROPERTY); + if (antLibDirProperty != null) { + antLibDir = new File(antLibDirProperty); + } + if ( (antLibDir == null) || !antLibDir.exists()) { + antLibDir = jarDir; + System.setProperty(ANTLIBDIR_PROPERTY, antLibDir.getAbsolutePath()); + } + URL[] systemJars = Locator.getLocationURLs(antLibDir); + + File userLibDir + = new File(System.getProperty("user.home"), USER_LIBDIR); + URL[] userJars = Locator.getLocationURLs(userLibDir); + + + int numJars = libJars.length + userJars.length + systemJars.length; + if (toolsJar != null) { + numJars++; + } + URL[] jars = new URL[numJars]; + System.arraycopy(libJars, 0, jars, 0, libJars.length); + System.arraycopy(userJars, 0, jars, libJars.length, userJars.length); + System.arraycopy(systemJars, 0, jars, userJars.length + libJars.length, + systemJars.length); + + if (toolsJar != null) { + jars[jars.length - 1] = toolsJar.toURL(); + } + + + // now update the class.path property + StringBuffer baseClassPath + = new StringBuffer(System.getProperty("java.class.path")); + if (baseClassPath.charAt(baseClassPath.length() - 1) + == File.pathSeparatorChar) { + baseClassPath.setLength(baseClassPath.length() - 1); + } + + for (int i = 0; i < jars.length; ++i) { + baseClassPath.append(File.pathSeparatorChar); + baseClassPath.append(Locator.fromURI(jars[i].toString())); + } + + System.setProperty("java.class.path", baseClassPath.toString()); + + URLClassLoader loader = new URLClassLoader(jars); + Thread.currentThread().setContextClassLoader(loader); + try { + Main main = new Main(); + Properties props = new Properties(); + props.putAll(allProperties); + return main.startAnt(newArgs, props, null, cxt); + } + catch (Throwable t) { + t.printStackTrace(); + return 1; + } + } + catch (Throwable ex) { + // Essentially all of the above is nice to have as far as AntInstaller is concerned + // ant.home may not be available when installing and application on a client that does not + // have and never will have Ant. However the code is left since sometimes AntInstaller can be used + // for a general gui for Ant builds and features such and ANT_HOME/lib are useful + try { + System.setProperty(ANTHOME_PROPERTY, new File(".").getAbsolutePath()); + Main main = new Main(); + // fix for bug:1177191 + // remove the -lib as discovered by Mark Anderson + String[] newArgs = new String[args.length-2]; + for(int i=0,n=0;i<args.length;i++){ + if(args[i].equals("-lib")){ + i++; + continue; + } + newArgs[n++]=args[i]; + } + Properties props = new Properties(); + props.putAll(allProperties); + return main.startAnt(newArgs, props, null, cxt); + } + catch (Throwable t) { + t.printStackTrace(); + return 1; + } + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Launcher.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Main.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Main.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Main.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,1064 @@ +/* + * Copyright 2000-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.tp23.antinstaller.antmod; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; +import java.util.Enumeration; +import java.util.Properties; +import java.util.Vector; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.BuildListener; +import org.apache.tools.ant.BuildLogger; +import org.apache.tools.ant.DefaultLogger; +import org.apache.tools.ant.Diagnostics; +import org.apache.tools.ant.ExitStatusException; +import org.apache.tools.ant.Project; +import org.apache.tools.ant.ProjectHelper; +import org.apache.tools.ant.Target; +import org.apache.tools.ant.input.DefaultInputHandler; +import org.apache.tools.ant.input.InputHandler; +import org.apache.tools.ant.launch.AntMain; +import org.apache.tools.ant.util.JavaEnvUtils; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.PropertiesFileRenderer; + + +/** + * Command line entry point into Ant. This class is entered via the + * canonical `public static void main` entry point and reads the + * command line arguments. It then assembles and executes an Ant + * project. + * <p> + * If you integrating Ant into some other tool, this is not the class + * to use as an entry point. Please see the source code of this + * class to see how it manipulates the Ant project classes. + * +* This file has been modified by Paul Hinds for Antinstaller and is not the same +* as the one delivered with Ant 1.6 +* @version $Id: Main.java,v 1.5 2007/01/12 10:41:48 anothermwilson Exp $ + */ +public class Main implements AntMain { + + /** The default build file name. */ + public static final String DEFAULT_BUILD_FILENAME = "build.xml"; + + /** Our current message output status. Follows Project.MSG_XXX. */ + private int msgOutputLevel = Project.MSG_INFO; + + /** File that we are using for configuration. */ + private File buildFile; /* null */ + + /** Stream to use for logging. */ + private static PrintStream out = System.out; + + /** Stream that we are using for logging error messages. */ + private static PrintStream err = System.err; + + /** The build targets. */ + private Vector targets = new Vector(); + + /** Set of properties that can be used by tasks. */ + private Properties definedProps = new Properties(); + + /** Names of classes to add as listeners to project. */ + private Vector listeners = new Vector(1); + + /** File names of property files to load on startup. */ + private Vector propertyFiles = new Vector(1); + + /** Indicates whether this build is to support interactive input */ + private boolean allowInput = true; + + /** keep going mode */ + private boolean keepGoingMode = false; + + /** + * The Ant logger class. There may be only one logger. It will have + * the right to use the 'out' PrintStream. The class must implements the + * BuildLogger interface. + */ + private String loggerClassname = null; + + /** + * The Ant InputHandler class. There may be only one input + * handler. + */ + private String inputHandlerClassname = null; + + /** + * Whether or not output to the log is to be unadorned. + */ + private boolean emacsMode = false; + + /** + * Whether or not this instance has successfully been + * constructed and is ready to run. + */ + private boolean readyToRun = false; + + /** + * Whether or not we should only parse and display the project help + * information. + */ + private boolean projectHelp = false; + + /** + * Whether or not a logfile is being used. This is used to + * check if the output streams must be closed. + */ + private static boolean isLogFileUsed = false; + + /** + * optional thread priority + */ + private Integer threadPriority = null; + /** + * Installer Context + */ + private InstallerContext ctx = null; + + /** + * Prints the message of the Throwable if it (the message) is not + * <code>null</code>. + * + * @param t Throwable to print the message of. + * Must not be <code>null</code>. + */ + private static void printMessage(Throwable t) { + String message = t.getMessage(); + if (message != null) { + System.err.println(message); + } + } + + /** + * Creates a new instance of this class using the + * arguments specified, gives it any extra user properties which have been + * specified, and then runs the build using the classloader provided. + * + * @param args Command line arguments. Must not be <code>null</code>. + * @param additionalUserProperties Any extra properties to use in this + * build. May be <code>null</code>, which is the equivalent to + * passing in an empty set of properties. + * @param coreLoader Classloader used for core classes. May be + * <code>null</code> in which case the system classloader is used. + */ + public static void start(String[] args, Properties additionalUserProperties, + ClassLoader coreLoader) { + throw new UnsupportedOperationException("Required by Ant interface but not used"); + //Main m = new Main(); + //m.startAnt(args, additionalUserProperties, coreLoader); + } + + + public void startAnt(String[] args, Properties additionalUserProperties, + ClassLoader coreLoader) { + throw new UnsupportedOperationException("Required by Ant interface but not used"); + //startAnt(args, additionalUserProperties, coreLoader, null); // FindBugs does not like this + } + /** + * Start Ant + * @param args command line args + * @param additionalUserProperties properties to set beyond those that + * may be specified on the args list + * @param coreLoader - not used + * @return the return code that was used for System.exit() in the original Ant + * + * @since Ant 1.6 + */ + public int startAnt(String[] args, Properties additionalUserProperties, + ClassLoader coreLoader, InstallerContext ctx) { + this.ctx = ctx; + out = ctx.getAntOutputRenderer().getOut(); + err = ctx.getAntOutputRenderer().getErr(); + try { + Diagnostics.validateVersion(); + processArgs(args); + } catch (Throwable exc) { + handleLogfile(); + printMessage(exc); + return 1; + } + + if (additionalUserProperties != null) { + for (Enumeration e = additionalUserProperties.keys(); + e.hasMoreElements();) { + String key = (String) e.nextElement(); + String property = additionalUserProperties.getProperty(key); + definedProps.put(key, property); + } + } + + // expect the worst + int exitCode = 1; + try { + try { + runBuild(coreLoader); + exitCode = 0; + } catch (ExitStatusException ese) { + exitCode = ese.getStatus(); + if (exitCode != 0) { + throw ese; + } + } + } catch (BuildException be) { + if (err != System.err) { + printMessage(be); + } + } catch (Throwable exc) { + exc.printStackTrace(); + printMessage(exc); + } finally { + handleLogfile(); + } + //mod by Paul Hinds + return exitCode; + //System.exit(exitCode); + } + + /** + * Close logfiles, if we have been writing to them. + * + * @since Ant 1.6 + */ + private static void handleLogfile() { + if (isLogFileUsed) { + if (out != null) { + try { + out.close(); + } catch (final Exception e) { + //ignore + } + } + if (err != null) { + try { + err.close(); + } catch (final Exception e) { + //ignore + } + } + } + } + + /** + * Command line entry point. This method kicks off the building + * of a project object and executes a build using either a given + * target or the default target. + * + * @param args Command line arguments. Must not be <code>null</code>. + */ +// public static void main(String[] args) { +// start(args, null, null); +// } +// + /** + * Constructor used when creating Main for later arg processing + * and startup + */ + public Main() { + } + + /** + * Sole constructor, which parses and deals with command line + * arguments. + * + * @param args Command line arguments. Must not be <code>null</code>. + * + * @exception BuildException if the specified build file doesn't exist + * or is a directory. + * + * @deprecated + */ + protected Main(String[] args) throws BuildException { + processArgs(args); + } + + /** + * Process command line arguments. + * When ant is started from Launcher, the -lib argument does not get + * passed through to this routine. + * + * @param args the command line arguments. + * + * @since Ant 1.6 + */ + private void processArgs(String[] args) { + String searchForThis = null; + PrintStream logTo = null; + + // cycle through given args + + for (int i = 0; i < args.length; i++) { + String arg = args[i]; + + if (arg.equals("-help") || arg.equals("-h")) { + printUsage(); + return; + } else if (arg.equals("-version")) { + printVersion(); + return; + } else if (arg.equals("-diagnostics")) { + Diagnostics.doReport(System.out); + return; + } else if (arg.equals("-quiet") || arg.equals("-q")) { + msgOutputLevel = Project.MSG_WARN; + } else if (arg.equals("-verbose") || arg.equals("-v")) { + printVersion(); + msgOutputLevel = Project.MSG_VERBOSE; + } else if (arg.equals("-debug") || arg.equals("-d")) { + printVersion(); + msgOutputLevel = Project.MSG_DEBUG; + } else if (arg.equals("-noinput")) { + allowInput = false; + } else if (arg.equals("-logfile") || arg.equals("-l")) { + try { + File logFile = new File(args[i + 1]); + i++; + logTo = new PrintStream(new FileOutputStream(logFile)); + isLogFileUsed = true; + } catch (IOException ioe) { + String msg = "Cannot write on the specified log file. " + + "Make sure the path exists and you have write " + + "permissions."; + throw new BuildException(msg); + } catch (ArrayIndexOutOfBoundsException aioobe) { + String msg = "You must specify a log file when " + + "using the -log argument"; + throw new BuildException(msg); + } + } else if (arg.equals("-buildfile") || arg.equals("-file") + || arg.equals("-f")) { + try { + buildFile = new File(args[i + 1].replace('/', File.separatorChar)); + i++; + } catch (ArrayIndexOutOfBoundsException aioobe) { + String msg = "You must specify a buildfile when " + + "using the -buildfile argument"; + throw new BuildException(msg); + } + } else if (arg.equals("-listener")) { + try { + listeners.addElement(args[i + 1]); + i++; + } catch (ArrayIndexOutOfBoundsException aioobe) { + String msg = "You must specify a classname when " + + "using the -listener argument"; + throw new BuildException(msg); + } + } else if (arg.startsWith("-D")) { + + /* Interestingly enough, we get to here when a user + * uses -Dname=value. However, in some cases, the OS + * goes ahead and parses this out to args + * {"-Dname", "value"} + * so instead of parsing on "=", we just make the "-D" + * characters go away and skip one argument forward. + * + * I don't know how to predict when the JDK is going + * to help or not, so we simply look for the equals sign. + */ + + String name = arg.substring(2, arg.length()); + String value = null; + int posEq = name.indexOf("="); + if (posEq > 0) { + value = name.substring(posEq + 1); + name = name.substring(0, posEq); + } else if (i < args.length - 1) { + value = args[++i]; + } else { + throw new BuildException("Missing value for property " + + name); + } + + definedProps.put(name, value); + } else if (arg.equals("-logger")) { + if (loggerClassname != null) { + throw new BuildException("Only one logger class may " + + " be specified."); + } + try { + loggerClassname = args[++i]; + } catch (ArrayIndexOutOfBoundsException aioobe) { + throw new BuildException("You must specify a classname when" + + " using the -logger argument"); + } + } else if (arg.equals("-inputhandler")) { + if (inputHandlerClassname != null) { + throw new BuildException("Only one input handler class may " + + "be specified."); + } + try { + inputHandlerClassname = args[++i]; + } catch (ArrayIndexOutOfBoundsException aioobe) { + throw new BuildException("You must specify a classname when" + + " using the -inputhandler" + + " argument"); + } + } else if (arg.equals("-emacs") || arg.equals("-e")) { + emacsMode = true; + } else if (arg.equals("-projecthelp") || arg.equals("-p")) { + // set the flag to display the targets and quit + projectHelp = true; + } else if (arg.equals("-find") || arg.equals("-s")) { + // eat up next arg if present, default to build.xml + if (i < args.length - 1) { + searchForThis = args[++i]; + } else { + searchForThis = DEFAULT_BUILD_FILENAME; + } + } else if (arg.startsWith("-propertyfile")) { + try { + propertyFiles.addElement(args[i + 1]); + i++; + } catch (ArrayIndexOutOfBoundsException aioobe) { + String msg = "You must specify a property filename when " + + "using the -propertyfile argument"; + throw new BuildException(msg); + } + } else if (arg.equals("-k") || arg.equals("-keep-going")) { + keepGoingMode = true; + } else if (arg.equals("-nice")) { + try { + threadPriority=Integer.decode(args[i + 1]); + } catch (ArrayIndexOutOfBoundsException aioobe) { + throw new BuildException( + "You must supply a niceness value (1-10)"+ + " after the -nice option"); + } catch (NumberFormatException e) { + throw new BuildException("Unrecognized niceness value: " + + args[i + 1]); + } + i++; + if(threadPriority.intValue()<Thread.MIN_PRIORITY || + threadPriority.intValue()>Thread.MAX_PRIORITY) { + throw new BuildException( + "Niceness value is out of the range 1-10"); + } + } else if (arg.startsWith("-")) { + // we don't have any more args to recognize! + String msg = "Unknown argument: " + arg; + System.out.println(msg); + printUsage(); + throw new BuildException(""); + } else { + // if it's no other arg, it may be the target + targets.addElement(arg); + } + } + + // if buildFile was not specified on the command line, + if (buildFile == null) { + // but -find then search for it + if (searchForThis != null) { + buildFile = findBuildFile(System.getProperty("user.dir"), + searchForThis); + } else { + buildFile = new File(DEFAULT_BUILD_FILENAME); + } + } + + // make sure buildfile exists + if (!buildFile.exists()) { + System.out.println("Buildfile: " + buildFile + " does not exist!"); + throw new BuildException("Build failed"); + } + + // make sure it's not a directory (this falls into the ultra + // paranoid lets check everything category + + if (buildFile.isDirectory()) { + System.out.println("What? Buildfile: " + buildFile + " is a dir!"); + throw new BuildException("Build failed"); + } + + // Load the property files specified by -propertyfile + for (int propertyFileIndex = 0; + propertyFileIndex < propertyFiles.size(); + propertyFileIndex++) { + String filename + = (String) propertyFiles.elementAt(propertyFileIndex); + Properties props = new Properties(); + FileInputStream fis = null; + try { + fis = new FileInputStream(filename); + props.load(fis); + } catch (IOException e) { + System.out.println("Could not load property file " + + filename + ": " + e.getMessage()); + } finally { + if (fis != null) { + try { + fis.close(); + } catch (IOException e) { + // ignore + } + } + } + + // ensure that -D properties take precedence + Enumeration propertyNames = props.propertyNames(); + while (propertyNames.hasMoreElements()) { + String name = (String) propertyNames.nextElement(); + if (definedProps.getProperty(name) == null) { + definedProps.put(name, props.getProperty(name)); + } + } + } + + if (msgOutputLevel >= Project.MSG_INFO) { + System.out.println("Buildfile: " + buildFile); + } + + if (logTo != null) { + out = logTo; + err = logTo; + System.setOut(out); + System.setErr(err); + } + readyToRun = true; + } + + /** + * Helper to get the parent file for a given file. + * <p> + * Added to simulate File.getParentFile() from JDK 1.2. + * @deprecated + * + * @param file File to find parent of. Must not be <code>null</code>. + * @return Parent file or null if none + */ + private File getParentFile(File file) { + File parent = file.getParentFile(); + + if (parent != null && msgOutputLevel >= Project.MSG_VERBOSE) { + System.out.println("Searching in " + parent.getAbsolutePath()); + } + + return parent; + } + + /** + * Search parent directories for the build file. + * <p> + * Takes the given target as a suffix to append to each + * parent directory in search of a build file. Once the + * root of the file-system has been reached an exception + * is thrown. + * + * @param start Leaf directory of search. + * Must not be <code>null</code>. + * @param suffix Suffix filename to look for in parents. + * Must not be <code>null</code>. + * + * @return A handle to the build file if one is found + * + * @exception BuildException if no build file is found + */ + private File findBuildFile(String start, String suffix) + throws BuildException { + if (msgOutputLevel >= Project.MSG_INFO) { + System.out.println("Searching for " + suffix + " ..."); + } + + File parent = new File(new File(start).getAbsolutePath()); + File file = new File(parent, suffix); + + // check if the target file exists in the current directory + while (!file.exists()) { + // change to parent directory + parent = getParentFile(parent); + + // if parent is null, then we are at the root of the fs, + // complain that we can't find the build file. + if (parent == null) { + throw new BuildException("Could not locate a build file!"); + } + + // refresh our file handle + file = new File(parent, suffix); + } + + return file; + } + + /** + * Executes the build. If the constructor for this instance failed + * (e.g. returned after issuing a warning), this method returns + * immediately. + * + * @param coreLoader The classloader to use to find core classes. + * May be <code>null</code>, in which case the + * system classloader is used. + * + * @exception BuildException if the build fails + */ + private void runBuild(ClassLoader coreLoader) throws BuildException { + + if (!readyToRun) { + return; + } + + final Project project = new Project(); + project.setCoreLoader(coreLoader); + + Throwable error = null; + + try { + addBuildListeners(project); + addInputHandler(project); + + PrintStream err = System.err; + PrintStream out = System.out; + InputStream in = System.in; + + // use a system manager that prevents from System.exit() + // only in JDK > 1.1 + SecurityManager oldsm = null; + if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_0) + && !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)) { + oldsm = System.getSecurityManager(); + + //SecurityManager can not be installed here for backwards + //compatibility reasons (PD). Needs to be loaded prior to + //ant class if we are going to implement it. + //System.setSecurityManager(new NoExitSecurityManager()); + } + try { + if (allowInput) { + project.setDefaultInputStream(System.in); + } + //System.setIn(new DemuxInputStream(project)); + //System.setOut(new PrintStream(new DemuxOutputStream(project, false))); + //System.setErr(new PrintStream(new DemuxOutputStream(project, true))); + + + if (!projectHelp) { + project.fireBuildStarted(); + } + + // set the thread priorities + if (threadPriority != null) { + try { + project.log("Setting Ant's thread priority to " + + threadPriority,Project.MSG_VERBOSE); + Thread.currentThread().setPriority(threadPriority.intValue()); + } catch (SecurityException swallowed) { + //we cannot set the priority here. + project.log("A security manager refused to set the -nice value"); + } + } + + project.init(); + project.setUserProperty("ant.version", getAntVersion()); + + // set user-define properties + Enumeration e = definedProps.keys(); + while (e.hasMoreElements()) { + String arg = (String) e.nextElement(); + String value = (String) definedProps.get(arg); + project.setUserProperty(arg, value); + } + + project.setUserProperty("ant.file", + buildFile.getAbsolutePath()); + project.setKeepGoingMode(keepGoingMode); + + ProjectHelper.configureProject(project, buildFile); + + project.setBasedir(definedProps.getProperty(PropertiesFileRenderer.FILE_ROOT_PROPERTY)); + + + if (projectHelp) { + printDescription(project); + printTargets(project, msgOutputLevel > Project.MSG_INFO); + return; + } + + // make sure that we have a target to execute + if (targets.size() == 0) { + if (project.getDefaultTarget() != null) { + targets.addElement(project.getDefaultTarget()); + } + } + project.executeTargets(targets); + } finally { + // put back the original security manager + //The following will never eval to true. (PD) + if (oldsm != null) { + System.setSecurityManager(oldsm); + } + + System.setOut(out); + System.setErr(err); + System.setIn(in); + } + } catch (RuntimeException exc) { + error = exc; + throw exc; + } catch (Error err) { + error = err; + throw err; + } finally { + if (!projectHelp) { + project.fireBuildFinished(error); + } else if (error != null) { + project.log(error.toString(), Project.MSG_ERR); + } + } + } + + /** + * Adds the listeners specified in the command line arguments, + * along with the default listener, to the specified project. + * + * @param project The project to add listeners to. + * Must not be <code>null</code>. + */ + protected void addBuildListeners(Project project) { + + // Add the default listener + project.addBuildListener(createLogger()); + + //Add the AntInstaller Listener + if(ctx.getBuildListener()!=null){ + project.addBuildListener(ctx.getBuildListener()); + } + + for (int i = 0; i < listeners.size(); i++) { + String className = (String) listeners.elementAt(i); + try { + BuildListener listener = + (BuildListener) Class.forName(className).newInstance(); + if (project != null) { + project.setProjectReference(listener); + } + project.addBuildListener(listener); + } catch (Throwable exc) { + throw new BuildException("Unable to instantiate listener " + + className, exc); + } + } + } + + /** + * Creates the InputHandler and adds it to the project. + * + * @param project the project instance. + * + * @exception BuildException if a specified InputHandler + * implementation could not be loaded. + */ + private void addInputHandler(Project project) throws BuildException { + InputHandler handler = null; + if (inputHandlerClassname == null) { + handler = new DefaultInputHandler(); + } else { + try { + handler = (InputHandler) + (Class.forName(inputHandlerClassname).newInstance()); + if (project != null) { + project.setProjectReference(handler); + } + } catch (ClassCastException e) { + String msg = "The specified input handler class " + + inputHandlerClassname + + " does not implement the InputHandler interface"; + throw new BuildException(msg); + } catch (Exception e) { + String msg = "Unable to instantiate specified input handler " + + "class " + inputHandlerClassname + " : " + + e.getClass().getName(); + throw new BuildException(msg); + } + } + project.setInputHandler(handler); + } + + // XXX: (Jon Skeet) Any reason for writing a message and then using a bare + // RuntimeException rather than just using a BuildException here? Is it + // in case the message could end up being written to no loggers (as the + // loggers could have failed to be created due to this failure)? + /** + * Creates the default build logger for sending build events to the ant + * log. + * + * @return the logger instance for this build. + */ + private BuildLogger createLogger() { + BuildLogger logger = null; + if (loggerClassname != null) { + try { + Class loggerClass = Class.forName(loggerClassname); + logger = (BuildLogger) (loggerClass.newInstance()); + } catch (ClassCastException e) { + System.err.println("The specified logger class " + + loggerClassname + + " does not implement the BuildLogger interface"); + throw new RuntimeException(); + } catch (Exception e) { + System.err.println("Unable to instantiate specified logger " + + "class " + loggerClassname + " : " + + e.getClass().getName()); + throw new RuntimeException(); + } + } else { + logger = new DefaultLogger(); + } + + logger.setMessageOutputLevel(msgOutputLevel); + logger.setOutputPrintStream(out); + logger.setErrorPrintStream(err); + logger.setEmacsMode(emacsMode); + + return logger; + } + + /** + * Prints the usage information for this class to <code>System.out</code>. + */ + private static void printUsage() { + String lSep = System.getProperty("line.separator"); + StringBuffer msg = new StringBuffer(); + msg.append("ant [options] [target [target2 [target3] ...]]" + lSep); + msg.append("Options: " + lSep); + msg.append(" -help, -h print this message" + lSep); + msg.append(" -projecthelp, -p print project help information" + lSep); + msg.append(" -version print the version information and exit" + lSep); + msg.append(" -diagnostics print information that might be helpful to" + lSep); + msg.append(" diagnose or report problems." + lSep); + msg.append(" -quiet, -q be extra quiet" + lSep); + msg.append(" -verbose, -v be extra verbose" + lSep); + msg.append(" -debug, -d print debugging information" + lSep); + msg.append(" -emacs, -e produce logging information without adornments" + lSep); + msg.append(" -lib <path> specifies a path to search for jars and classes" + lSep); + msg.append(" -logfile <file> use given file for log" + lSep); + msg.append(" -l <file> ''" + lSep); + msg.append(" -logger <classname> the class which is to perform logging" + lSep); + msg.append(" -listener <classname> add an instance of class as a project listener" + lSep); + msg.append(" -noinput do not allow interactive input" + lSep); + msg.append(" -buildfile <file> use given buildfile" + lSep); + msg.append(" -file <file> ''" + lSep); + msg.append(" -f <file> ''" + lSep); + msg.append(" -D<property>=<value> use value for given property" + lSep); + msg.append(" -keep-going, -k execute all targets that do not depend" + lSep); + msg.append(" on failed target(s)" + lSep); + msg.append(" -propertyfile <name> load all properties from file with -D" + lSep); + msg.append(" properties taking precedence" + lSep); + msg.append(" -inputhandler <class> the class which will handle input requests" + lSep); + msg.append(" -find <file> (s)earch for buildfile towards the root of" + lSep); + msg.append(" -s <file> the filesystem and use it" + lSep); + msg.append(" -nice number A niceness value for the main thread:" + lSep + + " 1 (lowest) to 10 (highest); 5 is the default" + lSep); + System.out.println(msg.toString()); + } + + /** + * Prints the Ant version information to <code>System.out</code>. + * + * @exception BuildException if the version information is unavailable + */ + private static void printVersion() throws BuildException { + System.out.println(getAntVersion()); + } + + /** + * Cache of the Ant version information when it has been loaded. + */ + private static String antVersion = null; + + /** + * Returns the Ant version information, if available. Once the information + * has been loaded once, it's cached and returned from the cache on future + * calls. + * + * @return the Ant version information as a String + * (always non-<code>null</code>) + * + * @exception BuildException if the version information is unavailable + */ + public static synchronized String getAntVersion() throws BuildException { + if (antVersion == null) { + try { + Properties props = new Properties(); + InputStream in = + Main.class.getResourceAsStream("/org/apache/tools/ant/version.txt"); + props.load(in); + in.close(); + + StringBuffer msg = new StringBuffer(); + msg.append("Apache Ant version "); + msg.append(props.getProperty("VERSION")); + msg.append(" compiled on "); + msg.append(props.getProperty("DATE")); + antVersion = msg.toString(); + } catch (IOException ioe) { + throw new BuildException("Could not load the version information:" + + ioe.getMessage()); + } catch (NullPointerException npe) { + throw new BuildException("Could not load the version information."); + } + } + return antVersion; + } + + /** + * Prints the description of a project (if there is one) to + * <code>System.out</code>. + * + * @param project The project to display a description of. + * Must not be <code>null</code>. + */ + private static void printDescription(Project project) { + if (project.getDescription() != null) { + project.log(project.getDescription()); + } + } + + /** + * Prints a list of all targets in the specified project to + * <code>System.out</code>, optionally including subtargets. + * + * @param project The project to display a description of. + * Must not be <code>null</code>. + * @param printSubTargets Whether or not subtarget names should also be + * printed. + */ + private static void printTargets(Project project, boolean printSubTargets) { + // find the target with the longest name + int maxLength = 0; + Enumeration ptargets = project.getTargets().elements(); + String targetName; + String targetDescription; + Target currentTarget; + // split the targets in top-level and sub-targets depending + // on the presence of a description + Vector topNames = new Vector(); + Vector topDescriptions = new Vector(); + Vector subNames = new Vector(); + + while (ptargets.hasMoreElements()) { + currentTarget = (Target) ptargets.nextElement(); + targetName = currentTarget.getName(); + if (targetName.equals("")) { + continue; + } + targetDescription = currentTarget.getDescription(); + // maintain a sorted list of targets + if (targetDescription == null) { + int pos = findTargetPosition(subNames, targetName); + subNames.insertElementAt(targetName, pos); + } else { + int pos = findTargetPosition(topNames, targetName); + topNames.insertElementAt(targetName, pos); + topDescriptions.insertElementAt(targetDescription, pos); + if (targetName.length() > maxLength) { + maxLength = targetName.length(); + } + } + } + + printTargets(project, topNames, topDescriptions, "Main targets:", + maxLength); + //if there were no main targets, we list all subtargets + //as it means nothing has a description + if (topNames.size() == 0) { + printSubTargets = true; + } + if (printSubTargets) { + printTargets(project, subNames, null, "Other targets:", 0); + } + + String defaultTarget = project.getDefaultTarget(); + if (defaultTarget != null && !"".equals(defaultTarget)) { + // shouldn't need to check but... + project.log("Default target: " + defaultTarget); + } + } + + /** + * Searches for the correct place to insert a name into a list so as + * to keep the list sorted alphabetically. + * + * @param names The current list of names. Must not be <code>null</code>. + * @param name The name to find a place for. + * Must not be <code>null</code>. + * + * @return the correct place in the list for the given name + */ + private static int findTargetPosition(Vector names, String name) { + int res = names.size(); + for (int i = 0; i < names.size() && res == names.size(); i++) { + if (name.compareTo((String) names.elementAt(i)) < 0) { + res = i; + } + } + return res; + } + + /** + * Writes a formatted list of target names to <code>System.out</code> + * with an optional description. + * + * + * @param project the project instance. + * @param names The names to be printed. + * Must not be <code>null</code>. + * @param descriptions The associated target descriptions. + * May be <code>null</code>, in which case + * no descriptions are displayed. + * If non-<code>null</code>, this should have + * as many elements as <code>names</code>. + * @param heading The heading to display. + * Should not be <code>null</code>. + * @param maxlen The maximum length of the names of the targets. + * If descriptions are given, they are padded to this + * position so they line up (so long as the names really + * <i>are</i> shorter than this). + */ + private static void printTargets(Project project, Vector names, + Vector descriptions, String heading, + int maxlen) { + // now, start printing the targets and their descriptions + String lSep = System.getProperty("line.separator"); + // got a bit annoyed that I couldn't find a pad function + String spaces = " "; + while (spaces.length() <= maxlen) { + spaces += spaces; + } + StringBuffer msg = new StringBuffer(); + msg.append(heading); + msg.append(lSep); + msg.append(lSep); + for (int i = 0; i < names.size(); i++) { + msg.append(" "); + msg.append(names.elementAt(i)); + if (descriptions != null) { + msg.append(spaces.substring(0, maxlen - ((String) names.elementAt(i)).length() + 2)); + msg.append(descriptions.elementAt(i)); + } + msg.append(lSep); + } + project.log(msg.toString()); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/Main.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/ProjectHelper3.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/ProjectHelper3.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/ProjectHelper3.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,1043 @@ +/* + * Copyright 2000-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.tp23.antinstaller.antmod; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.net.URL; +import java.util.Hashtable; +import java.util.Stack; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Location; +import org.apache.tools.ant.Project; +import org.apache.tools.ant.ProjectHelper; +import org.apache.tools.ant.RuntimeConfigurable; +import org.apache.tools.ant.Target; +import org.apache.tools.ant.Task; +import org.apache.tools.ant.UnknownElement; +import org.apache.tools.ant.helper.AntXMLContext; +import org.apache.tools.ant.util.FileUtils; +import org.apache.tools.ant.util.JAXPUtils; +import org.xml.sax.Attributes; +import org.xml.sax.InputSource; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.DefaultHandler; + +/** + * Sax2 based project reader + * +* This file has been modified by Paul Hinds for Antinstaller and is not the same +* as the ProjectHelper2 delivered with Ant 1.6 although almost identical + */ +public class ProjectHelper3 extends ProjectHelper { + /* Stateless */ + + // singletons - since all state is in the context + private static AntHandler elementHandler = new ElementHandler(); + private static AntHandler targetHandler = new TargetHandler(); + private static AntHandler mainHandler = new MainHandler(); + private static AntHandler projectHandler = new ProjectHandler(); + + /** + * helper for path -> URI and URI -> path conversions. + */ + private static FileUtils fu = FileUtils.newFileUtils(); + + /** + * Parse an unknown element from a url + * + * @param project the current project + * @param source the url containing the task + * @return a configured task + * @exception BuildException if an error occurs + */ + public UnknownElement parseUnknownElement(Project project, URL source) + throws BuildException { + Target dummyTarget = new Target(); + dummyTarget.setProject(project); + + AntXMLContext context = new AntXMLContext(project); + context.addTarget(dummyTarget); + context.setImplicitTarget(dummyTarget); + + parse(context.getProject(), source, + new RootHandler(context, elementHandler)); + Task[] tasks = dummyTarget.getTasks(); + if (tasks.length != 1) { + throw new BuildException("No tasks defined"); + } + return (UnknownElement) tasks[0]; + } + /** + * Parse a source xml input. + * + * @param project the current project + * @param source the xml source + * @exception BuildException if an error occurs + */ + public void parse(Project project, Object source) + throws BuildException { + getImportStack().addElement(source); + //System.out.println("Adding " + source); + AntXMLContext context = null; + context = (AntXMLContext) project.getReference("ant.parsing.context"); +// System.out.println("Parsing " + getImportStack().size() + " " + +// context+ " " + getImportStack() ); + if (context == null) { + context = new AntXMLContext(project); + project.addReference("ant.parsing.context", context); + project.addReference("ant.targets", context.getTargets()); + } + + if (getImportStack().size() > 1) { + // we are in an imported file. + context.setIgnoreProjectTag(true); + Target currentTarget = context.getCurrentTarget(); + try { + Target newCurrent = new Target(); + newCurrent.setProject(project); + newCurrent.setName(""); + context.setCurrentTarget(newCurrent); + parse(project, source, new RootHandler(context, mainHandler)); + newCurrent.execute(); + } finally { + context.setCurrentTarget(currentTarget); + } + } else { + // top level file + parse(project, source, new RootHandler(context, mainHandler)); + // Execute the top-level target + context.getImplicitTarget().execute(); + } + } + + /** + * Parses the project file, configuring the project as it goes. + * + * @param project the current project + * @param source the xml source + * @param handler the root handler to use (contains the current context) + * @exception BuildException if the configuration is invalid or cannot + * be read + */ + public void parse(Project project, Object source, RootHandler handler) + throws BuildException { + + AntXMLContext context = handler.context; + + File buildFile = null; + URL url = null; + String buildFileName = null; + + if (source instanceof File) { + buildFile = (File) source; + buildFile = fu.normalize(buildFile.getAbsolutePath()); + context.setBuildFile(buildFile); + buildFileName = buildFile.toString(); +// } else if (source instanceof InputStream ) { + } else if (source instanceof URL) { +// These commented out code is the only difference +// between this class and ProjectHelper2 +// if (handler.getCurrentAntHandler() != elementHandler) { +// throw new BuildException( +// "Source " + source.getClass().getName() +// + " not supported by this plugin for " +// + " non task xml"); +// } + url = (URL) source; + buildFileName = url.toString(); +// } else if (source instanceof InputSource ) { + } else { + throw new BuildException("Source " + source.getClass().getName() + + " not supported by this plugin"); + } + + InputStream inputStream = null; + InputSource inputSource = null; + + + try { + /** + * SAX 2 style parser used to parse the given file. + */ + XMLReader parser = JAXPUtils.getNamespaceXMLReader(); + + String uri = null; + if (buildFile != null) { + uri = fu.toURI(buildFile.getAbsolutePath()); + inputStream = new FileInputStream(buildFile); + } else { + inputStream = url.openStream(); + uri = url.toString(); // ?? OK ?? + } + + inputSource = new InputSource(inputStream); + if (uri != null) { + inputSource.setSystemId(uri); + } + project.log("parsing buildfile " + buildFileName + + " with URI = " + uri, Project.MSG_VERBOSE); + + DefaultHandler hb = handler; + + parser.setContentHandler(hb); + parser.setEntityResolver(hb); + parser.setErrorHandler(hb); + parser.setDTDHandler(hb); + parser.parse(inputSource); + } catch (SAXParseException exc) { + Location location = new Location(exc.getSystemId(), + exc.getLineNumber(), exc.getColumnNumber()); + + Throwable t = exc.getException(); + if (t instanceof BuildException) { + BuildException be = (BuildException) t; + if (be.getLocation() == Location.UNKNOWN_LOCATION) { + be.setLocation(location); + } + throw be; + } + + throw new BuildException(exc.getMessage(), t, location); + } catch (SAXException exc) { + Throwable t = exc.getException(); + if (t instanceof BuildException) { + throw (BuildException) t; + } + throw new BuildException(exc.getMessage(), t); + } catch (FileNotFoundException exc) { + throw new BuildException(exc); + } catch (UnsupportedEncodingException exc) { + throw new BuildException("Encoding of project file " + + buildFileName + " is invalid.", + exc); + } catch (IOException exc) { + throw new BuildException("Error reading project file " + + buildFileName + ": " + exc.getMessage(), + exc); + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } catch (IOException ioe) { + // ignore this + } + } + } + } + + /** + * The common superclass for all SAX event handlers used to parse + * the configuration file. + * + * The context will hold all state information. At each time + * there is one active handler for the current element. It can + * use onStartChild() to set an alternate handler for the child. + */ + public static class AntHandler { + /** + * Handles the start of an element. This base implementation does + * nothing. + * + * @param uri the namespace URI for the tag + * @param tag The name of the element being started. + * Will not be <code>null</code>. + * @param qname The qualified name of the element. + * @param attrs Attributes of the element being started. + * Will not be <code>null</code>. + * @param context The context that this element is in. + * + * @exception SAXParseException if this method is not overridden, or in + * case of error in an overridden version + */ + public void onStartElement(String uri, String tag, String qname, + Attributes attrs, + AntXMLContext context) + throws SAXParseException { + } + + /** + * Handles the start of an element. This base implementation just + * throws an exception - you must override this method if you expect + * child elements. + * + * @param uri The namespace uri for this element. + * @param tag The name of the element being started. + * Will not be <code>null</code>. + * @param qname The qualified name for this element. + * @param attrs Attributes of the element being started. + * Will not be <code>null</code>. + * @param context The current context. + * @return a handler (in the derived classes) + * + * @exception SAXParseException if this method is not overridden, or in + * case of error in an overridden version + */ + public AntHandler onStartChild(String uri, String tag, String qname, + Attributes attrs, + AntXMLContext context) + throws SAXParseException { + throw new SAXParseException("Unexpected element \"" + qname + + " \"", context.getLocator()); + } + + /** + * Handle the end of a element. + * + * @param uri the namespace uri of the element + * @param tag the tag of the element + * @param qname the qualified name of the element + * @param context the current context + * @exception SAXParseException if an error occurs + */ + public void onEndChild(String uri, String tag, String qname, + AntXMLContext context) + throws SAXParseException { + } + + /** + * This method is called when this element and all elements nested into it have been + * handled. I.e., this happens at the </end_tag_of_the_element>. + * @param uri the namespace uri for this element + * @param tag the element name + * @param context the current context + */ + public void onEndElement(String uri, String tag, + AntXMLContext context) { + } + + /** + * Handles text within an element. This base implementation just + * throws an exception, you must override it if you expect content. + * + * @param buf A character array of the text within the element. + * Will not be <code>null</code>. + * @param start The start element in the array. + * @param count The number of characters to read from the array. + * @param context The current context. + * + * @exception SAXParseException if this method is not overridden, or in + * case of error in an overridden version + */ + public void characters(char[] buf, int start, int count, AntXMLContext context) + throws SAXParseException { + String s = new String(buf, start, count).trim(); + + if (s.length() > 0) { + throw new SAXParseException("Unexpected text \"" + s + + "\"", context.getLocator()); + } + } + + /** + * Will be called every time a namespace is reached. + * It'll verify if the ns was processed, and if not load the task + * definitions. + * @param uri The namespace uri. + */ + protected void checkNamespace(String uri) { + + } + } + + /** + * Handler for ant processing. Uses a stack of AntHandlers to + * implement each element ( the original parser used a recursive behavior, + * with the implicit execution stack ) + */ + public static class RootHandler extends DefaultHandler { + private Stack antHandlers = new Stack(); + private AntHandler currentHandler = null; + private AntXMLContext context; + + /** + * Creates a new RootHandler instance. + * + * @param context The context for the handler. + * @param rootHandler The handler for the root element. + */ + public RootHandler(AntXMLContext context, AntHandler rootHandler) { + currentHandler = rootHandler; + antHandlers.push(currentHandler); + this.context = context; + } + + /** + * Returns the current ant handler object. + * @return the current ant handler. + */ + public AntHandler getCurrentAntHandler() { + return currentHandler; + } + + /** + * Resolves file: URIs relative to the build file. + * + * @param publicId The public identifier, or <code>null</code> + * if none is available. Ignored in this + * implementation. + * @param systemId The system identifier provided in the XML + * document. Will not be <code>null</code>. + * @return an inputsource for this identifier + */ + public InputSource resolveEntity(String publicId, + String systemId) { + + context.getProject().log("resolving systemId: " + + systemId, Project.MSG_VERBOSE); + + if (systemId.startsWith("file:")) { + String path = fu.fromURI(systemId); + + File file = new File(path); + if (!file.isAbsolute()) { + file = fu.resolveFile(context.getBuildFileParent(), path); + } + try { + InputSource inputSource = + new InputSource(new FileInputStream(file)); + inputSource.setSystemId(fu.toURI(file.getAbsolutePath())); + return inputSource; + } catch (FileNotFoundException fne) { + context.getProject().log(file.getAbsolutePath() + + " could not be found", Project.MSG_WARN); + } + + } + // use default if not file or file not found + return null; + } + + /** + * Handles the start of a project element. A project handler is created + * and initialised with the element name and attributes. + * + * @param uri The namespace uri for this element. + * @param tag The name of the element being started. + * Will not be <code>null</code>. + * @param qname The qualified name for this element. + * @param attrs Attributes of the element being started. + * Will not be <code>null</code>. + * + * @exception org.xml.sax.SAXParseException if the tag given is not + * <code>"project"</code> + */ + public void startElement(String uri, String tag, String qname, Attributes attrs) + throws SAXParseException { + AntHandler next + = currentHandler.onStartChild(uri, tag, qname, attrs, context); + antHandlers.push(currentHandler); + currentHandler = next; + currentHandler.onStartElement(uri, tag, qname, attrs, context); + } + + /** + * Sets the locator in the project helper for future reference. + * + * @param locator The locator used by the parser. + * Will not be <code>null</code>. + */ + public void setDocumentLocator(Locator locator) { + context.setLocator(locator); + } + + /** + * Handles the end of an element. Any required clean-up is performed + * by the onEndElement() method and then the original handler + * is restored to the parser. + * + * @param uri The namespace URI for this element. + * @param name The name of the element which is ending. + * Will not be <code>null</code>. + * @param qName The qualified name for this element. + * + * @exception SAXException in case of error (not thrown in + * this implementation) + * + */ + public void endElement(String uri, String name, String qName) throws SAXException { + currentHandler.onEndElement(uri, name, context); + AntHandler prev = (AntHandler) antHandlers.pop(); + currentHandler = prev; + if (currentHandler != null) { + currentHandler.onEndChild(uri, name, qName, context); + } + } + + /** + * Handle text within an element, calls currentHandler.characters. + * + * @param buf A character array of the test. + * @param start The start offset in the array. + * @param count The number of characters to read. + * @exception SAXParseException if an error occurs + */ + public void characters(char[] buf, int start, int count) + throws SAXParseException { + currentHandler.characters(buf, start, count, context); + } + + /** + * Start a namespace prefix to uri mapping + * + * @param prefix the namespace prefix + * @param uri the namespace uri + */ + public void startPrefixMapping(String prefix, String uri) { + context.startPrefixMapping(prefix, uri); + } + + /** + * End a namepace prefix to uri mapping + * + * @param prefix the prefix that is not mapped anymore + */ + public void endPrefixMapping(String prefix) { + context.endPrefixMapping(prefix); + } + } + + /** + * The main handler - it handles the <project> tag. + * + * @see AntHandler + */ + public static class MainHandler extends AntHandler { + + /** + * Handle the project tag + * + * @param uri The namespace uri. + * @param name The element tag. + * @param qname The element qualified name. + * @param attrs The attributes of the element. + * @param context The current context. + * @return The project handler that handles subelements of project + * @exception SAXParseException if the qualified name is not "project". + */ + public AntHandler onStartChild(String uri, String name, String qname, + Attributes attrs, + AntXMLContext context) + throws SAXParseException { + if (name.equals("project") + && (uri.equals("") || uri.equals(ANT_CORE_URI))) { + return ProjectHelper3.projectHandler; + } else { +// if (context.importlevel > 0) { +// // we are in an imported file. Allow top-level <target>. +// if (qname.equals( "target" ) ) +// return ProjectHelper3.targetHandler; +// } + throw new SAXParseException("Unexpected element \"" + qname + + "\" " + name, context.getLocator()); + } + } + } + + /** + * Handler for the top level "project" element. + */ + public static class ProjectHandler extends AntHandler { + + /** + * Initialisation routine called after handler creation + * with the element name and attributes. The attributes which + * this handler can deal with are: <code>"default"</code>, + * <code>"name"</code>, <code>"id"</code> and <code>"basedir"</code>. + * + * @param uri The namespace URI for this element. + * @param tag Name of the element which caused this handler + * to be created. Should not be <code>null</code>. + * Ignored in this implementation. + * @param qname The qualified name for this element. + * @param attrs Attributes of the element which caused this + * handler to be created. Must not be <code>null</code>. + * @param context The current context. + * + * @exception SAXParseException if an unexpected attribute is + * encountered or if the <code>"default"</code> attribute + * is missing. + */ + public void onStartElement(String uri, String tag, String qname, + Attributes attrs, + AntXMLContext context) + throws SAXParseException { + String id = null; + String baseDir = null; + boolean nameAttributeSet = false; + + Project project = context.getProject(); + + /** XXX I really don't like this - the XML processor is still + * too 'involved' in the processing. A better solution (IMO) + * would be to create UE for Project and Target too, and + * then process the tree and have Project/Target deal with + * its attributes ( similar with Description ). + * + * If we eventually switch to ( or add support for ) DOM, + * things will work smoothly - UE can be avoided almost completely + * ( it could still be created on demand, for backward compatibility ) + */ + + for (int i = 0; i < attrs.getLength(); i++) { + String attrUri = attrs.getURI(i); + if (attrUri != null + && !attrUri.equals("") + && !attrUri.equals(uri)) { + continue; // Ignore attributes from unknown uris + } + String key = attrs.getLocalName(i); + String value = attrs.getValue(i); + + if (key.equals("default")) { + if (value != null && !value.equals("")) { + if (!context.isIgnoringProjectTag()) { + project.setDefault(value); + } + } + } else if (key.equals("name")) { + if (value != null) { + context.setCurrentProjectName(value); + nameAttributeSet = true; + if (!context.isIgnoringProjectTag()) { + project.setName(value); + project.addReference(value, project); + } + } + } else if (key.equals("id")) { + if (value != null) { + // What's the difference between id and name ? + if (!context.isIgnoringProjectTag()) { + project.addReference(value, project); + } + } + } else if (key.equals("basedir")) { + if (!context.isIgnoringProjectTag()) { + baseDir = value; + } + } else { + // XXX ignore attributes in a different NS ( maybe store them ? ) + throw new SAXParseException("Unexpected attribute \"" + + attrs.getQName(i) + "\"", context.getLocator()); + } + } + + // XXX Move to Project ( so it is shared by all helpers ) + String antFileProp = "ant.file." + context.getCurrentProjectName(); + String dup = project.getProperty(antFileProp); + if (dup != null && nameAttributeSet) { + File dupFile = new File(dup); + if (context.isIgnoringProjectTag() + && !dupFile.equals(context.getBuildFile())) { + project.log("Duplicated project name in import. Project " + + context.getCurrentProjectName() + " defined first in " + + dup + " and again in " + context.getBuildFile(), + Project.MSG_WARN); + } + } + + if (context.getBuildFile() != null) { + project.setUserProperty("ant.file." + + context.getCurrentProjectName(), + context.getBuildFile().toString()); + } + + if (context.isIgnoringProjectTag()) { + // no further processing + return; + } + // set explicitly before starting ? + if (project.getProperty("basedir") != null) { + project.setBasedir(project.getProperty("basedir")); + } else { + // Default for baseDir is the location of the build file. + if (baseDir == null) { + project.setBasedir(context.getBuildFileParent().getAbsolutePath()); + } else { + // check whether the user has specified an absolute path + if ((new File(baseDir)).isAbsolute()) { + project.setBasedir(baseDir); + } else { + project.setBaseDir(fu.resolveFile( + context.getBuildFileParent(), baseDir)); + } + } + } + + project.addTarget("", context.getImplicitTarget()); + context.setCurrentTarget(context.getImplicitTarget()); + } + + /** + * Handles the start of a top-level element within the project. An + * appropriate handler is created and initialised with the details + * of the element. + * + * @param uri The namespace URI for this element. + * @param name The name of the element being started. + * Will not be <code>null</code>. + * @param qname The qualified name for this element. + * @param attrs Attributes of the element being started. + * Will not be <code>null</code>. + * @param context The context for this element. + * @return a target or an element handler. + * + * @exception org.xml.sax.SAXParseException if the tag given is not + * <code>"taskdef"</code>, <code>"typedef"</code>, + * <code>"property"</code>, <code>"target"</code> + * or a data type definition + */ + public AntHandler onStartChild(String uri, String name, String qname, + Attributes attrs, + AntXMLContext context) + throws SAXParseException { + if (name.equals("target") + && (uri.equals("") || uri.equals(ANT_CORE_URI))) { + return ProjectHelper3.targetHandler; + } else { + return ProjectHelper3.elementHandler; + } + } + + } + + /** + * Handler for "target" elements. + */ + public static class TargetHandler extends AntHandler { + + /** + * Initialisation routine called after handler creation + * with the element name and attributes. The attributes which + * this handler can deal with are: <code>"name"</code>, + * <code>"depends"</code>, <code>"if"</code>, + * <code>"unless"</code>, <code>"id"</code> and + * <code>"description"</code>. + * + * @param uri The namespace URI for this element. + * @param tag Name of the element which caused this handler + * to be created. Should not be <code>null</code>. + * Ignored in this implementation. + * @param qname The qualified name for this element. + * @param attrs Attributes of the element which caused this + * handler to be created. Must not be <code>null</code>. + * @param context The current context. + * + * @exception SAXParseException if an unexpected attribute is encountered + * or if the <code>"name"</code> attribute is missing. + */ + public void onStartElement(String uri, String tag, String qname, + Attributes attrs, + AntXMLContext context) + throws SAXParseException { + String name = null; + String depends = ""; + + Project project = context.getProject(); + Target target = new Target(); + target.setProject(project); + context.addTarget(target); + + for (int i = 0; i < attrs.getLength(); i++) { + String attrUri = attrs.getURI(i); + if (attrUri != null + && !attrUri.equals("") + && !attrUri.equals(uri)) { + continue; // Ignore attributes from unknown uris + } + String key = attrs.getLocalName(i); + String value = attrs.getValue(i); + + if (key.equals("name")) { + name = value; + if ("".equals(name)) { + throw new BuildException("name attribute must " + + "not be empty"); + } + } else if (key.equals("depends")) { + depends = value; + } else if (key.equals("if")) { + target.setIf(value); + } else if (key.equals("unless")) { + target.setUnless(value); + } else if (key.equals("id")) { + if (value != null && !value.equals("")) { + context.getProject().addReference(value, target); + } + } else if (key.equals("description")) { + target.setDescription(value); + } else { + throw new SAXParseException("Unexpected attribute \"" + + key + "\"", context.getLocator()); + } + } + + if (name == null) { + throw new SAXParseException("target element appears without " + + "a name attribute", context.getLocator()); + } + + Hashtable currentTargets = project.getTargets(); + + // If the name has already been defined ( import for example ) + if (currentTargets.containsKey(name)) { + if (!context.isIgnoringProjectTag()) { + // not in a import'ed file + throw new BuildException( + "Duplicate target '" + name + "'", + new Location(context.getLocator().getSystemId(), + context.getLocator().getLineNumber(), + context.getLocator().getColumnNumber())); + } + // Alter the name. + if (context.getCurrentProjectName() != null) { + String newName = context.getCurrentProjectName() + + "." + name; + project.log("Already defined in main or a previous import, " + + "define " + name + " as " + newName, + Project.MSG_VERBOSE); + name = newName; + } else { + project.log("Already defined in main or a previous import, " + + "ignore " + name, Project.MSG_VERBOSE); + name = null; + } + } + + if (name != null) { + target.setName(name); + project.addOrReplaceTarget(name, target); + } + + // take care of dependencies + if (depends.length() > 0) { + target.setDepends(depends); + } + } + + /** + * Handles the start of an element within a target. + * + * @param uri The namespace URI for this element. + * @param name The name of the element being started. + * Will not be <code>null</code>. + * @param qname The qualified name for this element. + * @param attrs Attributes of the element being started. + * Will not be <code>null</code>. + * @param context The current context. + * @return an element handler. + * + * @exception SAXParseException if an error occurs when initialising + * the appropriate child handler + */ + public AntHandler onStartChild(String uri, String name, String qname, + Attributes attrs, + AntXMLContext context) + throws SAXParseException { + return ProjectHelper3.elementHandler; + } + + /** + * Handle the end of the project, sets the current target of the + * context to be the implicit target. + * + * @param uri The namespace URI of the element. + * @param tag The name of the element. + * @param context The current context. + */ + public void onEndElement(String uri, String tag, AntXMLContext context) { + context.setCurrentTarget(context.getImplicitTarget()); + } + } + + /** + * Handler for all project elements ( tasks, data types ) + */ + public static class ElementHandler extends AntHandler { + + /** + * Constructor. + */ + public ElementHandler() { + } + + /** + * Initialisation routine called after handler creation + * with the element name and attributes. This configures + * the element with its attributes and sets it up with + * its parent container (if any). Nested elements are then + * added later as the parser encounters them. + * + * @param uri The namespace URI for this element. + * @param tag Name of the element which caused this handler + * to be created. Must not be <code>null</code>. + * @param qname The qualified name for this element. + * @param attrs Attributes of the element which caused this + * handler to be created. Must not be <code>null</code>. + * @param context The current context. + * + * @exception SAXParseException in case of error (not thrown in + * this implementation) + */ + public void onStartElement(String uri, String tag, String qname, + Attributes attrs, + AntXMLContext context) + throws SAXParseException { + RuntimeConfigurable parentWrapper = context.currentWrapper(); + Object parent = null; + + if (parentWrapper != null) { + parent = parentWrapper.getProxy(); + } + + /* UnknownElement is used for tasks and data types - with + delayed eval */ + UnknownElement task = new UnknownElement(tag); + task.setProject(context.getProject()); + task.setNamespace(uri); + task.setQName(qname); + task.setTaskType( + ProjectHelper.genComponentName(task.getNamespace(), tag)); + task.setTaskName(qname); + + Location location = new Location(context.getLocator().getSystemId(), + context.getLocator().getLineNumber(), + context.getLocator().getColumnNumber()); + task.setLocation(location); + task.setOwningTarget(context.getCurrentTarget()); + + context.configureId(task, attrs); + + if (parent != null) { + // Nested element + ((UnknownElement) parent).addChild(task); + } else { + // Task included in a target ( including the default one ). + context.getCurrentTarget().addTask(task); + } + + // container.addTask(task); + // This is a nop in UE: task.init(); + + RuntimeConfigurable wrapper + = new RuntimeConfigurable(task, task.getTaskName()); + + for (int i = 0; i < attrs.getLength(); i++) { + String name = attrs.getLocalName(i); + String attrUri = attrs.getURI(i); + if (attrUri != null + && !attrUri.equals("") + && !attrUri.equals(uri)) { + name = attrUri + ":" + attrs.getQName(i); + } + String value = attrs.getValue(i); + // PR: Hack for ant-type value + // an ant-type is a component name which can + // be namespaced, need to extract the name + // and convert from qualified name to uri/name + if (ANT_TYPE.equals(name) + || (ANT_CORE_URI.equals(attrUri) + && ANT_TYPE.equals(attrs.getLocalName(i)))) { + name = ANT_TYPE; + int index = value.indexOf(":"); + if (index != -1) { + String prefix = value.substring(0, index); + String mappedUri = context.getPrefixMapping(prefix); + if (mappedUri == null) { + throw new BuildException( + "Unable to find XML NS prefix " + prefix); + } + value = ProjectHelper.genComponentName( + mappedUri, value.substring(index + 1)); + } + } + wrapper.setAttribute(name, value); + } + + if (parentWrapper != null) { + parentWrapper.addChild(wrapper); + } + + context.pushWrapper(wrapper); + } + + /** + * Adds text to the task, using the wrapper + * + * @param buf A character array of the text within the element. + * Will not be <code>null</code>. + * @param start The start element in the array. + * @param count The number of characters to read from the array. + * @param context The current context. + * + * @exception SAXParseException if the element doesn't support text + * + * @see ProjectHelper#addText(Project,java.lang.Object,char[],int,int) + */ + public void characters(char[] buf, int start, int count, + AntXMLContext context) + throws SAXParseException { + RuntimeConfigurable wrapper = context.currentWrapper(); + wrapper.addText(buf, start, count); + } + + /** + * Handles the start of an element within a target. Task containers + * will always use another task handler, and all other tasks + * will always use a nested element handler. + * + * @param uri The namespace URI for this element. + * @param tag The name of the element being started. + * Will not be <code>null</code>. + * @param qname The qualified name for this element. + * @param attrs Attributes of the element being started. + * Will not be <code>null</code>. + * @param context The current context. + * @return The handler for elements. + * + * @exception SAXParseException if an error occurs when initialising + * the appropriate child handler + */ + public AntHandler onStartChild(String uri, String tag, String qname, + Attributes attrs, + AntXMLContext context) + throws SAXParseException { + return ProjectHelper3.elementHandler; + } + + /** + * Handles the end of the element. This pops the wrapper from + * the context. + * + * @param uri The namespace URI for the element. + * @param tag The name of the element. + * @param context The current context. + */ + public void onEndElement(String uri, String tag, AntXMLContext context) { + context.popWrapper(); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/ProjectHelper3.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/RegexpMatcherFactory.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/RegexpMatcherFactory.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/RegexpMatcherFactory.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,43 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.antmod; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.util.regexp.RegexpMatcher; + + +/** + * This class exists because the default Regexp handler is not part of ant.jar + * @author Paul Hinds + * @version $Id: RegexpMatcherFactory.java,v 1.2 2006/12/21 00:03:05 teknopaul Exp $ + */ +public class RegexpMatcherFactory { + + /** + * + */ + public RegexpMatcherFactory() { + super(); + } + public RegexpMatcher newRegexpMatcher() throws BuildException { + try{ + return new org.apache.tools.ant.util.regexp.RegexpMatcherFactory().newRegexpMatcher(null); + } + catch(BuildException be){ + return new Jdk14RegexpMatcher(); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/RegexpMatcherFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/RuntimeLauncher.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/RuntimeLauncher.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/RuntimeLauncher.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,144 @@ +/* + * Copyright 2003-2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.tp23.antinstaller.antmod; + +import java.io.File; +import java.net.URL; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import org.apache.tools.ant.Project; +import org.apache.tools.ant.ProjectHelper; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.antmod.taskdefs.LogTask; +import org.tp23.antinstaller.antmod.taskdefs.MessageTask; +import org.tp23.antinstaller.antmod.taskdefs.PropertyTask; +import org.tp23.antinstaller.runtime.ExecInstall; +import org.tp23.antinstaller.selfextract.NonExtractor; +import org.tp23.antinstaller.selfextract.SelfExtractor; + + + +/** + * This is a launcher for Ant which swallows all messages and logs. + * + * This file has been modified by Paul Hinds for Antinstaller and is not the same + * as the one delivered with Ant 1.6 + * + * @since Ant 1.6 + * @version $Id$ + */ +public class RuntimeLauncher { + + public final static String CONTEXT_REFERENCE = "antinstaller.internal.context"; + + private final Map allProperties = new HashMap(); + private final Project project = new Project(); + private InstallerContext ctx; + + public RuntimeLauncher(InstallerContext ctx) { + this.ctx = ctx; + } + + public void updateProps(){ + allProperties.clear(); + allProperties.putAll(InstallerContext.getEnvironment()); + allProperties.putAll(ctx.getInstaller().getResultContainer().getAllProperties()); + // add properties + String arg; + String value; + Iterator iter = allProperties.keySet().iterator(); + while (iter.hasNext()) { + arg = (String) iter.next(); + value = (String) allProperties.get(arg); + project.setUserProperty(arg, value); + } + } + + public void parseProject(){ + project.setCoreLoader(this.getClass().getClassLoader()); + //project.addBuildListener(this); + project.init(); + + ProjectHelper helper = new ProjectHelper3(); + project.addReference("ant.projectHelper", helper); + + //SelfExtractor requirements + if(SelfExtractor.CONFIG_RESOURCE == ctx.getConfigResource()){ + File buildXml = new File(ctx.getFileRoot(), ctx.getAntBuildFile()); + if(!buildXml.exists()){ + ctx.log("No build file found??: " + buildXml); + } + helper.parse(project, buildXml); + project.setUserProperty("ant.file", buildXml.getAbsolutePath()); + } + + //NonExtractor requirements + if(NonExtractor.CONFIG_RESOURCE == ctx.getConfigResource()){ + URL buildIS = this.getClass().getResource("/" + ctx.getAntBuildFile()); + helper.parse(project, buildIS); + project.setUserProperty("ant.file", buildIS.toExternalForm()); + try { + File enclosingJar = SelfExtractor.getEnclosingJar(this); + project.setUserProperty(NonExtractor.ANTINSTALLER_JAR_PROPERTY, enclosingJar.getAbsolutePath()); + } catch (RuntimeException e) { + ctx.log("No enclosing jar found"); + } + } + + //Scripted install requirements + if(ExecInstall.CONFIG_RESOURCE == ctx.getConfigResource()){ + File buildXml = new File(ctx.getFileRoot(), ctx.getAntBuildFile()); + helper.parse(project, buildXml); + if(!buildXml.exists()){ + ctx.log("No build file found??: " + buildXml); + } + project.setUserProperty("ant.file", buildXml.getAbsolutePath()); + } + + project.setBaseDir(ctx.getFileRoot()); + + // clever stuff for callbacks + project.addReference(CONTEXT_REFERENCE, ctx); + project.addTaskDefinition("antinstaller-property", PropertyTask.class); + project.addTaskDefinition("antinstaller-message", MessageTask.class); + project.addTaskDefinition("antinstaller-log", LogTask.class); + + } + /** + * Run the launcher to launch Ant with a specific target, there is no classpath + * additions set or ant.home; everything should be loaded for this to run correctly. + * + * @param args the command line arguments + */ + public int run(String target){ + try { + ctx.getLogger().log("internal target execution started:" + target); + project.fireBuildStarted(); + project.executeTarget(target); + project.fireBuildFinished(null); + ctx.getLogger().log("internal target execution successful:" + target); + return 0; + } + catch (Throwable t) { + ctx.getLogger().log("internal target execution error:" + target); + ctx.getLogger().log(ctx.getInstaller(), t); + return 1; + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/RuntimeLauncher.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/package.html =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/package.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/package.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,9 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head><!-- + Copyright (c) 2004 tp23 + All Rights Reserved. +--></head> + +<body bgcolor="white">Contains modifications of Apache Ant code.</body> +</html> Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/package.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/GetResourceTask.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/GetResourceTask.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/GetResourceTask.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,73 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.antmod.taskdefs; + +import java.io.File; +import java.io.IOException; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.tp23.antinstaller.selfextract.ResourceExtractor; +/** + * Extracts a resource from the classpath into the filesystem + * @author teknopaul + * + */ +public class GetResourceTask extends Task{ + + String resource; + String dest; + String regex; + String replace; + + public void execute() throws BuildException{ + try { + ResourceExtractor re = new ResourceExtractor(); + if(regex != null){ + re.copyResource(resource, new File(dest), regex, replace); + } + else{ + re.copyResourceBinary(resource, new File(dest)); + } + } catch (IOException e) { + throw new BuildException(e.getMessage()); + } + } + public String getDest() { + return dest; + } + public void setDest(String file) { + this.dest = file; + } + public String getResource() { + return resource; + } + public void setResource(String resource) { + this.resource = resource; + } + public String getReplace() { + return replace; + } + public void setReplace(String replace) { + this.replace = replace; + } + public String getRegex() { + return regex; + } + public void setRegex(String token) { + this.regex = token; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/GetResourceTask.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/LogTask.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/LogTask.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/LogTask.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,54 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.antmod.taskdefs; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.antmod.RuntimeLauncher; +/** + * usage: + * <antinstaller-log message="log message"/> + * @author teknopaul + * + */ +public class LogTask extends Task { + + private String message; + /** + * Ant Tasks must have a noargs constructor + */ + public LogTask(){ + } + + /** + * the "main" method + */ + public void execute() throws BuildException { + InstallerContext ctx = (InstallerContext)getProject().getReference(RuntimeLauncher.CONTEXT_REFERENCE); + ctx.log(message); + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/LogTask.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/MessageTask.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/MessageTask.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/MessageTask.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,54 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.antmod.taskdefs; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.antmod.RuntimeLauncher; +/** + * usage: + * <antinstaller-message message="output"/> + * @author teknopaul + * + */ +public class MessageTask extends Task { + + private String message; + /** + * Ant Tasks must have a noargs constructor + */ + public MessageTask(){ + } + + /** + * the "main" method + */ + public void execute() throws BuildException { + InstallerContext ctx = (InstallerContext)getProject().getReference(RuntimeLauncher.CONTEXT_REFERENCE); + ctx.getMessageRenderer().printMessage(message); + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/MessageTask.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/PropertyTask.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/PropertyTask.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/PropertyTask.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,114 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.antmod.taskdefs; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.antmod.RuntimeLauncher; +/** + * usage: + * <antinstaller-property name="property.name" value="myValue"/> + * <br /> + * or: + * <antinstaller-property resource="/resources/my.props"/> + * @author teknopaul + * + */ +public final class PropertyTask extends Task { + + private String name; + private String value; + private String resource; + /** + * Ant Tasks must have a noargs constructor + */ + public PropertyTask(){ + } + + /** + * the "main" method + */ + public void execute() throws BuildException { + if(resource != null){ + executeResource(); + } + else { + if(name == null || value == null) { + throw new BuildException("either resource or (name and value) can not be null for antinstaller-property task"); + } + executePropVal(); + } + } + + private void executePropVal(){ + InstallerContext ctx = (InstallerContext)getProject().getReference(RuntimeLauncher.CONTEXT_REFERENCE); + ctx.log("setting property: name=" + name + ", value=" + value); + ctx.getInstaller().getResultContainer().setProperty(name, value); + } + + // FindBugs - this class should stay final since getResourceAsStream() may not work in subclasses + private void executeResource() throws BuildException{ + InstallerContext ctx = (InstallerContext)getProject().getReference(RuntimeLauncher.CONTEXT_REFERENCE); + InputStream is = this.getClass().getResourceAsStream(resource); + if(is == null){ + ctx.log("Can not find resource: " + resource); + throw new BuildException("Can not find resource: " + resource); + } + try { + Properties props = new Properties(); + props.load(is); + is.close(); + if(ctx.getInstaller().isVerbose()){ + ctx.log("loaded properties: " + props.size()); + } + + ctx.getInstaller().getResultContainer().getAllProperties().putAll(props); + } catch (IOException e) { + ctx.log("Can not load resource: " + resource); + throw new BuildException("Can not load resource: " + resource); + } + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getResource() { + return resource; + } + + public void setResource(String resource) { + this.resource = resource; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/antmod/taskdefs/PropertyTask.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/AppRootInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/AppRootInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/AppRootInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,162 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + +import java.io.File; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.renderer.MessageRenderer; + +/** + * + * <p>Input type to select a directory and validate it by checking the existence of + * files relative to the directory selected. An Expected use for this is to find the + * Application root of an exiting app on the clients machine. for example to find + * Tomcat, ask the user to select the tomcat root and check the existence of ./conf/tomcat-users.xml + * and ./webapps </p> + * @author Paul Hinds + * @version $Id: AppRootInput.java,v 1.2 2005/10/23 14:39:20 teknopaul Exp $ + */ +public class AppRootInput + extends DirectoryInput { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + + private String checkFile1; + private String checkFile2; + private String checkDir1; + private String checkDir2; + + public AppRootInput() { + } + + /** + * Called to validate the user input + */ + public boolean validate(InstallerContext cxt) throws ValidationException{ + if (getInputResult() == null)return false; + MessageRenderer mr = cxt.getMessageRenderer(); + String directorySelected = getInputResult(); + File file = new File(directorySelected); + // removed in response to BUG:1303230 +// if(!file.exists()){ +// if(mr.prompt(res.getString("dirNotExistCreate"))){ +// boolean ok = file.mkdirs(); +// if(!ok)mr.printMessage(res.getString("dirNotCreated")); +// } +// } + if(!file.isDirectory()){ + mr.printMessage(res.getString("dirNotExist")+":"+file.getAbsolutePath()); + return false; + } + else if(checkFile1!=null && ! checkExists(mr,file,checkFile1)){ + return false ; + } + else if(checkFile2!=null && ! checkExists(mr,file,checkFile2)){ + return false ; + } + else if(checkDir1!=null && ! checkExists(mr,file,checkDir1)){ + return false ; + } + else if(checkDir2!=null && ! checkExists(mr,file,checkDir2)){ + return false ; + } + return true; + } + + private boolean checkExists(MessageRenderer mr,File root,String check){ + File checkFile = new File(root,checkFile1); + if(!checkFile.exists()){ + reportMissing(mr,checkFile); + return false; + } + return true; + } + + private void reportMissing(MessageRenderer mr,File missing){ + StringBuffer message = new StringBuffer(); + message.append(res.getString("appRootInvalid")); + message.append(System.getProperty("line.separator")); + if(missing.isDirectory()){ + message.append(res.getString("dirNotExist")); + } + else{ + message.append(res.getString("fileNotExist")); + } + message.append(":"); + message.append(missing.getAbsolutePath()); + mr.printMessage(message.toString()); + } + + + + public String getCheckDir1() { + return checkDir1; + } + + public String getCheckDir2() { + return checkDir2; + } + + public String getCheckFile1() { + return checkFile1; + } + + public String getCheckFile2() { + return checkFile2; + } + + public void setCheckFile2(String checkFile2) { + this.checkFile2 = checkFile2; + } + + public void setCheckFile1(String checkFile1) { + this.checkFile1 = checkFile1; + } + + public void setCheckDir2(String checkDir2) { + this.checkDir2 = checkDir2; + } + + public void setCheckDir1(String checkDir1) { + this.checkDir1 = checkDir1; + } + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText()==null){ + System.out.println("AppRoot:displayText must be set"); + return false; + } + if(getProperty()==null){ + System.out.println("AppRoot:property must be set"); + return false; + } + if(getDefaultValue()==null){ + System.out.println("AppRoot:defaultValue must be set"); + return false; + } + return true; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/AppRootInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/CheckboxInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/CheckboxInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/CheckboxInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,86 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + + + +/** + * + * <p>Input type for boolean choices represented as a checkbox in swing and a yes/no option + * on the command line </p> + * @author Paul Hinds + * @version $Id: CheckboxInput.java,v 1.3 2006/12/07 02:42:22 teknopaul Exp $ + */ +public class CheckboxInput + extends InputField{ + + + private String force; + + public CheckboxInput() { + } + + public String getForce() { + return force; + } + + public void setForce(String force) { + this.force = force; + } + + public void setValue(String trueOrFalse){ + setInputResult(trueOrFalse); + } + /** + * Called to validate the user input + * @TODO should validate against non internationalized true or false flags + */ + public boolean validate(InstallerContext cxt) throws ValidationException{ + return true; + } + + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getProperty()==null){ + System.out.println("Checkbox:property must be set"); + return false; + } + if(getDisplayText()==null){ + System.out.println("Checkbox:displayText must be set"); + return false; + } + if(!InputField.requiredBoolean(getDefaultValue())){ + System.out.println("Checkbox:defaultValue must be true or false"); + return false; + } + if(!InputField.optionalBoolean(getForce())){ + System.out.println("Checkbox:defaultValue must be true or false or null"); + return false; + } + return true; + } + + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/CheckboxInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/CommentOutput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/CommentOutput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/CommentOutput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,97 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + + + +/** + * + * <p>This "Input type" is strictly for Output! Unlike all the other + * concrete classes in this package CommentOutputs refer to text + * that will be printed but nothing will be collected from + * the user.</p> + * The text outputted in Comments will have property values resolved + * if they are in the format ${property.name} + * @author Paul Hinds + * @version $Id: CommentOutput.java,v 1.2 2006/03/24 18:25:58 teknopaul Exp $ + */ +public class CommentOutput + extends OutputField { + + private String bold; + private String title; + + public CommentOutput() { + } + + public String getBold() { + return bold; + } + + public void setBold(String bold) { + this.bold = bold; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getDisplayText() { + return resultContainer.getDefaultValue(super.getDisplayText()) ; + } + + public String getExplanatoryText() { + return resultContainer.getDefaultValue(super.getExplanatoryText()); + } + + /** + * Called to validate the user input + */ + public boolean validate(InstallerContext cxt) throws ValidationException{ + return true; + } + + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { +// null accepted now if only using explanatory text +// if(getDisplayText() == null){ +// System.out.println("Comment:displayText must be set"); +// return false; +// } + if(!InputField.optionalBoolean(getBold())){ + System.out.println("Comment:bold must be true or false or null:" + getBold()); + return false; + } + if(!InputField.optionalBoolean(getTitle())){ + System.out.println("Comment:title must be true or false or null:" + getTitle()); + return false; + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/CommentOutput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ConditionalField.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ConditionalField.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ConditionalField.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,119 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.input; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.runtime.ConfigurationException; +import org.tp23.antinstaller.runtime.logic.Expression; +import org.tp23.antinstaller.runtime.logic.ExpressionBuilder; + +/** + * Container for other <code>OutputField</code> members that will be + * conditionally updated. Typical use is with <code><hidden></code> + * to conditionally set property values. + * + * @author mwilson + * @version $Id + * @since 0.7.4 patch 7 + */ +public class ConditionalField extends InputField { + + private String ifProperty; + private Expression expression; + private InputField[] fields; + + public void setIfProperty(final String expressionStr) { + this.ifProperty = expressionStr; + } + + public String getIfProperty() { + return ifProperty; + } + + public InputField[] getFields() { + return fields; + } + + public void setFields(InputField[] fields) { + this.fields = fields; + } + + /** + * Runtime validation of user input + * + * @param context Installer context + * @return <code>true</code> if user input is valid, otherwise <code>false</code> + * @throws ValidationException + */ + public boolean validate(InstallerContext context) + throws ValidationException { + try { + getExpression(); + if ((fields != null) && (fields.length > 0)) { + int i = 0; + for (; (i < fields.length) && (fields[i].validate(context)); i++) { + } + + if (i == fields.length) { + return true; + } + } + } catch (ConfigurationException configExc) { + if(context.getInstaller().isVerbose()) { + context.log(configExc); + } + } + return false; + } + + /** + * Build-time validation of installer configuration file + * + * @return <code>true</code> if configuration is ok, otherwise <code>false</code> + */ + public boolean validateObject() { + try { + getExpression(); + if ((fields != null) && (fields.length > 0)) { + int i = 0; + for (; (i < fields.length) && (fields[i].validateObject()); i++) { + } + + if (i == fields.length) { + return true; + } + + System.out.println("Invalid field:" + fields[i]); + } + } catch (ConfigurationException configExc) { + System.out.println("Invalid conditional expression: " + configExc); + } + return false; + } + + /** + * Get the conditional expression in preparation for evaluation + * + * @throws ConfigurationException if the expression is invalid + */ + public Expression getExpression() throws ConfigurationException { + if (expression == null) { + expression = ExpressionBuilder.parseLogicalExpressions(resultContainer, ifProperty); + } + + return expression; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ConditionalField.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ConfirmPasswordTextInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ConfirmPasswordTextInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ConfirmPasswordTextInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,70 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + +/** + * a second password filed that checks to see if a password entered twice matches + * @author Paul Hinds + * @version $Id$ + */ +public class ConfirmPasswordTextInput + extends PasswordTextInput +{ + private String origField; + + /** + * Called to validate the user input, if the confirm flag is set + * and there is a password field on the same page with the same property name + * both passwords must match for validation to pass + */ + public boolean validate(InstallerContext ctx) throws ValidationException{ + OutputField[] otherFields = ctx.getCurrentPage().getOutputField(); + for (int i = 0; i < otherFields.length; i++) { + if(otherFields[i] instanceof PasswordTextInput && + otherFields[i] != this){ + PasswordTextInput pwd = (PasswordTextInput)otherFields[i]; + if(pwd.getProperty().equals(getOrigField())){ + return this.getInputResult().equals(pwd.getInputResult()); + } + } + } + throw new ValidationException("Confirm password requires a PasswordTextInput, on the same page, with property " + getOrigField()); + } + + public boolean validateObject() { + if ( ! super.validateObject()){ + return false; + } + if(getOrigField() == null){ + System.out.println("ConfirmPassword:origField must be set"); + return false; + } + // @TODO check the orig field exists + return true; + } + + public String getOrigField() { + return origField; + } + + public void setOrigField(String origField) { + this.origField = origField; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ConfirmPasswordTextInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/DateInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/DateInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/DateInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,107 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + + +/** + * + * <p>Free text input type with validation a SimpleDataFormat instance. </p> + * <p>By default the date format is <code>dd/MM/yyyy</code> unless it + * is overriden in teh antinstall-config.xml file. </p> + * @author Paul Hinds + * @version $Id: DateInput.java,v 1.1.1.1 2005/10/18 18:20:54 teknopaul Exp $ + */ +public class DateInput + extends InputField{ + + private String dateFormat = "dd/MM/yyyy"; + private DateFormat formatter = new SimpleDateFormat(dateFormat); + + public DateInput() { + formatter.setLenient(false); + } + + public String getDateFormat() { + return dateFormat; + } + public void setDateFormat(String dateFormat) { + try { + formatter = new SimpleDateFormat(dateFormat); + formatter.setLenient(false); + this.dateFormat = dateFormat; + } + catch (RuntimeException e) { + throw new InputException("Invalid date format in DateInput"); + } + } + + public void setValue(String dir){ + setInputResult(dir); + } + + /** + * Called to validate the user input + */ + public boolean validate(InstallerContext cxt) throws ValidationException{ + if (getInputResult() == null)return false; + String toTest = getInputResult(); + try { + formatter.parse(toTest); + } + catch (ParseException ex) { + return false; + } + return true; + } + + public void setDefaultValue(String defaultValue) { + if(defaultValue.equals("TODAY")){ + this.defaultValue = formatter.format(new Date()); + } else { + this.defaultValue = defaultValue; + } + } + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText()==null){ + System.out.println("Date:displayText must be set"); + return false; + } + if(getProperty()==null){ + System.out.println("Date:property must be set"); + return false; + } + if(getDefaultValue()==null){ + System.out.println("Date:defaultValue must be set"); + return false; + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/DateInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/DirectoryInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/DirectoryInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/DirectoryInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,156 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + +import java.io.File; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.renderer.MessageRenderer; + +/** + * <p>Input type to select a directory </p> + * <p> </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: DirectoryInput.java,v 1.5 2007/01/28 10:25:48 teknopaul Exp $ + */ +public class DirectoryInput + extends OSSpecific { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + + private boolean abort = false; + private String create; + private String checkExists; + + public DirectoryInput() { + } + + /** + * Called to validate the user input + */ + public boolean validate(InstallerContext cxt) throws ValidationException{ + if (getInputResult() == null)return false; + MessageRenderer mr = cxt.getMessageRenderer(); + String selectedName = getInputResult(); + // handle no directory option + if( "".equals(selectedName) ){ + if( InputField.isTrue(create) || InputField.isTrue(checkExists) ){ + mr.printMessage(res.getString("dirNotExist")); + return false; + } + else { + return true; + } + } + File file = new File(selectedName); + if(InputField.isTrue(create)){ + if(!file.exists()){ + try { + if(mr.prompt(res.getString("dirNotExistCreate") + "\n" + file.getAbsolutePath())){ + boolean ok = file.mkdirs(); + if(!ok){ + mr.printMessage(res.getString("dirNotCreated")); + } + } + } + catch (Exception ex) { + mr.printMessage(res.getString("canNotCreateFile") + "\n" + file.getAbsolutePath()); + //FIXME should not throw here, should do something better so users on linux can chmod where necessary + // then try again + throw new ValidationException(res.getString("canNotCreateFile"),ex); + + } + } + } + if(InputField.isTrue(checkExists)){ +// if( ( !file.exists() || !file.isDirectory() ) && triedToCreate){ +// //TODO add some usefull text here to explain that we can not continue +// } + if(!file.exists() || !file.isDirectory()){ + mr.printMessage(res.getString("dirNotExist") + "\n" + file.getAbsolutePath()); + return false; + } + } + return true; + } + + public boolean isAbort() { + return abort; + } + + public void setAbort(boolean abort) { + this.abort = abort; + } + + public String getCreate() { + return create; + } + public void setCreate(String create) { + this.create = create; + } + public void setValue(String dir){ + setInputResult(dir); + } + + public String getCheckExists() { + return checkExists; + } + + public void setCheckExists(String checkExists) { + this.checkExists = checkExists; + } + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText() == null){ + System.out.println("Directory:displayText must be set"); + return false; + } + if(getProperty() == null){ + System.out.println("Directory:property must be set"); + return false; + } + if(getDefaultValue() == null){ + System.out.println("Directory:defaultValue must be set"); + return false; + } + if(getDefaultValue().equals("")){ + if( isTrue(getCreate()) || isTrue(getCheckExists()) ) { + System.out.println("Directory:defaultValue must be set if checkExists or create are true"); + return false; + } + } + if(!InputField.optionalBoolean(getCreate())){ + System.out.println("Directory:create must be true or false or null"); + return false; + } + if(!InputField.optionalBoolean(getCheckExists())){ + System.out.println("Directory:checkExists must be true or false or null"); + return false; + } + return true; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/DirectoryInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ExtValidatedTextInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ExtValidatedTextInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ExtValidatedTextInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,108 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + + +/** + * + * <p>Free text input type with validation using a custon supplied class.</p> + * This enable very coplext validation, for example, a class could be written + * to validate a port number enterd by a user that tries to open a socket + * on the port and returns false to the validate method if the socket is in use. + * @author Paul Hinds + * @version $Id: ExtValidatedTextInput.java,v 1.2 2007/01/09 22:41:41 teknopaul Exp $ + */ +public class ExtValidatedTextInput + extends ValidatedTextInput{ + + private String validationClass; + private Validator validator; + private Throwable throwable ; + + public ExtValidatedTextInput() { + } + + public void setValue(String dir){ + setInputResult(dir); + } + public String getValidationClass() { + return validationClass; + } + public void setValidationClass(String validationClass) { + this.validationClass = validationClass; + try { + validator = (Validator)Class.forName(validationClass).newInstance(); + } + catch (Exception ex) { + throw new InputException("Invalid Class in ExtValidated text input"); + } + } + + /** + * Called to validate the user input + */ + public boolean validate(InstallerContext ctx) throws ValidationException{ + String result = getInputResult(); + try{ + validator.validate(result,ctx); + throwable = null; + return true; + } + catch(Throwable t){ + throwable = t; + return false; + } + + } + /** + * @return Returns the validator. + */ + public Validator getValidator() { + return validator; + } + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText() == null){ + System.out.println("ExtValidated:displayText must be set"); + return false; + } + if(getProperty() == null){ + System.out.println("ExtValidated:property must be set"); + return false; + } + if(getValidationClass() == null){ + System.out.println("ExtValidated:validationClass must be set"); + return false; + } + return true; + } + /** + * @return Returns the throwable. + */ + public Throwable getThrowable() { + return throwable; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ExtValidatedTextInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/FileInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/FileInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/FileInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,100 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + +import java.io.File; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + + +/** + * + * <p>Input type to select a directory </p> + * <p> </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: FileInput.java,v 1.2 2007/01/28 10:25:48 teknopaul Exp $ + */ +public class FileInput + extends OSSpecific{ + + private boolean abort = false; + private String checkExists; + + public FileInput() { + } + + /** + * Called to validate the user input + */ + public boolean validate(InstallerContext ctx) throws ValidationException{ + if (getInputResult() == null) { // this does not happen + return false; + } + if(InputField.isTrue(checkExists)){ + File file = new File(getInputResult()); + if(!file.exists()){ + return false; + } + } + return true; + } + + public boolean isAbort() { + return abort; + } + + public void setAbort(boolean abort) { + this.abort = abort; + } + + public String getCheckExists() { + return checkExists; + } + public void setCheckExists(String checkExists) { + this.checkExists = checkExists; + } + public void setValue(String dir){ + setInputResult(dir); + } + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText()==null){ + System.out.println("File:displayText must be set"); + return false; + } + if(getProperty()==null){ + System.out.println("File:property must be set"); + return false; + } + if(getDefaultValue()==null){ + System.out.println("File:defaultValue must be set"); + return false; + } + if(!InputField.optionalBoolean(getCheckExists())){ + System.out.println("File:checkExists must be true or false or null"); + return false; + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/FileInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/HiddenPropertyInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/HiddenPropertyInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/HiddenPropertyInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,67 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + +/** + * @author mwilson + * @version $Id + * @since 0.7.4 patch 6 + */ +public class HiddenPropertyInput extends InputField +{ + + public HiddenPropertyInput() + { + } + + public void setValue( String propValue ) + { + //Use default value to allow updates when page re-displayed + setDefaultValue( propValue ); + } + + /** + * Called to validate the non-existent user input + */ + public boolean validate( InstallerContext cxt ) throws ValidationException + { + return true; + } + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * + * @return boolean + */ + public boolean validateObject() + { + + final String typeName = "hidden"; + if( getProperty() == null ) + { + System.out.println( typeName + ": property must be set" ); + return false; + } + if( getDefaultValue() == null ) + { + System.out.println( typeName + ": value must be set" ); + return false; + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/HiddenPropertyInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/InputException.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/InputException.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/InputException.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,12 @@ +package org.tp23.antinstaller.input; + + +/** + * @author Paul Hinds + * @version $Id: InputException.java,v 1.1.1.1 2005/10/18 18:20:55 teknopaul Exp $ + */ +public class InputException extends RuntimeException { + public InputException(String message){ + super(message); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/InputException.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/InputField.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/InputField.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/InputField.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,107 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +/** + * + * <p>Object representation of an inputField XML Element </p> + * <p>Also used to hold data of the results of the installer questions </p> + * @author Paul Hinds + * @version $Id: InputField.java,v 1.4 2006/12/07 02:50:27 teknopaul Exp $ + */ +public abstract class InputField + extends OutputField { + + // i18n support + private static ResourceBundle langPack = null; + static{ + try { + langPack = ResourceBundle.getBundle("resources.LanguagePack"); + } catch (MissingResourceException e) { + // ignore, signifies no lang packs installed + } + } + + private String property; + protected String defaultValue; + + /** + * Flag to indicate that the user has already editted this field + */ + private boolean editted = false; + + public InputField() { + } + + public String getDisplayText() { + if(langPack != null){ + return langPack.getString(getProperty() + ".displayText"); + } + return displayText; + } + public String getExplanatoryText() { + if(langPack != null){ + try { + return langPack.getString(getProperty() + ".explanatoryText"); + } catch (MissingResourceException e) { + // ignore and return null explanatoryText is optional + } + } + return explanatoryText; + } + + /** + * Returns the input result if there is one and if this is a PropertyField + * @return String + */ + public String getInputResult() { + return resultContainer.getProperty(property); + } + + public void setInputResult(String inputResult) { + resultContainer.setProperty(property, inputResult); + } + public boolean isEditted() { + return editted; + } + public void setEditted(boolean editted) { + this.editted = editted; + } + public void setResultContainer(ResultContainer resultContainer) { + this.resultContainer = resultContainer; + } + + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + public String getDefaultValue() { + return resultContainer.getDefaultValue(defaultValue); + } + + public void setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + } + + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/InputField.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/LargeSelectInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/LargeSelectInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/LargeSelectInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,151 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + + + +/** + * + * <p>Input type to choose a single value from a (numbered) list of options </p> + * <p>This input is designed to handle larger lists of options </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: LargeSelectInput.java,v 1.3 2006/12/07 02:50:27 teknopaul Exp $ + */ +public class LargeSelectInput + extends InputField{ + + // i18n support + private static ResourceBundle langPack = null; + private int optionIdx = 0; + static{ + try { + langPack = ResourceBundle.getBundle("resources.LanguagePack"); + } catch (MissingResourceException e) { + // ignore, signifies no lang packs installed + } + } + + private LargeSelectInput.Option[] options; + + public LargeSelectInput() { + } + + + public LargeSelectInput.Option[] getOptions() { + return options; + } + + public void setOptions(LargeSelectInput.Option[] options) { + this.options = options; + } + public Option getNewOption(){ + return new Option(); + } + + public class Option { + + private int idx = ++optionIdx; + private String text; + public String value; + public void setText(String text) { + this.text = text; + } + public String getText() { + if(langPack != null){ + return langPack.getString(getProperty() + "." + idx +".displayText"); + } + return text; + } + } + + public void setValue(String dir){ + setInputResult(dir); + } + /** + * Called to validate the user input + */ + public boolean validate(InstallerContext cxt) throws ValidationException{ + if(getInputResult()==null)return false; + String value = getInputResult(); + boolean ok = false; + for (int i = 0; i < options.length; i++) { + ok |= options[i].value.equals(value); + } + return ok; + } + + + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText()==null){ + System.out.println("LargeSelect:displayText must be set"); + return false; + } + if(getProperty()==null){ + System.out.println("LargeSelect:property must be set"); + return false; + } + if(getDefaultValue()==null){ + System.out.println("LargeSelect:defaultValue must be set"); + return false; + } + if(getOptions()==null){ + System.out.println("LargeSelect:option must have at least two options"); + return false; + } + if(getOptions().length<2){ + System.out.println("LargeSelect:option must have at least two options"); + return false; + } + for (int i = 0; i < getOptions().length; i++) { + Option o = getOptions()[i]; + if(o.getText()==null){ + System.out.println("LargeSelect:option:text must be set"); + return false; + } + if(o.value==null){ + System.out.println("LargeSelect:option:value must be set"); + return false; + } + } + boolean defaultExists = false; + for (int i = 0; i < getOptions().length; i++) { + Option o = getOptions()[i]; + if(o.value.equals(getDefaultValue())){ + defaultExists=true; + } + } + if(!defaultExists){ + System.out.println("LargeSelect:option:Default must be one of the options"); + return false; + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/LargeSelectInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OSSpecific.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OSSpecific.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OSSpecific.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,49 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + +import org.tp23.antinstaller.InstallerContext; +/** + * Operating System Specific input fields have different default values for Unix and Windoze + * TODO something more with defaults for optionally supporting more OSs + */ +public abstract class OSSpecific extends InputField { + + private String defaultValueWin; + + public String getDefaultValue(boolean correctForOS) { + if(InstallerContext.isUnix() || defaultValueWin == null){ + if("".equals(defaultValue)){ + return ""; + } + return resultContainer.getDefaultFileRef(defaultValue); + } + else { + if("".equals(defaultValueWin)){ + return ""; + } + return resultContainer.getDefaultFileRef(defaultValueWin); + } + } + + public String getDefaultValueWin() { + return defaultValueWin; + } + + public void setDefaultValueWin(String defaultValueWin) { + this.defaultValueWin = defaultValueWin; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OSSpecific.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OutputField.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OutputField.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OutputField.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,146 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; +/** + * This is the super class of all "Input types". It is called OutputField since + * it handles the base features of "Input types" for outputing text for + * the user to read. It also encapsulates some convenience methods for + * interpreting boolean values from the command line and in configuration files. + */ +public abstract class OutputField { + + // i18n support + private static ResourceBundle langPack = null; + private static int commentIdx = 0; + static{ + try { + langPack = ResourceBundle.getBundle("resources.LanguagePack"); + } catch (MissingResourceException e) { + // ignore, signifies no lang packs installed + } + } + + /* This is redundant unless language packs are used + */ + private String name = "comment." + ++commentIdx; + + protected String displayText; + protected String explanatoryText; + protected ResultContainer resultContainer; + + public OutputField() { + + } + + /* This is redundant unless language packs are used + */ + public String getName() { + return name; + } + + /* This is redundant unless language packs are used + */ + public void setName(String name) { + this.name = name; + } + + public String getDisplayText() { + if(langPack != null){ + return langPack.getString(getName() + ".displayText"); + } + return displayText; + } + + public void setDisplayText(String displayText) { + this.displayText = displayText; + } + + public String getExplanatoryText() { + if(langPack != null){ + try { + return langPack.getString(getName() + ".explanatoryText"); + } catch (MissingResourceException e) { + // ignore and return null explanatoryText is optional + } + } + return explanatoryText; + } + + public void setExplanatoryText(String explanatoryText) { + this.explanatoryText = explanatoryText; + } + + public void setResultContainer(ResultContainer resultContainer) { + this.resultContainer = resultContainer; + } + + /** + * Validate the user input (or lack of it) + * This method should return false if the validation fails an throw an exception + * if it is not possible to validate or there is an error. + * + * @param cxt InstallerContext + * @throws ValidationException thrown in error conditions not validation failure + * @return boolean + */ + public abstract boolean validate(InstallerContext cxt) throws ValidationException; + + /** + * Used to validate the configuration, this can be run prior to distributing the + * installer to check that the config is valid. Will not be used at runtime. + * @throws ValidationException + * @return boolean + */ + public abstract boolean validateObject(); + + //////////////////////Static convenience methods + + /** true if specified and true or yes. + * N.B it is possible for X, isTrue(X) == isFalse(X); + * This occurs if the value is null. + */ + public static boolean isTrue(String value){ + if(value == null)return false; + return value.equalsIgnoreCase("true") || value.equalsIgnoreCase("yes"); + } + /** same as isTrue() but default is false if not specified */ + public static boolean isFalse(String value){ + if(value == null)return false; + return value.equalsIgnoreCase("false") || value.equalsIgnoreCase("no"); + } + /** + * Return true if the value is set to true or false, returns false if the value is null + * @param value String + * @return boolean + */ + public static boolean requiredBoolean(String value){ + return isTrue(value) || isFalse(value); + } + /** + * Return true if the value is set to true or false, returns false if the value is null + * @param value String + * @return boolean + */ + public static boolean optionalBoolean(String value){ + return value == null || isTrue(value) || isFalse(value); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/OutputField.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/PasswordTextInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/PasswordTextInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/PasswordTextInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,75 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + +/** + * + * <p>Free validated text input type that does not echo the value in the GUI.</p> + * <p>This class implements SecretPropertyField so the + * values are not printed in the properties file. It is the responsibility of the renderer + * not to show the password. Hiding is currently not supported on the console.</p> + * @author Paul Hinds + * @version $Id: PasswordTextInput.java,v 1.3 2006/12/21 00:03:09 teknopaul Exp $ + */ +public class PasswordTextInput + extends ValidatedTextInput implements SecretPropertyField +{ + + private String textMask = "false"; + + /** + * @return Returns true if text masking is requested. + */ + public String getTextMask() { + return textMask; + } + /** + * @param textMask The textMask value true or false. + */ + public void setTextMask(String textMask) { + this.textMask = textMask; + } + /** + * Used by checkConfig to validate the configuration file + * not at runtime + * @return boolean + */ + public boolean validateObject() { + if( ! InputField.optionalBoolean(getTextMask())){ + System.out.println("Comment:textMask must be true or false or null:" + getTextMask()); + return false; + } + if(getDisplayText() == null){ + System.out.println("Password:displayText must be set"); + return false; + } + if(getProperty() == null){ + System.out.println("Password:property must be set"); + return false; + } + if(getDefaultValue() == null){ + System.out.println("Password:defaultValue must be set"); + return false; + } + if(getRegex() == null){ + System.out.println("Password:regex must be set"); + return false; + } + return true; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/PasswordTextInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ResultContainer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ResultContainer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ResultContainer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,190 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + +import java.io.File; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +import org.tp23.antinstaller.InstallerContext; + + + +/** + * <p>Data Holder for results of the data collection and convenience methods for + * obtaining default values containing ${prop.name}/blah syntax </p> + * @todo Ensure in the validator (and Docs) that developers only add ${refs} for properties set on earlier pages + * @author Paul Hinds + * @version $Id: ResultContainer.java,v 1.6 2007/01/28 10:25:48 teknopaul Exp $ + */ +public class ResultContainer { + + private HashMap properties = new HashMap(); + private Properties environment = InstallerContext.getEnvironment(); + private File installRoot; + + public ResultContainer() { + } + + /** + * fetch a string for File and Directory inputs that expands ${refs} and + * also creates absolute paths from relative paths in the default value + * @param defaultString String + * @return String + */ + public String getDefaultFileRef(String defaultString){ + if(defaultString == null) { + return null; + } + + String expandedRefs = getDefaultValue(defaultString); + File ref = new File(expandedRefs); + if(!ref.isAbsolute()){ + String path = null; + try { + path = new File(installRoot, expandedRefs).getCanonicalPath(); + } + catch (IOException ex) { + // this is a bugger, but it should not happen it implies . or .. + // can not be resolved, all we can do is return the . or .. and hope + // it works later + path = new File(installRoot, expandedRefs).getAbsolutePath(); + } + return path; + } else { + String path = ref.getAbsolutePath(); + return path; + } + } + + /** + * + * Handles dereferenceing ${propName} syntax in default value fields + * @param defaultString String a plain String or a String with ${ref} references + * @return String + */ + public String getDefaultValue(String defaultString) { + if(defaultString == null) { + return null; + } + + char[] characters = defaultString.toCharArray(); + char c; + StringBuffer result = new StringBuffer(); + + StringBuffer propertyNameBuffer = new StringBuffer(); + boolean inProp = false; // state flag indicating parsing a propertyName + for (int i = 0; i < characters.length;) { + c = characters[i]; + if ( c == '$' && ( characters.length > i + 1 && characters[i + 1] == '{' ) ){ + if(inProp){ + //Nested property + int endIndex = defaultString.indexOf( '}', i + 1 ); + if( endIndex != -1 ) { + ++endIndex; + propertyNameBuffer.append( getDefaultValue( defaultString.substring( i, endIndex ) ) ); + i = endIndex; + continue; + } + else { + result.append(propertyNameBuffer.toString()); + propertyNameBuffer = new StringBuffer(); + } + } + else{ + inProp = true; + propertyNameBuffer.append(c); + ++i; + continue; + } + } + else if (c == '{') { + if (inProp) { + propertyNameBuffer.append(c); + if(characters[i - 1] != '$') { + inProp=false; + result.append(propertyNameBuffer.toString()); + propertyNameBuffer = new StringBuffer(); + } + ++i; + continue; + } + } + else if (c == '}') { + if (inProp) { + appendProperty(propertyNameBuffer, result); + propertyNameBuffer = new StringBuffer(); + inProp = false; + ++i; + continue; + } + } + if (!inProp) result.append(c); + else propertyNameBuffer.append(c); + ++i; + } + if(propertyNameBuffer.length() != 0) { + result.append(propertyNameBuffer.toString()); + } + return result.toString(); + } + + + + public HashMap getResults() { + return properties; + } + public void setProperty(String key, String value){ + properties.put(key, value); + } + public String getProperty(String key){ + return (String)properties.get(key); + } + + public void setInstallRoot(File installRoot) { + this.installRoot = installRoot; + } + /** + * @since 0.7.1 to support installs from readonly media + * @return Map + */ + public Map getAllProperties(){ + return properties; + } + + /** + * Appends the property if found or inserts an empty string. + * This method now supports loading environment variables. + * @param propertyNameBuffer StringBuffer + * @param result StringBuffer + */ + private void appendProperty(StringBuffer propertyNameBuffer, StringBuffer result) { + String propertyName = propertyNameBuffer.toString(); + String key = propertyName.substring(2); + String value = (String)properties.get(key); + if(value == null && key.startsWith(InstallerContext.ENV_PREFIX)) { + value = environment.getProperty(key); + } + if(value == null && key.startsWith(InstallerContext.JAVA_PREFIX)) { + value = environment.getProperty(key); + } + if (value != null) { + result.append(value); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ResultContainer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/SecretPropertyField.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/SecretPropertyField.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/SecretPropertyField.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,30 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + +/** + * + * <p>An InputField that should not have its property printed to the properties + * file, probably for security reasons such as a PasswordTextInput </p> + * <p>It is imperative that all classes that implement this interface extend +* InputField </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: SecretPropertyField.java,v 1.1.1.1 2005/10/18 18:20:55 teknopaul Exp $ + */ +public interface SecretPropertyField{ +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/SecretPropertyField.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/SelectInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/SelectInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/SelectInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,152 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + + + +/** + * + * <p>Input type to choose a single value from a (numbered) list of options </p> + * <p>N.B. subclassed for TargetSelectInput </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: SelectInput.java,v 1.4 2006/12/07 02:50:27 teknopaul Exp $ + */ +public class SelectInput + extends InputField{ + + // i18n support + private static ResourceBundle langPack = null; + private int optionIdx = 0; + static{ + try { + langPack = ResourceBundle.getBundle("resources.LanguagePack"); + } catch (MissingResourceException e) { + // ignore, signifies no lang packs installed + } + } + + private SelectInput.Option[] options; + + public SelectInput() { + } + + + public SelectInput.Option[] getOptions() { + return options; + } + + public void setOptions(SelectInput.Option[] options) { + this.options = options; + } + public Option getNewOption(){ + return new Option(); + } + + public class Option { + + private int idx = ++optionIdx; + private String text; + public String value; + + public void setText(String text) { + this.text = text; + } + public String getText() { + if(langPack != null){ + return langPack.getString(getProperty() + "." + idx +".displayText"); + } + return text; + } + } + + public void setValue(String value){ + setInputResult(value); + } + + public boolean validate(InstallerContext cxt) throws ValidationException{ + if(getInputResult() == null){ + return false; + } + String value = getInputResult(); + boolean ok = false; + for (int i = 0; i < options.length; i++) { + ok |= options[i].value.equals(value); + } + return ok; + } + + + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText()==null){ + System.out.println("Select:displayText must be set"); + return false; + } + if(getProperty()==null){ + System.out.println("Select:property must be set"); + return false; + } + if(getDefaultValue()==null){ + System.out.println("Select:defaultValue must be set"); + return false; + } + if(getOptions()==null){ + System.out.println("Select:option must have at least two options"); + return false; + } + if(getOptions().length<2){ + System.out.println("Select:option must have at least two options"); + return false; + } + for (int i = 0; i < getOptions().length; i++) { + Option o = getOptions()[i]; + if(o.getText()==null){ + System.out.println("Select:option:text must be set"); + return false; + } + if(o.value==null){ + System.out.println("Select:option:value must be set"); + return false; + } + } + boolean defaultExists = false; + for (int i = 0; i < getOptions().length; i++) { + Option o = getOptions()[i]; + if(o.value.equals(getDefaultValue())){ + defaultExists=true; + } + } + if(!defaultExists){ + System.out.println("Select:option:Default must be one of the options"); + return false; + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/SelectInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/Target.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/Target.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/Target.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,11 @@ +package org.tp23.antinstaller.input; +/** + * Indicates the input type is a target based type and requires special + * processing in the properties loader + * @author teknopaul + * + */ +public interface Target { + public int getIdx(); + public String getTarget(); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/Target.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/TargetInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/TargetInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/TargetInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,209 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + + +/** + * + * <p>Input type to select targets to install </p> + * If the osSpecific flag is set the OS of the current system will + * be appended to the name of the target actually by ant run so that different + * Targets can be run according to the target platform. + * This feature goes against the principles of + * building cross platform installers, but is provided so that common installer + * tasks such as creating icons and shortcuts can be run on Windows for + * all those useless users who can't run a command script ;) + * <br> + * Currently there are two modes strict and not strict (lax).</p> + * <p>Strict target will return the target name plus the exact String in the + * System Property "os.name" this means you will have to provide targets for + * every possible OS version. See + * <a href="http://lopica.sourceforge.net/os.html">this page</a> for a list of possible values + * There are a great many but you may not want to consider some of the options.</p> + * <p>Lax target will return one of the following strings only + * <ul> + * <li>"[target-name]-linux" - Linux </li> + * <li>"[target-name]-mac" - Mac OS and Mac OS X</li> + * <li>"[target-name]-sun" - SunOS and Solaris</li> + * <li>"[target-name]-win" - Windows *</li> + * <li>"[target-name]-other" - any thing else</li> + * </ul></p> so you only have to create 5 ant targets to support all the cases. + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: TargetInput.java,v 1.3 2006/12/07 02:42:22 teknopaul Exp $ + */ +public class TargetInput + extends InputField + implements Target{ + + + private String target; + private String force; + private String osSpecific; + private String strict; + //targets are ordered + private int idx; + + private static int globalIdx = 1; + + public TargetInput() { + idx = getGlobalIdx(); + } + + public String getTarget() { + if(isTrue(osSpecific)){ + return getOSSpecificTarget(); + } else { + return target; + } + } + + /** + * Used to fetch the target value that was set in the config file + * @return + */ + public String getTargetName() { + return target; + } + + public void setTarget(String target) { + this.target = target; + setProperty(target); + } + + public String getForce() { + return force; + } + + public void setForce(String force) { + this.force = force; + } + + + public String getStrict() { + return strict; + } + + public void setStrict(String strict) { + this.strict = strict; + } + + public String getOsSpecific() { + return osSpecific; + } + + public void setOsSpecific(String osSpecific) { + this.osSpecific = osSpecific; + } + + /** + * Called to validate the user input + */ + public boolean validate(InstallerContext cxt) throws ValidationException { + //setInputResult(target); + return true; + } + + + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText()==null){ + System.out.println("Target:displayText must be set"); + return false; + } + if(getTarget()==null){ + System.out.println("Target:target must be set"); + return false; + } +// if(getTarget().equals("default")){ +// System.out.println("Target:target can not be \"default\""); +// return false; +// } + if(!InputField.optionalBoolean(getForce())){ + System.out.println("Target:force must be true or false or null"); + return false; + } + if(!InputField.optionalBoolean(getStrict())){ + System.out.println("Target:strict must be true or false or null"); + return false; + } + if(!InputField.optionalBoolean(getOsSpecific())){ + System.out.println("Target:osSpecific must be true or false or null"); + return false; + } + if(!InputField.requiredBoolean(getDefaultValue())){ + System.out.println("Target:defaultValue must be true or false"); + return false; + } + return true; + } + public int getIdx() { + return idx; + } + public static int getGlobalIdx() { + return globalIdx++; + } + + public String getOSSpecificTarget() { + if(isTrue(strict)){ + return getStrictTarget(); + } + else return getLaxTarget(); + } + + private String getStrictTarget(){ + return target + getOsSpecificSuffix(); + } + + private String getLaxTarget(){ + return target + getLaxOsSpecificSuffix(); + } + + /** + * N.B. should have added a "-" but to late to change now and not important + * @return + */ + public static String getOsSpecificSuffix(){ + return System.getProperty("os.name"); + } + public static String getLaxOsSpecificSuffix(){ + String osName = System.getProperty("os.name").toLowerCase(); + if(osName.indexOf("linux") != -1){ + return "-linux"; + } + if(osName.indexOf("mac") != -1){ + return "-mac"; + } + if(osName.indexOf("windows") != -1){ + return "-win"; + } + if(osName.indexOf("solaris") != -1 || osName.indexOf("sunos") != -1){ + return "-sun"; + } + return "-other"; + + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/TargetInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/TargetSelectInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/TargetSelectInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/TargetSelectInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,100 @@ +/* + * Copyright 2005 Paul Hinds, Mark Anderson + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + +/** + * + * <p>Input type to choose a single value from a (numbered) list of options + * which will be rendered as radio buttons in the Swing GUI </p> + * REF: 1177206 + * @author Paul Hinds, Mark Anderson + * @version $Id: TargetSelectInput.java,v 1.4 2006/12/21 00:03:08 teknopaul Exp $ + */ +public class TargetSelectInput + extends SelectInput + implements Target{ + + //targets are ordered + private int idx; + + public TargetSelectInput() { + idx = TargetInput.getGlobalIdx(); + } + + public int getIdx() { + return idx; + } + + public String getTarget(){ + return super.getDefaultValue(); + } + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText() == null){ + System.out.println("TargetSelect:displayText must be set"); + return false; + } + if(getProperty() == null){ + System.out.println("TargetSelect:property must be set"); + return false; + } + if(getDefaultValue() == null){ + System.out.println("TargetSelect:defaultValue must be set"); + return false; + } + if(getOptions() == null){ + System.out.println("TargetSelect:option must have at least two options"); + return false; + } + if(getOptions().length < 2){ + System.out.println("TargetSelect:option must have at least two options"); + return false; + } + for (int i = 0; i < getOptions().length; i++) { + Option o = getOptions()[i]; + if(o.getText() == null){ + System.out.println("TargetSelect:option:text must be set"); + return false; + } + if(o.value == null){ + System.out.println("TargetSelect:option:value must be set"); + return false; + } + } + boolean defaultExists = false; + for (int i = 0; i < getOptions().length; i++) { + Option o = getOptions()[i]; + if(o.value.equals(getDefaultValue())){ + defaultExists=true; + } +// if(o.value.equals("default")){ +// System.out.println("Target:target can not be \"default\""); +// return false; +// } + } + if(!defaultExists){ + System.out.println("TargetSelect:option:Default must be one of the options"); + return false; + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/TargetSelectInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/UnvalidatedTextInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/UnvalidatedTextInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/UnvalidatedTextInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,66 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + + +/** + * + * <p>Free text input type </p> + * @author Paul Hinds + * @version $Id: UnvalidatedTextInput.java,v 1.1.1.1 2005/10/18 18:20:54 teknopaul Exp $ + */ +public class UnvalidatedTextInput + extends InputField{ + + public UnvalidatedTextInput() { + } + + public void setValue(String dir){ + setInputResult(dir); + } + + /** + * Called to validate the user input + */ + public boolean validate(InstallerContext cxt) throws ValidationException{ + return true; + } + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText()==null){ + System.out.println("Simple:displayText must be set"); + return false; + } + if(getProperty()==null){ + System.out.println("Simple:property must be set"); + return false; + } + if(getDefaultValue()==null){ + System.out.println("Simple:defualtValue must be set"); + return false; + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/UnvalidatedTextInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ValidatedTextInput.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ValidatedTextInput.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ValidatedTextInput.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,113 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.input; + + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.apache.tools.ant.BuildException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; + + +/** + * + * <p>Free text input type with validation using regular expressions</p> + * @author Paul Hinds + * @version $Id: ValidatedTextInput.java,v 1.2 2006/12/21 00:03:09 teknopaul Exp $ + */ +public class ValidatedTextInput + extends InputField{ + + private String regex; + private Pattern pattern; + //private RegexpMatcher matcher; // use ant version in an attempt to support jdk1.3 + + public ValidatedTextInput() { + } + + public void setValue(String dir){ + setInputResult(dir); + } + public String getRegex() { + return regex; + } + public void setRegex(String regex) { + this.regex = regex; + try { + //matcher = new RegexpMatcherFactory().newRegexpMatcher(); + //matcher.setPattern(regex); + pattern = Pattern.compile(regex); + } + catch (BuildException ex) { + throw new InputException("Invalid regex in Validated text input"); + } + } + + /** + * Called to validate the user input + */ + public boolean validate(InstallerContext cxt) throws ValidationException{ + try { + if (getInputResult() == null)return false; + String toTest = getInputResult(); + + Matcher matcher = pattern.matcher(toTest); + //boolean matches = matcher.matches(toTest); + boolean matches = matcher.matches(); + + return matches; + } + catch (Throwable e) { + cxt.log(e); + return false; + } + } + + /** + * Used by checkConfig to validate the configuration file. + * Not used at runtime. + * @return boolean + */ + public boolean validateObject() { + if(getDisplayText()==null){ + System.out.println("Validated:displayText must be set"); + return false; + } + if(getProperty()==null){ + System.out.println("Validated:property must be set"); + return false; + } + if(getDefaultValue()==null){ + System.out.println("Validated:defaultValue must be set"); + return false; + } + if(getRegex()==null){ + System.out.println("Validated:regex must be set"); + return false; + } + try{ + //matcher = new RegexpMatcherFactory().newRegexpMatcher(); + //matcher.setPattern(getRegex()); + } + catch(Exception e){ + System.out.println("Validated:regex must compile"); + + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/ValidatedTextInput.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/Validator.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/Validator.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/Validator.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,40 @@ +package org.tp23.antinstaller.input; + +import java.util.Locale; + +import org.tp23.antinstaller.InstallerContext; + + +/** + * A no args constructor should be provided + * @author Paul Hinds + * @version $Id: Validator.java,v 1.1.1.1 2005/10/18 18:20:54 teknopaul Exp $ + */ +public interface Validator { + + /** + * Validate the user entry. The InstallerContext is provided to allow + * conditional failure based on user input. for example the implementation + * of this class could call the following code after failing to open a socket + * <pre> + * boolean usrOverride = ctx.getMessageRenderer().prompt("Prot not available are you sure?"); + * if(userOverride)return true; + * else{ + * throw new SocketException(); + * } + * </pre> + * @param text may be null it is up to the validator to decide if null or "" + * is acceptable + * @throws Exception + */ + public void validate(String text,InstallerContext ctx)throws Exception; + /** + * This method should return a string for every exception that might be + * thrown by the validate method. The top level Throwable should be + * handled at least. + * @param ex + * @param l Locale (ignored, but one day we should be internationalized) + * @return + */ + public String getErrorMessage(Throwable ex,Locale l); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/Validator.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/package.html =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/package.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/package.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,9 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head><!-- + Copyright (c) 2004 tp23 + All Rights Reserved. +--></head> + +<body bgcolor="white">Contains classes for representing Input/Output elements and holding the data collected for each input type.</body> +</html> Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/input/package.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/LicensePage.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/LicensePage.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/LicensePage.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,52 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.page; + + +/** + * + * <p>Represents a license page witha resouce that contains the text of the licenses </p> + * <p> </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: LicensePage.java,v 1.1.1.1 2005/10/18 18:21:04 teknopaul Exp $ + */ +public class LicensePage + extends Page { + + private String resource; + private String usePaging; + + public LicensePage() { + } + + public String getResource() { + return resource; + } + + public void setResource(String resource) { + this.resource = resource; + } + + public String getUsePaging() { + return usePaging; + } + + public void setUsePaging(String usePaging) { + this.usePaging = usePaging; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/LicensePage.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/Page.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/Page.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/Page.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,284 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.page; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +import java.util.Set; +import java.util.StringTokenizer; +import java.util.TreeSet; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.TargetInput; +import org.tp23.antinstaller.runtime.IfPropertyHelper; +/** + * + * <p>Represents a page in the installer. </p> + * <p>This object maintians an ordered list of targets that have been selected +* so that when ant is run the targets are run in the correct order. If +* Targets exist in multiple pages they are run in the order they appear in the config file. </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: Page.java,v 1.10 2007/01/19 00:24:36 teknopaul Exp $ + */ + +public abstract class Page { + +// i18n support + private static ResourceBundle langPack = null; + static{ + try { + langPack = ResourceBundle.getBundle("LanguagePack"); + } catch (MissingResourceException e) { + // ignore, signifies no lang packs installed + } + } + + //private static final int MAX_TARGETS = 10; + private String name; + private String displayText; + private String imageResource; + private OutputField[] outputField; + private boolean abort; + /** + * target to be called as the installer is running + */ + private String postDisplayTarget; + private Set targets = new TreeSet(); + + public Page() { + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDisplayText() { + if(langPack != null){ + return langPack.getString("page." + getName() + ".displayText"); + } + return displayText; + } + + public void setDisplayText(String displayText) { + this.displayText = displayText; + } + + public String getImageResource() { + return imageResource; + } + + public void setImageResource(String imageResource) { + this.imageResource = imageResource; + } + + public OutputField[] getOutputField() { + return outputField; + } + + public void setOutputField(OutputField[] outputField) { + this.outputField = outputField; + } + + public String getPostDisplayTarget() { + return postDisplayTarget; + } + + public void setPostDisplayTarget(String runtimeTarget) { + this.postDisplayTarget = runtimeTarget; + } + + + /** + * These are the ant targets that will be run, this is decided after + * the Page has been displayed. For example if the user chooses not + * to enter a field that may signify that a target should not be run + * @return A sorted List a list of Ant targets as Strings; + * @throws InstallException + */ + public List getTargets(InstallerContext ctx) { + List results = new ArrayList(targets.size()); + try { + Iterator iter = targets.iterator(); + IfPropertyHelper helper = new IfPropertyHelper(ctx); + while(iter.hasNext()){ + IndexedTarget idxTarget = (IndexedTarget)iter.next(); + if( IndexedTarget.PAGE.equals(idxTarget.getTargetType()) ){ + if( helper.ifProperty(this) || helper.ifTarget(this, ctx.getInstaller().getPages() ) ){ + results.add(idxTarget.target); + } + } + else{ + results.add(idxTarget.target); + } + } + } catch (InstallException e) { + // should not happen at runtime if ifProperty has been validated + e.printStackTrace(); + ctx.log(ctx.getInstaller().isVerbose(), e); + throw new RuntimeException(); + } + return results; + } + /** + * get input targets that are selected and all page targets, independent of + * the ifProperty value + * @return + */ + public List getAllTargets() { + List results = new ArrayList(targets.size()); + Iterator iter = targets.iterator(); + while(iter.hasNext()){ + IndexedTarget idxTarget = (IndexedTarget)iter.next(); + results.add(idxTarget.target); + } + return results; + } + /** + * Comma separated list of targets for this page, called when parsing the + * config file + * @param target String + */ + public void setTarget(String targetList) { + StringTokenizer st = new StringTokenizer(targetList, ","); + while (st.hasMoreTokens()) { + targets.add(new IndexedTarget(TargetInput.getGlobalIdx(), + st.nextToken(), + IndexedTarget.PAGE)); + } + } + /** + * Adds an INPUT target to the Page config + * @param idx + * @param target + */ + public void addTarget(int idx, String target) { + this.targets.add(new IndexedTarget(idx, target, IndexedTarget.INPUT)); + } + public void removeTarget(int idx) { + this.targets.remove(new IndexedTarget(idx, null)); + } + /** + * returns true if the page has the current target set + * @param target String + * @return boolean + */ + public boolean isTarget(String target) { + if(target == null){ + return false; + } + Iterator iter = targets.iterator(); + while(iter.hasNext()) { + IndexedTarget idxTarget = (IndexedTarget)iter.next(); + if(idxTarget.target.equals(target)){ + return true; + } + } + return false; + } + + /** + * @return a List of IndexedTarget objects + */ + public List getPageTargets(){ + List toReturn = new ArrayList(targets.size()); + Iterator iter = targets.iterator(); + while(iter.hasNext()) { + IndexedTarget idxTarget = (IndexedTarget)iter.next(); + if( IndexedTarget.PAGE.equals(idxTarget.targetType) ){ + toReturn.add(idxTarget); + } + } + return toReturn; + } + + /** + * @return a List of IndexedTarget objects + */ + public List getElementTargets(){ + List toReturn = new ArrayList(targets.size()); + Iterator iter = targets.iterator(); + while(iter.hasNext()) { + IndexedTarget idxTarget = (IndexedTarget)iter.next(); + if( IndexedTarget.INPUT.equals(idxTarget.targetType) ){ + toReturn.add(idxTarget); + } + } + return toReturn; + } + /** + * This is called after the page is displayed, a page can return false to indicate + * that the installation should abort. Should be false if the cancel button is pressed. + * System.exit is not called to allow the installer to clean up temporary files. + * @return boolean + */ + public boolean isAbort() { + return abort; + } + + public void setAbort(boolean abort) { + this.abort = abort; + } + public static class IndexedTarget implements Comparable{ + + private static final String PAGE = "page"; + private static final String INPUT = "input"; + + int idx; + String target; + String targetType = INPUT; + + IndexedTarget(int idx, String target){ + this.idx = idx; + this.target = target; + } + IndexedTarget(int idx, String target, String targetType){ + this.idx = idx; + this.target = target; + this.targetType = targetType; + } + + public boolean equals(Object target){ + IndexedTarget test = (IndexedTarget)target; + return test.idx == idx; + } + // FindBugs - part of equals() contract + public int hashCode(){ + return this.idx; + } + public int compareTo(Object o) { + IndexedTarget test = (IndexedTarget)o; + return idx - test.idx; + } + public String getTarget() { + return target; + } + public String getTargetType() { + return targetType; + } + + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/Page.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/ProgressPage.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/ProgressPage.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/ProgressPage.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,43 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.page; + +import org.tp23.antinstaller.input.OutputField; + +public class ProgressPage extends Page{ + + private boolean showTargets = true; + + + public ProgressPage() { + } + /** + * @return Returns the showTargets. + */ + public boolean isShowTargets() { + return showTargets; + } + /** + * @param showTargets indicates that the graphical display of + * progress should be used in the Swing renderer + */ + public void setShowTargets(boolean showTargets) { + this.showTargets = showTargets; + } + public void setShowTargets(String strShowTargets) { + this.showTargets = OutputField.isTrue(strShowTargets); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/ProgressPage.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/SimpleInputPage.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/SimpleInputPage.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/SimpleInputPage.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,57 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.page; + +import org.tp23.antinstaller.input.OutputField; + + + +public class SimpleInputPage + extends Page { + + + private String ifTarget; + private String ifProperty; + private boolean overflow; + + public SimpleInputPage() { + } + + public String getIfTarget() { + return ifTarget; + } + + public void setIfTarget(String ifTarget) { + this.ifTarget = ifTarget; + } + public String getIfProperty() { + return ifProperty; + } + public void setIfProperty(String ifProperty) { + this.ifProperty = ifProperty; + } + + public boolean isOverflow() { + return overflow; + } + public void setOverflow(boolean overflow) { + this.overflow = overflow; + } + public void setOverflow(String strOverflow) { + this.overflow = OutputField.isTrue(strOverflow); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/SimpleInputPage.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/SplashPage.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/SplashPage.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/SplashPage.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,40 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.page; + +public class SplashPage + extends Page { + private String splashResource; + private String altText; + public SplashPage() { + } + + public String getSplashResource() { + return splashResource; + } + + public void setSplashResource(String splashResource) { + this.splashResource = splashResource; + } + + public String getAltText() { + return altText; + } + + public void setAltText(String altText) { + this.altText = altText; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/SplashPage.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/TextPage.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/TextPage.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/TextPage.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,42 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.page; + +public class TextPage + extends Page { + + private String htmlResource; + private String textResource; + + public TextPage() { + } + + public String getHtmlResource() { + return htmlResource; + } + + public void setHtmlResource(String htmlResource) { + this.htmlResource = htmlResource; + } + + public String getTextResource() { + return textResource; + } + + public void setTextResource(String textResource) { + this.textResource = textResource; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/TextPage.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/package.html =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/package.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/package.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,9 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head><!-- + Copyright (c) 2004 tp23 + All Rights Reserved. +--></head> + +<body bgcolor="white">Contains holders for the three different types of Page in an installer and the base class.</body> +</html> Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/page/package.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/AntOutputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/AntOutputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/AntOutputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,24 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer; + +import java.io.PrintStream; + +public interface AntOutputRenderer { + public PrintStream getOut(); + public PrintStream getErr(); + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/AntOutputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/MessageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/MessageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/MessageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,42 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer; + +import org.tp23.antinstaller.InstallerContext; +/** + * + * <p>Abstract message renderer asking user questions or providing feedback</p> + * <p> </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: MessageRenderer.java,v 1.1.1.1 2005/10/18 18:20:59 teknopaul Exp $ + */ +public interface MessageRenderer { + + public void setInstallerContext(InstallerContext ctx); + /** + * Print a message for which there is not option to reply + * @param message String + */ + public void printMessage(String message); + /** + * ask the user for Yes or No + * @param message String + * @return boolean true = Yes false = No + */ + public boolean prompt(String message); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/MessageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/PageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/PageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/PageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,25 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.page.Page; + +public interface PageRenderer { + public void setContext(InstallerContext ctx); + public InstallerContext getContext(); + public boolean renderPage(Page page) throws Exception; +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/PageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/RendererFactory.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/RendererFactory.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/RendererFactory.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,136 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer; + +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.renderer.swing.SwingOutputFieldRenderer; +import org.tp23.antinstaller.renderer.swing.SwingPageRenderer; +import org.tp23.antinstaller.renderer.text.AbstractTextPageRenderer; +import org.tp23.antinstaller.renderer.text.TextOutputFieldRenderer; + + + +/** + * + * <p>Fetches an instance of a Renderers by using the class of the method parameter and + * a naming convention </p> + * <p> </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: RendererFactory.java,v 1.3 2006/12/21 00:03:30 teknopaul Exp $ + */ +public class RendererFactory { + public RendererFactory() { + } + + public static TextOutputFieldRenderer getTextRenderer(OutputField field) throws ClassNotFoundException { + String fullyQualified = field.getClass().getName(); + int lastDot = fullyQualified.lastIndexOf('.'); + if (lastDot == -1) { + throw new UnsupportedOperationException("InputField can not be a member of the default package"); + } + int prevDot = fullyQualified.substring(0,lastDot-1).lastIndexOf('.', lastDot - 1); + if (prevDot == -1) { + throw new UnsupportedOperationException("InputField can not be a member of a single level package"); + } + StringBuffer rendererClassName = new StringBuffer(); + rendererClassName.append(fullyQualified.substring(0, prevDot)); + rendererClassName.append(".renderer.text."); + rendererClassName.append(fullyQualified.substring(lastDot + 1)); + rendererClassName.append("Renderer"); + try { + Class clazz = Class.forName(rendererClassName.toString()); + return (TextOutputFieldRenderer) clazz.newInstance(); + } + catch (Exception ex) { + throw new ClassNotFoundException("Class does not meet the contract for TextInputFieldRenderer:" + rendererClassName); + } + } + + public static AbstractTextPageRenderer getTextPageRenderer(Page page) throws ClassNotFoundException { + String fullyQualified = page.getClass().getName(); + int lastDot = fullyQualified.lastIndexOf('.'); + if (lastDot == -1) { + throw new UnsupportedOperationException("Pages can not be a member of the default package"); + } + int prevDot = fullyQualified.substring(0,lastDot-1).lastIndexOf('.', lastDot - 1); + if (prevDot == -1) { + throw new UnsupportedOperationException("Pages can not be a member of a single level package"); + } + StringBuffer rendererClassName = new StringBuffer(); + rendererClassName.append(fullyQualified.substring(0, prevDot)); + rendererClassName.append(".renderer.text."); + rendererClassName.append(fullyQualified.substring(lastDot + 1)); + rendererClassName.append("Renderer"); + try { + Class clazz = Class.forName(rendererClassName.toString()); + return (AbstractTextPageRenderer) clazz.newInstance(); + } + catch (Exception ex) { + throw new ClassNotFoundException("Class does not meet the contract for TextPageRenderer:" + rendererClassName); + } + } + public static SwingPageRenderer getSwingPageRenderer(Page page) throws ClassNotFoundException { + String fullyQualified = page.getClass().getName(); + int lastDot = fullyQualified.lastIndexOf('.'); + if (lastDot == -1) { + throw new UnsupportedOperationException("Pages can not be a member of the default package"); + } + int prevDot = fullyQualified.substring(0,lastDot-1).lastIndexOf('.', lastDot - 1); + if (prevDot == -1) { + throw new UnsupportedOperationException("Pages can not be a member of a single level package"); + } + StringBuffer rendererClassName = new StringBuffer(); + rendererClassName.append(fullyQualified.substring(0, prevDot)); + rendererClassName.append(".renderer.swing."); + rendererClassName.append(fullyQualified.substring(lastDot + 1)); + rendererClassName.append("Renderer"); + try { + Class clazz = Class.forName(rendererClassName.toString()); + return (SwingPageRenderer) clazz.newInstance(); + } + catch (Exception ex) { + throw new ClassNotFoundException("Class does not meet the contract for SwingPageRenderer:" + rendererClassName); + } + } + + public static SwingOutputFieldRenderer getSwingRenderer(OutputField field) throws ClassNotFoundException { + String fullyQualified = field.getClass().getName(); + int lastDot = fullyQualified.lastIndexOf('.'); + if (lastDot == -1) { + throw new UnsupportedOperationException("OutputField can not be a member of the default package"); + } + int prevDot = fullyQualified.substring(0,lastDot-1).lastIndexOf('.', lastDot - 1); + if (prevDot == -1) { + throw new UnsupportedOperationException("OutputField can not be a member of a single level package"); + } + StringBuffer rendererClassName = new StringBuffer(); + rendererClassName.append(fullyQualified.substring(0, prevDot)); + rendererClassName.append(".renderer.swing."); + rendererClassName.append(fullyQualified.substring(lastDot + 1)); + rendererClassName.append("Renderer"); + try { + Class clazz = Class.forName(rendererClassName.toString()); + return (SwingOutputFieldRenderer) clazz.newInstance(); + } + catch (Exception ex) { + ex.printStackTrace(); + throw new ClassNotFoundException("Class does not meet the contract for SwingInputFieldRenderer:" + rendererClassName); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/RendererFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res.properties =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res.properties (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res.properties 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,48 @@ +#org.tp23.antinstaller.renderer.Res +#Wed Nov 10 01:06:42 CET 2004 + +dirNotExistCreate=The Directory does not exist, create it? +dirNotExist=The Directory does not exist +fileNotExist=The File does not exist +dirNotCreated=The Directory could not be created +canNotCreateFile=Can not create file +appRootInvalid=This directory does not appear to be the root of the application +selectFile=Select File +selectFolder=Select Folder +notValidSelection=Not a valid selection +showDetails=Show Details + +#Default loading +promptLoadDefaults=Installation configuration found. Load the existing configuration? +promptMissingDefaultPassword=A password was not found it may have been omitted for security reasons, it will be set to the default. + +click=Click +toContinue=to continue +failed=Failed +exit=Exit +complete=Complete +finished=Finished +extracting=Extracting... +installFinished=Install Finished +running=Running: + +backButton=Back +cancelButton=Cancel +nextButton=Next + +output=Output +errors=Errors +notCorrectFormat=The field is not of the correct format +notCorrectPasswordFormat=The password is not of the correct format +passwordsDoNotMatch=The passwords do not match +installationFailed=Install failed +propertiesVersionMismatch=Some options are missing from the previous version and must be manually entered, continue? + +Finished=Finished +Failed=Failed, view the error messages +ant.failure=Ant run failed - examine the error logs for details + +#Text for license page buttons +license.next.text=Accept +license.cancel.text=Reject + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res.properties ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_de.properties =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_de.properties (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_de.properties 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,48 @@ +#org.tp23.antinstaller.renderer.Res +#Wed Nov 10 01:06:42 CET 2004 + +dirNotExistCreate=Das Verzeichnis existiert nicht, erzeugen? +dirNotExist=Das Verzeichnis existiert nicht +fileNotExist=Die Datei existiert nicht +dirNotCreated=Das Verzeichnis konnte nicht erzeugt werden +canNotCreateFile=Kann die Datei nicht erzeugen +appRootInvalid=Das Verzeichnis scheint nicht das Wurzelverzeichnis der Applikation zu sein +selectFile=Datei auswählen +selectFolder=Verzeichnis auswählen +notValidSelection=Keine gültige Auswahl +showDetails=Details anzeigen + +#Default loading +promptLoadDefaults=Installation configuration found. Load the existing configuration? +promptMissingDefaultPassword=A password was not found it may have been omitted for security reasons, it will be set to the default. + +click=Klicken +toContinue=zum Fortfahren +failed=fehlgeschlagen +exit=Beenden +complete=Fertigstellen +finished=abgeschlossen +extracting=Auspacken ... +installFinished=Installation beendet +running=Ausführung: + +backButton=Zurück +cancelButton=Abbrechen +nextButton=Weiter + +output=Ausgabe +errors=Fehler +notCorrectFormat=Der Wert hat nicht das vorgegebene Format +notCorrectPasswordFormat=Das Kennwort hat nicht das vorgegebene Format +passwordsDoNotMatch=The passwords do not match +installationFailed=Installation fehlgeschlagen +propertiesVersionMismatch=Some properties are missing from and must be manually entered, continue? + +Finished=Fertig +Failed=Fehlgeschlagen, Details siehe Fehlermeldungen +ant.failure=Ant run failed - examine the error logs for details + +#Text for license page buttons +license.next.text=Accept +license.cancel.text=Reject + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_de.properties ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_es.properties =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_es.properties (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_es.properties 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,47 @@ +#org.tp23.antinstaller.renderer.Res +#Wed Nov 10 01:06:42 CET 2004 + +dirNotExistCreate=El directorio no existe, quieres crearlo? +dirNotExist=El directorio no existe. +fileNotExist=El fichero no existe. +dirNotCreated=El directorio no se ha creado. +canNotCreateFile=No se puede crear el fichero. +appRootInvalid=Este directorio no parece ser la raiz de la aplicaciòn. +selectFile=Seleccionar fichero. +selectFolder=Seleccionar carpeta. +notValidSelection=No es una opciòn vàlida. +showDetails=Enseñar detalles. + +#Default loading +promptLoadDefaults=Configuracion de instalaciòn encontrada. Carga configuraciòn? +promptMissingDefaultPassword=A password was not found it may have been omitted for security reasons, it will be set to the default. + +click=Click +toContinue=Para continuar +failed= Intento Fallido +exit=Salir +complete=Completar +finished=Terminado +extracting=Extrayendo... +installFinished=Se ha terminado la instalaciòn +running=Ejecutando: + +backButton=Atras +cancelButton=Cancelar +nextButton=Proxima + +output=Salida +errors=Errores +notCorrectFormat=El fichero no tiene un formato adecuado. +notCorrectPasswordFormat=El fichero no tiene un formato adecuado. +passwordsDoNotMatch=Las contraseñas tienen que ser iguales +installationFailed=Instalaciòn fallado +propertiesVersionMismatch=Faltan datos del versión anterior, continuar y entrar los manualmente? + +Finished=Terminado +Failed=Intento fallido, enseñar mensajes de error +ant.failure=Ant run failed - examine the error logs for details + +#Text for license page buttons +license.next.text=Aceptar +license.cancel.text=Cancellar \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_es.properties ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_es_EU.properties =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_es_EU.properties (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_es_EU.properties 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,47 @@ +#org.tp23.antinstaller.renderer.Res +#Wed Nov 10 01:06:42 CET 2004 + +dirNotExistCreate=Direktorioa ez da existitzen, sortu nahi al duzu? +dirNotExist=Direktorioa ez da existitzen. +fileNotExist=Fitxategia ez da existitzen. +dirNotCreated=Ezin izan da direktorioa sortu. +canNotCreateFile=Fitxategia ezin da sortu. +appRootInvalid=Ez dirutdi direktorio hay aplikazioaren erroa denik. +selectFile=Fitxategia aukeratu. +selectFolder=karpeta aukeratu. +notValidSelection=Ez da aukera onargarria. +showDetails=Erakutsi xehetasunak. + +#Default loading +promptLoadDefaults=Instalazio konfigurazio bat aurkituta. Kargatu instalazioa? +promptMissingDefaultPassword=A password was not found it may have been omitted for security reasons, it will be set to the default. + +click=Sakatu +toContinue=Jarraitzeko +failed=Hutsegitea +exit=Atera +complete=Bukatu +finished=Bukatuta +extracting=Ateratzen... +installFinished=Instalazioa bukatuta. +running=Exekutatzen: + +backButton=Atzera +cancelButton=Ezeztatu +nextButton=Hurrengoa + +output=Irteera +errors=Akatsak +notCorrectFormat=Fitxategia ez da formatu egokikoa. +notCorrectPasswordFormat=Fitxategia ez da formatu egokikoa. +passwordsDoNotMatch=Pasa hitzak berdinak izan behar dira +installationFailed=Instalaciòn fallado +propertiesVersionMismatch=Faltan datos del versión anterior, continuar y entrar los manualmente? + +Finished=Bukatuta +Failed=Huts egin da, erakutsi akats mezuak +ant.failure=Ant run failed - examine the error logs for details + +#Text for license page buttons +license.next.text=Aceptar +license.cancel.text=Cancellar \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/Res_es_EU.properties ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/package.html =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/package.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/package.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,10 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head><!-- + Copyright (c) 2004 tp23 + All Rights Reserved. +--></head> + +<body bgcolor="white">Classes of this package follow a strict naming convention to define the supported renderers +for a specific input class.</body> +</html> Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/package.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIButton.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIButton.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIButton.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,71 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Dimension; + +import javax.swing.Action; +import javax.swing.Icon; +import javax.swing.JButton; + + +/** + * A JButton with altered prefered size to facilitate fixing the width + * but still using a GridBagLayout + * @author Paul Hinds + * @version $Id: AIButton.java,v 1.2 2006/12/09 15:26:09 teknopaul Exp $ + */ +public class AIButton extends JButton { + + public AIButton() { + super(); + } + + public AIButton(String text) { + super(text); + } + + public AIButton(Action a) { + super(a); + } + + public AIButton(Icon icon) { + super(icon); + } + + public AIButton(String text, Icon icon) { + super(text, icon); + } + + private Dimension prefSize = new Dimension(SizeConstants.BUTTON_WIDTH, + SizeConstants.FIELD_HEIGHT); + + public Dimension getMinimumSize() { + return prefSize; + } + + public Dimension getPreferredSize() { + return prefSize; + } + public void setOverflow(Dimension prefSize) { + this.prefSize = prefSize; + } + + public Dimension getMaximumSize() { + return prefSize; + } + +} \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIButton.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AICheckBox.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AICheckBox.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AICheckBox.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,82 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Dimension; + +import javax.swing.Action; +import javax.swing.Icon; +import javax.swing.JCheckBox; + + +/** + * A JCheckBox with altered prefered size to facilitate fixing the width + * but still using a GridBagLayout + * @author Paul Hinds + * @version $Id: AICheckBox.java,v 1.2 2006/12/09 15:26:09 teknopaul Exp $ + */ +public class AICheckBox extends JCheckBox { + + public AICheckBox() { + super(); + } + + public AICheckBox(String text) { + super(text); + } + + public AICheckBox(String text, boolean selected) { + super(text, selected); + } + + public AICheckBox(Action a) { + super(a); + } + + public AICheckBox(Icon icon) { + super(icon); + } + + public AICheckBox(Icon icon, boolean selected) { + super(icon, selected); + } + + public AICheckBox(String text, Icon icon) { + super(text, icon); + } + + public AICheckBox(String text, Icon icon, boolean selected) { + super(text, icon, selected); + } + + private Dimension prefSize = new Dimension(SizeConstants.FIELD_WIDTH, SizeConstants.FIELD_HEIGHT); + + public Dimension getMinimumSize() { + return prefSize; + } + + public Dimension getPreferredSize() { + return prefSize; + } + public void setOverflow(Dimension prefSize) { + this.prefSize = prefSize; + } + + public Dimension getMaximumSize() { + return prefSize; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AICheckBox.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AILabel.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AILabel.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AILabel.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,65 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Dimension; + +import javax.swing.Icon; +import javax.swing.JLabel; + + +/** + * A JLabel with altered prefered size to facilitate fixing the width + * but still using a GridBagLayout + * @author Paul Hinds + * @version $Id: AILabel.java,v 1.2 2006/12/09 15:26:09 teknopaul Exp $ + */ +public class AILabel extends JLabel { + + public AILabel() { + super(); + } + public AILabel(String text) { + super(text); + } + public AILabel(String text, int horizontalAlignment) { + super(text, horizontalAlignment); + } + public AILabel(Icon image) { + super(image); + } + public AILabel(Icon image, int horizontalAlignment) { + super(image, horizontalAlignment); + } + public AILabel(String text, Icon icon, int horizontalAlignment) { + super(text, icon, horizontalAlignment); + } + private Dimension prefSize= new Dimension(SizeConstants.LABEL_WIDTH, + SizeConstants.FIELD_HEIGHT); + public Dimension getMinimumSize() { + return prefSize; + } + public Dimension getPreferredSize() { + return prefSize; + } + public void setOverflow(Dimension prefSize) { + this.prefSize = prefSize; + } + public Dimension getMaximumSize() { + return prefSize; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AILabel.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIPasswordField.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIPasswordField.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIPasswordField.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,52 @@ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Dimension; + +import javax.swing.JPasswordField; +import javax.swing.text.Document; + + +/** + * @author Paul Hinds + * @version $Id: AIPasswordField.java,v 1.3 2006/12/21 00:02:59 teknopaul Exp $ + */ +public class AIPasswordField extends JPasswordField { + + public AIPasswordField() { + super(); + } + + public AIPasswordField(int columns) { + super(columns); + } + + public AIPasswordField(String text) { + super(text); + } + + public AIPasswordField(String text, int columns) { + super(text, columns); + } + + public AIPasswordField(Document doc, String txt, int columns) { + super(doc, txt, columns); + } + + private Dimension prefSize = new Dimension(SizeConstants.FIELD_WIDTH, SizeConstants.FIELD_HEIGHT); + + public Dimension getMinimumSize() { + return prefSize; + } + + public Dimension getPreferredSize() { + return prefSize; + } + public void setOverflow(Dimension prefSize) { + this.prefSize = prefSize; + } + + public Dimension getMaximumSize() { + return prefSize; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIPasswordField.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIRadioButton.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIRadioButton.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIRadioButton.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,82 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Dimension; + +import javax.swing.Action; +import javax.swing.Icon; +import javax.swing.JRadioButton; + + +/** + * A JRadioButton with altered prefered size to facilitate fixing the width + * but still using a GridBagLayout + * @author Paul Hinds + * @version $Id: AIRadioButton.java,v 1.2 2006/12/09 15:26:09 teknopaul Exp $ + */ +public class AIRadioButton extends JRadioButton { + + public AIRadioButton() { + super(); + } + + public AIRadioButton(String text) { + super(text); + } + + public AIRadioButton(String text, boolean selected) { + super(text, selected); + } + + public AIRadioButton(Action a) { + super(a); + } + + public AIRadioButton(Icon icon) { + super(icon); + } + + public AIRadioButton(Icon icon, boolean selected) { + super(icon, selected); + } + + public AIRadioButton(String text, Icon icon) { + super(text, icon); + } + + public AIRadioButton(String text, Icon icon, boolean selected) { + super(text, icon, selected); + } + + private Dimension prefSize = new Dimension(SizeConstants.FIELD_WIDTH, SizeConstants.FIELD_HEIGHT); + + public Dimension getMinimumSize() { + return prefSize; + } + + public Dimension getPreferredSize() { + return prefSize; + } + public void setOverflow(Dimension prefSize) { + this.prefSize = prefSize; + } + + public Dimension getMaximumSize() { + return prefSize; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIRadioButton.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIShortTextField.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIShortTextField.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIShortTextField.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,71 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Dimension; + +import javax.swing.JTextField; +import javax.swing.text.Document; + + +/** + * A JTextField with altered prefered size to facilitate fixing the width + * but still using a GridBagLayout. This text field is for use inconjunction + * with a button for example file chooser. + * @author Paul Hinds + * @version $Id: AIShortTextField.java,v 1.2 2006/12/09 15:26:10 teknopaul Exp $ + */ +public class AIShortTextField extends JTextField { + + public AIShortTextField() { + super(); + } + + public AIShortTextField(int columns) { + super(columns); + } + + public AIShortTextField(String text) { + super(text); + } + + public AIShortTextField(String text, int columns) { + super(text, columns); + } + + public AIShortTextField(Document doc, String text, int columns) { + super(doc, text, columns); + } + + private Dimension prefSize = new Dimension(SizeConstants.SHORT_FIELD_WIDTH, SizeConstants.FIELD_HEIGHT); + + public Dimension getMinimumSize() { + return prefSize; + } + + public Dimension getPreferredSize() { + return prefSize; + } + public void setOverflow(Dimension prefSize) { + this.prefSize = prefSize; + } + + public Dimension getMaximumSize() { + return prefSize; + } + + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AIShortTextField.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AITextfield.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AITextfield.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AITextfield.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,70 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Dimension; + +import javax.swing.JTextField; +import javax.swing.text.Document; + + +/** + * A JTextField with altered prefered size to facilitate fixing the width + * but still using a GridBagLayout + * @author Paul Hinds + * @version $Id: AITextfield.java,v 1.2 2006/12/09 15:26:09 teknopaul Exp $ + */ +public class AITextfield extends JTextField { + + public AITextfield() { + super(); + } + + public AITextfield(int columns) { + super(columns); + } + + public AITextfield(String text) { + super(text); + } + + public AITextfield(String text, int columns) { + super(text, columns); + } + + public AITextfield(Document doc, String text, int columns) { + super(doc, text, columns); + } + + private Dimension prefSize = new Dimension(SizeConstants.FIELD_WIDTH, SizeConstants.FIELD_HEIGHT); + + public Dimension getMinimumSize() { + return prefSize; + } + + public Dimension getPreferredSize() { + return prefSize; + } + public void setOverflow(Dimension prefSize) { + this.prefSize = prefSize; + } + + public Dimension getMaximumSize() { + return prefSize; + } + + +} \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AITextfield.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AppRootInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AppRootInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AppRootInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,20 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +public class AppRootInputRenderer + extends DirectoryInputRenderer { +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/AppRootInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/CheckboxInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/CheckboxInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/CheckboxInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,90 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.JLabel; +import javax.swing.JPanel; + +import org.tp23.antinstaller.input.CheckboxInput; +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.gui.GBCF; + +public class CheckboxInputRenderer + extends SwingOutputFieldRenderer { + + protected CheckboxInput inputField; + + protected JLabel fieldLabel = new AILabel(); + protected AICheckBox checkBox = new AICheckBox(); + + public CheckboxInputRenderer() { + } + public void initComponent(JPanel parent){ + try { + jbInit(); + } + catch(Exception e) { + e.printStackTrace(); + } + } + + + + public void setOutputField(OutputField inputField) { + this.inputField = (CheckboxInput)inputField; + } + public void updateInputField(){ + boolean selected = checkBox.isSelected(); + if(selected)inputField.setValue("true"); + else inputField.setValue("false"); + } + public void updateDefaultValue(){ + if(!inputField.isEditted()){ + String newDefault = inputField.getDefaultValue(); + checkBox.setSelected(InputField.isTrue(newDefault)); + } + } + + private void jbInit() throws Exception { + fieldLabel.setText(inputField.getDisplayText()); + checkBox.setSelected(OutputField.isTrue(inputField.getDefaultValue())); + checkBox.setEnabled(!OutputField.isTrue(inputField.getForce())); + checkBox.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + updateInputField(); + inputField.setEditted(true); + } + }); + } + public int addSelf(JPanel content, GBCF cf, int row, boolean overflow) { + content.add(fieldLabel, cf.getCell(row, 0)); + content.add(checkBox, cf.getCell(row, 1)); + if(overflow){ + checkBox.setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); + } + return ++row; + } + + /** + * renderError + */ + public void renderError() { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/CheckboxInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ClasspathHTMLEditorKit.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ClasspathHTMLEditorKit.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ClasspathHTMLEditorKit.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,54 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.net.URL; + +import javax.swing.text.Element; +import javax.swing.text.View; +import javax.swing.text.ViewFactory; +import javax.swing.text.html.HTML; +import javax.swing.text.html.HTMLEditorKit; +import javax.swing.text.html.ImageView; +/** + * HTMLEditor kit that replaces the source of images in the document + * with resources loaded from the classpath. + * @author teknopaul + */ +public class ClasspathHTMLEditorKit extends HTMLEditorKit { + + public ViewFactory getViewFactory(){ + + return new HTMLEditorKit.HTMLFactory(){ + + public View create(Element elem){ + if(! elem.getName().equals("img")){ + return super.create(elem); + } + return new ImageView(elem){ + public URL getImageURL() { + String src = (String)getElement().getAttributes(). + getAttribute(HTML.Attribute.SRC); + return TextPageRenderer.class.getResource(src); + } + }; + } + + }; + + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ClasspathHTMLEditorKit.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/CommentOutputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/CommentOutputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/CommentOutputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,115 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Dimension; +import java.awt.Font; + +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.text.JTextComponent; + +import org.tp23.antinstaller.input.CommentOutput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.gui.GBCF; + +public class CommentOutputRenderer + extends SwingOutputFieldRenderer { + + protected AILabel fieldLabel = new AILabel(); + // hack callback, should move this to superclass + protected JTextComponent explanatoryTextField; + + private static Font boldCommentFont; + private static Font titleCommentFont; + static{ + boldCommentFont = new JLabel().getFont();// reusing the variable + try { + boldCommentFont = new Font(boldCommentFont.getFamily(), Font.BOLD, boldCommentFont.getSize()); + titleCommentFont = new Font(boldCommentFont.getFamily(), Font.BOLD, 16); + } + catch (Exception ex) { + // lets not fail due to font errors + } + } + + public CommentOutputRenderer() { + } + + public void initComponent(JPanel parent){ + try { + jbInit(); + } + catch(Exception e) { + e.printStackTrace(); + } + } + + public void setOutputField(OutputField outputField) { + this.outputField = (CommentOutput)outputField;// trap ClassCast bugs early + } + public void updateInputField(){ + } + +// hack callback, should move this to superclass + public JTextComponent getExplanatoryTextField() { + return explanatoryTextField; + } +// hack callback, should move this to superclass + public void setExplanatoryTextField(JTextComponent explanatoryTextField) { + this.explanatoryTextField = explanatoryTextField; + } + /** + * Since comments may now include expanded properties this should be called when the + * field is rendered. For no ONLY comment fields have property values expanded + */ + public void updateDefaultValue(){ + fieldLabel.setText(outputField.getDisplayText()); + if(explanatoryTextField != null) { + explanatoryTextField.setText(outputField.getExplanatoryText()); + } + } + private void jbInit() throws Exception { + + // FindBugs - cast is performed here to avoid overriding protected superclass field + CommentOutput cOutputField = (CommentOutput)outputField; + + fieldLabel.setText(cOutputField.getDisplayText()); + + if( OutputField.isTrue(cOutputField.getBold()) ){ + fieldLabel.setFont(boldCommentFont); + } + if( OutputField.isTrue(cOutputField.getTitle()) ){ + fieldLabel.setFont(titleCommentFont); + } + } + public int addSelf(JPanel content, GBCF cf, int row, boolean overflow) { + content.add(fieldLabel, cf.getSpan(row)); + if(overflow){ + fieldLabel.setOverflow(SizeConstants.OVERFLOW_TOTAL_SIZE); + } else { + fieldLabel.setOverflow(new Dimension(SizeConstants.FIELD_WIDTH + SizeConstants.LABEL_WIDTH, SizeConstants.FIELD_HEIGHT)); + } + return ++row; + } + + + /** + * renderError + */ + public void renderError() { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/CommentOutputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ConditionalFieldRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ConditionalFieldRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ConditionalFieldRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,111 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.util.ArrayList; + +import javax.swing.JPanel; + +import org.tp23.antinstaller.ResourceBundleHelper; +import org.tp23.antinstaller.input.ConditionalField; +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.renderer.RendererFactory; +import org.tp23.antinstaller.runtime.ConfigurationException; +import org.tp23.antinstaller.runtime.logic.Expression; +import org.tp23.gui.GBCF; + +/** + * Conditionally render a collection of fields. + * For now, will ONLY handle <code><hiddeb></code> fields + * + * @author mwilson + * @version $Id + * @since 0.7.4 patch 7 + */ +public class ConditionalFieldRenderer extends SwingOutputFieldRenderer { + + private ResourceBundleHelper resHelper = new ResourceBundleHelper( "org.tp23.antinstaller.renderer.Res" ); + private ConditionalField condField; + private ArrayList renderers = new ArrayList( ); + + public ConditionalFieldRenderer() { + } + + public void initComponent( JPanel parent ) { + + condField = (ConditionalField) outputField; + InputField[] fields = condField.getFields(); + + for (int i = 0; i < fields.length; i++) { + try { + SwingOutputFieldRenderer renderer = RendererFactory.getSwingRenderer(fields[i]); + renderer.setOutputField(fields[i]); + renderer.setInstallerContext(ctx); + renderers.add( renderer ); + } + catch( ClassNotFoundException clsNotFndExc ) { + + } + } + + } + + public void updateInputField() { + + if( expressionIsTrue() ) { + int listSize = renderers.size(); + for( int i = 0; i < listSize; i++ ) { + SwingOutputFieldRenderer renderer = (SwingOutputFieldRenderer) renderers.get( i ); + renderer.updateInputField(); + } + } + + } + + public void updateDefaultValue() { + if( expressionIsTrue() ) { + int listSize = renderers.size(); + for( int i = 0; i < listSize; i++ ) { + SwingOutputFieldRenderer renderer = (SwingOutputFieldRenderer) renderers.get( i ); + renderer.updateDefaultValue(); + } + } + } + + public void renderError() { + int listSize = renderers.size(); + for( int i = 0; i < listSize; i++ ) { + SwingOutputFieldRenderer renderer = (SwingOutputFieldRenderer) renderers.get( i ); + renderer.renderError(); + } + } + + public int addSelf( JPanel content, GBCF cf, int row, boolean overflow ) { + return row; + } + + private boolean expressionIsTrue() { + Expression expr = null; + + try { + expr = condField.getExpression(); + } + catch( ConfigurationException configExc ) { + ctx.log( resHelper.getMessage( "invalid.conditional.expression", configExc ) ); + return false; + } + + return expr.evaluate(); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ConditionalFieldRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ConfirmPasswordTextInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ConfirmPasswordTextInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ConfirmPasswordTextInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,27 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.util.ResourceBundle; + +public class ConfirmPasswordTextInputRenderer extends PasswordTextInputRenderer{ + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + protected String getErrorMessage(){ + return res.getString("passwordsDoNotMatch"); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ConfirmPasswordTextInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/DateInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/DateInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/DateInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,104 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Color; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.util.ResourceBundle; + +import javax.swing.JPanel; + +import org.tp23.antinstaller.input.DateInput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.renderer.MessageRenderer; +import org.tp23.gui.GBCF; + +public class DateInputRenderer + extends SwingOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + protected DateInput inputField; + + protected AILabel fieldLabel = new AILabel(); + protected AITextfield jTextField = new AITextfield(); + protected Color origFore; + + public DateInputRenderer() { + origFore = jTextField.getForeground(); + } + + public void initComponent(JPanel parent){ + try { + jbInit(); + } + catch(Exception e) { + e.printStackTrace(); + } + } + + public void setOutputField(OutputField inputField) { + this.inputField = (DateInput)inputField; + this.inputField.setValue(this.inputField.getDefaultValue()); + } + public void updateInputField(){ + inputField.setValue(jTextField.getText()); + } + public void updateDefaultValue(){ + if(!inputField.isEditted())jTextField.setText(inputField.getDefaultValue()); + } + + private void jbInit() throws Exception { + fieldLabel.setText(inputField.getDisplayText()); + jTextField.setText(inputField.getDefaultValue()); + jTextField.addKeyListener(new KeyAdapter() { + public void keyTyped(KeyEvent e) { + if(e.getKeyChar() != '\t'){ + inputField.setEditted(true); + } + } + }); + jTextField.addFocusListener(new FocusAdapter() { + public void focusLost(FocusEvent fe){ + jTextField.setForeground(origFore); + } + }); + } + public int addSelf(JPanel content, GBCF cf, int row,boolean overflow) { + content.add(fieldLabel, cf.getCell(row, 0)); + content.add(jTextField, cf.getCell(row, 1)); + if(overflow){ + jTextField.setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); + } + return ++row; + } + + + /** + * renderError + */ + public void renderError() { + MessageRenderer mr = ctx.getMessageRenderer(); + mr.printMessage(res.getString("notCorrectFormat") + "\n\n " + inputField.getDateFormat()); + //fixed BUG1295944 mr.printMessage("The field is not of the correct format\n\n "+inputField.getDateFormat()); + this.jTextField.requestFocus(); + this.jTextField.setForeground(Color.red); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/DateInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/DirectoryInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/DirectoryInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/DirectoryInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,143 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; +import java.util.ResourceBundle; + +import javax.swing.JFileChooser; +import javax.swing.JPanel; + +import org.tp23.antinstaller.input.DirectoryInput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.gui.GBCF; +import org.tp23.gui.widget.DefaultingDirectoryChooser; + +public class DirectoryInputRenderer + extends SwingOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + private static final String EMPTY_STRING = ""; + protected DirectoryInput inputField; + private boolean createMode; + private DefaultingDirectoryChooser chooser = null; + + protected AILabel fieldLabel = new AILabel(); + protected AIShortTextField jTextField = new AIShortTextField(); + protected AIButton browseButton = new AIButton(); + protected JPanel browsePanel = new JPanel(); + private JPanel parent; + + public DirectoryInputRenderer() { + } + public void initComponent(JPanel parent){ + this.parent = parent; + try { + jbInit(); + } + catch(Exception e) { + e.printStackTrace(); + } + } + + public void setOutputField(OutputField inputField) { + this.inputField = (DirectoryInput)inputField; + this.inputField.setValue(this.inputField.getDefaultValue(true)); + this.createMode = OutputField.isTrue(this.inputField.getCreate()); + + } + public void updateInputField(){ + if( !inputField.getDefaultValue(true).equals(jTextField.getText()) ){ + inputField.setEditted(true); + } + inputField.setValue(jTextField.getText()); + } + public void updateDefaultValue(){ + if(!inputField.isEditted())jTextField.setText(inputField.getDefaultValue(true)); + } + + private void jbInit() throws Exception { + BorderLayout bl = new BorderLayout(); + //bl.setHgap(3); + browsePanel.setLayout(bl); + fieldLabel.setText(inputField.getDisplayText()); + jTextField.setText(inputField.getDefaultValue(true)); + browsePanel.add(jTextField, BorderLayout.CENTER); + browsePanel.add(browseButton, BorderLayout.EAST); + browseButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + File selectedFile = null; + if(chooser==null){ + chooser = new DefaultingDirectoryChooser(createMode); + chooser.setFileHidingEnabled(false); + } + + //PR 1468823 - if input is cleared, dialogue won't be displayed + String dirPath = jTextField.getText(); + if( dirPath == null ) { + dirPath = EMPTY_STRING; + } + dirPath = dirPath.trim(); + + if( dirPath.length() == 0 ) { + dirPath = inputField.getDefaultValue(true); + jTextField.setText(dirPath); + } + chooser.setDefaultDirectory(new File(dirPath)); + + int returnVal = chooser.showDialog(parent, e.getActionCommand()); + if (returnVal == JFileChooser.APPROVE_OPTION) { + selectedFile = chooser.getSelectedFile(); + } + if (selectedFile != null) { + jTextField.setText(selectedFile.getAbsolutePath()); + inputField.setValue(selectedFile.getAbsolutePath()); + inputField.setEditted(true); + } + } + }); + browseButton.setText(res.getString("selectFolder")); + browseButton.setPreferredSize(new Dimension(150, SizeConstants.FIELD_HEIGHT)); + + jTextField.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + updateInputField(); + } + }); + + } + public int addSelf(JPanel content,GBCF cf, int row,boolean overflow) { + content.add(fieldLabel,cf.getCell(row,0)); + content.add(browsePanel,cf.getCell(row,1)); + if(overflow){ + jTextField.setOverflow(SizeConstants.OVERFLOW_SHORT_FIELD_SIZE); + } + return ++row; + } + + + /** + * renderError + */ + public void renderError() { + jTextField.requestFocus(); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/DirectoryInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ExtValidatedTextInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ExtValidatedTextInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ExtValidatedTextInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,40 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Color; + +import org.tp23.antinstaller.input.ExtValidatedTextInput; +import org.tp23.antinstaller.input.Validator; +import org.tp23.antinstaller.renderer.MessageRenderer; + +public class ExtValidatedTextInputRenderer + extends ValidatedTextInputRenderer { + + /** + * renderError + */ + public void renderError() { + MessageRenderer mr = ctx.getMessageRenderer(); + ExtValidatedTextInput extVal = (ExtValidatedTextInput)inputField; + Validator validator = extVal.getValidator(); + Throwable t = extVal.getThrowable(); + mr.printMessage(validator.getErrorMessage(t, null)); + this.jTextField.requestFocus(); + this.jTextField.setForeground(Color.red); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ExtValidatedTextInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/FileInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/FileInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/FileInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,139 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.io.File; +import java.util.ResourceBundle; + +import javax.swing.JFileChooser; +import javax.swing.JPanel; + +import org.tp23.antinstaller.input.FileInput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.renderer.MessageRenderer; +import org.tp23.gui.GBCF; + +public class FileInputRenderer + extends SwingOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + protected FileInput inputField; + + protected AILabel fieldLabel = new AILabel(); + protected AIShortTextField jTextField = new AIShortTextField(); + protected AIButton browseButton = new AIButton(); + protected JPanel browsePanel = new JPanel(); + private Color origFore = jTextField.getForeground(); + private JPanel parent; + + public FileInputRenderer() { + } + public void initComponent(JPanel parent){ + this.parent=parent; + try { + jbInit(); + } + catch(Exception e) { + e.printStackTrace(); + } + } + + public void setOutputField(OutputField inputField) { + this.inputField = (FileInput)inputField; + this.inputField.setValue(this.inputField.getDefaultValue(true)); + } + public void updateInputField(){ + if( !inputField.getDefaultValue(true).equals(jTextField.getText()) ){ + inputField.setEditted(true); + } + inputField.setValue(jTextField.getText()); + } + public void updateDefaultValue(){ + if(!inputField.isEditted())jTextField.setText(inputField.getDefaultValue(true)); + } + + private void jbInit() throws Exception { + BorderLayout bl = new BorderLayout(); + //bl.setHgap(3); + browsePanel.setLayout(bl); + fieldLabel.setText(inputField.getDisplayText()); + jTextField.setText(inputField.getDefaultValue(true)); + browsePanel.add(jTextField, BorderLayout.CENTER); + browsePanel.add(browseButton, BorderLayout.EAST); + browseButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + File selectedFile = null; + + JFileChooser chooser = new JFileChooser(); + chooser.setFileHidingEnabled(false); + chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); + if (jTextField.getText() != null) { + chooser.setCurrentDirectory(new File(jTextField.getText()).getParentFile()); + } + int returnVal = chooser.showDialog(parent, e.getActionCommand()); + if (returnVal == JFileChooser.APPROVE_OPTION) { + selectedFile = chooser.getSelectedFile(); + } + if (selectedFile != null) { + jTextField.setText(selectedFile.getAbsolutePath()); + inputField.setValue(selectedFile.getAbsolutePath()); + inputField.setEditted(true); + } + } + }); + browseButton.setText(res.getString("selectFile")); + browseButton.setPreferredSize(new Dimension(150, SizeConstants.FIELD_HEIGHT)); + + jTextField.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + updateInputField(); + } + }); + jTextField.addFocusListener(new FocusAdapter() { + public void focusLost(FocusEvent fe){ + jTextField.setForeground(origFore); + } + }); + + } + public int addSelf(JPanel content,GBCF cf, int row,boolean overflow) { + content.add(fieldLabel,cf.getCell(row,0)); + content.add(browsePanel,cf.getCell(row,1)); + if(overflow){ + jTextField.setOverflow(SizeConstants.OVERFLOW_SHORT_FIELD_SIZE); + } + return ++row; + } + + + /** + * renderError + */ + public void renderError() { + MessageRenderer mr = ctx.getMessageRenderer(); + mr.printMessage(res.getString("fileNotExist")); + this.jTextField.requestFocus(); + this.jTextField.setForeground(Color.red); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/FileInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/HiddenPropertyInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/HiddenPropertyInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/HiddenPropertyInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,66 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import javax.swing.JPanel; + +import org.tp23.antinstaller.input.HiddenPropertyInput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.gui.GBCF; + +/** + * Swing UI hidden property renderer - displays nothing + * + * @author mwilson + * @version $Id + * @since 0.7.4 patch 6 + */ +public class HiddenPropertyInputRenderer extends SwingOutputFieldRenderer +{ + HiddenPropertyInput inputField; + + public void setOutputField( OutputField ioField ) + { + inputField = (HiddenPropertyInput) ioField; + inputField.setInputResult( inputField.getDefaultValue() ); + } + + public void initComponent( JPanel parent ) + { + + } + + public void updateInputField() + { + + } + + public void updateDefaultValue() + { + if( !inputField.isEditted() ) + { + inputField.setInputResult( inputField.getDefaultValue() ); + } + } + + public void renderError() + { + + } + + public int addSelf( JPanel content, GBCF cf, int row, boolean overflow ) + { + return row; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/HiddenPropertyInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/LargeSelectInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/LargeSelectInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/LargeSelectInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,116 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.util.ResourceBundle; + +import javax.swing.JComboBox; +import javax.swing.JLabel; +import javax.swing.JPanel; + +import org.tp23.antinstaller.input.LargeSelectInput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.gui.GBCF; + +public class LargeSelectInputRenderer + extends SwingOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + protected LargeSelectInput inputField; + + protected JLabel fieldLabel = new AILabel(); + protected JComboBox optionCombo = new JComboBox(); + + //private int numOfEntries = 2; + + public LargeSelectInputRenderer() { + } + public void initComponent(JPanel parent){ + try { + jbInit(); + } + catch(Exception e) { + e.printStackTrace(); + } + } + + + + public void setOutputField(OutputField inputField) { + this.inputField=(LargeSelectInput)inputField; + //this.numOfEntries=this.inputField.getOptions().length; + } + public void updateInputField(){ + + int selectedIdx = optionCombo.getSelectedIndex(); + if (selectedIdx != -1) { + inputField.setValue(inputField.getOptions()[selectedIdx].value); + + }else{ + inputField.setValue(inputField.getDefaultValue()); + } + } + public void updateDefaultValue(){ + if(!inputField.isEditted()){ + + String newDefault = inputField.getDefaultValue(); + + for(int i=0;i<optionCombo.getItemCount();i++){ + if(newDefault.equals(inputField.getOptions()[i].value)){ + optionCombo.setSelectedIndex(i); + break; + } + } + } + } + + private void jbInit() throws Exception { + fieldLabel.setText(inputField.getDisplayText()); + LargeSelectInput.Option[] options = inputField.getOptions(); + + + for (int i = 0; i < options.length; i++) { + optionCombo.addItem(options[i].getText()); + if(options[i].value.equals(inputField.getDefaultValue())){ + optionCombo.setSelectedIndex(i); + } + } + optionCombo.addItemListener(new ItemListener(){ + public void itemStateChanged(ItemEvent e) { + inputField.setEditted(true); + } + }); + } + public int addSelf(JPanel content,GBCF cf, int row,boolean overflow) { + content.add(fieldLabel,cf.getCell(row,0)); + content.add(optionCombo,cf.getCell(row,1)); + if(overflow){ + optionCombo.setPreferredSize(SizeConstants.OVERFLOW_FIELD_SIZE); + } + return ++row; + } + + /** + * renderError + */ + public void renderError() { + ctx.getMessageRenderer().printMessage(res.getString("notValidSelection")); + optionCombo.requestFocus(); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/LargeSelectInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/LicensePageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/LicensePageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/LicensePageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,103 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.BorderLayout; +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ResourceBundle; + +import javax.swing.BorderFactory; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; + +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.page.LicensePage; +import org.tp23.antinstaller.runtime.ConfigurationException; + +/** + * + * <p>Renders the license page </p> + * <p> </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> +* @todo this could be an input type and simple renderer + * @author Paul Hinds + * @version $Id: LicensePageRenderer.java,v 1.5 2007/01/12 10:49:09 anothermwilson Exp $ + */ +public class LicensePageRenderer + extends SwingPageRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + private JTextArea licenseTextArea = new JTextArea(); + private JScrollPane scrollPane = new JScrollPane(); + + public LicensePageRenderer(){ + } + + public boolean validateFields()throws ValidationException{ + return true; // @todo option to force accepting or tick box to accept + } + + public void instanceInit() throws Exception { + String resource = ((LicensePage)page).getResource(); + InputStream licensein = this.getClass().getResourceAsStream(resource); + if (licensein == null) { + throw new ConfigurationException("License resource '" + resource + "' is missing from installer"); + } + BufferedReader reader = new BufferedReader(new InputStreamReader(licensein)); + StringBuffer sb = new StringBuffer(); + String line; + while((line = reader.readLine()) != null){ + sb.append(line); + sb.append('\n'); + } + + licenseTextArea.setText(sb.toString()); + licenseTextArea.setTabSize(4); + licenseTextArea.setAutoscrolls(true); + licenseTextArea.setCaretPosition(0); + licenseTextArea.setEditable(false); + licenseTextArea.setLineWrap(true); + licenseTextArea.setWrapStyleWord(true); + licenseTextArea.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); + scrollPane.getViewport().add(licenseTextArea); + scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); + scrollPane.setBorder(BorderFactory.createCompoundBorder( + BorderFactory.createEmptyBorder(4, 4, 4, 4), + BorderFactory.createEtchedBorder())); + this.add(scrollPane, BorderLayout.CENTER); + + getNextButton().setText( res.getString( "license.next.text" ) ); + getNextButton().setIcon(getImage("/resources/icons/ok.png")); + getCancelButton().setText( res.getString( "license.cancel.text" ) ); + + } + + public void updateInputFields(){ + ; + } + + + + /** + * updateDefaultValues + */ + public void updateDefaultValues() { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/LicensePageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/PageCompletionListener.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/PageCompletionListener.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/PageCompletionListener.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,33 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import org.tp23.antinstaller.page.Page; +/** + * + * <p>Called when a page is complete and the user presses next. +* At this point the pages fields are validated. If validation passes +* the next page is shown </p> + * <p> </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: PageCompletionListener.java,v 1.1.1.1 2005/10/18 18:21:01 teknopaul Exp $ + */ +public interface PageCompletionListener { + public void pageComplete(Page page); + public void pageBack(Page page); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/PageCompletionListener.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/PasswordTextInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/PasswordTextInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/PasswordTextInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,66 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Color; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.util.ResourceBundle; + +import javax.swing.JPanel; + +import org.tp23.antinstaller.renderer.MessageRenderer; +import org.tp23.gui.GBCF; + +public class PasswordTextInputRenderer extends ValidatedTextInputRenderer{ + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + public PasswordTextInputRenderer() { + this.jTextField = new AIPasswordField(); + origFore = jTextField.getForeground(); // this is lazy there must be a way to shift this line of code to the superclass (is it worth it) + } + + + public void renderError() { + MessageRenderer mr = ctx.getMessageRenderer(); + mr.printMessage( getErrorMessage() ); + // fixed BUG:1295944 mr.printMessage("The password is not of the correct format\n\n e.g. "+inputField.getDefaultValue()); + this.jTextField.requestFocus(); + this.jTextField.setForeground(Color.red); + jTextField.addKeyListener(new KeyAdapter() { + public void keyTyped(KeyEvent e) { + if(e.getKeyChar() != '\t'){ + inputField.setEditted(true); + } + } + }); + } + public int addSelf(JPanel content, GBCF cf, int row, boolean overflow) { + content.add(fieldLabel, cf.getCell(row, 0)); + content.add(jTextField, cf.getCell(row, 1)); + if(overflow){ + ((AIPasswordField)jTextField).setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); + } + return ++row; + } + protected String getErrorMessage(){ + return res.getString("notCorrectPasswordFormat") + + "\n\n e.g. " + + inputField.getDefaultValue(); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/PasswordTextInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ProgressPageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ProgressPageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ProgressPageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,196 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Insets; +import java.awt.Rectangle; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import javax.swing.BorderFactory; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTabbedPane; +import javax.swing.JToggleButton; + +import org.tp23.antinstaller.page.ProgressPage; +import org.tp23.antinstaller.renderer.AntOutputRenderer; +import org.tp23.gui.widget.SystemOutJTextArea; +/** + * + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @todo change absolute to Border layout and panels + * @author Paul Hinds + * @version $Id: ProgressPageRenderer.java,v 1.4 2006/12/21 00:03:00 teknopaul Exp $ + */ +public class ProgressPageRenderer + extends SwingPageRenderer + implements AntOutputRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + private static final int MESSAGE_PANEL_HEIGHT = 30; + + private JPanel contentPanel = new JPanel(); + + private JTabbedPane jTabbedPane = new JTabbedPane(); + private JPanel messagesPanel = new JPanel(); + private BorderLayout borderLayout1 = new BorderLayout(); + private JToggleButton jToggleButton = new JToggleButton(); + private JLabel feedBackLabel = new JLabel(); + + private SystemOutJTextArea outPanel = new SystemOutJTextArea(); + private SystemOutJTextArea errPanel = new SystemOutJTextArea(); + + private boolean showTargets = true; + private JScrollPane progressScrollPane = new JScrollPane();; + private ProgressPanel progressPanel; + + public ProgressPageRenderer() { + errPanel.setAsSystemErr(); + outPanel.setAsSystemOut(); + } + /** + * getErr + * @return PrintStream + */ + public PrintStream getErr() { + return errPanel.getOut(); + } + /** + * getOut + * @return PrintStream + */ + public PrintStream getOut() { + return outPanel.getOut(); + } + + + /** + * instanceInit + */ + public void instanceInit() { + showTargets = ((ProgressPage)page).isShowTargets(); + contentPanel.setLayout(borderLayout1); + this.add(contentPanel,BorderLayout.CENTER); + + //progressScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); + + messagesPanel.setLayout(null); + Dimension messPanelSize = new Dimension(SizeConstants.PAGE_WIDTH,MESSAGE_PANEL_HEIGHT); + messagesPanel.setSize(messPanelSize); + messagesPanel.setPreferredSize(messPanelSize); + messagesPanel.setMaximumSize(messPanelSize); + messagesPanel.setMinimumSize(messPanelSize); + + //FIXME not i18n properly since the sentence is not correct ordering in German + feedBackLabel.setText(res.getString("click")+" "+ctx.getInstaller().getFinishButtonText()+" "+res.getString("toContinue")); + feedBackLabel.setBounds(new Rectangle(115, 7, 272, 22)); + jToggleButton.setText(res.getString("showDetails")); + jToggleButton.setBounds(new Rectangle(5, 7, 104, 22)); + jToggleButton.setMargin(new Insets(0,0,0,0)); + messagesPanel.add(jToggleButton, null); + messagesPanel.add(feedBackLabel, null); + jToggleButton.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e) { + if(jToggleButton.isSelected()){ + if(showTargets){ + contentPanel.remove(progressScrollPane); + } + contentPanel.add(jTabbedPane, BorderLayout.CENTER); + contentPanel.doLayout(); + contentPanel.repaint(); + } + else { + contentPanel.remove(jTabbedPane); + if(showTargets){ + contentPanel.add(progressScrollPane, BorderLayout.CENTER); + progressScrollPane.revalidate(); + } + contentPanel.doLayout(); + contentPanel.repaint(); + } + } + }); + jToggleButton.setIcon(getImage("/resources/icons/showdetails.png")); + contentPanel.add(messagesPanel, BorderLayout.NORTH); + + if(showTargets){ + progressScrollPane.setBorder(BorderFactory.createEmptyBorder(10,5,5,5)); + contentPanel.add(progressScrollPane, BorderLayout.CENTER); + } + jTabbedPane.add(res.getString("output"), outPanel); + jTabbedPane.add(res.getString("errors"), errPanel); +// if(OutputField.isTrue( ctx.getInstaller().getAntialiased())){ +// outPanel.setAntialiased(true); +// errPanel.setAntialiased(true); +// } + + //jTabbedPane.setVisible(false); + jTabbedPane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); + contentPanel.setMaximumSize(new Dimension(SizeConstants.PAGE_WIDTH, Integer.MAX_VALUE)); + contentPanel.setMinimumSize(new Dimension(SizeConstants.PAGE_WIDTH, 100)); + contentPanel.setPreferredSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.PAGE_HEIGHT-100)); + //contentPanel.add(jTabbedPane, null); + //jTabbedPane.setBounds(new Rectangle(4, MESSAGE_PANEL_HEIGHT, PAGE_WIDTH-12, 214)); + + this.getNextButton().setEnabled(false); + this.getFinishButton().setText(ctx.getInstaller().getFinishButtonText()); + this.getFinishButton().setEnabled(true); + } + + public void setContext(SwingInstallerContext swingCtx){ + super.setContext(swingCtx); + if(showTargets){ + progressPanel = new ProgressPanel(swingCtx.getInstallerContext()); + progressScrollPane.getViewport().add(progressPanel); + this.swingCtx.setProgressPanel(progressPanel); + } + this.swingCtx.setFeedBackLabel(feedBackLabel); + } + + + /** + * updateInputFields + */ + public void updateInputFields() { + + } + + + + /** + * validateFields + * + * @return boolean + */ + public boolean validateFields() { + return true; + } + + + + /** + * updateDefaultValues + */ + public void updateDefaultValues() { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ProgressPageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ProgressPanel.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ProgressPanel.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ProgressPanel.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,279 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import javax.swing.JPanel; +import javax.swing.Scrollable; + +import org.apache.tools.ant.BuildEvent; +import org.apache.tools.ant.Target; +import org.tp23.antinstaller.InstallerContext; + + +/** + * Progress panel prints a graphical view of the progress of the Ant targets + * being run. It supports displaying one layer of dependent targets. + * @author Paul Hinds + * @version $Id: ProgressPanel.java,v 1.5 2006/12/21 00:02:59 teknopaul Exp $ + */ +public class ProgressPanel extends JPanel implements Scrollable{ + + public static final int tHeight = 19; + public static final int leftIndent = 15; + public static final int DONE = 0; + public static final int INPROGRESS = 1; + public static final int TODO = 2; + private static final Color progressColor = new Color(0, 125, 0); + private static final Font mainFont = new Font("Dialog", Font.PLAIN, 11); + private static final Font subFont = new Font("Dialog", Font.PLAIN, 10); + List targets = null; + + private final InstallerContext ctx; + private int mainTargetPos = 0; + private ProgressModel currentPM = null; + + public ProgressPanel(InstallerContext ctx) { + super(true); + this.ctx = ctx; + } + + public synchronized void prepareCalledTargets(){ + List targetStrings = ctx.getInstaller().getTargets(ctx); + Iterator iter = targetStrings.iterator(); + targets = new ArrayList(); + while (iter.hasNext()) { + String tgt = (String) iter.next(); + targets.add(new ProgressModel(tgt)); + } + this.setSize(getSize());// panel size changes + revalidate(); + repaint(); + } + /** + * This method assumes that we are send target started methods in order + * but that we do not have the information about "depends" targets and have to + * insert the information as it arrives. If a TargetStarted event arrives that + * is not the expected target is is assumed to be a depends. + * @param buildEvent + */ + public synchronized void targetStarted(BuildEvent buildEvent){ + try { + Target tgt = buildEvent.getTarget(); + ProgressModel pm = (ProgressModel)targets.get(mainTargetPos); + pm.state = INPROGRESS; + if(tgt.getName().equals(pm.name)){ + // main target + currentPM = pm; + mainTargetPos++; + revalidate(); + repaint(); + } + else { + //dependency + ProgressModel dependency = new ProgressModel(tgt.getName()); + dependency.state = INPROGRESS; + if(currentPM != null){ + currentPM.state = DONE;// this to catch antcall strangenesses + } + currentPM = dependency; + pm.subTargets.add(dependency); + this.setSize(getSize());// panel size changes + revalidate(); + repaint(); + } + } + catch (Exception e) { + ctx.log(e); + } + } + public synchronized void targetFinished() { + // BUG 1494105 reports NPE here, looks like no targets specified in his antinstaller-config.xml + currentPM.state = DONE; + } + + /** + * N.B. buildFinished must be fired manually in Ant + */ + public synchronized void buildFinished() { + // this is done because antcall sometimes results in targetFinished not being called + setToDone(targets); + repaint(); + } + + private void setToDone(List pModels){ + if(pModels == null || pModels.size() == 0){ + return; + } + Iterator iter = pModels.iterator(); + while (iter.hasNext()) { + ProgressModel pm = (ProgressModel)iter.next(); + pm.state = DONE; + setToDone(pm.subTargets); + } + } + /** + */ + public synchronized void paintComponent(Graphics g){ + super.paintComponent(g); + if(targets == null){ + return; + } +// g.setColor(getBackground()); +// g.fillRect(g.getClipBounds().x, +// g.getClipBounds().y, +// g.getClipBounds().width, +// g.getClipBounds().height); + Iterator iter = targets.iterator(); + int offset = 0; + for(int i = 1; iter.hasNext(); i++){ + ProgressModel pmodel = (ProgressModel)iter.next(); + drawTarget(pmodel, (Graphics2D)g, offset, i < targets.size(), i > 1); + offset += tHeight; + offset += pmodel.subTargets.size() * tHeight; + } + } + + public synchronized Dimension getPreferredSize(){ + return getSize(); + } + /** + * @see java.awt.Component#getSize() + */ + public synchronized Dimension getSize() { + if(targets == null){ + return new Dimension(SizeConstants.PAGE_WIDTH, tHeight * 5); + } + int count = targets.size(); + Iterator iter = targets.iterator(); + while(iter.hasNext()){ + ProgressModel pmodel = (ProgressModel)iter.next(); + count += pmodel.subTargets.size(); + } + return new Dimension(SizeConstants.PAGE_WIDTH, count * tHeight); + } + /** + * + * @param target the main target to be rendered + * @param g + * @param yOffset the vertical offset where this target should be drawn + * @param hasMore if false this target is the last in the list + * @param hasPrev if false this target is the first in the list + */ + private void drawTarget(ProgressModel target, Graphics2D g, + int yOffset, boolean hasMore, boolean hasPrev){ + g.setFont(mainFont); + g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g.setColor(Color.gray); + //7 vertical line (up) + if(hasPrev){ + g.drawLine(leftIndent + 8, yOffset, leftIndent + 8, yOffset + 8); + } + //7 vertical line (down) + if(hasMore || target.subTargets.size() > 0){ + g.drawLine(leftIndent + 8, (tHeight/2) + yOffset, + leftIndent + 8, tHeight + yOffset); + } + // sideways line + int xOffset = 0; + g.drawLine(leftIndent + 8, 8 + yOffset, leftIndent + xOffset + 20, 8 + yOffset); + if(target.state == DONE){ + g.setColor(Color.darkGray); + } + if(target.state == INPROGRESS){ + g.setColor(progressColor); + } + if(target.state == TODO){ + g.setColor(Color.gray); + } + g.fillRoundRect(leftIndent + xOffset + 3, yOffset + 4, 11, 9, 7, 7); + g.setColor(Color.black); + g.drawString(target.name, leftIndent + xOffset + 22, 13 + yOffset); + if(target.subTargets.size() > 0){ + Iterator iter = target.subTargets.iterator(); + for(int i = 1; iter.hasNext(); i++){ + drawSubTarget((ProgressModel)iter.next(), g, + yOffset += tHeight, hasMore | i < target.subTargets.size()); + } + } + } + private void drawSubTarget(ProgressModel target, Graphics2D g, + int yOffset, boolean hasMore){ + g.setFont(subFont); + g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g.setColor(Color.gray); + //7 vertical line (up) + g.drawLine(leftIndent + 8, yOffset, leftIndent + 8, yOffset + 8); + //7 vertical line (down) + if(hasMore){ + g.drawLine(leftIndent + 8, (tHeight/2) + yOffset, leftIndent + 8, tHeight + yOffset); + } + int xOffset = 15; + // sideways line + g.drawLine(leftIndent + 8, 8 + yOffset, leftIndent + xOffset + 4, 8 + yOffset); + if(target.state == DONE){ + g.setColor(Color.darkGray); + } + if(target.state == INPROGRESS){ + g.setColor(progressColor); + } + if(target.state == TODO){ + g.setColor(Color.gray); + } + g.fillRoundRect(leftIndent + xOffset + 4, yOffset + 5, 9, 7, 7, 7); + g.setColor(Color.black); + g.drawString(target.name, leftIndent + xOffset + 15, 12 + yOffset); + } + + public synchronized Dimension getPreferredScrollableViewportSize(){ + return getPreferredSize(); + } + public synchronized int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction){ + return tHeight; + } + public synchronized int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction){ + return tHeight * 3; + } + public synchronized boolean getScrollableTracksViewportWidth(){ + return true; + } + public synchronized boolean getScrollableTracksViewportHeight(){ + return false; + } + public static class ProgressModel{ + int state = TODO; + String name; + List subTargets = new ArrayList(); + + public ProgressModel(String name){ + this.name = name; + } + + int getHeight(){ + return tHeight + subTargets.size() * tHeight; + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ProgressPanel.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SelectInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SelectInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SelectInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,138 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.util.Enumeration; +import java.util.ResourceBundle; + +import javax.swing.ButtonGroup; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JRadioButton; + +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.SelectInput; +import org.tp23.gui.GBCF; + +public class SelectInputRenderer + extends SwingOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + protected SelectInput inputField; + + protected JLabel fieldLabel = new AILabel(); + protected ButtonGroup optionGroup = new ButtonGroup(); + + public SelectInputRenderer() { + } + public void initComponent(JPanel parent){ + try { + jbInit(); + } + catch(Exception e) { + ctx.log(e.getMessage()); + if(ctx.getInstaller().isVerbose()) { + ctx.log(e); + } + } + } + + + + public void setOutputField(OutputField inputField) { + this.inputField = (SelectInput)inputField; + } + public void updateInputField(){ + Enumeration enumumeration = optionGroup.getElements(); + int i = 0; + for(; enumumeration.hasMoreElements(); i++){ + JRadioButton o = (JRadioButton)enumumeration.nextElement(); + if(o.isSelected()) { + inputField.setValue(inputField.getOptions()[i].value); + break; + } + } + if(i > inputField.getOptions().length) { + inputField.setValue(inputField.getDefaultValue()); + } + } + public void updateDefaultValue() { + if(!inputField.isEditted()) { + String newDefault = inputField.getDefaultValue(); + Enumeration enumeration = optionGroup.getElements(); + for(int i = 0; enumeration.hasMoreElements(); i++){ + if(newDefault.equals(inputField.getOptions()[i].value)) { + JRadioButton jrb = (JRadioButton) enumeration.nextElement(); + jrb.setSelected(true); + // @todo should break? + } else { + enumeration.nextElement(); + } + } + } + } + + private void jbInit() throws Exception { + fieldLabel.setText(inputField.getDisplayText()); + SelectInput.Option[] options = inputField.getOptions(); + + for (int i = 0; i < options.length; i++) { + JRadioButton jrb = new AIRadioButton(options[i].getText()); + optionGroup.add(jrb); + if(options[i].value.equals(inputField.getDefaultValue())){ + jrb.setSelected(true); + } + jrb.addItemListener(new ItemListener(){ + public void itemStateChanged(ItemEvent e) { + inputField.setEditted(true); + } + }); + } + } + public int addSelf(JPanel content,GBCF cf, int row,boolean overflow) { + content.add(fieldLabel,cf.getCell(row, 0)); + Enumeration enumeration = optionGroup.getElements(); + // there should be at least two + enumeration.hasMoreElements(); + AIRadioButton jrb = (AIRadioButton)enumeration.nextElement(); + content.add(jrb,cf.getCell(row++, 1)); + if(overflow) { + jrb.setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); + } + JPanel empty = new JPanel(); + while(enumeration.hasMoreElements()){ + jrb = (AIRadioButton)enumeration.nextElement(); + content.add(empty,cf.getCell(row, 0)); + content.add(jrb,cf.getCell(row++, 1)); + if(overflow) { + jrb.setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); + } + } + return row; + } + + /** + * renderError + */ + public void renderError() { + ctx.getMessageRenderer().printMessage(res.getString("notValidSelection")); + // fixed BUG:1295944 ctx.getMessageRenderer().printMessage("Not a valid selection"); + //optionGroup.requestFocus(); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SelectInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SimpleInputPageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SimpleInputPageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SimpleInputPageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,170 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.util.ArrayList; + +import javax.swing.BorderFactory; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; + +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.input.CommentOutput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.page.SimpleInputPage; +import org.tp23.antinstaller.renderer.RendererFactory; +import org.tp23.gui.GBCF; + +/** + * + * <p>This PageRenderer just renders a list of SwingInputRenderers using +* a BoxLayout </p> + * <p> </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: SimpleInputPageRenderer.java,v 1.6 2006/12/27 21:46:35 teknopaul Exp $ + */ +public class SimpleInputPageRenderer + extends SwingPageRenderer { + + //Prevent displayText and explanatoryText being rendered using different fonts + private static final Font defaultFont = new JLabel().getFont(); + + private JPanel contentPanel = new JPanel(); + + private GridBagLayout gridLayout = new GridBagLayout(); + private GBCF cf = new GBCF(); // GridBagConstraintsFactory + private boolean overflow = false; + // used in overflow + JScrollPane scroller = null; + + + private ArrayList renderers = new ArrayList(); + + public SimpleInputPageRenderer(){ + } + + public boolean validateFields() throws ValidationException { + OutputField[] fields = page.getOutputField(); + for (int i = 0; i < fields.length; i++) { + if(!fields[i].validate(ctx)){ + SwingOutputFieldRenderer renderer = (SwingOutputFieldRenderer)renderers.get(i); + renderer.renderError(); + return false; + } + } + return true; + } + public void updateInputFields(){ + for (int i = 0; i < renderers.size(); i++) { + ((SwingOutputFieldRenderer)renderers.get(i)).updateInputField(); + } + } + + public void updateDefaultValues(){ + for (int i = 0; i < renderers.size(); i++) { + ((SwingOutputFieldRenderer)renderers.get(i)).updateDefaultValue(); + } + } + + public void instanceInit() throws Exception { + overflow = ((SimpleInputPage)page).isOverflow(); + if(overflow){ + //WARNING this causes flickering in the UI + contentPanel.setMaximumSize(new Dimension(SizeConstants.PAGE_WIDTH - 50, SizeConstants.PAGE_HEIGHT)); + scroller = new JScrollPane(); + scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); + scroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); + scroller.setBorder(BorderFactory.createCompoundBorder( + BorderFactory.createEmptyBorder(4,4,4,4), + BorderFactory.createEtchedBorder() + )); + add(scroller, BorderLayout.CENTER); + scroller.getViewport().add(contentPanel); + //contentPanel.setBackground(Color.red); + } + else { + this.add(contentPanel, BorderLayout.CENTER); + contentPanel.setBorder(BorderFactory.createEmptyBorder(SizeConstants.TOP_INDENT, 4, 4, 4)); + } + + OutputField[] fields = page.getOutputField(); + contentPanel.setDoubleBuffered(true); + contentPanel.setLayout(gridLayout); + int row = 0; + for (int i = 0; i < fields.length; i++) { + SwingOutputFieldRenderer renderer = RendererFactory.getSwingRenderer(fields[i]); + String text = fields[i].getExplanatoryText(); + if(fields[i].getExplanatoryText() != null){ + JTextArea area = new DisplayTextArea(contentPanel.getBackground(), contentPanel.getForeground()); + area.setIgnoreRepaint(true); + area.setFont( defaultFont ); + area.setText(text); + contentPanel.add(area, cf.getSpan(row++)); + if(fields[i] instanceof CommentOutput){ + CommentOutputRenderer crenderer = (CommentOutputRenderer)renderer; + crenderer.setExplanatoryTextField(area); + if(fields[i].getDisplayText() == null){ + continue; + } + } + } + renderer.setOutputField(fields[i]); + renderer.setInstallerContext(ctx); + renderer.initComponent(contentPanel); + row = renderer.addSelf(contentPanel, cf, row, overflow); + renderers.add(renderer); + } + contentPanel.add(new JPanel(), cf.getVertGlue(row++)); + } +} +/** + * A JTextArea that is not editable and looks like a JLabel but uses + * JTextAreas ability to wrap. Also has a fixed prefered width; + * @author Paul Hinds + * @version $Id: SimpleInputPageRenderer.java,v 1.6 2006/12/27 21:46:35 teknopaul Exp $ + */ +class DisplayTextArea extends JTextArea{ + DisplayTextArea(Color back, Color fore){ + super(); + this.setBackground(back); + this.setForeground(fore); + this.setLineWrap(true); + this.setWrapStyleWord(true); + this.setEditable(false); + this.setSelectionColor(back); + this.setSelectionColor(back); + this.setMargin(new Insets(5,0,0,0)); + } + + public Dimension getPreferredSize(){ + Dimension pref = super.getPreferredSize(); + return new Dimension(SizeConstants.PAGE_WIDTH - 40, pref.height); + } + public Dimension getMinimumSize(){ + Dimension pref = super.getMinimumSize(); + return new Dimension(SizeConstants.PAGE_WIDTH - 40, pref.height); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SimpleInputPageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SizeConstants.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SizeConstants.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SizeConstants.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,48 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Dimension; +/** + * Extracted contants with aim of making these variables configurable + * @author teknopaul + */ +public class SizeConstants { + + // Page size constants + public static int PAGE_WIDTH = 472; // orig value 472 + public static int PAGE_HEIGHT = 400;// orig value 400 + public static int LABEL_WIDTH = 175;// orig value 175 + + public static int TITLE_IMAGE_HEIGHT = 100; + public static int TITLE_PANEL_HEIGHT = 75; // suspect this is irrelevant + + // Field size constants + public static int LEFT_INDENT = 15; + public static int TOP_INDENT = 8; + public static int BUTTON_WIDTH = 90; // file and directory chooser + public static int FIELD_HEIGHT = 20;// field Y + public static int FIELD_WIDTH = SizeConstants.PAGE_WIDTH - SizeConstants.LABEL_WIDTH - SizeConstants.LEFT_INDENT; + public static int SHORT_FIELD_WIDTH = FIELD_WIDTH - SizeConstants.BUTTON_WIDTH; + // overflow resizing + // in the gridbaglayout is seems that only preferred size + // is significant + private static int OVERFLOW_REDUCTION = 40; + public static Dimension OVERFLOW_FIELD_SIZE = new Dimension(FIELD_WIDTH - OVERFLOW_REDUCTION, FIELD_HEIGHT); + public static Dimension OVERFLOW_SHORT_FIELD_SIZE = new Dimension(FIELD_WIDTH - SizeConstants.BUTTON_WIDTH - OVERFLOW_REDUCTION, FIELD_HEIGHT); + public static Dimension OVERFLOW_TOTAL_SIZE = new Dimension(FIELD_WIDTH + SizeConstants.LABEL_WIDTH - OVERFLOW_REDUCTION, FIELD_HEIGHT); + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SizeConstants.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SplashPageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SplashPageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SplashPageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,72 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.BorderLayout; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; + +import javax.swing.ImageIcon; +import javax.swing.JLabel; + +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.page.SplashPage; +import org.tp23.antinstaller.runtime.ConfigurationException; +/** + * A page containing only a single image. + * + * @author teknopaul + */ +public class SplashPageRenderer extends SwingPageRenderer{ + + private JLabel imagePanel = new JLabel(); + + public SplashPageRenderer() { + } + public boolean validateFields()throws ValidationException{ + return true; + } + + public void instanceInit() throws Exception { + String resource = ((SplashPage)page).getSplashResource(); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + InputStream in = this.getClass().getResourceAsStream(resource); + if(in == null) { + throw new ConfigurationException("Splash page resource is missing: " + resource); + } + byte[] buffer = new byte[2048]; + int read = -1; + while ( (read = in.read(buffer)) != -1) { + baos.write(buffer, 0, read); + } + ImageIcon icon = new ImageIcon(baos.toByteArray()); + imagePanel.setHorizontalAlignment(JLabel.CENTER); + imagePanel.setIcon(icon); + this.add(imagePanel, BorderLayout.CENTER); + } + + public void updateInputFields(){ + ; + } + + + + /** + * updateDefaultValues + */ + public void updateDefaultValues() { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SplashPageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingInstallerContext.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingInstallerContext.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingInstallerContext.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,149 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.SwingUtilities; + +import org.apache.tools.ant.BuildEvent; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.runtime.SwingRunner; + +public class SwingInstallerContext{ + + private static JFrame masterFrame; + private JLabel feedBackPanel; + private ProgressPanel progressPanel; + private InstallerContext ctx; + + public SwingInstallerContext(InstallerContext ctx, + JFrame masterFrame) { + this.ctx = ctx; + SwingInstallerContext.masterFrame = masterFrame; + } + + public JFrame getMasterFrame() { + return masterFrame; + } + public SwingRunner getSwingRunner() { + return (SwingRunner)ctx.getRunner(); + } + + public void setFeedBackLabel(JLabel feedBackPanel) { + this.feedBackPanel = feedBackPanel; + } + /** + * The progress panel is optional so not calling this method + * should not cause errors or NPEs + * @param progressPanel + */ + public void setProgressPanel(ProgressPanel progressPanel) { + this.progressPanel = progressPanel; + } + + public void buildStarted(BuildEvent buildEvent) { + provideAntFeedBack(buildEvent.getMessage()); + try { + SwingUtilities.invokeAndWait(new Runnable(){ + public void run(){ + if(SwingInstallerContext.this.progressPanel != null){ + SwingInstallerContext.this.progressPanel.prepareCalledTargets(); + } + } + }); + } catch (Exception e) { //Interrupted or InvocationTarget + SwingInstallerContext.this.ctx.log(e); + } + } + + public void buildFinished(BuildEvent buildEvent) { + if(this.progressPanel != null){ + try { + SwingUtilities.invokeLater(new Runnable(){ + public void run(){ + SwingInstallerContext.this.progressPanel.buildFinished(); + } + }); + } catch (Exception e) { //Interrupted or InvocationTarget + SwingInstallerContext.this.ctx.log(e); + } + } + } + + public void targetStarted(BuildEvent buildEvent) { + TargetStarted targetStarted = new TargetStarted(); + targetStarted.buildEvent = buildEvent; + try { + if(this.progressPanel != null){ + //Invoke and wait used since strict ordering od started and finished is requried + SwingUtilities.invokeAndWait(targetStarted); + } + } catch (Exception e) { //Interrupted or InvocationTarget + SwingInstallerContext.this.ctx.log(e); + } + } + + public void targetFinished(BuildEvent buildEvent) { + try { + //Invoke and wait used since strict ordering od started and finished is requried + SwingUtilities.invokeAndWait(new Runnable(){ + public void run(){ + if(SwingInstallerContext.this.progressPanel != null){ + SwingInstallerContext.this.progressPanel.targetFinished(); + } + } + }); + } catch (Exception e) { //Interrupted or InvocationTarget + SwingInstallerContext.this.ctx.log(e); + } + } + + public void provideAntFeedBack(String message){ + // We should never have Ant running without a ProgressPane + // but do an if null here in case future FilterChains are different + ProvideAntFeedBack provideAntFeedBack = new ProvideAntFeedBack(); + provideAntFeedBack.message = message; + try { + if(feedBackPanel != null){ + SwingUtilities.invokeLater(provideAntFeedBack); + } + } catch (Exception e) { //Interrupted or InvocationTarget + SwingInstallerContext.this.ctx.log(e); + } + } + + + /** + * @return Returns the ctx. + */ + public InstallerContext getInstallerContext() { + return ctx; + } + + private class TargetStarted implements Runnable{ + private BuildEvent buildEvent; + public void run(){ + SwingInstallerContext.this.progressPanel.targetStarted(buildEvent); + } + } + private class ProvideAntFeedBack implements Runnable{ + private String message; + public void run(){ + SwingInstallerContext.this.feedBackPanel.setText(message); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingInstallerContext.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingMessageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingMessageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingMessageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,113 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import javax.swing.JFrame; +import javax.swing.JOptionPane; +import javax.swing.SwingUtilities; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.renderer.MessageRenderer; +/** + * + * <p>Render User messages in Popup windows </p> + * <p> </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: SwingMessageRenderer.java,v 1.4 2006/12/21 00:02:59 teknopaul Exp $ + */ +public class SwingMessageRenderer + implements MessageRenderer { + + private InstallerContext ctx = null; + private JFrame owner = null; + + + public SwingMessageRenderer() { + } + public SwingMessageRenderer(InstallerContext ctx) { + this.ctx = ctx; + } + + public void setInstallerContext(InstallerContext ctx){ + this.ctx = ctx; + } + public void printMessage(String message){ + MessageRunnable messageRunnable = new MessageRunnable(); + messageRunnable.message = message; + if(SwingUtilities.isEventDispatchThread()){ + messageRunnable.run(); + } + else{ + try { + SwingUtilities.invokeAndWait(messageRunnable); + } catch (Exception e) { // Interrupted or InvocationTarget + ctx.log(e); + } + } + } + + public boolean prompt(String message){ + OptionRunnable optionRunnable = new OptionRunnable(); + optionRunnable.message = message; + if(SwingUtilities.isEventDispatchThread()){ + optionRunnable.run(); + } + else{ + try { + SwingUtilities.invokeAndWait(optionRunnable); + } catch (Exception e) { // Interrupted or InvocationTarget + ctx.log(e); + } + } + return optionRunnable.ok; + } + /** + * @param owner The owner to set. + */ + public void setOwner(JFrame owner) { + this.owner = owner; + } + + private class MessageRunnable implements Runnable{ + String message; + + public void run() { + JOptionPane.showMessageDialog(SwingMessageRenderer.this.owner, + message, "Message", JOptionPane.INFORMATION_MESSAGE ); + } + + } + + private class OptionRunnable implements Runnable{ + String message; + boolean ok; + public void run() { + int ret = JOptionPane.showConfirmDialog(SwingMessageRenderer.this.owner, + message, + "Question", + JOptionPane.YES_NO_OPTION); + if (ret == JOptionPane.YES_OPTION) { + ok = true; + } + else { + ok = false; + } + } + + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingMessageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingOutputFieldRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingOutputFieldRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingOutputFieldRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,86 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import javax.swing.JPanel; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.gui.GBCF; +/** + * + * <p>Instances of this interface should have a no args constructor. +* They sould +* be Swing JComponent (e.g. subclass JPanel) and render normally responding +* to update paint and requests to change Look & Feel in a normal way. </p> + * <p>Instances of this class should follow the naming convention. for each OutputField +* Xxx in the package org.tp23.antinstaller.input there should exist a SwingOutputFieldRenderer +* called org.tp23.antinstaller.renderer.swing.XxxRenderer</p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: SwingOutputFieldRenderer.java,v 1.5 2007/01/04 22:57:17 teknopaul Exp $ + */ +public abstract class SwingOutputFieldRenderer{ + + //TODO From FindBugs - sometimes this field is not used in subclasses to avoid casting + // replace with for example, getInputField() that casts in InputRenderers + // requires work in ConditionalFieldRenderer + protected OutputField outputField; + protected InstallerContext ctx; + + /** + * this should hold a local reference and set the input fields default value + * if one exists + * @param inputField InputField + */ + public void setOutputField(OutputField outputField){ + this.outputField = outputField; + } + /** + * Init the swing components + */ + public abstract void initComponent(JPanel parent); + /** + * Called by the Page prior to firing pagecompletion events + */ + public abstract void updateInputField(); + /** + * Called to update the defaults from the ResultContainer + */ + public abstract void updateDefaultValue(); + + /** + * Called when validation fails + */ + public abstract void renderError(); + /** + * Called when the renderer should add itself to the content pane; + * @param content the panel to which the Renderer should add itself + * @param GridBagConstraintsFactory + * @param row the current row index in the table + * @param components should adjust preferred size when the overflow flag is set + * to compensate for width loss due to the scroll bar + * @return the row index after adding all its components + */ + public abstract int addSelf(JPanel content, GBCF cf, int row, boolean overflow); + + public void setInstallerContext(InstallerContext ctx){ + this.ctx = ctx; + } + + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingOutputFieldRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingPageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingPageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingPageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,269 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.util.ResourceBundle; + +import javax.swing.BorderFactory; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.border.Border; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.page.Page; + +/** + * + * <p>Abstract super class for page renderers. setPage will always be called. </p> + * <p>Subclasses should implement instanceInit for initialising swing components + * on the page. </p> + * @author Paul Hinds + * @version $Id: SwingPageRenderer.java,v 1.10 2007/01/19 00:24:35 teknopaul Exp $ + */ +public abstract class SwingPageRenderer + extends JPanel { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + // gui components + private BorderLayout borderLayout1 = new BorderLayout(); + + // holds the next back buttons etc + private JPanel controlPanel = new JPanel(); + + private JButton backButton = new JButton(); + private JButton cancelButton = new JButton(); + private JButton nextButton = new JButton(); + private JButton finishButton = new JButton(); + + private JPanel titlePanel = new JPanel(); + private JLabel titleLabel = new JLabel(); + private JLabel imagePanel = new JLabel(); // Graphic for the installer + private GridLayout titleLayout = new GridLayout(); + + // app components + protected Page page; + protected SwingInstallerContext swingCtx; + protected InstallerContext ctx; + protected PageCompletionListener listener; + private Border bevelBorder; + + + private static Font titleFont; + static{ + titleFont = new JLabel().getFont(); + try { + titleFont = new Font(titleFont.getFamily(), Font.BOLD, 14); + } + catch (Exception ex) { + // lets not fail due to font errors + } + } + + public SwingPageRenderer(){ + super(); + } + public void setPage(Page page){ + this.page = page; + try { + jbInit(); + } + catch (Exception e) { + ctx.log(e.getMessage()); + if(ctx.getInstaller().isVerbose()) { + ctx.log(e); + } + } + } + + public void setContext(SwingInstallerContext swingCtx){ + this.ctx = swingCtx.getInstallerContext(); + this.swingCtx = swingCtx; + } + + + private void jbInit() throws Exception { + + this.setDoubleBuffered(true); + //emptyBorder = BorderFactory.createEmptyBorder(2,5,2,2); + //bevelBorder = BorderFactory.createCompoundBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED,Color.white,Color.white,new Color(116, 116, 112),new Color(166, 166, 161)),BorderFactory.createEmptyBorder(2,SwingInputFieldRenderer.LEFT_INDENT,2,2)); + bevelBorder = BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.black,1),BorderFactory.createEmptyBorder(2,SizeConstants.LEFT_INDENT,2,2)); + bevelBorder = BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(),BorderFactory.createEmptyBorder(2,SizeConstants.LEFT_INDENT,2,2)); + Border tripleBorder = BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(3,4,1,4),bevelBorder); + this.setLayout(borderLayout1); + titleLabel.setBorder(tripleBorder); + controlPanel.setBorder(tripleBorder); + + this.add(titlePanel, BorderLayout.NORTH); + this.add(controlPanel, BorderLayout.SOUTH); + + // title panel + titlePanel.add(imagePanel, null); + titlePanel.add(titleLabel, null); + + titlePanel.setLayout(titleLayout); + titleLayout.setColumns(1); + titleLayout.setHgap(0); + titleLayout.setRows(2); + titleLayout.setVgap(2); + titlePanel.setMinimumSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_PANEL_HEIGHT)); + titlePanel.setMaximumSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_PANEL_HEIGHT)); + titlePanel.setPreferredSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_PANEL_HEIGHT)); + + titleLabel.setText(page.getDisplayText()); + titleLabel.setFont(titleFont); + setImage(page.getImageResource()); + imagePanel.setMinimumSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_IMAGE_HEIGHT)); + imagePanel.setMaximumSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_IMAGE_HEIGHT)); + imagePanel.setPreferredSize(new Dimension(SizeConstants.PAGE_WIDTH, SizeConstants.TITLE_IMAGE_HEIGHT)); + + // Ctrl Panel + controlPanel.add(cancelButton, null); + controlPanel.add(backButton, null); + controlPanel.add(nextButton, null); + controlPanel.add(finishButton, null); + backButton.setText(res.getString("backButton"));// "<< Back"); + cancelButton.setText(res.getString("cancelButton"));// "Cancel"); + nextButton.setText(res.getString("nextButton"));// "Next >>"); + finishButton.setText(ctx.getInstaller().getFinishButtonText()); + finishButton.setEnabled(false); + setEventListeners(); + setIcons(); + } + public abstract void instanceInit() throws Exception ; + public abstract void updateInputFields(); + public abstract void updateDefaultValues(); + public abstract boolean validateFields()throws ValidationException; + + public void setPageCompletionListener(PageCompletionListener listener){ + this.listener = listener; + } + + private void setImage(String resource) throws Exception{ + if(resource == null){ + resource = ctx.getInstaller().getDefaultImageResource(); + } + ImageIcon icon = getImage(resource); + imagePanel.setIcon(icon); + } + + protected ImageIcon getImage(String resource){ + try { + if (resource != null) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + InputStream in = this.getClass().getResourceAsStream(resource); + byte[] buffer = new byte[2048]; + int read = -1; + while ( (read = in.read(buffer)) != -1) { + baos.write(buffer, 0, read); + } + ImageIcon icon = new ImageIcon(baos.toByteArray()); + return icon; + } + } + catch (Exception ex) { + ctx.log("Can't load image resource:" + resource); + if(ctx.getInstaller().isVerbose()){ + ctx.log(ex); + } + } + return null; + } + + + private void setEventListeners(){ + backButton.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + listener.pageBack(page); + } + }); + cancelButton.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + page.setAbort(true); + if (ctx.getInstaller().isVerbose()) { + ctx.log("Abort called"); + } + listener.pageComplete(page); + } + }); + nextButton.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + listener.pageComplete(page); + + } + }); + finishButton.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + if(finishButton.getText().equals(res.getString("exit"))) { + //TODO FindBugs this will prevent cleanup in FinalizerFilter + System.exit(0); + } + listener.pageComplete(page); + //((SwingInstallerContext)ctx).getSwingRunner().finish(); + } + }); + } + + private void setIcons(){ + backButton.setIcon(getImage("/resources/icons/back.png")); + cancelButton.setIcon(getImage("/resources/icons/cancel.png")); + nextButton.setIcon(getImage("/resources/icons/next.png")); + finishButton.setIcon(getImage("/resources/icons/finish.png")); + } + + public JButton getCancelButton() { + return cancelButton; + } + + public InstallerContext getCtx() { + return ctx; + } + + public JPanel getControlPanel() { + return controlPanel; + } + + public JLabel getImagePanel() { + return imagePanel; + } + + public JButton getNextButton() { + return nextButton; + } + + public JLabel getTitleLabel() { + return titleLabel; + } + public JButton getFinishButton() { + return finishButton; + } + public JButton getBackButton() { + return backButton; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/SwingPageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TargetInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TargetInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TargetInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,104 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.JPanel; + +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.TargetInput; +import org.tp23.gui.GBCF; + +public class TargetInputRenderer + extends SwingOutputFieldRenderer { + + protected TargetInput outputField; + + protected AILabel fieldLabel = new AILabel(); + protected AICheckBox targetCheckBox = new AICheckBox(); + + public TargetInputRenderer() { + } + public void initComponent(JPanel parent){ + try { + jbInit(); + } + catch(Exception e) { + ctx.log(e.getMessage()); + if(ctx.getInstaller().isVerbose()) { + ctx.log(e); + } + + } + } + + + + public void setOutputField(OutputField outputField) { + this.outputField = (TargetInput)outputField; + } + public void updateInputField(){ + String target = outputField.getTarget(); + int targetIdx = outputField.getIdx(); + boolean selected = targetCheckBox.isSelected(); + outputField.setInputResult(String.valueOf(selected)); + if(selected && !ctx.getCurrentPage().getAllTargets().contains(target)){ + ctx.getCurrentPage().addTarget(targetIdx, target); + } + else if(!selected && ctx.getCurrentPage().isTarget(target)){ + ctx.getCurrentPage().removeTarget(targetIdx); + } + } + public void updateDefaultValue(){ + if(!outputField.isEditted()){ + targetCheckBox.setSelected(InputField.isTrue(outputField.getDefaultValue())); + } + } + + private void jbInit() throws Exception { + fieldLabel.setText(outputField.getDisplayText()); + targetCheckBox.setSelected(InputField.isTrue(outputField.getDefaultValue())); + if(InputField.isTrue(outputField.getForce())){ + targetCheckBox.setEnabled(false); + } + + targetCheckBox.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + updateInputField(); + outputField.setEditted(true); + } + }); + } + public int addSelf(JPanel content,GBCF cf, int row,boolean overflow) { + content.add(fieldLabel,cf.getCell(row, 0)); + content.add(targetCheckBox,cf.getCell(row, 1)); + if(overflow){ + targetCheckBox.setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); + } + return ++row; + } + + + + /** + * renderError + */ + public void renderError() { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TargetInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TargetSelectInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TargetSelectInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TargetSelectInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,53 @@ +/* + * Copyright 2005 Paul Hinds, Mark Anderson + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.util.Enumeration; + +import javax.swing.JRadioButton; + +import org.tp23.antinstaller.input.TargetSelectInput; +/** + * + * @author Paul Hinds, Mark Anderson + * @version $Id: TargetSelectInputRenderer.java,v 1.3 2006/08/04 17:13:24 anothermwilson Exp $ + */ +public class TargetSelectInputRenderer + extends SelectInputRenderer { + + public TargetSelectInputRenderer() { + } + + public void updateInputField(){ + Enumeration enumeration = optionGroup.getElements(); + int targetIdx = ((TargetSelectInput)inputField).getIdx(); + int i = 0; + for(; enumeration.hasMoreElements(); i++){ + JRadioButton o = (JRadioButton)enumeration.nextElement(); + ctx.getCurrentPage().removeTarget(targetIdx); + if(o.isSelected()){ + String target = inputField.getOptions()[i].value; + ctx.getCurrentPage().addTarget(targetIdx, target); + inputField.setValue(target); + break; + } + } + if(i > inputField.getOptions().length){ + inputField.setValue(inputField.getDefaultValue()); + } + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TargetSelectInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TextPageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TextPageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TextPageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,113 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.BorderLayout; +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; + +import javax.swing.BorderFactory; +import javax.swing.JLabel; +import javax.swing.JScrollPane; +import javax.swing.JTextPane; +import javax.swing.text.html.HTMLEditorKit; + +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.page.TextPage; +import org.tp23.antinstaller.runtime.ConfigurationException; +/** + * A page containing a text file's contents, may be HTML in swing. + * The HTML supported is the standard Swing subset of HTML3.2 so + * it really just adds a bit of formatting and looks pretty bad. + * The page is also parsed and property references in the document + * are converted to the runtime values. + * e.g. ${java.user.name} would be replaced with the current user in the HTML text. + * + * Both the html page and embeded images are loaded from the classpath so + * can be packaged in the jar. + * + * The default font and background are determined by + * the LAF. + * @author teknopaul + * + */ +public class TextPageRenderer extends SwingPageRenderer{ + + private JTextPane textPane = new JTextPane(); + private StringBuffer buffer = new StringBuffer(); + + public TextPageRenderer() { + } + + public boolean validateFields()throws ValidationException{ + return true; + } + + public void instanceInit() throws Exception { + final String resource = ((TextPage)page).getHtmlResource(); + InputStream in = this.getClass().getResourceAsStream(resource); + if(in == null){ + throw new ConfigurationException("Html page resource is missing:" + resource); + } + BufferedReader br = new BufferedReader(new InputStreamReader(in)); + String read = null; + while ( (read = br.readLine()) != null) { + buffer.append(read); + } + // as per FindBugs + br.close(); + + JLabel defaults = new JLabel(); + textPane.setBackground(defaults.getBackground()); + textPane.setEditable(false); + textPane.setContentType("text/html"); + HTMLEditorKit classpathKit = new ClasspathHTMLEditorKit(); + textPane.setEditorKit(classpathKit); + textPane.setAutoscrolls(true); + + String rule = "body{font-family:" + defaults.getFont().getFamily() + + ";font-size:" + defaults.getFont().getSize() + "}"; + classpathKit.getStyleSheet().addRule(rule); + textPane.setBorder(BorderFactory.createEmptyBorder()); + + JScrollPane scroller = new JScrollPane(); + scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); + scroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); + scroller.setBorder(BorderFactory.createCompoundBorder( + BorderFactory.createEmptyBorder(4, 4, 4, 4), + BorderFactory.createEtchedBorder() + )); + add(scroller, BorderLayout.CENTER); + scroller.getViewport().add(textPane); + this.add(scroller, BorderLayout.CENTER); + } + + public void updateInputFields(){ + } + + + + /** + * updateDefaultValues + */ + public void updateDefaultValues() { + // parse property references + String parsedHtml = ctx.getInstaller().getResultContainer().getDefaultValue(buffer.toString()); + textPane.setText(parsedHtml); + textPane.setCaretPosition(0); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/TextPageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/UnvalidatedTextInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/UnvalidatedTextInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/UnvalidatedTextInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,95 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; + +import javax.swing.JPanel; + +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.UnvalidatedTextInput; +import org.tp23.gui.GBCF; + +public class UnvalidatedTextInputRenderer + extends SwingOutputFieldRenderer { + + protected UnvalidatedTextInput inputField; + + protected AILabel fieldLabel = new AILabel(); + protected AITextfield jTextField = new AITextfield(); + + public UnvalidatedTextInputRenderer() { + } + + public void initComponent(JPanel parent){ + try { + jbInit(); + } + catch(Exception e) { + ctx.log(e.getMessage()); + if(ctx.getInstaller().isVerbose()) { + ctx.log(e); + } + + } + } + + public void setOutputField(OutputField inputField) { + this.inputField=(UnvalidatedTextInput)inputField; + this.inputField.setValue(this.inputField.getDefaultValue()); + } + public void updateInputField(){ + inputField.setValue(jTextField.getText()); + } + public void updateDefaultValue(){ + if(!inputField.isEditted())jTextField.setText(inputField.getDefaultValue()); + } + + private void jbInit() throws Exception { + fieldLabel.setText(inputField.getDisplayText()); + jTextField.setText(inputField.getDefaultValue()); + jTextField.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + updateInputField(); + } + }); + jTextField.addKeyListener(new KeyAdapter() { + public void keyTyped(KeyEvent e) { + if (e.getKeyChar() != '\t') { + inputField.setEditted(true); + } + } + }); + + } + public int addSelf(JPanel content,GBCF cf, int row,boolean overflow) { + content.add(fieldLabel,cf.getCell(row,0)); + content.add(jTextField,cf.getCell(row,1)); + if(overflow){ + jTextField.setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); + } + return ++row; + } + + /** + * renderError + */ + public void renderError() { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/UnvalidatedTextInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ValidatedTextInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ValidatedTextInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ValidatedTextInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,111 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing; + +import java.awt.Color; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.util.ResourceBundle; + +import javax.swing.JPanel; +import javax.swing.JTextField; + +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.ValidatedTextInput; +import org.tp23.antinstaller.renderer.MessageRenderer; +import org.tp23.gui.GBCF; + +public class ValidatedTextInputRenderer extends SwingOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + protected ValidatedTextInput inputField; + protected AILabel fieldLabel = new AILabel(); + protected JTextField jTextField = new AITextfield(); + protected Color origFore; + + public ValidatedTextInputRenderer() { + origFore = jTextField.getForeground(); + } + + public void initComponent(JPanel parent) { + try { + jbInit(); + } catch (Exception e) { + ctx.log(e.getMessage()); + if (ctx.getInstaller().isVerbose()) { + ctx.log(e); + } + + } + } + + public void setOutputField(OutputField inputField) { + this.inputField = (ValidatedTextInput) inputField; + this.inputField.setValue(this.inputField.getDefaultValue()); + } + + public void updateInputField() { + inputField.setValue(jTextField.getText()); + } + + public void updateDefaultValue() { + if (!inputField.isEditted()) { + jTextField.setText(inputField.getDefaultValue()); + } + } + + private void jbInit() throws Exception { + fieldLabel.setText(inputField.getDisplayText()); + jTextField.setText(inputField.getDefaultValue()); + + jTextField.addFocusListener(new FocusAdapter() { + public void focusLost(FocusEvent fe) { + jTextField.setForeground(origFore); + } + }); + jTextField.addKeyListener(new KeyAdapter() { + public void keyTyped(KeyEvent e) { + if (e.getKeyChar() != '\t') { + inputField.setEditted(true); + } + } + }); + } + + public int addSelf(JPanel content, GBCF cf, int row, boolean overflow) { + content.add(fieldLabel, cf.getCell(row, 0)); + content.add(jTextField, cf.getCell(row, 1)); + if (overflow) { + ((AITextfield) jTextField).setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); + } + return ++row; + } + + /** + * renderError + */ + public void renderError() { + MessageRenderer mr = ctx.getMessageRenderer(); + mr.printMessage(res.getString("notCorrectFormat") + "\n\n e.g. " + + inputField.getDefaultValue()); + this.jTextField.requestFocus(); + this.jTextField.setForeground(Color.red); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/ValidatedTextInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/package.html =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/package.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/package.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,9 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head><!-- + Copyright (c) 2004 tp23 + All Rights Reserved. +--></head> + +<body bgcolor="white">Renderers for the Swing UI.</body> +</html> Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/package.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/LookAndFeelFactory.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/LookAndFeelFactory.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/LookAndFeelFactory.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,105 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing.plaf; + +import java.lang.reflect.Method; + +import javax.swing.LookAndFeel; +import javax.swing.UIManager; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.OutputField; + + +/** + * @author Paul Hinds + * @version $Id: LookAndFeelFactory.java,v 1.9 2007/01/28 21:31:08 teknopaul Exp $ + */ +public class LookAndFeelFactory { + + public static final String DEFAULT_LAF = "org.tp23.jgoodies.plaf.plastic.PlasticXPLookAndFeel"; + public static final String GREYMETAL_LAF = "greymetal"; + public static final String NATIVE_LAF = "native"; + public static final String JGOODIES_LAF = "jgoodies"; + public static final String NULL_LAF = "null"; + + private final String specifiedLAF; + private final InstallerContext ctx; + /** + * + */ + public LookAndFeelFactory(InstallerContext ctx) { + this.ctx = ctx; + this.specifiedLAF = ctx.getInstaller().getLookAndFeel(); + } + + public void setLAF(){ + String lafClassName = null; + try{ + lafClassName = getLafFromToken(specifiedLAF); + if(lafClassName == null){ + return; + } + LookAndFeel look = (LookAndFeel)Class.forName(lafClassName).newInstance(); + ctx.log("Setting look and feel:" + lafClassName); + UIManager.setLookAndFeel(look); + + boolean antialias = OutputField.isTrue(ctx.getInstaller().getAntialiased()); + // Reflection used here to avoid dependencies on JGoodies + if(antialias){ + Method setAntialiased = look.getClass().getMethod("setAntiAliased", new Class[]{boolean.class}); + if(setAntialiased != null){ + ctx.log("Setting antialiasing:" + antialias); + // JDK1.5 warning fix + Object[] args = new Boolean[]{new Boolean(antialias)}; + setAntialiased.invoke(null, args); + } + } + }catch(Exception ex ){ + ctx.getLogger().log("Can not correctly set Look And Feel:" + ex.getMessage()); + ctx.getLogger().log(ctx.getInstaller(), ex); + } + } + + public static boolean isDefault(String laf){ + return ( laf == null || laf.equals(JGOODIES_LAF) || laf.equals(DEFAULT_LAF) ); + } + /** + * Gets a look and feel class name respecting the tokens supported + * such as jgoodies, null, native and greymetal + * @param token + * @return look and feel class name + */ + public static String getLafFromToken(String token) { + String laf = null; + if(token == null || token.equals(JGOODIES_LAF)) { + laf = DEFAULT_LAF; + } + else if(token.equals(NULL_LAF)) { + laf = null; + } + else if(token.equals(NATIVE_LAF)) { + laf = UIManager.getSystemLookAndFeelClassName(); + } + else if(token.equals(GREYMETAL_LAF)) { + laf = "org.tp23.antinstaller.renderer.swing.plaf.ModMetalLookAndFeel"; + } + else { + laf = token; + } + return laf; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/LookAndFeelFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ModMetalLookAndFeel.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ModMetalLookAndFeel.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ModMetalLookAndFeel.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,118 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing.plaf; + +import java.awt.Font; +import java.awt.Insets; + +import javax.swing.LookAndFeel; +import javax.swing.UIDefaults; +import javax.swing.UIManager; +import javax.swing.plaf.metal.MetalLookAndFeel; + + +/** + * This LAF is a replacement for Metal for those of us who can't stand the + * exsessive use of the <b>BOLD</b> font in the default MetalLookAndFeel + * but don't want a heavy LAF that uses excessive memory or increases download + * size. The excessive use of Sun's corporate color purple has also been + * removed, but icons have been left as they are since they would add + * to the download size significantly. + * @author Paul Hinds + * @version $Id: ModMetalLookAndFeel.java,v 1.3 2006/12/21 00:03:03 teknopaul Exp $ + */ +public class ModMetalLookAndFeel extends MetalLookAndFeel { + + private static final long serialVersionUID = 1L; + private static boolean isInstalled = false; + protected static final Font defaultFont = new Font("Dialog",Font.PLAIN,11); + + + public ModMetalLookAndFeel(){ + if(!isInstalled){ + isInstalled = true; + UIManager.installLookAndFeel(new javax.swing.UIManager.LookAndFeelInfo("ModMetal", "org.tp23.laf.modmetal.ModMetalLookAndFeel")); + } + } + public static void setAntiAliased(boolean antialiased){ + + } + + public String getID(){ + return "ModMetalLookAndFeel"; + } + + public String getName() + { + return "ModMetalLookAndFeel"; + } + + public String getDescription(){ + return "Metal LAF with minor changes to default Fonts"; + } + + public boolean isNativeLookAndFeel(){ + return false; + } + + public boolean isSupportedLookAndFeel(){ + return true; + } + + protected void initClassDefaults(UIDefaults table){ + super.initClassDefaults(table); + } + + protected void createDefaultTheme(){ + setCurrentTheme(new ModMetalTheme()); + super.createDefaultTheme(); + } + + protected void initSystemColorDefaults(UIDefaults table){ + super.initSystemColorDefaults(table); + } + + protected void initComponentDefaults(UIDefaults table){ + super.initComponentDefaults(table); + table.put("Button.font", defaultFont); + table.put("Checkbox.font", defaultFont); + table.put("CheckboxMenuItem.font", defaultFont); + table.put("ComboBox.font", defaultFont); + table.put("ComboBox.font", defaultFont); + table.put("FormattedTextField.font", defaultFont); + table.put("Label.font", defaultFont); + table.put("List.font", defaultFont); + table.put("Menu.font", defaultFont); + table.put("MenuItem.font", defaultFont); + table.put("PopupMenu.font", defaultFont); + table.put("ProgressBar.font", defaultFont); + table.put("RadioButton.font", defaultFont); + table.put("RadioButtonMenuItem.font", defaultFont); + table.put("TextArea.font", defaultFont); + table.put("TextField.font", defaultFont); + table.put("TextPane.font", defaultFont); + table.put("TabbedPane.font", defaultFont); + table.put("ToggleButton.font", defaultFont); + table.put("Tree.font", defaultFont); + table.put("Viewport.font", defaultFont); + table.put("OptionPane.errorIcon", LookAndFeel.makeIcon(MetalLookAndFeel.class, "icons/Error.gif")); + table.put("OptionPane.informationIcon", LookAndFeel.makeIcon(MetalLookAndFeel.class, "icons/Inform.gif")); + table.put("OptionPane.warningIcon", LookAndFeel.makeIcon(MetalLookAndFeel.class, "icons/Warn.gif")); + table.put("Button.margin", new Insets(2,4,2,4)); + } + +} + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ModMetalLookAndFeel.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ModMetalTheme.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ModMetalTheme.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ModMetalTheme.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,53 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.swing.plaf; + +import javax.swing.plaf.ColorUIResource; +import javax.swing.plaf.metal.DefaultMetalTheme; + +/** + * @author Paul Hinds + * @version $Id: ModMetalTheme.java,v 1.4 2006/12/21 00:03:03 teknopaul Exp $ + */ +public class ModMetalTheme extends DefaultMetalTheme{ + + private static final ColorUIResource primary1 = new ColorUIResource( + 102, 102, 102); + private static final ColorUIResource primary2 = new ColorUIResource( + 153, 153, 153); + private static final ColorUIResource primary3 = new ColorUIResource( + 204, 204, 204); + + + private static final ColorUIResource secondary1 = new ColorUIResource( + 192, 192, 192); + private static final ColorUIResource secondary2 = new ColorUIResource( + 213, 213, 213); + private static final ColorUIResource secondary3 = new ColorUIResource( + 234, 234, 234); + + + // these are blue in Metal Default Theme + protected ColorUIResource getPrimary1() { return primary1; } + protected ColorUIResource getPrimary2() { return primary2; } + protected ColorUIResource getPrimary3() { return primary3; } + + // these are gray in Metal Default Theme + protected ColorUIResource getSecondary1() { return secondary1; } + protected ColorUIResource getSecondary2() { return secondary2; } + protected ColorUIResource getSecondary3() { return secondary3; } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/swing/plaf/ModMetalTheme.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/AbstractTextPageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/AbstractTextPageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/AbstractTextPageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,121 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.renderer.PageRenderer; +/** + * renamed from TextPageRenderer in version 0.8 to enable + * the use of the page type TextPage, TextPageRenderer is now + * the renderer for these page types + * @author teknopaul + * + */ +public abstract class AbstractTextPageRenderer + implements PageRenderer { + + public static final int PAGE_BLANK_LINES = 20; + public static final int PAGE_DECO_WIDTH = 80; + + protected BufferedReader reader; + protected PrintStream out; + private InstallerContext ctx; + + + public AbstractTextPageRenderer() { + } + + public void setContext(InstallerContext ctx){ + this.ctx = ctx; + } + public InstallerContext getContext(){ + return ctx; + } + + public void init( BufferedReader reader, PrintStream out){ + this.out = out; + this.reader = reader; + } + /** + * + * @param page Page + * @throws InstallException + * @return boolean false implys user aborted + */ + public abstract boolean renderPage(Page page) throws InstallException; + + protected void printHeader(Page page) throws IOException{ + for (int i = 0; i < PAGE_BLANK_LINES; i++) { + out.println(); + } + + + for (int i = 0; i < PAGE_DECO_WIDTH; i++) { + out.print('~'); + } + out.println(); + out.println(" " + page.getDisplayText()); + for (int i = 0; i < PAGE_DECO_WIDTH; i++) { + out.print('~'); + } + out.println(); + out.println(); + out.println(); + } + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + private static final char[] affimativeChars = parseChars(res.getString("affirmativeChars")); + + private static char[] parseChars(String commaSeparated){ + char[] input = commaSeparated.toCharArray(); + char[] theChars = new char[input.length]; + int j = 0; + for (int i = 0; i < input.length; i++) { + if(Character.isWhitespace(input[i]))continue; + if(',' == input[i]) { + continue; + } + else theChars[j++] = input[i]; + } + char[] toReturn = new char[j]; + System.arraycopy(theChars,0,toReturn,0,j); + return toReturn; + } + + /** + * does the string represent true default = true + * @param entered String + * @return boolean + */ + protected boolean isTrue(String entered){ + if(entered.length() == 0) { + return true; + } + char first = entered.charAt(0); + boolean isTrue= false; + for (int i = 0; i < affimativeChars.length; i++) { + isTrue |= Character.toUpperCase(first) == affimativeChars[i]; + } + return isTrue; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/AbstractTextPageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/AppRootInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/AppRootInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/AppRootInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,20 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +public class AppRootInputRenderer + extends DirectoryInputRenderer { +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/AppRootInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/CheckboxInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/CheckboxInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/CheckboxInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,93 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.CheckboxInput; +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.input.OutputField; + + +public class CheckboxInputRenderer + implements TextOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + + protected InstallerContext ctx; + + public CheckboxInputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + CheckboxInput iField = (CheckboxInput) field; + out.print(iField.getDisplayText()); + out.print(" ["); + out.print(res.getString("_default_")); + out.print(":"); + out.print(iField.getDefaultValue()); + out.print("]"); + if (InputField.isTrue(iField.getForce())) { + out.println(res.getString("_required_")); + iField.setValue(iField.getDefaultValue()); + return; + } + else { + out.println(); + } + + + String input = reader.readLine(); + out.println(); + if (input == null || input.trim().equals("")) { + input = iField.getDefaultValue(); + } + if(InputField.isTrue(input)){ + iField.setValue("true"); + } + //@TODO should accept true or false only and complain toher wise looping till sensible input + //else if (InputField.isFalse(input)){ + // iField.setValue("false"); + //} + else{ + iField.setValue("false"); + } + } + + public boolean isAbort() { + return false; + } + + + + /** + * renderError + * + * @param field InputField + * @param in InputStream + * @param out PrintStream + */ + public void renderError(OutputField field, BufferedReader reader, PrintStream out) { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/CheckboxInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/CommentOutputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/CommentOutputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/CommentOutputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,68 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.CommentOutput; +import org.tp23.antinstaller.input.OutputField; + + +public class CommentOutputRenderer + implements TextOutputFieldRenderer { + protected InstallerContext ctx; + + public CommentOutputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + CommentOutput comField = (CommentOutput) field; + String text = field.getDisplayText(); + if(text == null){ + return; + } + + if( OutputField.isTrue(comField.getBold()) ){ + text = text.toUpperCase(); + } + else if( OutputField.isTrue(comField.getTitle()) ){ + text = text.toUpperCase(); + } + + out.println(text); + } + public boolean isAbort(){ + return false; + } + + + + /** + * renderError + * + * @param field InputField + * @param out PrintStream + */ + public void renderError(OutputField field, BufferedReader reader, PrintStream out) { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/CommentOutputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ConditionalFieldRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ConditionalFieldRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ConditionalFieldRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,85 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ResourceBundleHelper; +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.input.ConditionalField; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.runtime.ConfigurationException; + +/** + * Conditionally render a collection of fields + * + * @author mwilson + * @version $Id + * @since 0.7.4.patch 7 + */ +public class ConditionalFieldRenderer implements TextOutputFieldRenderer +{ + private static final ResourceBundleHelper res = new ResourceBundleHelper("org.tp23.antinstaller.renderer.text.Res"); + + private InstallerContext context; + + public void setContext( InstallerContext context ) + { + this.context = context; + } + + public void renderOutput( OutputField field, BufferedReader reader, PrintStream out ) + throws ValidationException, InstallException, IOException + { + ConditionalField conditional = (ConditionalField) field; + + try + { + + OutputField[] fields = null; + + if( conditional.getExpression().evaluate() ) + { + fields = conditional.getFields(); + + SimpleInputPageRenderer.renderFields( context, fields, reader, out); + } + } + catch( ConfigurationException configExc ) + { + throw new InstallException( res.getMessage( "invalid.conditional.expression", conditional.getIfProperty()), + configExc ); + } + catch( ClassNotFoundException clsNotFoundExc ) + { + throw new InstallException( res.getMessage( "text.render.not.found" ), + clsNotFoundExc ); + } + } + + public void renderError( OutputField field, BufferedReader reader, PrintStream out ) throws IOException + { + //renderOutput will have already rendered any errors + } + + public boolean isAbort() + { + return false; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ConditionalFieldRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ConfirmPasswordTextInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ConfirmPasswordTextInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ConfirmPasswordTextInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,13 @@ +package org.tp23.antinstaller.renderer.text; + +import java.util.ResourceBundle; + +public class ConfirmPasswordTextInputRenderer extends PasswordTextInputRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + protected String getErrorMessage(){ + return res.getString("passwordsDoNotMatch"); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ConfirmPasswordTextInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/DateInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/DateInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/DateInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,66 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.DateInput; +import org.tp23.antinstaller.input.OutputField; + + +public class DateInputRenderer + implements TextOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + + protected InstallerContext ctx; + public DateInputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + DateInput iField = (DateInput) field; + out.print(field.getDisplayText()); + + out.print(" ["); + out.print(res.getString("_default_")); + out.print(":"); + out.print(iField.getDefaultValue()); + out.println("]"); + +// @TODO check this from the patch submitted for bug 1469254 + String input = reader.readLine(); + + out.println(); + if(input==null || input.equals(""))input = iField.getDefaultValue(); + iField.setInputResult(input); + } + public void renderError(OutputField field, BufferedReader reader, PrintStream out) throws IOException{ + DateInput iField = (DateInput) field; + out.println("The input is not in the correct format:"+iField.getDateFormat()); + renderOutput(field, reader, out); + } + public boolean isAbort(){ + return false; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/DateInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/DirectoryInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/DirectoryInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/DirectoryInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,86 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.DirectoryInput; +import org.tp23.antinstaller.input.OutputField; + +public class DirectoryInputRenderer implements TextOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + + protected InstallerContext ctx; + + public DirectoryInputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + DirectoryInput iField = (DirectoryInput) field; + out.print(iField.getDisplayText()); + + out.print(" ["); + out.print(res.getString("_default_")); + out.print(":"); + out.print(iField.getDefaultValue(true)); + out.print("]"); + + out.println(); + String input = reader.readLine(); + out.println(); + if (input == null || input.equals("")) { + input = iField.getDefaultValue(true); + if("".equals(input)) { // if we have empty default and empty input getAbsolutePath() produces a temporary directory + iField.setInputResult(""); + } + else { + iField.setInputResult(new File(input).getAbsolutePath()); + } + } + else { + iField.setInputResult(new File(input).getAbsolutePath()); + } + } + + public boolean isAbort() { + return false; + } + + /** + * renderError + * + * @param field + * InputField + * @param in + * InputStream + * @param out + * PrintStream + */ + public void renderError(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + renderOutput(field, reader, out); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/DirectoryInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ExtValidatedTextInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ExtValidatedTextInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ExtValidatedTextInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,38 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; + +import org.tp23.antinstaller.input.ExtValidatedTextInput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.Validator; + + +public class ExtValidatedTextInputRenderer + extends ValidatedTextInputRenderer { + + public void renderError(OutputField field, BufferedReader reader, PrintStream out) throws IOException{ + ExtValidatedTextInput extVal = (ExtValidatedTextInput) field; + Validator validator = extVal.getValidator(); + Throwable t = extVal.getThrowable(); + String message = validator.getErrorMessage(t,null); + out.println(message); + renderOutput(field, reader, out); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ExtValidatedTextInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/FileInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/FileInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/FileInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,70 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.FileInput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.renderer.MessageRenderer; + + +public class FileInputRenderer + implements TextOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + + protected InstallerContext ctx; + public FileInputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + FileInput iField = (FileInput) field; + out.print(iField.getDisplayText()); + + out.print(" ["); + out.print(res.getString("_default_")); + out.print(":"); + out.print(iField.getDefaultValue(true)); + out.print("]"); + + out.println(); + String input = reader.readLine(); + out.println(); + if(input == null || input.equals("")){ + input = iField.getDefaultValue(true); + } + iField.setInputResult(new File(input).getAbsolutePath()); + } + public void renderError(OutputField field, BufferedReader reader, PrintStream out) throws IOException{ + MessageRenderer mr = ctx.getMessageRenderer(); + mr.printMessage(res.getString("fileDoesNotExist")); + renderOutput(field, reader, out); + } + public boolean isAbort(){ + return false; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/FileInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/HiddenPropertyInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/HiddenPropertyInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/HiddenPropertyInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,58 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.HiddenPropertyInput; +import org.tp23.antinstaller.input.OutputField; + +/** + * Text UI Renderer for hidden properties - displays nothing + * + * @author mwilson + * @version $Id + * @since 0.7.4 patch 6 + */ +public class HiddenPropertyInputRenderer implements TextOutputFieldRenderer +{ + + public void setContext( InstallerContext ctx ) + { + + } + + public void renderOutput( OutputField field, BufferedReader reader, PrintStream out ) throws IOException + { + HiddenPropertyInput propertyField = (HiddenPropertyInput) field; + + if( !propertyField.isEditted() ) + { + propertyField.setInputResult( propertyField.getDefaultValue() ); + } + } + + public void renderError( OutputField field, BufferedReader reader, PrintStream out ) throws IOException + { + + } + + public boolean isAbort() + { + return false; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/HiddenPropertyInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LargeSelectInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LargeSelectInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LargeSelectInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,115 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.LargeSelectInput; +import org.tp23.antinstaller.input.OutputField; + + +public class LargeSelectInputRenderer + implements TextOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + private static final String nextChar = res.getString("nextChar"); + + protected InstallerContext ctx; + public LargeSelectInputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + LargeSelectInput iField = (LargeSelectInput) field; + + printText(iField,out,reader); + String input = reader.readLine(); + out.println(); + if(input == null || input.equals("")) { + input = iField.getDefaultValue(); + } + else { + try { + int idx = Integer.parseInt(input.trim()); + input = iField.getOptions()[idx - 1].value; + } catch(Exception numFormatOrIndexOutOfBounds) { + return; + } + } + iField.setInputResult(input); + } + + public boolean isAbort(){ + return false; + } + private void printText(LargeSelectInput iField, PrintStream out,BufferedReader reader) throws IOException{ + out.println(iField.getDisplayText()); + LargeSelectInput.Option[] options = iField.getOptions(); + out.print(" "); + out.println(res.getString("availableOptions")); + StringBuffer optionsData = new StringBuffer(); + for (int i = 0; i < options.length; i++) { + optionsData.append(" "); + optionsData.append(i+1); + optionsData.append(") "); + optionsData.append(options[i].getText()); + if(iField.getDefaultValue().equals(options[i].value)){ + optionsData.append(" ["); + optionsData.append(res.getString("_default_")); + optionsData.append("]"); + } + optionsData.append("\n"); + } + optionsData.append(" "); + optionsData.append(res.getString("enterNumber")).append("\n"); + Pager pager = new Pager(optionsData.toString()); + String command = null; + do { + if (!pager.next(out)) { + break; + } + out.println(); + out.println(getNextInstructions()); + command = reader.readLine(); + } + while (command.toUpperCase().startsWith( nextChar )); + pager.rest(out); + + } + + + + /** + * renderError + * + * @param field InputField + * @param out PrintStream + */ + public void renderError(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + ctx.getMessageRenderer().printMessage("Not a valid selection"); + renderOutput(field, reader, out); + } + private String getNextInstructions() { + return res.getString("large_select_next"); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LargeSelectInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LicensePageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LicensePageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LicensePageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,119 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.runtime.ConfigurationException; +import org.tp23.antinstaller.page.LicensePage; +import org.tp23.antinstaller.page.Page; + + +public class LicensePageRenderer + extends AbstractTextPageRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + private static final String nextChar = res.getString("nextChar"); + + private boolean usePaging = false; + + public LicensePageRenderer() { + } + + public boolean renderPage(Page page) throws InstallException { + if (page instanceof LicensePage) { + LicensePage lPage = (LicensePage) page; + String strUsePaging = lPage.getUsePaging(); + usePaging = strUsePaging!=null && isTrue(strUsePaging); + return renderLicensePage(lPage); + } + else { + throw new InstallException("Wrong Renderer in LicensePageRenderer.renderPage"); + } + } + + private boolean renderLicensePage(LicensePage page) throws InstallException { + try { + BufferedReader commandReader = reader; + out.println(); + out.println(res.getString("clickViewLicense")); + commandReader.readLine(); + + String resource = page.getResource(); + InputStream licensein = this.getClass().getResourceAsStream(resource); + if (licensein == null) { + throw new ConfigurationException("License resource '" + resource + "' is missing from installer"); + } + BufferedReader reader = new BufferedReader(new InputStreamReader(licensein)); + printHeader(page); + String lineread = null; + StringBuffer sb = new StringBuffer(); + + while ( (lineread = reader.readLine()) != null) { + sb.append(lineread); + sb.append('\n'); + } + // as per FindBugs + reader.close(); + + String command = null; + Pager pager = new Pager(sb.toString()); + if (usePaging) { + do { + if (!pager.next(out)) { + break; + } + out.println(); + out.println(getNextInstructions()); + command = commandReader.readLine(); + } + while (command.toUpperCase().startsWith(nextChar)); + pager.rest(out); + } + else { + out.println(pager.getText()); + } + + for (int i = 0; i < PAGE_DECO_WIDTH; i++) { + out.print('~'); + } + out.println(); + out.println(res.getString("licenseAccept")); + command = commandReader.readLine(); + command = command.trim(); + if (isTrue(command)) { + return true; + } + else { + page.setAbort(true); + return false; + } + } + catch (IOException ex) { + throw new InstallException("Not able to read license file", ex); + } + } + + private String getNextInstructions() { + return res.getString("license_next"); + } +} + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/LicensePageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Pager.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Pager.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Pager.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,101 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.PrintStream; + + +/** + * + * <p>Used for the Text/Console input to show pages of text as opposed to displaying +* a long list of text that scrolls off the top of the page. </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: Pager.java,v 1.2 2006/12/21 00:09:19 teknopaul Exp $ + */ +public class Pager { + + private char[] text; + private int linesPerPage = 20; + private int charsPerLine = 80; + private int stringIndex = 0; + + public Pager(String text) { + this.text = text.toCharArray(); + } + public Pager(){ + } + + public String getText() { + return new String(text); + } + + public void setText(String text) { + this.text = text.toCharArray(); + } + /** + * Print the rest of the text + */ + public void rest(PrintStream out){ + while(next(out)); +} + /** + * Print the next page + * @param out PrintStream + * @return boolean true if there is more text + */ + public boolean next(PrintStream out){ + int lineChars = 0; + int lastSpace = -1; + // loop past charaters, increment with lines + char[] lineBuffer = new char[charsPerLine+1]; + for (int lines = 0; lines < linesPerPage;) { + if(stringIndex >= text.length){ + return false; + } + lineBuffer[lineChars] = text[stringIndex]; + if(text[stringIndex] == ' '){ + lastSpace = lineChars; + } + if(text[stringIndex] == '\n'){ + String tmp = new String(lineBuffer, 0, lineChars + 1); + out.print(tmp); + lines++; + lineChars = 0; + lastSpace = -1; + } + else if(lineChars == charsPerLine){ + // handle lines ending with the last full word + if(lastSpace != -1){ + out.println(new String(lineBuffer, 0, lastSpace)); + stringIndex = stringIndex - (charsPerLine - lastSpace); + } + else { + out.println(new String(lineBuffer, 0, lineChars)); + } + lines++; + lineChars = 0; + lastSpace = -1; + } + else{ + lineChars++; + } + stringIndex++; + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Pager.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/PasswordTextInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/PasswordTextInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/PasswordTextInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,167 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.PasswordTextInput; + + +public class PasswordTextInputRenderer extends ValidatedTextInputRenderer + + implements TextOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + + public PasswordTextInputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + PasswordTextInput iField = (PasswordTextInput) field; + StringBuffer displayText = new StringBuffer(); + displayText.append(field.getDisplayText()); + displayText.append(" ["); + displayText.append(res.getString("_default_")); + displayText.append(":"); + displayText.append(iField.getDefaultValue()); + displayText.append("]"); + + String input = null; + if(OutputField.isTrue(iField.getTextMask())){ + input = new PasswordField().getPassword(displayText.toString()); + System.out.print("\r "); + } + else { + out.println(displayText.toString()); + input = reader.readLine(); + } + + out.println(); + out.println(); + if(input == null || input.equals("")){ + input = iField.getDefaultValue(); + } + iField.setInputResult(input); + } + public void renderError(OutputField field, BufferedReader reader, PrintStream out) throws IOException{ + out.println(getErrorMessage()); + renderOutput(field, reader, out); + } + public boolean isAbort(){ + return false; + } + + protected String getErrorMessage(){ + return res.getString("notCorrectPasswordFormat"); + } + + // shame this does not work + // does any one know a way to not echo passwords? +// private String readInput(InputStreamReader reader, PrintStream out) throws IOException{ +// StringBuffer sb = new StringBuffer(); +// char c = 0; +// while((c=(char)reader.read())!='\n'){ +// if(c==8)sb.setLength(sb.length()-1); +// sb.append(c); +// out.print((char)8); +// out.flush(); +// } +// return sb.toString(); +// } + + /* + * + * Taken from the SUN website + * @author Paul Hinds + * @version $Id: PasswordTextInputRenderer.java,v 1.4 2007/01/04 22:57:18 teknopaul Exp $ + */ + class MaskingThread extends Thread { + private boolean stop = false; + private int index; + private String prompt; + + public MaskingThread(String prompt) { + this.prompt = prompt; + } + + public void run() { + while (!stop) { + try { + // attempt masking at this rate + this.sleep(1); + } + catch (InterruptedException iex) { + iex.printStackTrace(); + } + if (!stop) { + System.out.print("\r" + prompt + " \r" + prompt); + } + System.out.flush(); + } + } + + public void stopMasking() { + this.stop = true; + } + } + + public class PasswordField { + + /** + *@param prompt The prompt to display to the user. + *@return The password as entered by the user. + */ + String getPassword(String prompt) throws IOException { + // password holder + StringBuffer password = new StringBuffer(); + MaskingThread maskingthread = new MaskingThread(prompt); + Thread thread = new Thread(maskingthread); + thread.start(); + // block until enter is pressed + while (true) { + char c = (char) System.in.read(); + // assume enter pressed, stop masking + maskingthread.stopMasking(); + if (c == '\r') { + c = (char) System.in.read(); + if (c == '\n') { + break; + } + else { + continue; + } + } + else if (c == '\n') { + break; + } + else { + // store the password + password.append(c); + } + } + return password.toString(); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/PasswordTextInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ProgressPageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ProgressPageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ProgressPageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,68 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.IOException; +import java.io.PrintStream; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.renderer.AntOutputRenderer; + + +public class ProgressPageRenderer extends AbstractTextPageRenderer implements AntOutputRenderer { + + public ProgressPageRenderer() { + } + + /** + * getErr + * + * @return PrintStream + */ + public PrintStream getErr() { + return System.err; + } + + + + /** + * getOut + * + * @return PrintStream + */ + public PrintStream getOut() { + return System.out; + } + + + + /** + * renderPage + * + * @param page Page + * @return boolean + */ + public boolean renderPage(Page page) throws InstallException { + try { + printHeader(page); + } + catch (IOException ex) { + throw new InstallException("Can not print header");// not very likely!! + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ProgressPageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res.properties =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res.properties (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res.properties 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,16 @@ +#org.tp23.antinstaller.renderer.text.Res +#Wed Nov 10 00:25:59 CET 2004 + +_required_=required +_default_=default +true=true +affirmativeChars=T,Y +licenseAccept=Do you accept the license? Y or N [default\:Y] +clickViewLicense=Press enter to view the license agreement +clickViewText=Press enter to continue +enterNumber=Enter a number +fileDoesNotExist=The File does not exist +license_next=enter 'N' for the next page, enter anything else to scroll to the the end +large_select_next=enter 'N' for the next page, enter anything else to scroll to the the end +nextChar=N +availableOptions=view available options Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res.properties ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_de.properties =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_de.properties (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_de.properties 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,17 @@ +#org.tp23.antinstaller.renderer.text.Res +#Wed Nov 10 00:25:59 CET 2004 + +_required_=erforderlich +_default_=Voreinstellung +true=wahr +affirmativeChars=W,J +licenseAccept=Akzeptieren Sie diese Lizenz? J oder N [Vorgabe\:J] +clickViewLicense=Drücken Sie die Eingabetaste, um die Lizenzvereinbarung anzusehen +clickViewText=Press enter to continue +enterNumber=Geben Sie eine Zahl ein +fileDoesNotExist=Die Datei existiert nicht +license_next=Geben Sie 'N' für die nächste Seite ein, oder eine andere +Taste, um zum Ende zu springen +large_select_next=Geben Sie 'N' für die nächste Seite ein, oder eine andere Taste, um zum Ende zu springen +nextChar=N +availableOptions=Verfügbare Optionen ansehen \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_de.properties ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_es.properties =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_es.properties (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_es.properties 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,15 @@ +#org.tp23.antinstaller.renderer.text.Res +#Wed Nov 10 00:25:59 CET 2004 +_required_=Requerido +_default_=Por defecto +true=Verdad +affirmativeChars=S,V +licenseAccept=Aceptar la licencia? S o N [Por defecto\:Y] +clickViewLicense=Pulsar intro para ver licencia. +clickViewText=Pulsar intro para continuar. +enterNumber=Introduzca un nmero. +fileDoesNotExist=El fichero no existe. +license_next=Pulse 'S' para ver la siguiente página, pulse cualquier otra tecla para ir al final. +large_select_next=Pulse 'S' para ver la siguiente pàgina, pulse cualquier otra tecla para ir al final. +nextChar=S +availableOptions=Ver opciones disponibles. Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_es.properties ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_es_EU.properties =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_es_EU.properties (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_es_EU.properties 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,15 @@ +#org.tp23.antinstaller.renderer.text.Res +#Wed Nov 10 00:25:59 CET 2004 +_required_=Beharrezkoa +_default_=Lehenetsia +true=Egia +affirmativeChars=E,B +licenseAccept=Baimena onartzen duzu? E,B edo N [Lehenetsia\:Y] +clickViewLicense=Sakatu hemen baimena ikusteko. +clickViewText=Pulsar intro para continuar. +enterNumber=Sartu zenbaki bat. +fileDoesNotExist=Fitztegia ez da existitzen. +license_next=Sakatu 'N' hurrengo horrialdea ikusteko, sakatu beste edozer gauza bukaerara joateko. +large_select_next=Sakatu 'N' hurrengo horrialdea ikusteko, sakatu beste edozer gauza bukaerara joateko. +nextChar=N +availableOptions=ikusi aukerak Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/Res_es_EU.properties ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SelectInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SelectInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SelectInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,95 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.SelectInput; + + +public class SelectInputRenderer + implements TextOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + + protected InstallerContext ctx; + public SelectInputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + SelectInput iField = (SelectInput) field; + printText(iField,out); + + String input = reader.readLine(); + out.println(); + if(input == null || input.equals("")){ + input = iField.getDefaultValue(); + } + else { + try { + int idx = Integer.parseInt(input.trim()); + input = iField.getOptions()[idx - 1].value; + } catch(Exception numFormatOrIndexOutOfBounds){ + return; + } + } + iField.setInputResult(input); + } + public boolean isAbort(){ + return false; + } + private void printText(SelectInput iField, PrintStream out) throws IOException{ + out.println(iField.getDisplayText()); + SelectInput.Option[] options = iField.getOptions(); + out.print(" "); + out.println(res.getString("enterNumber")); + for (int i = 0; i < options.length; i++) { + out.print(" "); + out.print(i+1); + out.print(") "); + out.print(options[i].getText()); + if(iField.getDefaultValue().equals(options[i].value)){ + out.print(" ["); + out.print(res.getString("_default_")); + out.print("]"); + } + out.println(); + } + } + + + + /** + * renderError + * + * @param field InputField + * @param in InputStream + * @param out PrintStream + */ + public void renderError(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + ctx.getMessageRenderer().printMessage("Not a valid selection"); + renderOutput(field, reader, out); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SelectInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SimpleInputPageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SimpleInputPageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SimpleInputPageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,91 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.page.SimpleInputPage; +import org.tp23.antinstaller.renderer.RendererFactory; + +public class SimpleInputPageRenderer + extends AbstractTextPageRenderer { + + public SimpleInputPageRenderer() { + } + + public boolean renderPage(Page page) throws InstallException{ + if (page instanceof SimpleInputPage) { + try { + return renderSimpleInputPage( (SimpleInputPage) page); + } + catch (ClassNotFoundException ex) { + // this would be a code error + throw new InstallException("Cant find acceptable TextField renderer in SimpleInputPageRenderer.renderPage:" + ex.getMessage(), + ex); + } + } + else { + //this would be a code error + throw new InstallException("Wrong Renderer in SimpleInputPageRenderer.renderPage"); + } + } + + private boolean renderSimpleInputPage(SimpleInputPage page) + throws InstallException, ClassNotFoundException, ValidationException + { + + try { + printHeader(page); + OutputField[] fields = page.getOutputField(); + return renderFields( getContext(), fields, reader, out ); + } + catch (IOException ex) { + // If you cant write to the console there is not much you can do + throw new InstallException("IOException",ex); + } + } + + public static boolean renderFields( InstallerContext context, OutputField[] fields, BufferedReader reader, PrintStream out ) + throws ClassNotFoundException, IOException, ValidationException, InstallException + { + + for (int f = 0; f < fields.length; f++) { + String text = fields[f].getExplanatoryText(); + if(text != null){ + out.println(text); + out.println(); + } + + TextOutputFieldRenderer frenderer = RendererFactory.getTextRenderer(fields[f]); + frenderer.setContext( context ); + frenderer.renderOutput(fields[f], reader, out); + if (frenderer.isAbort()) { + return false; + } + while(!fields[f].validate( context ) ){ + frenderer.renderError(fields[f], reader, out); + }; + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SimpleInputPageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SplashPageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SplashPageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SplashPageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,49 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.IOException; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.page.SplashPage; + +public class SplashPageRenderer extends AbstractTextPageRenderer { + public SplashPageRenderer() { + } + public boolean renderPage(Page page) throws InstallException { + if (page instanceof SplashPage) { + SplashPage sPage = (SplashPage) page; + return renderSplashPage(sPage); + } + else { + throw new InstallException("Wrong Renderer in SplashPageRenderer.renderPage"); + } + } + private boolean renderSplashPage(SplashPage page) throws InstallException { + try { + printHeader(page); + out.println(); + out.println(page.getAltText()); + + reader.read(); + return true; + } + catch (IOException ex) { + throw new InstallException("IOException"); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/SplashPageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TargetInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TargetInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TargetInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,96 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.TargetInput; + + +public class TargetInputRenderer + implements TextOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + + protected InstallerContext ctx; + public TargetInputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + TargetInput iField = (TargetInput) field; + out.println("Install the following component?"); + out.print(iField.getDisplayText()); + + out.print(" ["); + out.print(res.getString("_default_")); + out.print(":"); + out.print(iField.getDefaultValue()); + out.print("]"); + + if (InputField.isTrue(iField.getForce())) { + out.print(" ["); + out.print(res.getString("_required_")); + out.println("]"); + ctx.getCurrentPage().addTarget(iField.getIdx(), iField.getTarget()); + iField.setInputResult("true"); + out.println(); + return; + } + + + + out.println(); + String input = reader.readLine(); + out.println(); + if (input == null || input.trim().equals("")){ + input = iField.getDefaultValue(); + } + if(InputField.isTrue(input)){ + ctx.getCurrentPage().addTarget(iField.getIdx(), iField.getTarget()); + iField.setInputResult("true"); + } + else{ + ctx.getCurrentPage().removeTarget(iField.getIdx()); + iField.setInputResult("false"); + } + + } + + public boolean isAbort() { + return false; + } + + + + /** + * renderError + * + * @param field InputField + * @param out PrintStream + */ + public void renderError(OutputField field, BufferedReader reader, PrintStream out) { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TargetInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TargetSelectInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TargetSelectInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TargetSelectInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,79 @@ +/* + * Copyright 2005 Paul Hinds, Mark Anderson + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.TargetSelectInput; + +/** + * + * @author Paul Hinds, Mark Anderson + * @version $Id: TargetSelectInputRenderer.java,v 1.3 2007/01/09 22:41:40 teknopaul Exp $ + */ +public class TargetSelectInputRenderer + extends SelectInputRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + + public TargetSelectInputRenderer() { + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + TargetSelectInput iField = (TargetSelectInput) field; + printText(iField,out); + + String input = reader.readLine(); + out.println(); + if(input == null || input.equals("")) + input = iField.getDefaultValue(); + else{ + try{ + int idx = Integer.parseInt(input.trim()); + input = iField.getOptions()[idx - 1].value; + } catch(Exception numFormatOrIndexOutOfBounds) { + return; + } + } + ctx.getCurrentPage().removeTarget(iField.getIdx()); + ctx.getCurrentPage().addTarget(iField.getIdx(), input); + iField.setInputResult(input); + } + + private void printText(TargetSelectInput iField, PrintStream out) throws IOException{ + out.println(iField.getDisplayText()); + TargetSelectInput.Option[] options = iField.getOptions(); + out.print(" "); + out.println(res.getString("enterNumber")); + for (int i = 0; i < options.length; i++) { + out.print(" "); + out.print(i+1); + out.print(") "); + out.print(options[i].getText()); + if(iField.getDefaultValue().equals(options[i].value)){ + out.print(" ["); + out.print(res.getString("_default_")); + out.print("]"); + } + out.println(); + } + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TargetSelectInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextMessageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextMessageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextMessageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,74 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.renderer.MessageRenderer; + +/** + * + * <p>Render user messages to the console </p> + * <p> </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: TextMessageRenderer.java,v 1.3 2007/01/09 22:41:40 teknopaul Exp $ + */ +public class TextMessageRenderer + implements MessageRenderer { + + private InstallerContext ctx = null; + + public TextMessageRenderer() { + } + + public void setInstallerContext(InstallerContext ctx){ + this.ctx = ctx; + } + public void printMessage(String message){ + System.out.println(message); + } + + public boolean prompt(String message){ + try { + System.out.println(message); + // FIXME need to read directly from InputStreamReader and stop at first \n or \r + // test the following +// InputStreamReader isr = new InputStreamReader(System.in); +// int intChar = -1; +// StringBuffer sb = new StringBuffer(); +// while((intChar = isr.read()) != -1 && intChar != '\n' && intChar != '\r'){ +// sb.append((char)intChar); +// } +// String line = sb.toString(); + + BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); + String line = reader.readLine(); + if (line != null && !line.equals("") && line.trim().length() > 0) { + return Character.toUpperCase(line.trim().charAt(0)) == 'Y' || + Character.toUpperCase(line.trim().charAt(0)) == 'T' ; + } + return false; + } + catch (IOException ex) { + throw new RuntimeException("IOException", ex); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextMessageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextOutputFieldRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextOutputFieldRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextOutputFieldRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,53 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.OutputField; + + + +/** + * + * <p>Renders text OutputFields, TextOutputFieldRenderer should provide a no args constructor. </p> + * <p>The package name for TextOutputFieldRenderer is critical</p> + * BufferedInputStream is used for input to prevent new Buffered reader swallowing more input from the + * input stream than is strictly required + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: TextOutputFieldRenderer.java,v 1.4 2006/12/21 00:03:01 teknopaul Exp $ + */ +public interface TextOutputFieldRenderer { + public void setContext(InstallerContext ctx); + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws InstallException, IOException; + /** + * Called when validation fails + * @param field InputField + * @param in InputStream + * @param out PrintStream + * @throws IOException + */ + public void renderError(OutputField field, BufferedReader reader, PrintStream out) throws IOException; + /** fields have abort for text since each field has its own input line*/ + public boolean isAbort(); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextOutputFieldRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextPageRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextPageRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextPageRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,101 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.page.TextPage; + + +public class TextPageRenderer + extends AbstractTextPageRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + private static final String nextChar = res.getString("nextChar"); + + public TextPageRenderer() { + } + + public boolean renderPage(Page page) throws InstallException { + if (page instanceof TextPage) { + TextPage lPage = (TextPage) page; + return renderTextPage(lPage); + } + else { + throw new InstallException("Wrong Renderer in TextPageRenderer.renderPage"); + } + } + + private boolean renderTextPage(TextPage page) throws InstallException { + try { + BufferedReader commandReader = reader;//new BufferedReader(new InputStreamReader(in)); + + String resource = page.getTextResource(); + InputStream textin = this.getClass().getResourceAsStream(resource); + BufferedReader reader = new BufferedReader(new InputStreamReader(textin)); + printHeader(page); + String lineread = null; + StringBuffer sb = new StringBuffer(); + + while ( (lineread = reader.readLine()) != null) { + sb.append(lineread); + sb.append('\n'); + } + // as per FindBugs + reader.close(); + + // parse property references + String parsedText = getContext().getInstaller().getResultContainer().getDefaultValue(sb.toString()); + + String command = null; + Pager pager = new Pager(parsedText); + do { + if (!pager.next(out)) { + break; + } + out.println(); + out.println(getNextInstructions()); + command = commandReader.readLine(); + } + while (command.toUpperCase().startsWith(nextChar)); + pager.rest(out); + + for (int i = 0; i < PAGE_DECO_WIDTH; i++) { + out.print('~'); + } + + out.println(); + out.println(res.getString("clickViewText")); + commandReader.readLine(); + + return true; + } + catch (IOException ex) { + throw new InstallException("Not able to read text file", ex); + } + } + + private String getNextInstructions() { + return res.getString("license_next"); + } +} + Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/TextPageRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/UnvalidatedTextInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/UnvalidatedTextInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/UnvalidatedTextInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,74 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.UnvalidatedTextInput; + + +public class UnvalidatedTextInputRenderer + implements TextOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + + protected InstallerContext ctx; + public UnvalidatedTextInputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + UnvalidatedTextInput iField = (UnvalidatedTextInput) field; + out.print(field.getDisplayText()); + + out.print(" ["); + out.print(res.getString("_default_")); + out.print(":"); + out.print(iField.getDefaultValue()); + out.print("]"); + + + //BufferedReader reader = new BufferedReader(new InputStreamReader(in)); + out.println(); + String input = reader.readLine(); + out.println(); + if(input==null || input.equals(""))input=iField.getDefaultValue(); + iField.setInputResult(input); + } + public boolean isAbort(){ + return false; + } + + + + /** + * renderError + * + * @param field InputField + * @param in InputStream + * @param out PrintStream + */ + public void renderError(OutputField field, BufferedReader reader, PrintStream out) { + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/UnvalidatedTextInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ValidatedTextInputRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ValidatedTextInputRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ValidatedTextInputRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,66 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.renderer.text; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.ValidatedTextInput; + + +public class ValidatedTextInputRenderer + implements TextOutputFieldRenderer { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + + protected InstallerContext ctx; + public ValidatedTextInputRenderer() { + } + + public void setContext(InstallerContext ctx) { + this.ctx = ctx; + } + + public void renderOutput(OutputField field, BufferedReader reader, PrintStream out) throws IOException { + ValidatedTextInput iField = (ValidatedTextInput) field; + out.print(field.getDisplayText()); + + out.print(" ["); + out.print(res.getString("_default_")); + out.print(":"); + out.print(iField.getDefaultValue()); + out.println("]"); + + + //BufferedReader reader = new BufferedReader(new InputStreamReader(in)); + String input = reader.readLine(); + out.println(); + if(input==null || input.equals(""))input=iField.getDefaultValue(); + iField.setInputResult(input); + } + public void renderError(OutputField field, BufferedReader reader, PrintStream out) throws IOException{ + //ValidatedTextInput iField = (ValidatedTextInput) field; + out.println("The input is not of the correct format"); + renderOutput(field, reader, out); + } + public boolean isAbort(){ + return false; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/ValidatedTextInputRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/package.html =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/package.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/package.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,9 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head><!-- + Copyright (c) 2004 tp23 + All Rights Reserved. +--></head> + +<body bgcolor="white">Renderers for the command line interface.</body> +</html> Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/renderer/text/package.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AntRunner.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AntRunner.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AntRunner.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,54 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.antmod.RuntimeLauncher; +import org.tp23.antinstaller.page.Page; + +/** + * Abstract Runner superclass that handles the runPost(page) to execute + * ant tasks mid display. + * @author teknopaul + */ +public abstract class AntRunner implements Runner{ + + private RuntimeLauncher launcher = null; + private InstallerContext ctx; + + public AntRunner(InstallerContext ctx) { + this.ctx = ctx; + } + + protected void runPost(Page page){ + String postTarget = page.getPostDisplayTarget(); + if(postTarget != null){ + if(launcher == null){ + prepareLauncher(); + } + launcher.updateProps(); + launcher.run(postTarget); + } + } + /** + * This should never get run if there are no postTargets + * + */ + private void prepareLauncher(){ + launcher = new RuntimeLauncher(ctx); + launcher.parseProject(); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AntRunner.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AutoSwingRunner.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AutoSwingRunner.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AutoSwingRunner.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,53 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import java.util.List; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.renderer.swing.SwingPageRenderer; +/** + * Swing runner that starts with the last page bypassing all the other pages. + * This will be used during auto builds where the properties are already known. + * @author teknopaul + * + */ +public class AutoSwingRunner extends SwingRunner { + + public AutoSwingRunner(InstallerContext ctx){ + super(ctx); + } + protected void showFirstPage() throws Exception { + Page[] pages = installer.getPages(); + // run all postDisplayTargets as if the pages were shown + for (int i = 0; i < pages.length; i++) { + Page page = pages[i]; + if(page.getPostDisplayTarget() != null){ + if( ifHelper.ifProperty(page) && + ifHelper.ifTarget(page, ctx.getInstaller().getPages()) ){ // page would have been shown + runPost(page); + } + } + } + + // shows the LAST page directly which should be the Progress page + ctx.setCurrentPage(pages[pages.length - 1]); + List pageRenderers = getPageRenderers(); + renderNext((SwingPageRenderer)pageRenderers.get(pageRenderers.size() - 1)); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AutoSwingRunner.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AutoTextRunner.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AutoTextRunner.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AutoTextRunner.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,45 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import java.io.IOException; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.page.Page; + +public class AutoTextRunner extends TextRunner { + + public AutoTextRunner(InstallerContext ctx) throws IOException{ + super(ctx); + } + + public boolean runInstaller() throws InstallException { + Page[] pages = installer.getPages(); + // run all postDisplayTargets as if the pages were shown + for (int i = 0; i < pages.length; i++) { + Page page = pages[i]; + if(page.getPostDisplayTarget() != null) { + if( ifHelper.ifProperty(page) && + ifHelper.ifTarget(page, ctx.getInstaller().getPages()) ) { // page would have been shown + runPost(page); + } + } + } + + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/AutoTextRunner.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ConfigurationException.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ConfigurationException.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ConfigurationException.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,38 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import org.tp23.antinstaller.InstallException; + + +/** + * <p>A Runtime exception that implies the config file is wrong.</p> + */ +public class ConfigurationException + extends InstallException { + public ConfigurationException() { + super(); + } + + public ConfigurationException(String message) { + super(message); + } + + public ConfigurationException(String message, Throwable cause) { + super(message, cause); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ConfigurationException.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ConfigurationLoader.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ConfigurationLoader.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ConfigurationLoader.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,353 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.Installer; +import org.tp23.antinstaller.PropertiesFileRenderer; +import org.tp23.antinstaller.input.ConditionalField; +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.ResultContainer; +import org.tp23.antinstaller.input.SelectInput; +import org.tp23.antinstaller.input.TargetInput; +import org.tp23.antinstaller.input.TargetSelectInput; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.page.ProgressPage; +import org.tp23.antinstaller.page.SimpleInputPage; +import org.tp23.antinstaller.renderer.swing.plaf.LookAndFeelFactory; +import org.tp23.antinstaller.runtime.exe.LoadConfigFilter; +import org.tp23.antinstaller.runtime.exe.PropertyLoaderFilter; +import org.tp23.antinstaller.runtime.logic.ExpressionBuilder; +/** + * + * <p>Loads the configuration file into memory as an Installer object. </p> + * <p>This class also contains the main() method to check the config files for common errors </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @todo this should be an interface not a class + * @author Paul Hinds + * @version $Id: ConfigurationLoader.java,v 1.15 2007/01/28 08:44:43 teknopaul Exp $ + */ +public class ConfigurationLoader extends LoadConfigFilter{ + + /** + * Command line config checker + * @param args String[] + * @throws InstallException + */ + public static void main(String[] args) { + ConfigurationLoader configurationLoader = new ConfigurationLoader(); + String configFile = INSTALLER_CONFIG_FILE; + if(args.length > 1 && args[1].endsWith(".xml")){ + configFile = args[1]; + } + int ret = 1; + try { + configurationLoader.readConfig(new File(args[0]), configFile); + ret = configurationLoader.validate(); + + if(ret > 0){ + System.out.println("VALIDATION FAILED"); + } + } + catch (ConfigurationException ex) { + ex.printStackTrace(); + System.exit(ret); + } + catch (IOException ex) { + ex.printStackTrace(); + System.exit(ret); + } catch (InstallException ex) { + // probably ifProperty syntax wrong + ex.printStackTrace(); + System.exit(ret); + } + } + + /** + * This method is not valid until super.readConfig() has been run + * @return + */ + public Installer getInstaller(){ + return installer; + } + + public int validate() throws IOException, ConfigurationException, InstallException{ + Page[] pages = installer.getPages(); + boolean foundErrors = false; + Set pageNames = new HashSet(); + Set targets = new HashSet(); + Set propertyNames = new HashSet(); + Set pagePropertyNames = null; + + if(validateInstallerAttributes()){ + foundErrors = true; + } + + for (int p = 0; p < pages.length; p++) { + System.out.println("Checking page: " + pages[p].getName() ); + if(pageNames.contains(pages[p].getName())){ + System.out.println("Error: page name '" + + pages[p].getName() + + "' repeated - auto loading of configuration will fail"); + foundErrors = true; + } + pageNames.add(pages[p].getName()); + + //TODO check page requirements + //test ifProperty syntax + // TODO passes validation even if nothing will evaluate + if (pages[p] instanceof SimpleInputPage) { + SimpleInputPage sPage = (SimpleInputPage)pages[p]; + if(sPage.getIfProperty() != null){ + try { + ResultContainer mock = new ResultContainer(); + ExpressionBuilder.parseLogicalExpressions( mock, + sPage.getIfProperty() ); + } + catch( ConfigurationException configExc ){ + System.out.println("Error: loading ifProperty," + sPage.getIfProperty() + " ,page: " + pages[p].getName() ); + foundErrors = true; + } + } + } + + + pagePropertyNames = new HashSet(); + + OutputField[] fields = pages[p].getOutputField(); + for (int f = 0; f < fields.length; f++) { + if(!fields[f].validateObject()){ + foundErrors = true; + System.out.println("Error in page:" + pages[p].getName()); + } + if(fields[f] instanceof TargetInput){ + TargetInput tgtInput = (TargetInput)fields[f]; + targets.add(tgtInput.getTarget()); + } + if(fields[f] instanceof InputField && !(fields[f] instanceof ConditionalField) ){ + InputField genericInput = (InputField)fields[f]; + if(genericInput.getProperty().endsWith(PropertiesFileRenderer.TARGETS_SUFFIX)){ + System.out.println("Error: invalid property name:" + genericInput.getProperty()); + System.out.println("InputField names must not end with -targets"); + } + String propertyName = genericInput.getProperty(); + //System.out.println("Checking page.property: " + pages[p].getName() + "," + propertyName ); + if(propertyNames.contains(propertyName)){ + //foundErrors = true; + System.out.println("Repeated property name:" + propertyName); + System.out.println("Loading defaults from file will probably not work:" + propertyName); + } + else{ + propertyNames.add(propertyName); + } + // repeated properties on the same page are an error always + if(pagePropertyNames.contains(propertyName)){ + foundErrors = true; + System.out.println("Repeated property name: page=" + + pages[p].getName() + ", property=" + propertyName); + } + else{ + pagePropertyNames.add(propertyName); + } + + } + } + + } + System.out.println("Finished checking config inputs"); + // check page structure + if(!(pages[pages.length-1] instanceof ProgressPage)){ + foundErrors = true; + System.out.println("Last Page should be a progress page"); + } + else{ + if (pages[pages.length-1].getPostDisplayTarget() != null){ + foundErrors = true; + System.out.println("Progress pages do not support postDisplayTarget"); + } + } + // check for targets + int numOfPageTargets = 0; + for (int p = 0; p < pages.length; p++) { + numOfPageTargets += pages[p].getAllTargets().size(); + } + if(numOfPageTargets == 0){ + System.out.println("Warning: No Page Targets (not a problem if there are target input types)"); + } + + Iterator iter = targets.iterator(); + while (iter.hasNext()) { + String tgt = (String) iter.next(); + if(tgt.endsWith(PropertiesFileRenderer.TARGETS_SUFFIX)){ + System.out.println("Error: invalid target name:" + tgt); + System.out.println("Target names must not end with -targets"); + foundErrors = true; + } + } + + //@todo check targets exist in build.xml remember OSSpecific could be tricky to validate + + int numOfTargetInputs = 0; + // check ifTargets + ArrayList targetsSoFar = new ArrayList(); + for (int p = 0; p < pages.length; p++) { + if(pages[p] instanceof SimpleInputPage){ + SimpleInputPage simple = (SimpleInputPage)pages[p]; + String ifTarget = simple.getIfTarget(); + if(ifTarget != null && !targetsSoFar.contains(ifTarget)){ + System.out.println("ifTarget=" + ifTarget); + System.out.println("ifTarget will never test true, no prior target in page:"+pages[p].getName()); + // disabled due to bug 1412658 could be reinstated with proper test and OSSpecific handling + //foundErrors = true; + } + } + // add after to ensure testing previous pages + targetsSoFar.addAll(pages[p].getAllTargets()); + OutputField[] fields = pages[p].getOutputField(); + for (int f = 0; f < fields.length; f++) { + if(fields[f] instanceof TargetInput){ + if(numOfTargetInputs == 0){ + System.out.println("Found target input type"); + } + numOfTargetInputs++; + TargetInput ti = (TargetInput)fields[f]; + targetsSoFar.add(ti.getTarget()); + } + if(fields[f] instanceof TargetSelectInput){ + if(numOfTargetInputs == 0){ + System.out.println("Found target input type"); + } + numOfTargetInputs++; + TargetSelectInput ti = (TargetSelectInput)fields[f]; + SelectInput.Option[] options = ti.getOptions(); + for (int i = 0; i < options.length; i++) { + SelectInput.Option option = options[i]; + targetsSoFar.add(option.value); + } + } + } + } + if(numOfPageTargets == 0 && numOfTargetInputs == 0){ + System.out.println("Warning: No targets found, installer may do nothing."); + } +// if(targetsSoFar.contains("default")){ +// System.out.println("Target:target can not be \"default\""); +// foundErrors = true; +// } + + + System.out.println("Finished checking config"); + if(!foundErrors){ + return 0; + } + return 1; + } + + private boolean validateInstallerAttributes(){ + + System.out.println("Checking installer: " + installer.getName() ); + boolean foundErrors = false; + + String[] validBooleanValues = {"true", "false"}; + foundErrors |= validateValue("antialiased", installer.getAntialiased(), true, validBooleanValues); + + // done in DTD + //foundErrors |= validateValue("verbose", installer.isVerbose(), true, validBooleanValues); + //foundErrors |= validateValue("debug", installer.isDebug(), true, validBooleanValues); + + String[] validLAFValues = {LookAndFeelFactory.DEFAULT_LAF, + LookAndFeelFactory.GREYMETAL_LAF, + LookAndFeelFactory.NATIVE_LAF, + LookAndFeelFactory.JGOODIES_LAF, + LookAndFeelFactory.NULL_LAF }; + if( validateValue("lookAndFeel", installer.getLookAndFeel(), true, validLAFValues) ){ + System.out.println("Warning: non standard LookAndFeel ensure the correct classes are on the classpath at runtime:" + installer.getLookAndFeel()); + } + + if (installer.getName() == null){ + System.out.println("Error: installer element attribute does not exist: name"); + foundErrors = true; + } + + try { + String wide = installer.getWide(); + if(wide != null){ + installer.parseWideValue(wide); + } + } catch (Exception e) { + System.out.println("Error: installer element attribute incorrect format (e.g. 600:275): wide"); + foundErrors = true; + } + + String[] validLoadDefaultValues = {PropertyLoaderFilter.FALSE, + PropertyLoaderFilter.LOAD, + PropertyLoaderFilter.PROMPT, + PropertyLoaderFilter.PROMPT_AUTO}; + + boolean loadDefaultsNull = true; + if( installer.supportsAutoBuild() ){ + loadDefaultsNull = false; + } + foundErrors |= validateValue("loadDefaults", installer.getLoadDefaults(), loadDefaultsNull, validLoadDefaultValues); + + VersionHelper vHelper = new VersionHelper(); + if( installer.supportsAutoBuild() ){ + if( ! vHelper.isValid(installer.getVersion()) ){ + System.out.println("Error: invalid version attribute, required for -auto builds:" + installer.getVersion()); + foundErrors = true; + } + } + if(installer.getVersion() != null){ + if( ! vHelper.isValid(installer.getVersion()) ){ + System.out.println("Error: invalid version attribute format examples 1.2.0 , 0.2beta:" + installer.getVersion()); + foundErrors = true; + } + } + + return foundErrors; + } + /** + * @return foundErrors (true if there was an error) + */ + private boolean validateValue(String att, String value, boolean allowsNull, String[] validValues){ + if(value == null){ + if(!allowsNull){ + System.out.println("Error: installer element attribute does not exist: " + att); + return true; + } + return false; + } + else { + for (int i = 0; i < validValues.length; i++) { + if(validValues[i].equals(value)){ + return false; + } + } + System.out.println("Error: installer element attribute not valid value: " + att); + return true; + } + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ConfigurationLoader.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ExecInstall.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ExecInstall.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ExecInstall.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,266 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import java.io.File; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.renderer.MessageRenderer; +import org.tp23.antinstaller.runtime.exe.ExecuteFilter; +import org.tp23.antinstaller.runtime.exe.ExecuteRunnerFilter; +import org.tp23.antinstaller.runtime.exe.FilterChain; +import org.tp23.antinstaller.runtime.exe.FilterFactory; +import org.tp23.antinstaller.runtime.exe.FinalizerFilter; +import org.tp23.antinstaller.selfextract.SelfExtractor; + + + +/** + * This is the Applications entry point, it has a main method to run the + * installer. The main method is only for scripted installs. + * + * It is here that the command line options are parsed and it + * is determined which type of install (swing or text) will be run. + * <p>Reads the config, determines the runner, runs it and outputs the + * properties file, The Ant targets are then called by the AntRunner. + * This class also builds the internal Objects from the XML config file.</p> + * <p>This class can also be called by external tools to launch the installer + * currently two options are provided to lauch from Jars. </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: ExecInstall.java,v 1.9 2007/01/19 00:24:36 teknopaul Exp $ + */ +public class ExecInstall { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + public static final String CONFIG_RESOURCE = "/org/tp23/antinstaller/runtime/exe/script.fconfig"; + + private final InstallerContext ctx = new InstallerContext(); + private FilterChain chain; + /** + * @param chain chain of filters to be executed + */ + public ExecInstall(FilterChain chain){ + this.chain = chain; + } + + + + /** + * Execute the installer, this reads the config fetches a runner and runs the install. + * Once the install pages have finished an AntRunner is used to run Ant + */ + public void exec() { + + ExecuteFilter[] filters = null; + try { + chain.init(ctx); + filters = chain.getFilters(); + } + catch (Exception e) { + // This is a developer error or the package has not been built correctly + // It should never happen in a tested build + e.printStackTrace(); + System.exit(1); // called manually since in Win it was not shutting down properly + } +loop: for (int i = 0; i < filters.length; i++) { + try{ + ctx.log("Filter: " + filters[i].getClass().getName()); + filters[i].exec(ctx); + } + catch (ExecuteRunnerFilter.AbortException abort){ + MessageRenderer vLogger = ctx.getMessageRenderer(); + vLogger.printMessage(abort.getMessage()); + ctx.log("Aborted"); + FinalizerFilter ff = (FinalizerFilter)filters[filters.length - 1]; + ff.exec(ctx); + System.exit(1); + } + catch (Exception ex) { + + // write errors to the log + ctx.log("Installation error: " + ex.getMessage() + ": " + ex.getClass().toString()); + boolean verbose = true; // be verbose if we cant load the config + if(ctx.getInstaller() != null) { + verbose = ctx.getInstaller().isVerbose(); + } + ctx.log(verbose, ex); + + // write detailed errors to stdout for the GUI screens and text + if (ctx.getRunner() instanceof TextRunner) { + if(verbose){ + ex.printStackTrace(); + } + } + else { + if(verbose){ + ex.printStackTrace(System.err); + } + } + + // report the error to the user + MessageRenderer vLogger = ctx.getMessageRenderer(); + if(vLogger != null){ + vLogger.printMessage(res.getString("installationFailed") + "\n" + ex.getMessage()); + //Fixed BUG:1295944 vLogger.printMessage("Install failed\n" + ex.getMessage()); + } else { + System.err.println(res.getString("installationFailed") + ex.getClass().getName()); + System.err.println(ex.getMessage()); + } + + if(ctx.getRunner() != null){ + ctx.getRunner().fatalError(); + break loop; + } + else { // the screens did not even start e.g. XML config error + System.exit(1); + } + } + } + + } + + + + + + /** + * <p>Runs the installer from a script.</p> + * + * This install can be run from a set of files for example from a CD. + * @see org.tp23.antinstaller.selfextract.NonExtractor + * @see org.tp23.antinstaller.selfextract.SelfExtractor + * + * @param args String[] args are "default" or "swing" or "text" followed by the root directory of the install + */ + public static void main(String[] args) { + try { + FilterChain chain = FilterFactory.factory(CONFIG_RESOURCE); + ExecInstall installExec = new ExecInstall(chain); + if(installExec.parseArgs(args, true)){ + installExec.exec(); + } + } + catch (InstallException e) { + // Installer developer error + System.out.println("Cant load filter chain:/org/tp23/antinstaller/runtime/exe/script.fconfig"); + e.printStackTrace(); + } + } + + /** + * This method has been designed for backward compatibility with + * existing scripts. The root dir is passed on the command line for scripted + * installs but is determined automatically for installs from self-extracting Jars + * @param args + * @param requiresRootDir set to true if the args must include the root directory + */ + public boolean parseArgs(String[] args, boolean requiresRootDir){ + String uiOverride = null; + String installType = null; + String installRoot = null; + + int i = 0; + if(args.length > i && !args[i].startsWith("-")) { + uiOverride = args[i]; + i++; + ctx.setUIOverride(uiOverride); + } + + if(requiresRootDir){ + if(args.length > i && !args[i].startsWith("-")) { + installRoot = args[i]; + i++; + ctx.setFileRoot(new File(installRoot)); + } + else{ + printUsage(); + return false; + } + } + // additional params should all have a -something prefix + for (; i < args.length; i++) { + // RFE 1569628 + if("-type".equals(args[i]) && args.length > i + 1){ + installType = args[i + 1]; + i++; + String configFileName = "antinstall-config-" + installType + ".xml"; + String buildFileName = "build-" + installType + ".xml"; + ctx.setInstallerConfigFile(configFileName); + ctx.setAntBuildFile(buildFileName); + } + } + + return true; + } + + private static void printUsage(){ + System.out.println("Usage java -cp $CLASSPATH org.tp23.antinstaller.ExecInstall [text|swing|default] [install root] (-type [buildtype])"); + } + + + /** + * Sets the UI override from the command line + * @param installRoot + */ +// public void setUIOverride(String override) { +// ctx.setUIOverride(override); +// } + /** + * This is generated by the Main class which knows where it has + * extracted or where it has run from + * @param installRoot + */ + public void setInstallRoot(File installRoot) { + ctx.setFileRoot(installRoot); + } + + /** + * This is AntInstalls temporary space which will generally be deleted + * except in debug mode when it is left to view the build process. + * installRoot and tempRoot can be the same if the directory + * is a new empty directory + * @param tempDir directory to be used for temporary storage + */ + public void setTempRoot(File tempDir) { + addShutdownHook(tempDir); + } + /** + * This shutdown hook is to facilitate debugging the app can be left open + * in the GUI view and the resources will not be deleted. Upon exit + * temporary files will be removed. This is required because the + * deleteOnExit() method fails if the directory is filled with files. + * @param tempDir + */ + private void addShutdownHook(final File tempDir){ + Runnable hook = new Runnable(){ + public void run(){ + if(ctx.getInstaller() != null && + ctx.getInstaller().isDebug()) return; + if(tempDir != null && tempDir.exists() && tempDir.isDirectory()){ + SelfExtractor.deleteRecursive(tempDir); + } + } + }; + Thread cleanUp = new Thread(hook); + cleanUp.setDaemon(true); + Runtime.getRuntime().addShutdownHook(cleanUp); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/ExecInstall.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/IfPropertyHelper.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/IfPropertyHelper.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/IfPropertyHelper.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,89 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.page.SimpleInputPage; +import org.tp23.antinstaller.runtime.logic.Expression; +import org.tp23.antinstaller.runtime.logic.ExpressionBuilder; + + +/** + * <p>Encapsulates code fo the ifProperty feature</p> + * N.B. It is the installer generator's responsibility to ensure that properties passed + * to the less than or greater than test are valid Numbers. + * The internal Java format used is a Double so avalid regex would be + * something like [0-9]+\.*[0-9]* or [0-9]+ for an Integer. + * The rather strange -= and += syntax is used because > and < + * must be escaped to &gt; and &lt; in XML attributes and the legibility + * of the configuration files would be impared. + * REF: 1145496 + * @author Paul Hinds + * @version $Id: IfPropertyHelper.java,v 1.5 2007/01/19 00:24:36 teknopaul Exp $ + */ +public class IfPropertyHelper { + + private InstallerContext ctx = null; + public IfPropertyHelper(InstallerContext ctx){ + this.ctx = ctx; + } + + /** + * @return boolean true to SHOW the page + */ + public boolean ifProperty(Page next) throws InstallException { + // show page if ifProperty is specified and property is correct + if(next instanceof SimpleInputPage) { + SimpleInputPage conditionalPage = (SimpleInputPage) next; + String ifProperty = conditionalPage.getIfProperty(); + if (ifProperty != null) { + Expression expression; + try { + expression = ExpressionBuilder.parseLogicalExpressions( ctx.getInstaller().getResultContainer(), + ifProperty ); + } + catch( ConfigurationException configExc ) { + throw new InstallException( "Error parsing ifProperty condition for page " + next.getName(), + configExc ); + } + return expression.evaluate(); + } + + } + return true; // show the page by default + } + + /** + * @return boolean true to SHOW the page + */ + public boolean ifTarget(Page next, Page[] pages){ + // skip iftarget specified and target is missing + if(next instanceof SimpleInputPage){ + SimpleInputPage conditionalPage = (SimpleInputPage) next; + String ifTarget = conditionalPage.getIfTarget(); + if (ifTarget != null) { + boolean show = false; + for (int p = 0; p < pages.length; p++) { + show |= pages[p].isTarget(ifTarget); + } + return show; + } + } + return true; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/IfPropertyHelper.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/Logger.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/Logger.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/Logger.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,44 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import java.io.IOException; + +import org.tp23.antinstaller.Installer; + +public interface Logger { + + public void log(String message); + + public void log(Throwable exception); + + /** + * Logs the stack trace only if the installer is in verbose mode + * @param installer + * @param exception + */ + public void log(Installer installer, Throwable exception); + + public void setFileName(String fileName) throws IOException; + + /** + * Get the name of the file used for logging + * @return path to file or <code>null</code> if not initialised + */ + public String getFileName(); + + public void close(); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/Logger.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/Runner.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/Runner.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/Runner.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,56 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import org.tp23.antinstaller.InstallException; + + + +/** + * + * <p>A Runner runs the user interaction screens, not ant. + * The base interface for TextRunner and SwingRunner </p> + * <p>Instances of this interface should have a constructor that takes + * an InstallerContext as an argument</p> + * Due to historic bad naming convention there exists an AntRunner which has + * no connection to this interface. + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: Runner.java,v 1.2 2006/03/24 18:27:28 teknopaul Exp $ + */ + +public interface Runner { + + /** + * Renders the installer screens. This method should block until + * the UI has finished + * @throws InstallException + * @return boolean false implies user aborted + */ + public boolean runInstaller() throws InstallException; + + /** + * Called after Ant has finished so the Runner can clean up or provide feedback + */ + public void antFinished(); + + /** + * Called if the install failed for some reason and can not continue; + * + */ + public void fatalError(); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/Runner.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/SimpleLogger.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/SimpleLogger.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/SimpleLogger.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,120 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; + +import org.tp23.antinstaller.Installer; + +/** + * A Logger class that does not report errors + * + * @author Paul Hinds + * @version $Id: SimpleLogger.java,v 1.4 2007/01/19 00:24:36 teknopaul Exp $ + */ +public class SimpleLogger implements Logger { + + BufferedWriter fos; + + private String fileName; + + public SimpleLogger() { + } + + /** + * This method initialises the logger + */ + public void setFileName(String fileName) { + this.fileName = fileName; + try { + fos = new BufferedWriter(new FileWriter(fileName, false)); + fos.write("Logger initialized"); + fos.newLine(); + } catch (IOException e) { + fos = null; + } + } + + public String getFileName() { + return fileName; + } + + public void log(String message) { + if (fos == null) { + return; + } + try { + fos.write(message); + fos.newLine(); + fos.flush(); + } catch (Exception ex) { + throw new RuntimeException("Can not write to logs"); + } + } + + public void log(Installer installer, Throwable exception) { + if (installer != null && installer.isVerbose()) { + log(exception); + } + } + + public void log(Throwable exception) { + if (fos == null) { + return; + } + try { + StringWriter writer = new StringWriter(); + exception.printStackTrace(new PrintWriter(writer)); + String s = writer.getBuffer().toString(); + fos.write(s); + fos.newLine(); + } catch (IOException ex) { + throw new RuntimeException("Can not write to logs"); + } + } + + public void close() { + try { + if (fos != null) { + fos.flush(); + fos.close(); + fos = null; + } + } catch (IOException e) { + System.err.println("Can't close logger"); + } + } + + /** + * Called by the garbage collector on an object when garbage collection + * determines that there are no more references to the object. + * + * @throws Throwable + * the <code>Exception</code> raised by this method + * @todo Implement this java.lang.Object method + */ + protected void finalize() throws Throwable { + if (fos != null) { + fos.flush(); + fos.close(); + } + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/SimpleLogger.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/SwingRunner.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/SwingRunner.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/SwingRunner.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,387 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import java.awt.GraphicsConfiguration; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.ResourceBundle; + +import javax.swing.ImageIcon; +import javax.swing.JFrame; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.Installer; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ValidationException; +import org.tp23.antinstaller.antmod.FeedbackListener; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.renderer.AntOutputRenderer; +import org.tp23.antinstaller.renderer.RendererFactory; +import org.tp23.antinstaller.renderer.swing.PageCompletionListener; +import org.tp23.antinstaller.renderer.swing.SizeConstants; +import org.tp23.antinstaller.renderer.swing.SwingInstallerContext; +import org.tp23.antinstaller.renderer.swing.SwingMessageRenderer; +import org.tp23.antinstaller.renderer.swing.SwingPageRenderer; + +/** + * <p>Runs the installer in a JFrame window </p> + * <p>This class uses the Installer object tree as its data source and renderers + * from the org.tp23.antinstaller.renderer.swing package </p> + * Runners must also create a MessageRenderer and make it available in the + * InstallerContext + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * + * @author Paul Hinds + * @version $Id: SwingRunner.java,v 1.11 2007/01/19 00:24:36 teknopaul Exp $ + */ +public class SwingRunner extends AntRunner implements Runner, PageCompletionListener { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + + protected SwingInstallerContext swingCtx = null; + private JFrame frame = new JFrame(); + private List pageRenderers; + private volatile boolean doAnt = false; + protected Thread initialThread; + protected IfPropertyHelper ifHelper; + // context local property refs + protected InstallerContext ctx; + protected Logger logger; + protected Installer installer; + + public SwingRunner(InstallerContext ctx) { + super(ctx); + swingCtx = new SwingInstallerContext(ctx, frame); + + SwingMessageRenderer smr = new SwingMessageRenderer(); + smr.setOwner(frame); + ctx.setMessageRenderer(smr); + + ctx.setBuildListener(new FeedbackListener(swingCtx)); + + ifHelper = new IfPropertyHelper(ctx); + logger = ctx.getLogger(); + installer = ctx.getInstaller(); + this.ctx = ctx; + } + + /** + * Renders the installer in a Swing GUI, this method blocks until + * the UI has finished + * + * @return boolean false implies user aborted + * @throws InstallException + */ + public boolean runInstaller() throws InstallException { + try { + frame.setTitle(installer.getName()); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setSize(SizeConstants.PAGE_WIDTH, SizeConstants.PAGE_HEIGHT); + frame.getRootPane().setDoubleBuffered(true); + setLocation(frame); + setIcon(frame, installer); + + preparePages(installer.getPages(), ctx); + showFirstPage(); + // need to block here until pages are complete + initialThread = Thread.currentThread(); + try { + Thread.sleep(Long.MAX_VALUE); + } + catch (InterruptedException ex1) { + + } + return doAnt; + } + catch (Exception ex) { + logger.log("Fatal exception: " + ex.getMessage()); + if (ctx.getInstaller().isVerbose()) { + logger.log(ex); + } + ctx.getMessageRenderer().printMessage("Fatal exception: " + ex.getMessage()); + throw new InstallException("", ex); + } + } + + public void pageBack(Page page) { + if (page.isAbort()) { + abort(); + return; + } + Page[] pages = installer.getPages(); + for (int i = 0; i < pages.length; i++) { + if (pages[i] == page) { + // found current page + if (i > 0) { + + //skip pages if the ifTarget or ifProperty attributes exist and fail + int nextIdx = i - 1; + try { + while (true) { + if (!ifHelper.ifTarget(pages[nextIdx], pages) || + !ifHelper.ifProperty(pages[nextIdx])) { + //Continue looping + --nextIdx; + } else { + break; + } + } + } + catch (InstallException instExc) { + logger.log("InstallException rendering page:" + page.getName()); + logger.log(installer, instExc); + } + + //for(;ifTargetSkip(pages[nextIdx], pages);nextIdx--); + + SwingPageRenderer renderer = (SwingPageRenderer) pageRenderers.get(nextIdx); + ctx.setCurrentPage(pages[nextIdx]); + try { + renderNext(renderer); + } + catch (InstallException ex) { + logger.log("InstallExcepiton rendering page:" + page.getName()); + logger.log(installer, ex); + } + catch (ClassNotFoundException ex) { + logger.log("ClassNotFoundException rendering page:" + page.getName()); + logger.log(installer, ex); + } + return; + } + } + } + } + + /** + * Called when a page is complete and the next button is pressed. + * This method is called by the event thread that looses exceptions so Throwable + * is caught + * + * @param page Page + */ + public void pageComplete(Page page) { + try { + if (page.isAbort()) { + abort(); + return; + } + runPost(page); + Page[] pages = installer.getPages(); + SwingPageRenderer currentRenderer; + for (int i = 0; i < pages.length; i++) { + if (pages[i] == page) { // found current page + currentRenderer = (SwingPageRenderer) pageRenderers.get(i); + // check validation + boolean validationPassed = false; + try { + currentRenderer.updateInputFields(); + validationPassed = currentRenderer.validateFields(); + } catch (ValidationException ve) { + logger.log("ValidationException rendering page:" + page.getName()); + logger.log(installer, ve); + return; + } + if (!validationPassed) { + return; + } + + + if (i < pages.length - 1) { + + //more pages left + + // skip the page if the ifTarget or ifProperty dictate it + int nextIdx = i + 1; + while (true) { + if (!ifHelper.ifTarget(pages[nextIdx], pages) || + !ifHelper.ifProperty(pages[nextIdx])) { + //Continue looping + nextIdx++; + } else { + break; + } + } + + + SwingPageRenderer renderer = (SwingPageRenderer) pageRenderers.get(nextIdx); + ctx.setCurrentPage(pages[nextIdx]); + try { + renderNext(renderer); + } + catch (InstallException ex) { + logger.log("InstallException rendering page:" + page.getName()); + logger.log(installer, ex); + } + catch (ClassNotFoundException ex) { + logger.log("ClassNotFoundException rendering page:" + page.getName()); + logger.log(installer, ex); + } + return; + } + if (i == pages.length - 1) { + // all done + currentRenderer.getBackButton().setEnabled(false); + currentRenderer.getNextButton().setEnabled(false); + currentRenderer.getFinishButton().setEnabled(false); + doAnt = true; + initialThread.interrupt(); + return; + } + } + } + } + catch (Throwable e) { + ctx.log("Throwable during page completion:" + e.getMessage()); + if (ctx.getInstaller().isVerbose()) { + ctx.log(e); + } + } + } + + protected void showFirstPage() throws Exception { + ctx.setCurrentPage(installer.getPages()[0]); + renderNext((SwingPageRenderer) pageRenderers.get(0)); + } + + + private void preparePages(Page[] pages, InstallerContext ctx) throws Exception { + pageRenderers = new ArrayList(); + for (int i = 0; i < pages.length; i++) { + SwingPageRenderer renderer = RendererFactory.getSwingPageRenderer(pages[i]); + if (i == 0) { + renderer.getBackButton().setEnabled(false); + } + renderer.setContext(swingCtx); + renderer.setPageCompletionListener(this); + renderer.setPage(pages[i]); + renderer.instanceInit(); + pageRenderers.add(renderer); + if (renderer instanceof AntOutputRenderer) { + ctx.setAntOutputRenderer((AntOutputRenderer) renderer); + } + } + } + + protected void renderNext(SwingPageRenderer renderer) throws ClassNotFoundException, InstallException { + renderer.updateDefaultValues(); + frame.getContentPane().removeAll(); + frame.getContentPane().add(renderer); + frame.getContentPane().repaint(); + frame.show(); + if (renderer.getNextButton().isEnabled()) { + renderer.getNextButton().requestFocus(); + } else if (renderer.getFinishButton().isEnabled()) { + renderer.getFinishButton().requestFocus(); + } + } + + private void setLocation(JFrame frame) { + GraphicsConfiguration config = frame.getGraphicsConfiguration(); + int x = (int) config.getBounds().getCenterX() - (SizeConstants.PAGE_WIDTH / 2); + int y = (int) config.getBounds().getCenterY() - (SizeConstants.PAGE_HEIGHT / 2); + frame.setLocation(x, y); + frame.setResizable(false); + } + + private void setIcon(JFrame frame, Installer installer) { + String iconResource = installer.getWindowIcon(); + try { + if (iconResource == null) { + return; + } + InputStream in = this.getClass().getResourceAsStream(iconResource); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + byte[] buffer = new byte[256]; + int read = 0; // The number of bytes read from the stream + for (read = in.read(buffer); read != -1; read = in.read(buffer)) { + baos.write(buffer, 0, read); + } + ImageIcon icon = new ImageIcon(baos.toByteArray()); + //Image icon = Toolkit.getDefaultToolkit().createImage(baos.toByteArray()); + frame.setIconImage(icon.getImage()); + } + catch (Exception ex) { + // we can live with out an icon + logger.log("Can not load icon resource: " + iconResource); + logger.log(installer, ex); + } + } + + public void antFinished() { + SwingPageRenderer renderer = (SwingPageRenderer) pageRenderers.get(pageRenderers.size() - 1); + renderer.getBackButton().setEnabled(false); + renderer.getNextButton().setEnabled(false); + renderer.getCancelButton().setEnabled(false); + renderer.getFinishButton().setText(res.getString("exit")); + renderer.getFinishButton().setEnabled(true); + renderer.getFinishButton().requestFocus(); + renderer.getTitleLabel().setText(res.getString("complete")); + ctx.getAntOutputRenderer().getErr().flush(); + ctx.getAntOutputRenderer().getOut().flush(); + ctx.getMessageRenderer().printMessage(res.getString("finished")); + } + + public void fatalError() { + List renderers = getPageRenderers(); + if ((renderers != null) && (renderers.size() > 0)) { + SwingPageRenderer renderer = (SwingPageRenderer) renderers.get(renderers.size() - 1); + renderer.getBackButton().setEnabled(false); + renderer.getNextButton().setEnabled(false); + renderer.getCancelButton().setEnabled(false); + renderer.getFinishButton().setText(res.getString("exit")); + renderer.getFinishButton().setEnabled(true); + renderer.getFinishButton().requestFocus(); + renderer.getTitleLabel().setText(res.getString("failed")); + } + // else - we're done here, or should we call abort()? + } + + /** + * Returns a string representation of the object. + * + * @return a string representation of the object. + */ + public String toString() { + return "SwingRunner"; + } + + private void abort() { + this.doAnt = false; + initialThread.interrupt(); + } + + /** + * @return Returns the frame. + */ + public JFrame getFrame() { + return frame; + } + + /** + * This method is only valid after the PageRenderers have been generated + * + * @return Returns the pageRenderers. + */ + public List getPageRenderers() { + return pageRenderers; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/SwingRunner.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/TextRunner.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/TextRunner.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/TextRunner.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,143 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintStream; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.Installer; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.page.SimpleInputPage; +import org.tp23.antinstaller.renderer.AntOutputRenderer; +import org.tp23.antinstaller.renderer.RendererFactory; +import org.tp23.antinstaller.renderer.text.AbstractTextPageRenderer; +import org.tp23.antinstaller.renderer.text.TextMessageRenderer; + + + +/** + * + * <p>Runs the installer from the text only command line (console) </p> + * <p>This class uses the Installer object tree as its data source and renderers + * from the org.tp23.antinstaller.renderer.text package </p> + * <p>Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: TextRunner.java,v 1.10 2007/01/19 00:24:36 teknopaul Exp $ + */ +public class TextRunner extends AntRunner + implements Runner { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + protected final InstallerContext ctx; + protected final Installer installer; + private final Logger logger; + protected final IfPropertyHelper ifHelper; + + public TextRunner(InstallerContext ctx) throws IOException { + super(ctx); + this.ctx = ctx; + this.installer = ctx.getInstaller(); + this.logger = ctx.getLogger(); + ctx.setMessageRenderer(new TextMessageRenderer()); + ctx.setAntOutputRenderer(new AntOutputRenderer(){ + public PrintStream getErr() { + return System.err; + } + public PrintStream getOut() { + return System.out; + } + + }); + this.ifHelper = new IfPropertyHelper(ctx); + } + + /** + * Renders the installer on the command line, this method blocks until + * the UI has finished + * @throws InstallException + * @return boolean false implies the install was aborted + */ + public boolean runInstaller() throws InstallException { + try { + return renderPages(installer.getPages()); + } + catch (Exception ex) { + logger.log("FATAL exception during installation:"+ex.getMessage()); + logger.log(installer, ex); + + ctx.getMessageRenderer().printMessage(res.getString("installationFailed") + ":" + ex.getMessage()); + //Fixed BUG: ctx.getMessageRenderer().printMessage("Installation failed:"+ex.getMessage()); + throw new InstallException("Installation failed", ex); + } + } + + + private boolean renderPages(Page[] pages) throws ClassNotFoundException, InstallException{ + Page next = null; + for (int i = 0; i < pages.length; i++) { + next = pages[i]; + + if(next instanceof SimpleInputPage){ + // skip iftarget specified and missing + if(!ifHelper.ifTarget(next, pages))continue; + // skip page if ifProperty is specified and property is missing + if(!ifHelper.ifProperty(next))continue; + } + + AbstractTextPageRenderer renderer = RendererFactory.getTextPageRenderer(next); + renderer.setContext(ctx); + renderer.init( new BufferedReader(new InputStreamReader(System.in)), System.out); + ctx.setCurrentPage(next); + renderer.renderPage(next); + if (next.isAbort()){ + return false; + } + runPost(next); + } + return true; + } + public InstallerContext getInstallerContext() { + return ctx; + } + + + + /** + * Called when Ant has finished its work + */ + public void antFinished() { + System.out.println(res.getString("finished")); + //System.exit(0); + } + /** + * Called is Ant failed to install correctly + */ + public void fatalError(){ + System.out.println(res.getString("failed")); + //System.exit(1); + } + + public String toString() { + return "TextRunner"; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/TextRunner.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/VersionHelper.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/VersionHelper.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/VersionHelper.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,234 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime; + +import java.util.StringTokenizer; + +/** + * Version helper accepts version numbers of the following format. + * [major][clause].[minor][clause].[minor][clause].... ad infinitum + * + * If the Java flag is set to true an attempt is made to parse the string as if it were + * returned by System.getProperty("java.version"); + * Since pre 1.3.1 the system is not parsable the default is to accept the string + * if there is a format error. + * + * For the non java syntax getting the string wrong will result in failed tests + * @author teknopaul + * + */ +public class VersionHelper { + + public static final String CLAUSE_ALPHA = "alpha"; + public static final String CLAUSE_BETA = "beta"; + public static final String CLAUSE_GAMMA = "gamma"; + public static final String CLAUSE_JAVA_BETA = "ea"; + + public boolean equalOrHigher(final String test, final String version) { + return equalOrHigher(test, version, false); + } + + public boolean majorVersionCompatible(final String test, final String version) { + return getMajorVersion(test) == getMajorVersion(version); + } + + /** + * + * @param test java version string being tested + * @param version java version string being used as reference + * @param javaSyntax + * @return true if the value of <code>test</code> is greater than or equal to the value of <code>version</code> + */ + public boolean equalOrHigher(final String test, final String version, final boolean javaSyntax) { + try { + StringTokenizer testSt = new StringTokenizer(test, "."); + StringTokenizer verSt = new StringTokenizer(version, "."); + + while (true) { + boolean testMore = testSt.hasMoreTokens(); + boolean verMore = verSt.hasMoreTokens(); + if( ! testMore || ! verMore ){ + break; + } + String testToken = testSt.nextToken(); + String verToken = verSt.nextToken(); + short testVer = getVersion(testToken); + short versionVer = getVersion(verToken); + if( testVer == versionVer ) { + if ( equalClause(getClause( testToken ), getClause(verToken)) ) { + continue; + } + else { + return higherClause(getClause( testToken ), getClause( verToken ), javaSyntax); + } + } + return testVer > versionVer ; + } + // equal up to one not having minor details + if( countDots(test) >= countDots(version) ){ + return true; + } + return test.equals(version); + } catch (Exception e) { + // syntax exceptions + if(javaSyntax){ + return true; // return true for Java since pre 1.3.1 or other JVMs could get any old rubbish + } + return false; + } + } + + public boolean isValid(final String version) { + try { + StringTokenizer verSt = new StringTokenizer(version, "."); + + boolean verMore = false; + int i = 0; + for (; verMore = verSt.hasMoreTokens(); i++) { + + String verToken = verSt.nextToken(); + if("".equals(verToken)){ + return false; + } + // may throw NumberFormatExceptions + getVersion(verToken); + String clause = getClause(verToken); + if( ! "".equals(clause)){ + short clauseS = clauseToShort(clause); + if( ! (clauseS == 1 || clauseS == 2 || clauseS == 3 )){ + return false; + } + } + } + if( ! verMore && i == 0) { + return false; // nothing there! + } + return true; + + } + catch (Exception e) { + // syntax exceptions + return false; + } + } + /** + * @return the number part of the clause + */ + private short getVersion(final String section) { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < section.length(); i++) { + char c = section.charAt(i); + if(Character.isDigit(c)) { + sb.append(c); + } + else{ + return Short.parseShort( sb.toString() ); + } + } + if(sb.length() > 0) { + return Short.parseShort( sb.toString() ); + } + return 0; + } + + /** + * @return the clause eg beta or "" + */ + private String getClause(final String section) { + for (int i = 0; i < section.length(); i++) { + char c = section.charAt(i); + if(Character.isDigit(c)) { + continue; + } + else { + return section.substring(i); + } + } + return ""; + } + + private boolean higherClause(final String test, final String clause, final boolean javaSyntax) { + if(javaSyntax) { + return clauseJavaToShort(test) > clauseJavaToShort(clause); + } + else { + return clauseToShort(test) > clauseToShort(clause); + } + + } + private boolean equalClause(final String test, final String clause) { + return clauseToShort(test) == clauseToShort(clause); + } + + private short clauseToShort(String clause) { + if(clause.startsWith("-")){ + clause = clause.substring(1); // knock off java style 1-beta dashes + } + if( CLAUSE_ALPHA.equals(clause) ) { + return 3; + } + else if( CLAUSE_BETA.equals(clause) ) { + return 2; + } + else if( CLAUSE_GAMMA.equals(clause) ) { + return 1; + } + if(clause.startsWith("_")) { // java build version support 1_03-ea-beta (discarding the sub sub clause "-ea-beta" because I'm lazy) + int hasDash = clause.indexOf('-'); + if(hasDash > -1) { + return Short.parseShort(clause.substring(1, hasDash)); + } + else { + return Short.parseShort(clause.substring(1)); + } + } + else return Short.MAX_VALUE; // no clause assumes higher + } + + private short clauseJavaToShort(String clause) { + if(clause.startsWith("-")){ + clause = clause.substring(1); // knock off java style 1-beta dashes + } + else if( CLAUSE_JAVA_BETA.equals(clause) ) { // -ea early access are assumed to be less good + return -2; + } + if(clause.startsWith("_")) { // java build version support 1_03-ea-beta (discarding the sub sub clause "-ea-beta" because I'm lazy) + int hasDash = clause.indexOf('-'); + if(hasDash > -1) { + return Short.parseShort(clause.substring(1, hasDash)); + } + else { + return Short.parseShort(clause.substring(1)); + } + } + else return 0; // no clause assumes lower in Java speak + } + + private short countDots(final String fullver){ + short count = 0; + for (int i = 0; i < fullver.length(); i++) { + if(fullver.charAt(i) == '.') { + count++; + } + } + return count; + } + + private short getMajorVersion(String test){ + return getVersion(test); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/VersionHelper.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/AntLauncherFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/AntLauncherFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/AntLauncherFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,106 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import java.util.List; +import java.util.Map; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.ResourceBundleHelper; +import org.tp23.antinstaller.antmod.Launcher; + +/** + * + * <p>Runs the Ant script using the Apache Ant launcher.</p> + * <p>This runner uses a modified version of the Apache launcher to provide us + * with feed back as to the state of the install </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @todo get better feed back and progress for the targets that have run successfully + * @todo this should be an interface not a class + * @author Paul Hinds + * @version $Id: AntLauncherFilter.java,v 1.6 2007/01/12 14:47:44 anothermwilson Exp $ + */ +public class AntLauncherFilter implements ExecuteFilter { + + private static final ResourceBundleHelper resHelper = new ResourceBundleHelper("org.tp23.antinstaller.renderer.Res"); + + + public AntLauncherFilter() { + } + + public void exec(InstallerContext ctx) throws InstallException { + if(ctx.getInstaller().isVerbose())ctx.log("Starting Ant Launcher"); + + try { + + //TODO this should be refactored to installer + List argsList = ctx.getInstaller().getTargets(ctx); + + String[] argsArr = new String[argsList.size() + 4]; + argsList.toArray(argsArr); + + if (ctx.getInstaller().isVerbose()) { + ctx.log("Running targets:" + printArray(argsArr)); + } + System.out.println("Targets:"+printArray(argsArr)); + + argsArr[argsArr.length-2] = "-lib"; + argsArr[argsArr.length-1] = "antlib"; + + argsArr[argsArr.length-4] = "-buildfile"; + argsArr[argsArr.length - 3] = ctx.getFileRoot().getAbsolutePath() + + System.getProperty("file.separator") + + ctx.getAntBuildFile(); + + //Launcher uses stdout and stderr by default + System.setOut(ctx.getAntOutputRenderer().getOut()); + System.setErr(ctx.getAntOutputRenderer().getErr()); + + Map properties = ctx.getInstaller().getResultContainer().getAllProperties(); + Launcher launcher = new Launcher(properties); + int ok = launcher.run(argsArr, ctx); + if(ok!=0) { + throw new InstallException( resHelper.getMessage( "ant.failure" ) ); + //the default ctx.setInstallSucceded(false); + } + else { + ctx.setInstallSucceded(true); + } + ctx.log("Ant finished"); + ctx.getRunner().antFinished(); + } + catch (Throwable ex) { + throw new InstallException("Error running the install, " + ex.getMessage(), ex); + } + } + /** + * Used for debug to print the targets to system.out + * @param args Object[] + * @return String + */ + private String printArray(Object[] args){ + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < args.length-4; i++) { + if (i > 0) { + sb.append(','); + } + sb.append(args[i]); + } + return sb.toString(); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/AntLauncherFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/AntProjectFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/AntProjectFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/AntProjectFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,289 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.Iterator; +import java.util.Map; +import java.util.Properties; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.BuildListener; +import org.apache.tools.ant.DefaultLogger; +import org.apache.tools.ant.Diagnostics; +import org.apache.tools.ant.Project; +import org.apache.tools.ant.ProjectHelper; +import org.apache.tools.ant.input.DefaultInputHandler; +import org.apache.tools.ant.launch.Locator; +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.antmod.ProjectHelper3; +import org.tp23.antinstaller.selfextract.NonExtractor; +import org.tp23.antinstaller.selfextract.SelfExtractor; +/** + * + * <p>This AntRunner runs Ant builds directly from a Jar without having to extract + * the build.xml to temporary space.</p> + * <p> </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: AntProjectFilter.java,v 1.10 2007/01/28 08:44:39 teknopaul Exp $ + */ +public class AntProjectFilter implements ExecuteFilter{ + + //TODO certain jars are added from Ant default directories that are probably not needed + + private static String antVersion = null; + + /** The Ant Home property - from default Launcher */ + public static final String ANTHOME_PROPERTY = "ant.home"; + + /** The location of a per-user library directory - from default Launcher */ + public static final String USER_LIBDIR = ".ant/lib"; + + public AntProjectFilter() { + } + + /** + * run Ant + * + * @param ctx InstallerContext + * @throws InstallException + * @todo Implement this org.tp23.antinstaller.runtime.AntRunner method + */ + public void exec(InstallerContext ctx) throws InstallException { + if(ctx.getInstaller().isVerbose()) { + ctx.log("Starting Ant Project"); + } + + try { + + Project project = new Project(); + appendClassPath(); + setAntHome(ctx); + project.setCoreLoader(this.getClass().getClassLoader()); + + DefaultLogger antLogger = new DefaultLogger(); + antLogger.setOutputPrintStream(ctx.getAntOutputRenderer().getOut()); + antLogger.setErrorPrintStream(ctx.getAntOutputRenderer().getErr()); + antLogger.setMessageOutputLevel(Project.MSG_INFO); + BuildListener bl = ctx.getBuildListener(); + if(bl != null){ + project.addBuildListener(bl); + } + project.addBuildListener(antLogger); + + /* + * Log useful ant task output to the log file to help debugging + * and for customer support + */ + final String logFileName = ctx.getLogger().getFileName(); + if( logFileName != null && logFileName.length() > 0 ) + { + PrintStream stream = new PrintStream( new FileOutputStream(logFileName, true), true); + DefaultLogger antFileLogger = new DefaultLogger(); + antFileLogger.setOutputPrintStream( stream ); + antFileLogger.setErrorPrintStream( stream ); + int logLevel = (ctx.getInstaller().isVerbose()) + ? Project.MSG_VERBOSE + : Project.MSG_INFO; + antFileLogger.setMessageOutputLevel( logLevel ); + + project.addBuildListener( antFileLogger ); + } + + // irrelevant really but might help someone on a command line + project.setInputHandler(new DefaultInputHandler()); + project.fireBuildStarted(); + + project.init(); + project.setUserProperty("ant.version", getAntVersion()); + + + // add properties + // N.B. properties are not loaded from the file it exists for debugging installers + String arg; + String value; + Map properties = ctx.getInstaller().getResultContainer().getAllProperties(); + Iterator iter = properties.keySet().iterator(); + while (iter.hasNext()) { + arg = (String) iter.next(); + value = (String) properties.get(arg); + project.setUserProperty(arg, value); + } + + // From here we immitate Main + try { + Diagnostics.validateVersion(); + } catch (Throwable exc) { + // minimal messages for the benefit of the command line install + System.err.println("Version error:" + exc.getClass() + "," + exc.getMessage()); + return; + } + + ProjectHelper helper = new ProjectHelper3(); + project.addReference("ant.projectHelper", helper); + + File buildXml = new File(ctx.getFileRoot(), ctx.getAntBuildFile()); + if(buildXml.exists()){ + helper.parse(project, buildXml); + project.setUserProperty("ant.file",buildXml.getAbsolutePath()); + } else { + URL buildIS = this.getClass().getResource("/" + ctx.getAntBuildFile()); + helper.parse(project, buildIS); + project.setUserProperty("ant.file", buildIS.toExternalForm()); + } + + File enclosingJar = SelfExtractor.getEnclosingJar(this); + project.setUserProperty(NonExtractor.ANTINSTALLER_JAR_PROPERTY , enclosingJar.getAbsolutePath()); + System.out.println(NonExtractor.ANTINSTALLER_JAR_PROPERTY + enclosingJar.getAbsolutePath()); + + //what is this !?! project.setKeepGoingMode(keepGoingMode); + + project.setBaseDir(ctx.getFileRoot()); + + project.executeTargets(ctx.getInstaller().getTargets(ctx)); + project.fireBuildFinished(null); + ctx.setInstallSucceded(true); + ctx.log("Ant finished"); + } + catch (Throwable e) { + throw new InstallException("Error running the install, " + e.getMessage(), e); + } + finally { + ctx.getRunner().antFinished(); + } + } + + + public static synchronized String getAntVersion() throws BuildException { + if (antVersion == null) { + try { + Properties props = new Properties(); + InputStream in = + AntProjectFilter.class.getResourceAsStream("/org/apache/tools/ant/version.txt"); + props.load(in); + in.close(); + + StringBuffer msg = new StringBuffer(); + msg.append("Apache Ant version "); + msg.append(props.getProperty("VERSION")); + msg.append(" compiled on "); + msg.append(props.getProperty("DATE")); + antVersion = msg.toString(); + } catch (IOException ioe) { + throw new BuildException("Could not load the version information:" + + ioe.getMessage()); + } catch (NullPointerException npe) { + throw new BuildException("Could not load the version information."); + } + } + return antVersion; + } + + /** + * Append extra Ant jars to the classpath the original classpath + * is not removed incase the installer is launched from a script + * + */ + private static void appendClassPath(){ + try { + // now update the class.path property + StringBuffer baseClassPath + = new StringBuffer(System.getProperty("java.class.path")); + if (baseClassPath.charAt(baseClassPath.length() - 1) + == File.pathSeparatorChar) { + baseClassPath.setLength(baseClassPath.length() - 1); + } + URL[] jars = getLibPaths(); + for (int i = 0; i < jars.length; ++i) { + baseClassPath.append(File.pathSeparatorChar); + baseClassPath.append(Locator.fromURI(jars[i].toString())); + } + + System.setProperty("java.class.path", baseClassPath.toString()); + + URLClassLoader loader = new URLClassLoader(jars); + Thread.currentThread().setContextClassLoader(loader); + } + catch (MalformedURLException e) { + // swallow exception, normally all resources are already loaded + System.err.println("Invalid Jar path"); + } + } + + + /** + * Ant home is not a requirement but can exist prior to loading + * the default Ant mechanism of using the current Jars parent + * is consipicuously absent, do not rely on ANT_HOME out side of a + * controlled environment (e.g. a normal install) + */ + private static void setAntHome(InstallerContext ctx){ + String antHomeProperty = System.getProperty(ANTHOME_PROPERTY); + if(antHomeProperty==null){ + System.setProperty(ANTHOME_PROPERTY, ctx.getFileRoot().getAbsolutePath()); + } + } + + /** + * To maintain compatability with previous verisons currently the only + * Ant command line argument supported is the -lib parameter with the value + * "antlib" + * @TODO this should probably be removed + * @throws MalformedURLException + */ + private static URL[] getLibPaths() throws MalformedURLException{ + + // add all Jars from the ./antlib directory at the time of the build + // this is NOT based on ANT_HOME + URL[] libJars = Locator.getLocationURLs(new File("antlib")); + + // add all the Jars from ~/.ant/lib + // this is probably irrelevant for a normal install + URL[] userJars = Locator.getLocationURLs(new File(USER_LIBDIR)); + + // Now try and find JAVA_HOME + File toolsJar = Locator.getToolsJar(); + + int jarsLength = libJars.length + userJars.length + (toolsJar!=null?1:0); + URL[] allJars = new URL[jarsLength]; + int i = 0; + if(toolsJar != null){ + allJars[i++] = toolsJar.toURL(); + } + if(libJars.length != 0){ + System.arraycopy(libJars, 0, allJars, i, libJars.length); + i += libJars.length; + } + if(userJars.length != 0){ + System.arraycopy(userJars, 0, allJars, i, userJars.length); + //i+=userJars.length; + //assert(allJars.length=i-1); + } + return libJars; + } + + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/AntProjectFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/CreateLoggerFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/CreateLoggerFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/CreateLoggerFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,68 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import java.io.File; + +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.runtime.SimpleLogger; + + +/** + * Creates a suitable logger for the install. The logging does not + * throw exceptions since it is mainly for debug and we dont want to + * stop an install just because logging is not working + * @author Paul Hinds + * @version $Id: CreateLoggerFilter.java,v 1.3 2007/01/09 22:41:40 teknopaul Exp $ + */ +public class CreateLoggerFilter implements ExecuteFilter { + + public static final String LOG_FILE_NAME = "ant.install.log"; + + /** + */ + public void exec(InstallerContext ctx){ + SimpleLogger logger = new SimpleLogger(); + ctx.setLogger( logger ); + try { + String defaultName = "./ant.install.log"; + // @since 0.7.1 RFE-1154368 for installs from CD where ./ is not writable + File defaultFile = new File(defaultName); + try { + if( !defaultFile.exists() ){ + defaultFile.createNewFile(); + } + } + catch(Exception e) { + ;// ignore canWrite() will return false + } + if(defaultFile.canWrite()) { + logger.setFileName(defaultName); + } + else { + String tempDir = ctx.getFileRoot().getAbsolutePath(); + logger.setFileName(tempDir+System.getProperty("file.separator") + LOG_FILE_NAME); + } + ctx.log("Ant basedir:" + ctx.getFileRoot().getCanonicalPath()); + } + catch (Throwable ex1) { + ex1.printStackTrace(); + logger.close(); + // swallow exceptions + } + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/CreateLoggerFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/CreateUIFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/CreateUIFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/CreateUIFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,132 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import java.io.IOException; +import java.util.StringTokenizer; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.renderer.swing.plaf.LookAndFeelFactory; +import org.tp23.antinstaller.runtime.AutoSwingRunner; +import org.tp23.antinstaller.runtime.AutoTextRunner; +import org.tp23.antinstaller.runtime.Runner; +import org.tp23.antinstaller.runtime.SwingRunner; +import org.tp23.antinstaller.runtime.TextRunner; + + +/** + * Creates the Runner instance for the execution UI and sets up an appropriate + * message renderer. + * @author Paul Hinds + * @version $Id: CreateUIFilter.java,v 1.7 2007/01/28 17:49:15 teknopaul Exp $ + */ +public class CreateUIFilter implements ExecuteFilter { + + /** + * @see org.tp23.antinstaller.runtime.exe.ExecuteFilter#exec(org.tp23.antinstaller.InstallerContext) + */ + public void exec(InstallerContext ctx) throws InstallException { + try { + if(ctx.getInstaller().isVerbose()){ + ctx.log("Creating UI classes"); + } + ctx.setRunner(getRunner(ctx)); + ctx.log("Created UI classes"); + } + catch (IOException e) { + throw new InstallException("Unable to create the user interface", e); + } + catch (InstallException e) { + throw new InstallException(e.getMessage(), e); + } + } + /** + * Determines which Runner to use text or swing or "auto" UIs which skip past the properties sreens. + * @param override String if this paramter is not null it will be used. If + * swing and there is no graphics environment the install will fail, if it is left + * as null a check is made to see if there is a Graphics Environment and swing is used + * if there are no errors, if there are errors the system falls back to the text console + * + * @throws IOException + * @return Runner + */ + private Runner getRunner(InstallerContext ctx) throws IOException, InstallException { + + if(ctx.getUIOverride() != null){ + if (ctx.getUIOverride().equalsIgnoreCase("swing")){ + if(isUi("swing", ctx.getInstaller().getUi())){ + new LookAndFeelFactory(ctx).setLAF(); + return new SwingRunner(ctx); + }else{ + throw new InstallException("Not a permited UI override, swing is not allowed"); + } + } + + if (ctx.getUIOverride().equalsIgnoreCase("text")){ + if(isUi("text", ctx.getInstaller().getUi())){ + return new TextRunner(ctx); + }else{ + throw new InstallException("Not a permited UI override, text is not allowed"); + } + } + + if (ctx.getUIOverride().equalsIgnoreCase("swing-auto")){ + if(isUi("swing-auto", ctx.getInstaller().getUi())){ + new LookAndFeelFactory(ctx).setLAF(); + return new AutoSwingRunner(ctx); + }else{ + throw new InstallException("Not a permited UI override, swing-auto is not allowed"); + } + } + + if (ctx.getUIOverride().equalsIgnoreCase("text-auto")){ + if(isUi("text-auto", ctx.getInstaller().getUi())){ + return new AutoTextRunner(ctx); + }else{ + throw new InstallException("Not a permited UI override, text-auto is not allowed"); + } + } + + } + //else do stuff to work out if there is a graphics context + try{ + java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(); + /* + * Above test is not enough to be sure that we can use the graphics env + * so do remaining setup within try/catch block + */ + new LookAndFeelFactory(ctx).setLAF(); + return new SwingRunner(ctx); + } catch (Throwable e){ + System.out.println("No graphics environment available, reverting to text"); + System.out.println(); + return new TextRunner(ctx); + } + } + + + private boolean isUi(String ui, String commaSeparatedUiList){ + StringTokenizer st = new StringTokenizer(commaSeparatedUiList, ","); + while(st.hasMoreTokens()){ + if(st.nextToken().equals(ui)){ + return true; + } + } + return false; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/CreateUIFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,31 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; + + +/** + * The Execute engine is being replaced with a filter pattern to enable + * further extension of the system, Initiallly a hardcoded filter chain + * will be used subsequently to be replaced by a pluggable mechanism. + * @author Paul Hinds + * @version $Id: ExecuteFilter.java,v 1.1.1.1 2005/10/18 18:20:57 teknopaul Exp $ + */ +public interface ExecuteFilter { + public void exec(InstallerContext ctx) throws InstallException; +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteRunnerFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteRunnerFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteRunnerFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,48 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; + + +/** + * Executes the Screens part of the build + * @author Paul Hinds + * @version $Id: ExecuteRunnerFilter.java,v 1.3 2006/12/21 01:48:51 teknopaul Exp $ + */ +public class ExecuteRunnerFilter implements ExecuteFilter { + + /** + * @see org.tp23.antinstaller.runtime.exe.ExecuteFilter#exec(org.tp23.antinstaller.InstallerContext) + */ + public void exec(InstallerContext ctx) throws InstallException { + if(ctx.getInstaller().isVerbose()){ + ctx.log("Starting UI Screens"); + } + boolean ok = ctx.getRunner().runInstaller(); + if(!ok){ + throw new AbortException("Install Aborted"); + } + ctx.log("Install screens rendered"); + } + + public static class AbortException extends InstallException{ + public AbortException(String message){ + super(message); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/ExecuteRunnerFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FilterChain.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FilterChain.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FilterChain.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,32 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import org.tp23.antinstaller.InstallerContext; + + +/** + * A filter chain is a series of operations to be run by the ExecInstall class. + * This defines the sequence of events in the installer and provides for pluggable + * extra sequences for example post installtion messages or running the application. + * All FilterChains should end in a FinalizerFilter. + * @author Paul Hinds + * @version $Id: FilterChain.java,v 1.1.1.1 2005/10/18 18:20:57 teknopaul Exp $ + */ +public interface FilterChain { + public void init(InstallerContext ctx); + public ExecuteFilter[] getFilters(); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FilterChain.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FilterFactory.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FilterFactory.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FilterFactory.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,86 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.List; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; + + +/** + * Loads FilterChains from resource files on the classpath with lists of class + * names listed in order. In the files lines starting with # and blank + * lines are ignored + * @author Paul Hinds + * @version $Id: FilterFactory.java,v 1.4 2007/01/04 22:57:18 teknopaul Exp $ + */ +public class FilterFactory { + + public static final String FILTER_RESOURCE = "/antinstall-config.fconfig"; + + private FilterFactory() { + } + + public static FilterChain factory(String configResource) throws InstallException{ + try { + InputStream is = FilterFactory.class.getResourceAsStream(configResource); + BufferedReader br = new BufferedReader(new InputStreamReader(is)); + String filterClass = null; + final List filterChain = new ArrayList(); + while((filterClass = br.readLine())!=null){ + if(filterClass.startsWith("#"))continue; + filterClass = filterClass.trim(); + if(filterClass.equals("")){ + continue; + } + filterChain.add( Class.forName(filterClass).newInstance() ); + } + br.close(); + return new DynamicFilterChain(configResource, filterChain); + } + catch (IOException e) { + e.printStackTrace(); + } + catch (Exception e) { + e.printStackTrace(); + } + throw new InstallException("Can not create FilterChain"); + } + + static class DynamicFilterChain implements FilterChain{ + + private ExecuteFilter[] filters; + private String configResource; + + private DynamicFilterChain(String configResource, List filterChain){ + this.configResource = configResource; + filters = new ExecuteFilter[filterChain.size()]; + filterChain.toArray(filters); + } + public void init(InstallerContext ctx){ + ctx.setConfigResource(configResource); + } + public ExecuteFilter[] getFilters(){ + return filters; + } + }; +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FilterFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FinalizerFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FinalizerFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FinalizerFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,47 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import org.tp23.antinstaller.InstallerContext; + + +/** + * This filter is called at the end of the install. This is not the + * last Java operation since a shutDownHook is present to delete temporary + * files and in the GUI version the screen should not dissappear. + * All filter chains must end in a FinalizerFilter or subclass + * and the exec method must not throw an Exception. + * + * @author Paul Hinds + * @version $Id: FinalizerFilter.java,v 1.3 2007/01/04 22:57:17 teknopaul Exp $ + */ +public class FinalizerFilter implements ExecuteFilter { + + // TODO as per FindBugs the System.exit(0) in SwingPageRenderer prevents this running + /** + * @see org.tp23.antinstaller.runtime.exe.ExecuteFilter#exec(org.tp23.antinstaller.InstallerContext) + */ + public void exec(InstallerContext ctx){ + try { + ctx.log("Finalizing"); + ctx.getLogger().close(); + } + catch (Throwable e) { + e.printStackTrace(); + } + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/FinalizerFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/InputStreamLoadConfigFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/InputStreamLoadConfigFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/InputStreamLoadConfigFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,51 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import java.io.IOException; +import java.io.InputStream; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.runtime.ConfigurationException; + + +/** + * @author Paul Hinds + * @version $Id: InputStreamLoadConfigFilter.java,v 1.4 2007/01/28 08:44:39 teknopaul Exp $ + */ +public class InputStreamLoadConfigFilter extends LoadConfigFilter { + + public void exec(InstallerContext ctx) throws InstallException { + this.ctx = ctx; + + try { + InputStream config = this.getClass().getResourceAsStream("/" + ctx.getInstallerConfigFile()); + if(config == null){ // passed in incorrectly on the command line or bad installer + throw new IOException(); + } + readConfig(ctx.getFileRoot(), config); + ctx.setInstaller(installer); + ctx.log("Config loaded"); + } + catch (IOException e) { + throw new InstallException("Not able to load and read the AntInstaller config",e); + } + catch (ConfigurationException e) { + throw new InstallException("Not able to load and read the AntInstaller config",e); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/InputStreamLoadConfigFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/LoadConfigFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/LoadConfigFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/LoadConfigFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,477 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.Installer; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.AppRootInput; +import org.tp23.antinstaller.input.CheckboxInput; +import org.tp23.antinstaller.input.CommentOutput; +import org.tp23.antinstaller.input.ConditionalField; +import org.tp23.antinstaller.input.ConfirmPasswordTextInput; +import org.tp23.antinstaller.input.DateInput; +import org.tp23.antinstaller.input.DirectoryInput; +import org.tp23.antinstaller.input.ExtValidatedTextInput; +import org.tp23.antinstaller.input.FileInput; +import org.tp23.antinstaller.input.HiddenPropertyInput; +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.input.LargeSelectInput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.PasswordTextInput; +import org.tp23.antinstaller.input.SelectInput; +import org.tp23.antinstaller.input.TargetInput; +import org.tp23.antinstaller.input.TargetSelectInput; +import org.tp23.antinstaller.input.UnvalidatedTextInput; +import org.tp23.antinstaller.input.ValidatedTextInput; +import org.tp23.antinstaller.page.LicensePage; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.page.ProgressPage; +import org.tp23.antinstaller.page.SimpleInputPage; +import org.tp23.antinstaller.page.SplashPage; +import org.tp23.antinstaller.page.TextPage; +import org.tp23.antinstaller.runtime.ConfigurationException; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; + + +/** + * Loads the Ant Install configuration and sets the Installer object back + * into the context. A similar technique to the apache digester is used to + * populate object attributes in this class. + * N.B. The only types that can be set for object attributes are Strings, booleans + * or ints. + * @author Paul Hinds + * @version $Id: LoadConfigFilter.java,v 1.9 2007/01/28 08:44:39 teknopaul Exp $ + */ +public class LoadConfigFilter implements ExecuteFilter { + + //TODO move to InstallerContext + public static final String INSTALLER_CONFIG_FILE = "antinstall-config.xml"; + + protected Installer installer = new Installer(); + protected InstallerContext ctx; + + /** + * @see org.tp23.antinstaller.runtime.exe.ExecuteFilter#exec(org.tp23.antinstaller.InstallerContext) + */ + public void exec(InstallerContext ctx) throws InstallException { + this.ctx = ctx; + + try { + installer = readConfig(ctx.getFileRoot(), ctx.getInstallerConfigFile()); + ctx.setInstaller(installer); + ctx.log("Config loaded"); + } + catch (IOException e) { + throw new InstallException("Not able to load and read the AntInstaller config", e); + } + catch (ConfigurationException e) { + throw new InstallException("Not able to load and read the AntInstaller config", e); + } + } + + /** + * Currently read the config using any available XML parser + * This method reads the config from the file system + * @param fileRoot The directory where the config file is stored + * @param the name of the configuration file (usually antinstall-config.xml) + * @return Installer + */ + public Installer readConfig(File fileRoot, String fileName) throws IOException, ConfigurationException { + + installer.getResultContainer().setInstallRoot(fileRoot); + + File config = new File(fileRoot, fileName); + if(!config.exists()){ // passed in incorrectly on the command line or bad installer + throw new IOException(); + } + InputSource xmlInp = new InputSource(new FileInputStream(config)); + readConfig(xmlInp); + + return installer; + } + /** + * This overloaded method reads from the provided input stream to facilitate + * reading configs directly from the Jar, the file root is still needed + * for Ant's basedir. Used by InputStreamLoadConfigFilter + * @return Installer + */ + protected Installer readConfig(File fileRoot, InputStream configSource) throws IOException, ConfigurationException { + + installer.getResultContainer().setInstallRoot(fileRoot); + + InputSource xmlInp = new InputSource(configSource); + readConfig(xmlInp); + + return installer; + } + /** + * Currently read the config using any available XML parser + * @todo read the installer with only xerces + * @return Installer + */ + protected Installer readConfig(InputSource xmlInp) throws IOException, ConfigurationException { + + Document doc = null; + try { + + DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder parser = docBuilderFactory.newDocumentBuilder(); + + // RFE [ 1475361 ] Using a custom entity resolver + String entityResolverClass = System.getProperty("antinstaller.EntityResolverClass"); + EntityResolver er = null; + if(entityResolverClass != null){ + try{ + er = (EntityResolver)Class.forName(entityResolverClass).newInstance(); + } + catch(Exception e){ + // Property error use default this is a very specific requirement + er = new CustomEntityResolver(); + } + } + else{ + er = new CustomEntityResolver(); + } + + parser.setEntityResolver(er); + + doc = parser.parse(xmlInp); + Element root = doc.getDocumentElement(); + root.normalize(); + setProperties(installer, root.getAttributes()); + NodeList allPages = root.getElementsByTagName("page"); + //TODO make this pluggable + getPages(installer, allPages); + + } + catch (Exception e) { + throw new IOException("DomFactory error: caused by:" + e.getClass() + ":" + e.getMessage()); + } + return installer; + } + + + /** + * Used when reading the config + * @param allPages NodeList + * @throws ConfigurationException + */ + private void getPages(Installer installerConfig, NodeList allPages) throws ConfigurationException { + ArrayList pages = new ArrayList(); + for (int i = 0; i < allPages.getLength(); i++) { + Element pageElem = (Element) allPages.item(i); + Page page = getPageType(pageElem.getAttribute("type")); + setProperties(page, pageElem.getAttributes()); + pages.add(page); + getOutputFields(page, pageElem); + } + Page[] pageArr = new Page[pages.size()]; + pages.toArray(pageArr); + installerConfig.setPages(pageArr); + } + /** + * Used when reading the config + * @param page Page + * @param pageElem Element + * @throws ConfigurationException + */ + private void getOutputFields(Page page, Element pageElem) throws ConfigurationException { + page.setOutputField( getInnerOutputFields( pageElem )); + } + + private OutputField[] getInnerOutputFields( Element elem) throws ConfigurationException { + NodeList allFields = elem.getChildNodes(); + ArrayList fields = new ArrayList(); + for (int i = 0; i < allFields.getLength(); i++) { + if(! (allFields.item(i) instanceof Element))continue; + Element fieldElem = (Element)allFields.item(i); + OutputField field = getOutputFieldType(fieldElem.getNodeName(), fieldElem); + if(field != null){ + setProperties(field, fieldElem.getAttributes()); + fields.add(field); + field.setResultContainer(installer.getResultContainer()); + } + } + OutputField[] fieldArr = new OutputField[fields.size()]; + + return (OutputField[])fields.toArray(fieldArr); + } + + /** + * Used when reading the config + * @param type String + * @throws ConfigurationException + * @return Page + */ + private Page getPageType(String type) throws ConfigurationException { + if (type.equalsIgnoreCase("license")) { + return new LicensePage(); + } + else if (type.equalsIgnoreCase("input")) { + return new SimpleInputPage(); + } + else if (type.equalsIgnoreCase("progress")) { + return new ProgressPage(); + } + else if (type.equalsIgnoreCase("splash")) { + return new SplashPage(); + } + else if (type.equalsIgnoreCase("text")) { + return new TextPage(); + } + throw new ConfigurationException("Unknown Page type:" + type); + } + /** + * Used when reading the config + * @param type String + * @param field Element + * @throws ConfigurationException + * @return InputField + */ + private OutputField getOutputFieldType(String type, Element field) throws ConfigurationException { + if (type.equalsIgnoreCase("text")) { + return new UnvalidatedTextInput(); + } + else if (type.equalsIgnoreCase("directory")) { + return new DirectoryInput(); + } + else if (type.equalsIgnoreCase("target")) { + return new TargetInput(); + } + else if (type.equalsIgnoreCase("file")) { + return new FileInput(); + } + else if (type.equalsIgnoreCase("comment")) { + return new CommentOutput(); + } + else if (type.equalsIgnoreCase("checkbox")) { + return new CheckboxInput(); + } + else if (type.equalsIgnoreCase("validated")) { + return new ValidatedTextInput(); + } + else if (type.equalsIgnoreCase("ext-validated")) { + return new ExtValidatedTextInput(); + } + else if (type.equalsIgnoreCase("password")) { + return new PasswordTextInput(); + } + else if (type.equalsIgnoreCase("password-confirm")) { + return new ConfirmPasswordTextInput(); + } + else if (type.equalsIgnoreCase("hidden")) { + return new HiddenPropertyInput(); + } + else if (type.equalsIgnoreCase("date")) { + return new DateInput(); + } + else if (type.equalsIgnoreCase("app-root")) { + return new AppRootInput(); + } + else if (type.equalsIgnoreCase("conditional")) { + ConditionalField conditionalField = new ConditionalField(); + OutputField[] outFields = getInnerOutputFields( field ); + InputField[] inFields = new InputField[ outFields.length ]; + for( int i = 0; i < outFields.length; i++ ) { + inFields[i] = (InputField) outFields[i]; + } + conditionalField.setFields( inFields ); + return conditionalField; + } + else if (type.equalsIgnoreCase("select")) { + SelectInput sInput = new SelectInput(); + NodeList allOptions = field.getElementsByTagName("option"); + ArrayList options = new ArrayList(); + for (int i = 0; i < allOptions.getLength(); i++) { + Element optionElem = (Element) allOptions.item(i); + SelectInput.Option option = sInput.getNewOption(); + option.setText(optionElem.getAttribute("text")); + option.value = optionElem.getAttribute("value"); + options.add(option); + } + SelectInput.Option[] optionArr = new SelectInput.Option[options.size()]; + options.toArray(optionArr); + sInput.setOptions(optionArr); + + return sInput; + } + else if (type.equalsIgnoreCase("target-select")) { + TargetSelectInput sInput = new TargetSelectInput(); + NodeList allOptions = field.getElementsByTagName("option"); + ArrayList options = new ArrayList(); + for (int i = 0; i < allOptions.getLength(); i++) { + Element optionElem = (Element) allOptions.item(i); + SelectInput.Option option = sInput.getNewOption(); + option.setText(optionElem.getAttribute("text")); + option.value = optionElem.getAttribute("value"); + options.add(option); + } + SelectInput.Option[] optionArr = new SelectInput.Option[options.size()]; + options.toArray(optionArr); + sInput.setOptions(optionArr); + + return sInput; + } + else if (type.equalsIgnoreCase("large-select")) { + LargeSelectInput sInput = new LargeSelectInput(); + NodeList allOptions = field.getElementsByTagName("option"); + ArrayList options = new ArrayList(); + for (int i = 0; i < allOptions.getLength(); i++) { + Element optionElem = (Element) allOptions.item(i); + LargeSelectInput.Option option = sInput.getNewOption(); + option.setText(optionElem.getAttribute("text")); + option.value = optionElem.getAttribute("value"); + options.add(option); + } + LargeSelectInput.Option[] optionArr = new LargeSelectInput.Option[options.size()]; + options.toArray(optionArr); + sInput.setOptions(optionArr); + + return sInput; + } + System.out.println("Unrecognised Input Element:"+type); + return null; + //throw new ConfigurationException("Unknown Input Field type:" + type); + } + + + + /** + * Calls bean setter methods based on attribures found. Could use BeanUtils here + * but we want to stay clear of external dependencies. + * @param bean Object + * @param map NamedNodeMap + */ + private void setProperties(Object bean, NamedNodeMap map) { + int numAtts = map.getLength(); + for (int a = 0; a < numAtts; a++) { + Node attribute = map.item(a); + String name = attribute.getNodeName(); + String value = attribute.getNodeValue(); + String methodName = "set" + Character.toUpperCase(name.charAt(0)) + name.substring(1); + Method[] allMethods = bean.getClass().getMethods(); + for (int m = 0; m < allMethods.length; m++) { + if (allMethods[m].getName().equals(methodName)) { + try { + Class[] parameters = allMethods[m].getParameterTypes(); + Object[] paramValues; + if (parameters[0].equals(Boolean.class)) { + paramValues = new Boolean[1]; + if ( OutputField.isTrue(value) ) { + paramValues[0] = Boolean.TRUE; + } + else { + paramValues[0] = Boolean.FALSE; + } + } + else + if (parameters[0].equals(Integer.class)) { + paramValues = new Integer[1]; + paramValues[0] = new Integer(value); + } + else { + paramValues = new String[1]; + paramValues[0] = value; + } + allMethods[m].invoke(bean, paramValues); + continue; + } + catch (IndexOutOfBoundsException ex) { + // not the setter we are looking for + // this is the wrong overloaded method + continue; + } + // Ignore reflection errors and continue + catch (IllegalArgumentException e) { + } + catch (IllegalAccessException e) { + } + catch (InvocationTargetException e) { + } + } + } + } + } + + private static class CustomEntityResolver implements EntityResolver{ + public InputSource resolveEntity(String publicId, String systemId) { + + if (publicId.equals("-//tp23 //DTD Ant Installer Config//EN") && + systemId.equals("http://antinstaller.sf.net/dtd/antinstall-config-0.2.dtd")) { + InputSource localSrc = new InputSource(this.getClass().getResourceAsStream( + "/org/tp23/antinstaller/antinstall-config-0.2.dtd")); + return localSrc; + } + if (publicId.equals("-//tp23 //DTD Ant Installer Config//EN") && + systemId.equals("http://antinstaller.sf.net/dtd/antinstall-config-0.3.dtd")) { + InputSource localSrc = new InputSource(this.getClass().getResourceAsStream( + "/org/tp23/antinstaller/antinstall-config-0.3.dtd")); + return localSrc; + } + if (publicId.equals("-//tp23 //DTD Ant Installer Config//EN") && + systemId.equals("http://antinstaller.sf.net/dtd/antinstall-config-0.4.dtd")) { + InputSource localSrc = new InputSource(this.getClass().getResourceAsStream( + "/org/tp23/antinstaller/antinstall-config-0.4.dtd")); + return localSrc; + } + if (publicId.equals("-//tp23 //DTD Ant Installer Config//EN") && + systemId.equals("http://antinstaller.sf.net/dtd/antinstall-config-0.5.dtd")) { + InputSource localSrc = new InputSource(this.getClass().getResourceAsStream( + "/org/tp23/antinstaller/antinstall-config-0.5.dtd")); + return localSrc; + } + if (publicId.equals("-//tp23 //DTD Ant Installer Config//EN") && + systemId.equals("http://antinstaller.sf.net/dtd/antinstall-config-0.6.dtd")) { + InputSource localSrc = new InputSource(this.getClass().getResourceAsStream( + "/org/tp23/antinstaller/antinstall-config-0.6.dtd")); + return localSrc; + } + if (publicId.equals("-//tp23 //DTD Ant Installer Config//EN") && + systemId.equals("http://antinstaller.sf.net/dtd/antinstall-config-0.7.dtd")) { + InputSource localSrc = new InputSource(this.getClass().getResourceAsStream( + "/org/tp23/antinstaller/antinstall-config-0.7.dtd")); + return localSrc; + } + if (publicId.equals("-//tp23 //DTD Ant Installer Config//EN") && + systemId.equals("http://antinstaller.sf.net/dtd/antinstall-config-0.8.dtd")) { + InputSource localSrc = new InputSource(this.getClass().getResourceAsStream( + "/org/tp23/antinstaller/antinstall-config-0.8.dtd")); + return localSrc; + } + else { + return null; + } + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/LoadConfigFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyLoaderFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyLoaderFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyLoaderFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,419 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limiations under the License. + */ + +package org.tp23.antinstaller.runtime.exe; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; +import java.util.ResourceBundle; +import java.util.StringTokenizer; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.Installer; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.PropertiesFileRenderer; +import org.tp23.antinstaller.input.ConditionalField; +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.PasswordTextInput; +import org.tp23.antinstaller.input.TargetInput; +import org.tp23.antinstaller.input.TargetSelectInput; +import org.tp23.antinstaller.page.Page; +import org.tp23.antinstaller.runtime.VersionHelper; +import org.tp23.antinstaller.runtime.exe.ExecuteRunnerFilter.AbortException; + + +/** + * Loads properties from a file of default properties if found. + * the Installer element should define an attribute + * loadDefaults with one of the following values. + * <li>false - do not look for defaults</li> + * <li>prompt - look for properties and ask if they should be used if found</li> + * <li>load - look for defaults if found load them</li> + * <li>prompt-auto - wierd case where installer permits zero user interaction running only from antinstaller-config.xml defaults</li> + * + * N.B. this is not a generic property loader but one specifically for properties files + * generated by a previous run of an identical installer or one that according to the version + * number is compatible, see PropertyTask for loading other property sets + * FIXME i18n for AbortExceptoins + * @author teknopaul + * + */ +public class PropertyLoaderFilter implements ExecuteFilter { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + public static final String LOAD = "true"; + public static final String PROMPT = "prompt"; + public static final String PROMPT_AUTO = "prompt-auto"; + public static final String FALSE = "false"; + public static final String DEFAULT_PROPERTIES_FILE_PROPERTY = "antinstaller.properties"; + + private final String fileNameProperty; + + private int definedPropertiesCount; + + /** + * Default constructor required for an ExecuteFilter implementation. + * The default property name given by @see{DEFAULT_PROPERTIES_FILE_PROPERTY} + * is used with this constructor + */ + public PropertyLoaderFilter() { + this( DEFAULT_PROPERTIES_FILE_PROPERTY ); + } + + /** + * Constructor that allows the name of the property containg the properties file + * to be specified + * + * @param fileNameProperty property containing the name of file + */ + public PropertyLoaderFilter( final String fileNameProperty ) { + this.fileNameProperty = fileNameProperty; + } + + /** + * Execute the filter action - in this case pre-setting InputField values + * with values loaded from a properties file (if present) + * + * @see org.tp23.antinstaller.runtime.exe.ExecuteFilter + * @param ctx context data + * @throws InstallException if an error occurred loading pre-defined properties + */ + public void exec(InstallerContext ctx) throws InstallException { + + Installer installer = ctx.getInstaller(); + String loadDefaults = installer.getLoadDefaults(); + if(installer.isVerbose()) { + ctx.log("loadDefaults attribute:" + loadDefaults); + } + boolean load = false; + if(loadDefaults == null || FALSE.equals(loadDefaults)) { + if(installer.isVerbose()) { + ctx.log("Not loading defaults"); + } + return; + } + + ctx.log( "Checking for predefined properties"); + Properties predefinedProps = loadPredefinedProperties( ctx, fileNameProperty ); + + definedPropertiesCount = predefinedProps.size(); + + boolean foundProps = false; + if( definedPropertiesCount == 0 ) { + ctx.log( "No predefined properties"); + } + else{ + foundProps = true; + } + + if( foundProps && PROMPT.equals(loadDefaults) ) { + load = ctx.getMessageRenderer().prompt(res.getString("promptLoadDefaults")); + } + else if( foundProps && PROMPT_AUTO.equals(loadDefaults)) { + load = ctx.getMessageRenderer().prompt(res.getString("promptLoadDefaults")); + } + else if( foundProps && LOAD.equals(loadDefaults) ) { + load = true; + } + + if( (!foundProps || !load) && + ctx.isAutoBuild() && + PROMPT.equals(loadDefaults) ) { + ctx.log( "Cant run -auto install without properties"); + throw new AbortException("Install Aborted: cant load ant.install.properties"); + } + + if(load) { + if(installer.isVerbose()) { + ctx.log("Loading defaults"); + } + + // version control + String propertiesVersion = predefinedProps.getProperty(PropertiesFileRenderer.INSTALLER_VERSION_PROPERTY); + String configVersion = ctx.getInstaller().getVersion(); + if(propertiesVersion != null) { + VersionHelper helper = new VersionHelper(); + if( ( ! propertiesVersion.equals(configVersion)) && + helper.equalOrHigher(configVersion , propertiesVersion) ) { + + // let major versions pass but prompt for differences + if( (! ctx.isAutoBuild()) && helper.majorVersionCompatible(configVersion , propertiesVersion) ){ + if( ! ctx.getMessageRenderer().prompt(res.getString("propertiesVersionMismatch")) ){ + throw new AbortException("Install Aborted: existing configuration is not compatible, config version: " + configVersion); + } + } + else { + throw new AbortException("Install Aborted: existing configuration is not compatible, config version: " + configVersion); + } + } + + } + else { + throw new AbortException("Install Aborted: local ant.install.properties missing config version, must be equal or lower than: " + configVersion); + } + // end version control + + Page[] allPages = installer.getPages(); + handleDefaults( ctx, allPages, predefinedProps ); + + } + } + + /* + * Use the supplied properties to pre-populate the page fields + */ + private void handleDefaults( InstallerContext ctx, Page[] allPages, Properties props ) throws InstallException { + for( int i = 0; i < allPages.length; i++ ) { + OutputField[] fields = allPages[i].getOutputField(); + setInputValues( ctx, allPages[i], fields, props ); + } + } + + private void setInputValues( InstallerContext ctx, Page page, OutputField[] outputFields, Properties props ) + throws InstallException { + //Should never happen, but guard against it + if( outputFields == null ) { + return; + } + + // find relevant targets + String targets = props.getProperty(page.getName() + PropertiesFileRenderer.TARGETS_SUFFIX); + List targetsList = splitTargets(targets); + + for (int j = 0; j < outputFields.length; j++) { + OutputField field = outputFields[j]; + + if( field instanceof ConditionalField ) { + ConditionalField condField = (ConditionalField) field; + setInputValues( ctx, page, condField.getFields(), props ); + } + else if( field instanceof InputField ) { + InputField input = (InputField)field; + String propName = input.getProperty(); + if( props.containsKey( propName ) ) { + String value = props.getProperty(propName); + + if( ctx.getInstaller().isDebug() ) { + ctx.log( "Setting " + propName + "=" + value ); + } + + input.setDefaultValue(value); // does not evaluate references + input.setInputResult(value); + input.setEditted( true ); + + if(field instanceof PasswordTextInput) { + if(value == null ){ + ctx.getMessageRenderer().printMessage(res.getString("promptMissingDefaultPassword")); + + } + } + + // TARGET TYPES + if(field instanceof TargetInput) { + // Target and SelectTarget + TargetInput tgtInput = (TargetInput)field; + page.removeTarget(tgtInput.getIdx()); + // if target was selected + if( ! InputField.isFalse(value)) { + page.addTarget(tgtInput.getIdx(), tgtInput.getTarget()); // returns the OS specific suffix if relevant + // DEBUG + if( ! targetsList.contains(tgtInput.getTarget()) ){ + // could be caused by someone trying to copy a file across platforms (not a good idea) + ctx.log("Defaults error: targets list for page " + page.getName() + + " should contain a TargetInput that was true"); + } + } + else { + if(InputField.isTrue( tgtInput.getForce()) ) { + String msg = "Defaults error: forced target for page " + page.getName() + + " has been removed"; + ctx.log(msg); + throw new InstallException(msg); + } + } + } + if(field instanceof TargetSelectInput) { + TargetSelectInput tgtInput = (TargetSelectInput)field; + page.removeTarget(tgtInput.getIdx()); + // one target must be selected (what if the page was not shown??) + page.addTarget(tgtInput.getIdx(), value); + } + } + } + //TODO: Should properties that are present in properties file but which do not appear + // as an InputField be set in the ResultContainer so that they can be used by later + // "if" conditions? - no other properties should be loaded separately from additional + // resource files if there is a requirement for that using an postDisplayTarget - PH + } + + //Page targets should be handled by the config loader process and indexed correctly + List pageTargets = page.getTargets(ctx); + Iterator iter = targetsList.iterator(); + while (iter.hasNext()) { + String targetPerProps = (String) iter.next(); + if( ! pageTargets.contains(targetPerProps)) { + ctx.log("Defaults warning: targets list for page " + page.getName() + + " should contain " + targetPerProps); + } + } + + } + + /** + * Check if external properties have been loaded + * + * @return <code>true</code> if an external properties file was configured and contained + * at least one property + */ + protected boolean isPropertiesLoaded() { + return (definedPropertiesCount > 0); + } + + /* + * Primarily for unit testing + */ + int getPropertiesFoundCount() { + return definedPropertiesCount; + } + + /** + * Load properties from a properties file if present. + * The name of the properties file is checked for in the following order. + * <p> + * If the parameter fileNamePropertyName is not null: + * <ul> + * <li>the environment is checked for an environmentvariable with that name</li> + * <li>java system properties are checked for a property with that name</li> + * </ul> + * If the file name has not been found, or if <code>fileNamePropertyName == null</code> + * then the default file name is used - @see{org.tp23.antinstaller.PropertiesFileRenderer#PROPERTIES_FILE_NAME} + * + * @param context installer context + * @param fileNamePropertyName name of environment variable or java system property containing the + * name of the properties file to be loaded or <code>null</code> + * @return properties + * @throws InstallException if the properties file is missing or an error occurs loading it + */ + private Properties loadPredefinedProperties( final InstallerContext context, + final String fileNamePropertyName ) + throws InstallException { + + Properties contextProps = InstallerContext.getEnvironment(); + String propertiesFileName = null; + boolean failSilently = true; + + if( fileNamePropertyName != null ) { + propertiesFileName = contextProps.getProperty( InstallerContext.ENV_PREFIX + fileNamePropertyName ); + + if( propertiesFileName == null ) { + propertiesFileName = + contextProps.getProperty( InstallerContext.JAVA_PREFIX + fileNamePropertyName ); + } + + if( propertiesFileName != null ) { + //Properties have been passed explicitly to installer so must load them + failSilently = false; + } + } + + if( propertiesFileName == null ) { + propertiesFileName = PropertiesFileRenderer.PROPERTIES_FILE_NAME; + } + + Properties definedProperties = new Properties( ); + + if( propertiesFileName != null ) { + File definedPropertiesFile = new File( propertiesFileName ); + context.log( "Loading pre-defined properties from file " + + definedPropertiesFile.getAbsolutePath()); + + //TODO: Support loading properties file from via classloader as a resource + try { + FileInputStream istream = new FileInputStream( definedPropertiesFile ); + definedProperties.load( istream ); + istream.close(); + } + catch( FileNotFoundException fnfExc ) { + if( !failSilently ) { + throw new InstallException( "Defined properties file " + + definedPropertiesFile.getAbsolutePath() + + " doesn't exist" ); + } + } + catch( IOException ioExc ) { + if( !failSilently ) { + throw new InstallException( "Unable to read contents of defined properties file " + + definedPropertiesFile.getAbsolutePath(), + ioExc ); + } + } + + if( context.getInstaller().isDebug() ) { + logPropertiesLoaded( context, definedProperties, definedPropertiesFile ); + } + + } + + return definedProperties; + } + + + // Debug - log properties loaded + private void logPropertiesLoaded( final InstallerContext context, + final Properties properties, + final File propertiesFile ) { + Iterator iterator = properties.keySet().iterator(); + context.log( "Predefined properties (" + + definedPropertiesCount + + ") loaded from " + + propertiesFile.getAbsolutePath() + + "..." ); + while( iterator.hasNext() ) { + String key = (String) iterator.next(); + context.log( key + "=" + properties.getProperty( key ) ); + } + } + + /* + * Could do a String.split(",") but want to avoid 1.4 specific stuff generally + * @param commaSeparated + * @return + */ + private List splitTargets(String commaSeparated) { + if(commaSeparated == null) { + return Collections.EMPTY_LIST; + } + StringTokenizer st = new StringTokenizer(commaSeparated, ","); + List targets = new ArrayList(); + while (st.hasMoreElements()) { + String element = st.nextToken(); + if(element != null){ + element = element.trim(); + if(element.length() > 0){ + targets.add(element.trim()); + } + } + } + return targets; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyLoaderFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyPrinterFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyPrinterFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyPrinterFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,83 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import java.io.File; +import java.io.IOException; + +import org.tp23.antinstaller.DefaultPropertiesFileRenderer; +import org.tp23.antinstaller.ExplicitPropertiesFileRenderer; +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.PropertiesFileRenderer; +import org.tp23.antinstaller.input.ResultContainer; + + +/** + * @author Paul Hinds + * @version $Id: PropertyPrinterFilter.java,v 1.5 2006/12/28 00:57:53 teknopaul Exp $ + */ +public class PropertyPrinterFilter implements ExecuteFilter { + + /** + * @see org.tp23.antinstaller.runtime.exe.ExecuteFilter#exec(org.tp23.antinstaller.InstallerContext) + */ + public void exec(InstallerContext ctx) throws InstallException { + ResultContainer results = ctx.getInstaller().getResultContainer(); + results.setProperty(PropertiesFileRenderer.FILE_ROOT_PROPERTY, + ctx.getFileRoot().getAbsolutePath()); + + printProperties(ctx); + + if(ctx.getInstaller().isVerbose()){ + ctx.log("Properties printed:" + ctx.getFileRoot().getAbsolutePath() + + File.separatorChar + PropertiesFileRenderer.PROPERTIES_FILE_NAME); + } + } + /** + * + * @param installer Installer + * @throws IOException + */ + private void printProperties(InstallerContext ctx) { + PropertiesFileRenderer propRenderer; + if(ctx.getInstaller().isVerbose()){ + propRenderer = new ExplicitPropertiesFileRenderer(); + } + else{ + propRenderer = new DefaultPropertiesFileRenderer(); + } + // render properties for reuse in auto builds + File currentDir = new File("."); + ctx.log("auto build supported: " + ctx.getInstaller().supportsAutoBuild()); + boolean alreadyWritten = false; + if(currentDir.canWrite() && ctx.getInstaller().supportsAutoBuild()){ + if(ctx.getInstaller().isVerbose()){ + try { + ctx.log("Rendering properties in the current directory: " + currentDir.getCanonicalPath()); + } catch (IOException e) { + // oh well never mind + } + } + propRenderer.renderProperties(ctx, currentDir); + alreadyWritten = true; + } + if( ! currentDir.equals(ctx.getFileRoot()) || !alreadyWritten){ + propRenderer.renderProperties(ctx, ctx.getFileRoot()); + } + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/PropertyPrinterFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/nonextractor.fconfig =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/nonextractor.fconfig (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/nonextractor.fconfig 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,11 @@ +# +# Default config for the NonExtractor +# +org.tp23.antinstaller.runtime.exe.CreateLoggerFilter +org.tp23.antinstaller.runtime.exe.InputStreamLoadConfigFilter +org.tp23.antinstaller.runtime.exe.CreateUIFilter +org.tp23.antinstaller.runtime.exe.PropertyLoaderFilter +org.tp23.antinstaller.runtime.exe.ExecuteRunnerFilter +org.tp23.antinstaller.runtime.exe.PropertyPrinterFilter +org.tp23.antinstaller.runtime.exe.AntProjectFilter +org.tp23.antinstaller.runtime.exe.FinalizerFilter \ No newline at end of file Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/script.fconfig =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/script.fconfig (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/script.fconfig 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,11 @@ +# +# Default config for the Install started with a script +# +org.tp23.antinstaller.runtime.exe.CreateLoggerFilter +org.tp23.antinstaller.runtime.exe.LoadConfigFilter +org.tp23.antinstaller.runtime.exe.CreateUIFilter +org.tp23.antinstaller.runtime.exe.PropertyLoaderFilter +org.tp23.antinstaller.runtime.exe.ExecuteRunnerFilter +org.tp23.antinstaller.runtime.exe.PropertyPrinterFilter +org.tp23.antinstaller.runtime.exe.AntLauncherFilter +org.tp23.antinstaller.runtime.exe.FinalizerFilter \ No newline at end of file Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/selfextractor.fconfig =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/selfextractor.fconfig (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/exe/selfextractor.fconfig 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,11 @@ +# +# Default config for the SelfExtractor +# +org.tp23.antinstaller.runtime.exe.CreateLoggerFilter +org.tp23.antinstaller.runtime.exe.LoadConfigFilter +org.tp23.antinstaller.runtime.exe.CreateUIFilter +org.tp23.antinstaller.runtime.exe.PropertyLoaderFilter +org.tp23.antinstaller.runtime.exe.ExecuteRunnerFilter +org.tp23.antinstaller.runtime.exe.PropertyPrinterFilter +org.tp23.antinstaller.runtime.exe.AntLauncherFilter +org.tp23.antinstaller.runtime.exe.FinalizerFilter \ No newline at end of file Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/CompoundExpression.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/CompoundExpression.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/CompoundExpression.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,38 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: CompoundExpression.java,v 1.1 2006/09/08 19:16:22 + * anothermwilson Exp $ + * @since 0.7.4 patch 2 + */ +public class CompoundExpression implements Expression { + + private Expression expression1; + private LogicalTest test; + private Expression expression2; + + public CompoundExpression(Expression expr1, final LogicalTest logicalTest, Expression expr2) { + this.expression1 = expr1; + this.expression2 = expr2; + this.test = logicalTest; + } + + public boolean evaluate() { + return test.getTestResult(expression1, expression2); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/CompoundExpression.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/EndsWithTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/EndsWithTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/EndsWithTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,33 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: EndsWithTest.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ +public class EndsWithTest extends ValuesTest { + + private static final String[] TEST_TOKENS = { "$=" }; + + public String[] getTestTokens() { + return TEST_TOKENS; + } + + protected boolean getTestResult(final String value, final String expectedValue) { + return (value != null) && value.endsWith(expectedValue); + + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/EndsWithTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/EqualsTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/EqualsTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/EqualsTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,42 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: EqualsTest.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ +public class EqualsTest extends ValuesTest { + + private static final String[] TEST_TOKENS = { "==", "=" }; + + public String[] getTestTokens() { + return TEST_TOKENS; + } + + protected boolean getTestResult(final String propValue, final String expectedValue) { + // Where the expected value is null, empty string must also match + if (expectedValue == null) { + return (propValue == null) || propValue.equals(""); + } + + if ((propValue != null) && propValue.equals(expectedValue)) { + return true; + } + + return false; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/EqualsTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/Expression.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/Expression.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/Expression.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,25 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: Expression.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ + +public interface Expression { + public boolean evaluate(); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/Expression.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ExpressionBuilder.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ExpressionBuilder.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ExpressionBuilder.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,211 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.logic; + +import java.util.Arrays; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; + +import org.tp23.antinstaller.input.ResultContainer; +import org.tp23.antinstaller.runtime.ConfigurationException; + +/** + * @author mwilson + * @version $Id: ExpressionBuilder.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ +public class ExpressionBuilder { + private static final int GROUPING_START_OPERATOR = '('; + + private static final int GROUPING_END_OPERATOR = ')'; + + private static final ValuesTest[] testValueConditions = { + new EndsWithTest(), + new EqualsTest(), + new GreaterThanOrEqualsTest(), + new LessThanOrEqualsTest(), + new NotEqualsTest(), + new StartsWithTest() + }; + + private static final LogicalTest[] testLogicalConditions = { + new LogicalAndTest(), + new LogicalOrTest() + }; + + private static final SingleExpressionTest SINGLE_EXPRESSION_TEST = new SingleExpressionTest(); + + private static Map tokenMap = new HashMap(); + + private static String[] valueTokens; + + private static String[] logicalTokens; + + static { + for (int i = 0; i < testValueConditions.length; i++) { + String[] tmpTokens = testValueConditions[i].getTestTokens(); + for (int j = 0; j < tmpTokens.length; j++) { + tokenMap.put(tmpTokens[j], testValueConditions[i]); + } + } + + valueTokens = new String[tokenMap.size()]; + int index = 0; + for (int i = 0; i < testValueConditions.length; i++) { + String[] tmpTokens = testValueConditions[i].getTestTokens(); + for (int j = 0; j < tmpTokens.length; j++) { + valueTokens[index++] = tmpTokens[j]; + } + } + + Comparator lengthComparator = new StringLengthComparator(); + + //Have to sort so that longest test operator is checked for first + Arrays.sort(valueTokens, lengthComparator); + + index = 0; + final int mapInitialSize = tokenMap.size(); + + for (int i = 0; i < testLogicalConditions.length; i++) { + String[] tmpTokens = testLogicalConditions[i].getTestTokens(); + for (int j = 0; j < tmpTokens.length; j++) { + tokenMap.put(tmpTokens[j], testLogicalConditions[i]); + } + } + + logicalTokens = new String[tokenMap.size() - mapInitialSize]; + for (int i = 0; i < testLogicalConditions.length; i++) { + String[] tmpTokens = testLogicalConditions[i].getTestTokens(); + for (int j = 0; j < tmpTokens.length; j++) { + logicalTokens[index++] = tmpTokens[j]; + } + } + + Arrays.sort(logicalTokens, lengthComparator); + + } + + public static Expression parseLogicalExpressions(ResultContainer container, String exprStr) throws ConfigurationException { + int startIndex = skipWhiteSpace(exprStr, 0); + int index = exprStr.indexOf(GROUPING_START_OPERATOR, startIndex); + + if (index == -1) { + return getSimpleExpression(container, exprStr.substring(startIndex)); + } + + if (index != 0) { + throw new ConfigurationException("Illegal ifProperty value: If present, grouping operator " + GROUPING_START_OPERATOR + + " must be at start of property string"); + } + + ++startIndex; //Skip over grouping operator + + int endIndex = exprStr.indexOf(GROUPING_END_OPERATOR, startIndex); + + if (endIndex == -1) { + throw new ConfigurationException("Missing closing grouping bracket " + GROUPING_END_OPERATOR + " in expression " + exprStr); + } + + //Check that this isn't an attempt tu use nested logical tests - not supported + int tstIndex = exprStr.indexOf(GROUPING_START_OPERATOR, startIndex); + if ((tstIndex != -1) && (tstIndex < endIndex)) { + throw new ConfigurationException("Nesting of logical operations is not supported: " + exprStr); + } + + try { + Expression expr1 = parseLogicalExpressions(container, exprStr.substring(startIndex, endIndex)); + + LogicalTest test = null; + + startIndex = endIndex + 1; + + //Look for logical operator token + String logicalToken = getLogicalToken(exprStr, startIndex); + + for (int i = 0; i < logicalTokens.length; i++) { + + if (logicalTokens[i].compareTo(logicalToken) == 0) { + test = (LogicalTest) tokenMap.get(logicalTokens[i]); + index = exprStr.indexOf(logicalTokens[i], startIndex); + startIndex = index + logicalTokens[i].length(); + break; + } + } + + if (test == null) { + return new CompoundExpression(expr1, SINGLE_EXPRESSION_TEST, null); + } else { + startIndex = skipWhiteSpace(exprStr, startIndex); + String expr2Str = exprStr.substring(startIndex, exprStr.length()); + return new CompoundExpression(expr1, test, parseLogicalExpressions(container, expr2Str)); + + } + } catch (Exception e) { + throw new ConfigurationException("Invalid ifProperty expression"); + } + } + + private static Expression getSimpleExpression(ResultContainer resultContainer, String exprStr) throws ConfigurationException { + try { + int index = -1; + int i; + + for (i = 0; i < valueTokens.length; i++) { + index = exprStr.indexOf(valueTokens[i]); + + if (index != -1) { + break; + } + } + + return new SimpleExpression(resultContainer, exprStr.substring(0, index), (ValuesTest) tokenMap.get(valueTokens[i]), exprStr + .substring(index + valueTokens[i].length())); + } catch (Exception e) { // can be StringIndexOutOfBoundsException - PH + throw new ConfigurationException("Invalid ifProperty expression"); + } + } + + private static int skipWhiteSpace(final String str, final int startIndex) { + final int strLen = str.length(); + int index = startIndex; + + while (index < strLen) { + if ((str.charAt(index) != ' ') && (str.charAt(index) != '\t')) { + break; + } + + ++index; + } + + return index; + } + + private static String getLogicalToken(final String str, final int startIndex) { + final int strLen = str.length(); + int tokenStart = skipWhiteSpace(str, startIndex); + int endIndex = tokenStart; + + while (endIndex < strLen) { + int chr = str.charAt(endIndex); + if ((chr == ' ') || (chr == '\t') || (chr == GROUPING_START_OPERATOR)) { + break; + } + + ++endIndex; + } + + return str.substring(tokenStart, endIndex); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ExpressionBuilder.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/GreaterThanOrEqualsTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/GreaterThanOrEqualsTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/GreaterThanOrEqualsTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,33 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: GreaterThanOrEqualsTest.java,v 1.1 2006/09/08 19:16:27 + * anothermwilson Exp $ + * @since 0.7.4 patch 2 + */ +public class GreaterThanOrEqualsTest extends ValuesTest { + + private static final String[] TEST_TOKENS = { "+=" }; + + public String[] getTestTokens() { + return TEST_TOKENS; + } + + protected boolean getTestResult(final String value1, final String value2) { + return Double.parseDouble(value1) >= Double.parseDouble(value2); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/GreaterThanOrEqualsTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LessThanOrEqualsTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LessThanOrEqualsTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LessThanOrEqualsTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,33 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: LessThanOrEqualsTest.java,v 1.1 2006/09/08 19:16:27 + * anothermwilson Exp $ + * @since 0.7.4 patch 2 + */ +public class LessThanOrEqualsTest extends ValuesTest { + + private static final String[] TEST_TOKENS = { "-=" }; + + public String[] getTestTokens() { + return TEST_TOKENS; + } + + protected boolean getTestResult(final String value1, final String value2) { + return Double.parseDouble(value1) <= Double.parseDouble(value2); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LessThanOrEqualsTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LiteralValue.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LiteralValue.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LiteralValue.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,38 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: LiteralValue.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ +public class LiteralValue implements Value { + + public static final String NULL = "null"; + private final String value; + + public LiteralValue(final String value) { + if ((value != null) && (value.equals(NULL))) { + this.value = null; + } else { + this.value = value; + } + } + + public String getValue() { + return value; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LiteralValue.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalAndTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalAndTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalAndTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,41 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: LogicalAndTest.java,v 1.1 2006/09/08 19:16:28 anothermwilson + * Exp $ + * @since 0.7.4 patch 2 + */ +public class LogicalAndTest implements LogicalTest { + + private static final String[] TEST_TOKENS = { "&&", "AND" }; + + public String[] getTestTokens() { + return TEST_TOKENS; + } + + public boolean getTestResult(Expression expression1, Expression expression2) { + + boolean result = false; + + if (expression1 != null && expression2 != null) { + result = expression1.evaluate() && expression2.evaluate(); + } + + return result; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalAndTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalOrTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalOrTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalOrTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,43 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: LogicalOrTest.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ +public class LogicalOrTest implements LogicalTest { + + private static final String[] TEST_TOKENS = { "||", "OR" }; + + public String[] getTestTokens() { + return TEST_TOKENS; + } + + public boolean getTestResult(Expression expression1, Expression expression2) { + boolean isTrue = false; + + if (expression1 != null) { + isTrue = expression1.evaluate(); + } + if (!isTrue && (expression2 != null)) { + isTrue = expression2.evaluate(); + } + + return isTrue; + + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalOrTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,27 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: LogicalTest.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ + +public interface LogicalTest extends TestOperator { + + public boolean getTestResult(Expression expression1, Expression expression2); + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/LogicalTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/NotEqualsTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/NotEqualsTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/NotEqualsTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,38 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: NotEqualsTest.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ +public class NotEqualsTest extends ValuesTest { + + private static final String[] TEST_TOKENS = { "!=" }; + + public String[] getTestTokens() { + return TEST_TOKENS; + } + + protected boolean getTestResult(final String propValue, final String expectedValue) { + if (expectedValue == null) { + return propValue != null && !propValue.equals(""); + } + + return (propValue == null) || !propValue.equals(expectedValue); + + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/NotEqualsTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/SimpleExpression.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/SimpleExpression.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/SimpleExpression.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,68 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +import org.tp23.antinstaller.input.ResultContainer; +import org.tp23.antinstaller.runtime.ConfigurationException; + +/** + * @author mwilson + * @version $Id: SimpleExpression.java,v 1.1 2006/09/08 19:16:30 anothermwilson + * Exp $ + * @since 0.7.4 patch 2 + */ +public class SimpleExpression implements Expression { + + private final Value value1; + private final ValuesTest testCondition; + private final Value value2; + private final String literalValue1; + private final String literalValue2; + + public SimpleExpression( + final ResultContainer resultContainer, + final String value1, + final ValuesTest test, + final String value2) + throws ConfigurationException { + + this.literalValue1 = value1; + this.value1 = getValue(resultContainer, value1); + this.testCondition = test; + this.literalValue2 = value2; + this.value2 = getValue(resultContainer, value2); + + } + + public boolean evaluate() { + return testCondition.getTestResult(value1, value2); + } + + private Value getValue(ResultContainer container, String valueStr) throws ConfigurationException { + if ( (valueStr.length() > 0) && (valueStr.charAt(0) == '$') ) { + if ( valueStr.startsWith("${") && valueStr.endsWith("}") ) { + return new VariableValue(container, valueStr); + } else { + throw new ConfigurationException("Badly formed variable: '" + valueStr + "'"); + } + } else { + return new LiteralValue(valueStr); + } + } + + public String toString() { + return "[" + literalValue1 + "==" + literalValue2 + "]"; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/SimpleExpression.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/SingleExpressionTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/SingleExpressionTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/SingleExpressionTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,34 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: SingleExpressionTest.java,v 1.1 2006/09/08 19:16:30 + * anothermwilson Exp $ + * @since 0.7.4 patch 2 + */ +public class SingleExpressionTest implements LogicalTest { + + private static final String[] EMPTY_TOKEN_LIST = new String[0]; + + public boolean getTestResult(Expression expression1, Expression expression2) { + return expression1.evaluate(); + } + + public String[] getTestTokens() { + return EMPTY_TOKEN_LIST; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/SingleExpressionTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/StartsWithTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/StartsWithTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/StartsWithTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,35 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: StartsWithTest.java,v 1.1 2006/09/08 19:16:30 anothermwilson + * Exp $ + * @since 0.7.4 patch 2 + */ +public class StartsWithTest extends ValuesTest { + + private static final String[] TEST_TOKENS = { "^=" }; + + public String[] getTestTokens() { + return TEST_TOKENS; + } + + protected boolean getTestResult(final String value1, final String value2) { + return (value1 != null) && value1.startsWith(value2); + + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/StartsWithTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/StringLengthComparator.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/StringLengthComparator.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/StringLengthComparator.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,46 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +import java.util.Comparator; + +import org.apache.tools.ant.taskdefs.Length; + +/** + * Compare strings based on their length. Used by ExpressionBuilder to ensure + * that longest match is attempted first. + * + * @author mwilson + * @version $Id: StringLengthComparator.java,v 1.1 2006/09/08 19:16:31 + * anothermwilson Exp $ + * @since 0.7.4 patch 2 + */ + +public class StringLengthComparator implements Comparator { + + /** + * Sort by descending String length + * + * @param o1 first string + * @param o2 second string + * @return difference between the length of o2 and o1 + */ + public int compare(Object o1, Object o2) { + String str1 = (String) o1; + String str2 = (String) o2; + return (str2.length() - str1.length()); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/StringLengthComparator.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/TestOperator.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/TestOperator.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/TestOperator.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,27 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: TestOperator.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ + +public interface TestOperator { + + public String[] getTestTokens(); + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/TestOperator.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/Value.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/Value.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/Value.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,26 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: Value.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ + +public interface Value { + + public String getValue(); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/Value.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ValuesTest.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ValuesTest.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ValuesTest.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,30 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +/** + * @author mwilson + * @version $Id: ValuesTest.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ + +public abstract class ValuesTest implements TestOperator { + + public boolean getTestResult(final Value value1, final Value value2) { + return getTestResult(value1.getValue(), value2.getValue()); + } + + abstract protected boolean getTestResult(final String value1Str, final String value2Str); +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/ValuesTest.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/VariableValue.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/VariableValue.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/VariableValue.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,42 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.tp23.antinstaller.runtime.logic; + +import org.tp23.antinstaller.input.ResultContainer; + +/** + * @author mwilson + * @version $Id: VariableValue.java,v 1.2 2006/12/21 00:03:18 teknopaul Exp $ + * @since 0.7.4 patch 2 + */ +public class VariableValue implements Value { + + private final ResultContainer valueHolder; + private final String propertyName; + + public VariableValue(final ResultContainer container, final String propertyName) { + valueHolder = container; + this.propertyName = propertyName; + } + + public String getValue() { + /* + * Use somewhat misleadingly named method getDefaultValue() It doesn't + * return the default value, it returns the current value of a property + * referenced by the use of ${propertyname} syntax + */ + return valueHolder.getDefaultValue(propertyName); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/runtime/logic/VariableValue.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/NonExtractor.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/NonExtractor.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/NonExtractor.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,66 @@ + /* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.selfextract; + +import java.io.File; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.runtime.ExecInstall; +import org.tp23.antinstaller.runtime.exe.FilterChain; +import org.tp23.antinstaller.runtime.exe.FilterFactory; + +/** + * This class is a replacement for the SelfExtractor that provides a similar + * function to the SelfExtractor but avoids the need to extract all the + * files prior to running the build. When using this extractor the project + * is run from the Jar but It is the Ant builds responsibility to access + * resources from within the Jar the Jar itself can be referenced using + * the Ant property "antinstaller.jar". The build file is automatically read + * from the Jar. + * @author Paul Hinds + * @version $Id: NonExtractor.java,v 1.4 2006/12/15 21:16:39 teknopaul Exp $ + */ +public class NonExtractor extends SelfExtractor{ + + /** used by AntProjectFilter */ + public static final String ANTINSTALLER_JAR_PROPERTY = "antinstaller.jar"; + public static final String CONFIG_RESOURCE = "/org/tp23/antinstaller/runtime/exe/nonextractor.fconfig"; + + /** + * Run method to use from the command line. This is fired via an entry in the + * MANIFEST.MF in the Jar + *@param args The command line arguments + */ + public static void main(String[] args) { + try { + SelfExtractor extractor = null; + extractor = new NonExtractor(); + FilterChain chain = FilterFactory.factory(CONFIG_RESOURCE); + ExecInstall installExec = new ExecInstall(chain); + installExec.parseArgs(args, false); + + // create temporary space for the build to be removed on exit + File temp = extractor.makeTempDir(); + installExec.setTempRoot(temp); + installExec.setInstallRoot(temp); + installExec.exec(); + } + catch (InstallException e) { + System.out.println("Can't load filter chain: " + CONFIG_RESOURCE); + e.printStackTrace(); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/NonExtractor.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ProgressIndicator.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ProgressIndicator.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ProgressIndicator.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,163 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.selfextract; + +import java.awt.BorderLayout; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.GraphicsConfiguration; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.util.ResourceBundle; + +import javax.swing.BorderFactory; +import javax.swing.ImageIcon; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.UIManager; +import javax.swing.border.BevelBorder; +import javax.swing.border.Border; + + + +/** + * + * <p>Frame to indicate progress of the extraction of a SelfExctracting archive </p> + * <p> </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: tp23</p> + * @author Paul Hinds + * @version $Id: ProgressIndicator.java,v 1.3 2007/01/28 08:44:40 teknopaul Exp $ + */ +public class ProgressIndicator + extends JFrame { + + public static final String IMAGE_RESOURCE = "/resources/extract-image.png"; + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.Res"); + + private JPanel jPanel1 = new JPanel(); + private JProgressBar jProgressBar1 = new JProgressBar(); + private JLabel textLabel = new JLabel(); + private Border border1; + private int max = 0; + private static int PAGE_WIDTH = 160; + private static int PAGE_HEIGHT = 110; // 35 is text + bar + private String title = res.getString("extracting"); + private JLabel imagePanel = new JLabel(); + GridBagLayout gridBagLayout1 = new GridBagLayout(); + private boolean useIcon = true; + + + + public ProgressIndicator(int max) { + this.max = max; + jbInit(); + } + + public ProgressIndicator(int max, String title) { + this.max = max; + this.title = title; + jbInit(); + } + + private void setLocation() { + GraphicsConfiguration config = getGraphicsConfiguration(); + int x = (int) config.getBounds().getCenterX() - (PAGE_WIDTH / 2); + int y = (int) config.getBounds().getCenterY() - (PAGE_HEIGHT / 2); + setLocation(x, y); + } + + + private void jbInit() { + border1 = BorderFactory.createCompoundBorder( + BorderFactory.createBevelBorder(BevelBorder.RAISED), + BorderFactory.createEmptyBorder(4, 4, 4, 4)); + jPanel1.setLayout(gridBagLayout1); + int row = 0; + this.getContentPane().add(jPanel1, BorderLayout.CENTER); + if (useIcon) { + PAGE_HEIGHT = 110; + setImage(); + jPanel1.add(imagePanel, new GridBagConstraints(0, row++, 1, 1, 0.1, 0.9 + , GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); + this.setSize(new Dimension(PAGE_WIDTH, PAGE_HEIGHT)); + } + else { + PAGE_HEIGHT = 40; + this.setSize(new Dimension(PAGE_WIDTH, 35)); + } + jPanel1.setBorder(border1); + jPanel1.setMaximumSize(new Dimension(PAGE_WIDTH, PAGE_HEIGHT)); + jPanel1.setMinimumSize(new Dimension(PAGE_WIDTH, PAGE_HEIGHT)); + jPanel1.setPreferredSize(new Dimension(PAGE_WIDTH, PAGE_HEIGHT)); + textLabel.setText(title); + this.setTitle(title); + jPanel1.add(textLabel, new GridBagConstraints(0, row++, 1, 1, 0.1, 0.1 + , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); + jPanel1.add(jProgressBar1, new GridBagConstraints(0, row++, 1, 1, 0.1, 0.1 + , GridBagConstraints.SOUTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); + jProgressBar1.setMinimum(0); + jProgressBar1.setMaximum(max); + this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + this.setSize(new Dimension(PAGE_WIDTH, PAGE_HEIGHT)); + this.setResizable(false); + this.setUndecorated(true); + setLocation(); + } + + public void tick() { + jProgressBar1.setValue(jProgressBar1.getValue() + 1); + } + + private void setImage() { + try { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + InputStream in = this.getClass().getResourceAsStream(IMAGE_RESOURCE); + byte[] buffer = new byte[2048]; + int read = -1; + while ( (read = in.read(buffer)) != -1) { + baos.write(buffer, 0, read); + } + ImageIcon icon = new ImageIcon(baos.toByteArray()); + imagePanel.setHorizontalAlignment(JLabel.CENTER); + imagePanel.setIcon(icon); + } + catch (Exception ex) { + } + } + + /** + * TODO move to JUnit + * @param args + */ + public static void main(String[] args) { + try { + ProgressIndicator indicator = null; + indicator = new ProgressIndicator(200); + indicator.show(); + UIManager.setLookAndFeel("org.tp23.jgoodies.plaf.plastic.PlasticXPLookAndFeel"); + } + catch (Exception ex) { + // not concerned about Look and Feel + } + + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ProgressIndicator.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ResourceExtractor.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ResourceExtractor.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ResourceExtractor.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,74 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.selfextract; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +/** + * Copies resources from the Classpath to the filesystem replacing regex with replacement + * and correcting line endings + * @author teknopaul + * + */ +public class ResourceExtractor { + + /** + * @param resource Must start with / e.g. /org/tp23/myFile.txt + * @param dest + * @throws IOException + */ + public void copyResource(String resource, File dest, String regex, String replace) throws IOException{ + InputStream is = this.getClass().getResourceAsStream(resource); + if(is == null){ + throw new IOException("Can not find resource: " + resource); + } + InputStreamReader isr = new InputStreamReader(is); + BufferedReader br = new BufferedReader(isr); + FileOutputStream bos = new FileOutputStream(dest); + String line = null; + while((line = br.readLine()) != null){ + bos.write(line.replaceAll(regex, replace).getBytes()); + bos.write(System.getProperty("line.separator").getBytes()); + } + bos.flush(); + bos.close(); + br.close(); + } + /** + * @param resource Must start with / e.g. /org/tp23/myFile.txt + * @param dest + * @throws IOException + */ + public void copyResourceBinary(String resource, File dest) throws IOException{ + InputStream is = this.getClass().getResourceAsStream(resource); + if(is == null){ + throw new IOException("Can not find resource: " + resource); + } + FileOutputStream bos = new FileOutputStream(dest); + byte[] buffer = new byte[1024]; + for(int read = 0; (read = is.read(buffer)) > 0; ){ + bos.write(buffer, 0, read); + } + bos.flush(); + bos.close(); + is.close(); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/ResourceExtractor.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/SelfExtractor.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/SelfExtractor.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/SelfExtractor.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,483 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.selfextract; + +import java.awt.HeadlessException; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileFilter; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.net.URL; +import java.util.ArrayList; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import java.util.jar.JarInputStream; + +import javax.swing.JOptionPane; +import javax.swing.UIManager; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.renderer.swing.plaf.LookAndFeelFactory; +import org.tp23.antinstaller.runtime.ExecInstall; +import org.tp23.antinstaller.runtime.exe.FilterChain; +import org.tp23.antinstaller.runtime.exe.FilterFactory; + +/** + * + * <p>Finds a file reference to the Jar that loads this class and then extracts that Jar + * to a temporary directory </p> + * <p> </p> + * @author Paul Hinds + * @version $Id: SelfExtractor.java,v 1.10 2007/01/28 08:44:40 teknopaul Exp $ + */ +public class SelfExtractor { + + public static final String CONFIG_RESOURCE = "/org/tp23/antinstaller/runtime/exe/selfextractor.fconfig"; + + private File extractDir; + private File archiveFile; + private boolean overwrite = true; + + private static int DEFAULT_BUFFER_SIZE = 1024; + private int BUFFER_SIZE = DEFAULT_BUFFER_SIZE; + private static boolean graphicsEnv = false; + private static String lookAndFeel = null; + + /** + * returns the Jar that the reference object was loaded from. If it was not + * loaded from a jar this methods behaviour is undefined + * @TODO define what happens + * @param reference + * @return A java.io.File reference to the Jar + */ + public static File getEnclosingJar(Object reference) { + String thisClass = "/" + reference.getClass().getName().replace('.','/') + ".class"; + URL jarUrl = reference.getClass().getResource(thisClass); + String stringForm = jarUrl.toString(); + //String fileForm = jarUrl.getFile(); + + File file = null; + int endIdx = stringForm.indexOf("!/"); + if(endIdx != -1){ + String unescaped = null; + String fileNamePart = stringForm.substring("jar:file:".length(), endIdx); + file = new File(fileNamePart); + if ( ! file.exists()) { + // try to unescape encase the URL Handler has escaped the " " to %20 + unescaped = unescape(fileNamePart); + file = new File(unescaped); + } + return file; + } + throw new RuntimeException("Failed expanding Jar."); + } + + /** + * Constructor for the SelfExtractor object. Directly after constructing + * an instance the init() method should be called unless subclassing + */ + public SelfExtractor() { + } + + /** + * This has been moved from the default constructor to facilitate subclassing + * @return true if the lookAndFeel worked + */ + public void init(){ + System.out.println("Loading self extractor..."); + archiveFile = getEnclosingJar(this); + makeTempDir(); + try { + JarFile thisJar = new JarFile(archiveFile); + lookAndFeel = thisJar.getManifest().getMainAttributes().getValue("Look-And-Feel"); + lookAndFeel = LookAndFeelFactory.getLafFromToken(lookAndFeel); + if(lookAndFeel != null) { + UIManager.setLookAndFeel(lookAndFeel); + } + } + catch (Throwable ex) { + // not concerned about Look and Feel + } + } + + /** + * Creates a new empty temporary directory for the file extraction + * @return + */ + protected File makeTempDir(){ + String tempDir = System.getProperty("java.io.tmpdir"); + extractDir = new File(tempDir, "antinstall"); + int idx = 0; + while (extractDir.exists()) { + extractDir = new File(tempDir, "antinstall" + (idx++)); + } + extractDir.mkdirs(); + extractDir.deleteOnExit(); + return extractDir; + } + + /** + * Constructor for the SelfExtractor object that sets the buffersize in use. + * The write buffer is the same size as the write buffer size because the read buffer reads + * decompressed bytes + * @param newBufferSize the size of the read buffer + */ + public SelfExtractor(int newBufferSize) { + BUFFER_SIZE = newBufferSize; + archiveFile = getEnclosingJar(this); + } + + /** + * Sets the Directory into which the file will be extracted + * + *@param newExtractDir The new extract directory + */ + public void setExtractDir(File newExtractDir) { + extractDir = newExtractDir; + } + + /** + * changes the archive to be extracted + *@param newArchiveFile The new archiveFile value + */ + public void setArchiveFile(File newArchiveFile) { + archiveFile = newArchiveFile; + } + + /** + * Gets the Directory into which the files will be extracted that + * is currently set in the ZipExtractor object + *@return The extract directory value + */ + public File getExtractDir() { + return extractDir; + } + + /** + * Gets the set in the ZipExtractor + *@return The archiveFile value + */ + public boolean isOverwrite() { + return overwrite; + } + + /** + * Gets the Directory into which the files will be extracted that + * is currently set in the ZipExtractor object + *@return The extract directory value + */ + public void setOverwrite(boolean overwrite) { + this.overwrite = overwrite; + } + + /** + * Gets the set in the ZipExtractor + *@return The archiveFile value + */ + public File getArchiveFile() { + return archiveFile; + } + + /** + * Opens up the zip and gets a list of the files in it. If the zip file + * or the temp file have not been set NullPointerExceptions will get thrown + *@param vebose if true Prints out a list of the zips + * contents on to the command line + *@return an ArrayList of String objects that will + * be as per the path in the zip + *@exception FileNotFoundException Description of Exception + *@exception IOException Description of Exception + */ + public ArrayList getList(boolean vebose) throws FileNotFoundException, IOException { + JarInputStream zis = new JarInputStream(new FileInputStream(archiveFile)); + JarEntry entry = null; + ArrayList result = new ArrayList(); + while ( (entry = zis.getNextJarEntry()) != null) { + if (vebose) { + System.out.println(entry.getName()); + } + result.add(entry.getName()); + } + return result; + } + + /** + * @return the number of files in the jar + * @throws FileNotFoundException + * @throws IOException + */ + public int getFileCount() throws FileNotFoundException, IOException { + JarInputStream zis = new JarInputStream(new FileInputStream(archiveFile)); + int count = 0; + while ( zis.getNextJarEntry() != null) { + count++; + } + return count; + } + + /** + * Opens up the zip and extracts the files to the temp dir. + * + *@param vebose if true Prints out a list of the zips contents on to System.out + *@return an ArrayList of java.io.File objects that + * will be as per the path in the zip with the root being the temp dir + *@exception FileNotFoundException + *@exception IOException + */ + public ArrayList extract(boolean vebose, boolean isX) throws FileNotFoundException, IOException { + int fileCount = getFileCount(); + ProgressIndicator indicator = null; + if(isX){ + try { + indicator = new ProgressIndicator(fileCount); + indicator.show(); + } + catch ( Exception exc ) { + /* + * Chances are, there are problems with the graphics environment + * so trying falling back to text mode + */ + graphicsEnv = false; + isX = false; + } + + } + JarInputStream zis = new JarInputStream(new FileInputStream(archiveFile)); + JarEntry entry = null; + ArrayList result = new ArrayList(); + while ( (entry = zis.getNextJarEntry()) != null) { + if (vebose) { + System.out.println("Extracting:" + entry.getName()); + } + result.add(extract(zis, entry)); + if (isX) { + indicator.tick(); + } + } + if (isX) { + indicator.hide(); + } + zis.close(); + return result; + } + + + + /** + * Extract a single file from the stream. N.B. the stream must be in the correct + * position for this to work + *@param zis ZipInputStream open and ready + *@param entry A valid entry read from the stream + *@return The inflated file generated in the temp dir + *@exception FileNotFoundException + *@exception IOException + */ + private File extract(JarInputStream zis, JarEntry entry) throws FileNotFoundException, IOException { + createPath(entry.getName()); + File fileToUse = new File(extractDir, entry.getName()); + if (fileToUse.exists()) { + if (!overwrite) { + return fileToUse; + } + } + else { + fileToUse.createNewFile(); + } + if (fileToUse.isDirectory()) { + return fileToUse; + } + + BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(fileToUse), BUFFER_SIZE); + byte[] bytes = new byte[BUFFER_SIZE]; + int len = 0; + while ( (len = zis.read(bytes)) >= 0) { + bos.write(bytes, 0, len); + } + bos.close(); + zis.closeEntry(); + return fileToUse; + } + + /** + * This adds all the necessary directories in the root of the zip path to the + * temp dir. + *@param entryName The string name in the Zip file (virtual path) + *@exception IOException if the directories can not be made + */ + private void createPath(String entryName) throws IOException { + int slashIdx = entryName.lastIndexOf('/'); + if (slashIdx >= 0) { + // there is path info + String firstPath = entryName.substring(0, slashIdx); + File dir = new File(extractDir, firstPath); + if (!dir.exists()) { + dir.mkdirs(); + } + } + } + + /** + * Run method to use from the command line. This is fired via an entry in the + * MANIFEST.MF in the Jar + *@param args The command line arguments + */ + public static void main(String[] args) { + testX(); + // FIXME move after parseArgs() and set graphicsEnv if text selected + // will need to test SelfExtractor and comment parseArgs() to ensure + // no side effects in the future. + SelfExtractor extractor = null; + try { + boolean verbose = false; + extractor = new SelfExtractor(); + extractor.init(); + extractor.extract(verbose, graphicsEnv); + } + catch (Exception e) { + e.printStackTrace(); + String tempDir = "unknown"; + if(extractor != null){ + tempDir = extractor.getExtractDir().getAbsolutePath(); + } + String warning = "Could not extract Jar file to directory:" + tempDir; + printXorTextWarning(warning); + } + + try { + FilterChain chain = FilterFactory.factory(CONFIG_RESOURCE); + ExecInstall installExec = new ExecInstall(chain); + installExec.parseArgs(args, false); + installExec.setInstallRoot(extractor.getExtractDir()); + // removes files on exit + installExec.setTempRoot(extractor.getExtractDir()); + + installExec.exec(); + } + catch (InstallException e1) { + System.out.println("Cant load filter chain:/org/tp23/antinstaller/runtime/exe/selfextractor.fconfig"); + e1.printStackTrace(); + } + } + + /** + * This tests for the existence of a graphics environment and sets an + * internal flag so the test does not have to be repeated, it may be expensive. + * Prior to running this method the isGraphicsEnv() method will be invalid. + */ + protected static void testX(){ + try { + java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(); + try { + boolean headless = java.awt.GraphicsEnvironment.isHeadless(); + if(headless) { + graphicsEnv = false; + return; + } + } catch (Throwable e) { + // JDK 1.3 does not have the isHeadless() method but may still work in other situations + } + graphicsEnv = true; + } + catch (Throwable e) { + // thus graphicsEnv stays false; + } + } + + /** + * @see #testX() + * @return true if an X or windows environment is available + */ + protected boolean isGraphicsEnv(){ + return graphicsEnv; + } + + protected static void printXorTextWarning(String warning){ + if(graphicsEnv){ + try { + JOptionPane.showMessageDialog(null, warning); + } + catch( HeadlessException headlessExc ) { + graphicsEnv = false; + System.out.println(warning); + } + } + else { + System.out.println(warning); + } + } + + public static int deleteRecursive(File directory) { + int count = 0; + File[] files = directory.listFiles(new FileFilter() { + public boolean accept(File file) { + return!file.isDirectory(); + } + }); + for (int i = 0; i < files.length; i++) { + files[i].delete(); + count++; + } + File[] dirs = directory.listFiles(new FileFilter() { + public boolean accept(File file) { + return file.isDirectory(); + } + }); + for (int i = 0; i < dirs.length; i++) { + count += deleteRecursive(dirs[i]); + } + directory.delete(); + return count; + } + + /** + * UN-URL encode string + * TODO should this not support UNICODE escapes + */ + private static String unescape(final String s) { + StringBuffer sb = new StringBuffer(s.length()); + + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + switch (c) { + case '%': { + try { + sb.append( (char) Integer.parseInt(s.substring(i + 1, i + 3), 16)); + i += 2; + break; + } + catch (NumberFormatException nfe) { + throw new IllegalArgumentException(); + } + catch (StringIndexOutOfBoundsException siob) { + String end = s.substring(i); + sb.append(end); + if (end.length() == 2) i++; + } + break; + } + default: { + sb.append(c); + break; + } + } + } + return sb.toString(); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/SelfExtractor.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/package.html =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/package.html (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/package.html 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,14 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head><!-- + Copyleft (c) 2004 tp23 + All Rights Reserved. +--></head> + +<body bgcolor="white">Classes to extract the jar from which this package is loaded. + +The self extracting method is to obtain a temporary directory from java.io.File +and extract the files there. The baseDir for Ant is then set to this directory and it is +treated as if it were the current directory (although it is not and ./ references +will not work.</body> +</html> Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/antinstaller/selfextract/package.html ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/GBCF.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/GBCF.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/GBCF.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,117 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.gui; + +import java.awt.GridBagConstraints; +import java.awt.Insets; +/** + * GBCF Grib Bag Constraints Factory. This class exists mostly + * for tidying up code that used the exsivly verbose GridBagConstraints + * object, hence the shortened class name. + * By default a two column equal with table is assumed, to support other + * column layouts use the constructor that take an array of column wieghts + * Factory class for generating constraints for a equal width column table. + * the table is similar to the following table rendered in HTML + * <table border="2"> + * <tr> + * <td>data</td><td>data</td> + * </tr> + * <tr> + * <td colspan="2">data</td> + * </tr> + * <tr> + * <td>data</td><td>data</td> + * </tr> + * <tr> + * <td>data</td><td>data</td> + * </tr> + * <table> + * @author not attributable + * @version 1.0 + */ +public class GBCF { + + protected Insets insets = new Insets(1,4,1,4); + protected Insets noinsets = new Insets(0,0,0,0); + protected double[] columnWeights= new double[]{0.5,0.5}; + + public GBCF(){ + + } + /** + * to support more than two columns or vary the column wieghtings + * @param columnWeights double[] + */ + public GBCF(double[] columnWeights){ + this.columnWeights=columnWeights; + } + /** + * + * @param row int the 0 indexed row + * @param col int the 0 indexed column + * @param span boolean does cell span both columns + * @return GridBagConstraints + */ + public GridBagConstraints getCell(int row,int col){ + return new GridBagConstraints(col, //gridx + row, //gridy + 1, //gridwidth + 1, //gridheight + columnWeights[col],//weightx + 0.0, //weithty + GridBagConstraints.WEST, // anchor + GridBagConstraints.NONE, //fill + insets, // insets + 1, //ipadx + 1 //ipady + ); + } + /** + * + * @param row int the 0 indexed row + * @param first boolean is this the first column or the second + * @param span boolean does cell span both columns + * @return GridBagConstraints + */ + public GridBagConstraints getSpan(int row){ + return new GridBagConstraints(0, //gridx + row, //gridy + 2, //gridwidth + 1, //gridheight + columnWeights[0],//weightx + 0.0, //weithty + GridBagConstraints.WEST, // anchor + GridBagConstraints.NONE, //fill + insets, // insets + 1, //ipadx + 1 //ipady + ); + } + public GridBagConstraints getVertGlue(int row){ + return new GridBagConstraints(0, //gridx + row, //gridy + 2, //gridwidth + 1, //gridheight + columnWeights[0],//weightx + 1.0, //weithty + GridBagConstraints.NORTHWEST, // anchor + GridBagConstraints.NONE, //fill + noinsets, // insets + 0, //ipadx + 0 //ipady + ); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/GBCF.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/DefaultingDirectoryChooser.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/DefaultingDirectoryChooser.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/DefaultingDirectoryChooser.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,180 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.gui.widget; + +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.io.File; + +import javax.swing.JFileChooser; +import javax.swing.filechooser.FileFilter; +import javax.swing.filechooser.FileSystemView; +/** + * A file chooser that makes a beter default if the default directory is not available. +* Basically the default looks for the suggested directory and if it does not find it moves back +* up the directories. If still nothing is found (for example it may get to My Computer +* which you can not add file to) the home directory is selected, as in the default file chooser. +* +* To use this class call new DefaultingDirectoryChooser(boolean) and immediately call +* setDefaultDirectory(File) to determine the default. If you don't it behaves like the default JFileChooser +* Also if you call setCurrentDirectory(File) it will behave like JFileChooser +* +* This chooser has two modes CREATE_MODE and EXISTING_MODE. <br/><br/> +* +* In existing mode it is assumed the chooser is being used to identify an existing directory +* the default directory should exist if not the directory shown will be the next existing parent.<br/><br/> +* +* In create mode it is +* assumed that the last directory in the default directory is to be created and may not +* exist yet. Therefor the default directory displayed is the parent (with suitable defaulting) +* and the text box will contain the name of the last directory. +* e.g. if default is C:\Program Files\MyApp C:\Program Files will be displayed and +* MyApp will be shown in the text box (even if it does not exist yet) If C:\Program Files does not exist +* C:\ will be shown as with existing mode. +* Choosing select can lead to the creation of the file. It will not be automatically +* created that is the responsibility of the client code.<br/> +* +* This class uses FileSystemView and will only display folders that return true to fsv.isFileSystem() +* +* This class also uses a bit of a hack by in CREATE_MODE it sets the selectables to files and directories +* although only shows the directories this way a non-existing Directory can be chosen. This is the only way I can +* get it to work on my Java version but I would not be supprised if it did not work on +* other versions of the Java API. It also means that setFileSelectionMode() should +* never be called by clients as it will break this hack. + * @author Paul Hinds + * @version 1.0 + */ +public class DefaultingDirectoryChooser extends JFileChooser{ + + public static final boolean CREATE_MODE = true; + public static final boolean EXISTING_MODE = false; + + /** + * Determines that the default includes a directory name that is requried + * e.g. C:\Program Files\MyApp where even if Program Files does not exist + * MyApp should be part of the default even if it does not exist. + */ + private boolean createMode = false; + private File selectedFile = null; + private String desiredName = null; + + public DefaultingDirectoryChooser(boolean createMode) { + this.createMode=createMode; + if(createMode){ + setFileSelectionMode(FILES_AND_DIRECTORIES); + removeChoosableFileFilter(getAcceptAllFileFilter()); + addChoosableFileFilter(new FileFilter(){ + public boolean accept(File f) { + if(f.exists() && f.isDirectory())return true; + if(!f.exists() && getFileSystemView().getParentDirectory(f).isDirectory())return true; + return false; + } + public String getDescription() { + return "Directories"; + } + }); + + addPropertyChangeListener(JFileChooser.DIRECTORY_CHANGED_PROPERTY, new PropertyChangeListener(){ + public void propertyChange(PropertyChangeEvent evt) { + File directory = (File)evt.getNewValue(); + DefaultingDirectoryChooser.this.setCurrentDirectory(new File(directory, "newfolder")); + setSelectedFile(new File(directory, desiredName)); + } + }); + } + else { + setFileSelectionMode(DIRECTORIES_ONLY); + } + } + + + /** + * Sets the default directory. + * @param dir the current directory to point to + * @todo Implement this javax.swing.JFileChooser method + */ + public void setDefaultDirectory(File dir) { + if(dir==null)return;// called by the default consructor + if(createMode){ + if(desiredName == null)desiredName = dir.getName(); + File selected = determineCreateDir(dir); + super.setCurrentDirectory(selected.getParentFile()); + setSelectedFile(selected); + }else{ + super.setCurrentDirectory(determineExistingDir(dir)); + } + } + + + + private File determineExistingDir(File defaultDir){ + if(defaultDir.exists())return defaultDir; + FileSystemView fsv = this.getFileSystemView(); + File validParent = getFSVParent(fsv,defaultDir); + if(validParent!=null) { + return validParent; + } + else { + return fsv.getHomeDirectory(); + } + } + /** + * Select a base path for the default even if it does not exist. The order of preference is as follows + * if the directory exists use it + * if the parent does not exist try finding the next parent + * if the next parent is a root directory e.g. / or C:\ use the users home directory + * @param defaultDir File + * @return File + */ + private File determineCreateDir(File defaultDir){ + if(defaultDir.exists())return defaultDir; + FileSystemView fsv = this.getFileSystemView(); + String dirName = defaultDir.getName(); + File validParent = getFSVParent(fsv,defaultDir); + if(validParent!=null){ + return new File(validParent, dirName); + } + else { + return new File(fsv.getHomeDirectory(), dirName); + } + } + /** + * Step back up trying to find a parent if none if found return null. + * null can be found if the path starts e:\ and e: does not exist + * @param fsv FileSystemView + * @param dir File + * @return File + */ + private File getFSVParent(FileSystemView fsv,File dir){ + File parent = dir.getParentFile(); + if(fsv.isRoot(parent) && !parent.exists()){ + return null; + } + if(!parent.exists() || !fsv.isFileSystem(parent)){ + parent = getFSVParent(fsv,parent); + } + return parent; + } + + public static void main(String[] args) { + DefaultingDirectoryChooser chooser = new DefaultingDirectoryChooser(CREATE_MODE); + chooser.setDefaultDirectory(new File("/usr/local/dibble/MyApp")); + + chooser.showDialog(null,"Select"); + System.out.println("Selected:"+chooser.getSelectedFile().getAbsolutePath()); + System.exit(0); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/DefaultingDirectoryChooser.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/FollowingJTextArea.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/FollowingJTextArea.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/FollowingJTextArea.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,125 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.gui.widget; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; + +import javax.swing.JMenuItem; +import javax.swing.JPopupMenu; +import javax.swing.JTextArea; + +public class FollowingJTextArea extends JTextArea{ + + private boolean follow = true; + + public FollowingJTextArea() { + jInit(); + } + + + private void jInit(){ + final JPopupMenu popUp = getPopupMenu(); + this.add(popUp); + this.addMouseListener(new MouseAdapter(){ + public void mouseClicked(MouseEvent e) { + if (e.getButton() == e.BUTTON3) { + popUp.show(FollowingJTextArea.this,e.getX(),e.getY()); + } + } + }); + } + + public boolean isFollow() { + return follow; + } + public void setFollow(boolean follow) { + this.follow = follow; + } + + private void scrollToEnd(){ + setCaretPosition(getDocument().getLength()); + } + private void toggleFollow(){ + setFollow(!isFollow()); + } + + /** + * Appends the given text to the end of the document. + * + * @param str the text to insert + * @todo Implement this javax.swing.JTextArea method + */ + public void append(String str) { + super.append(str); + if(follow)scrollToEnd(); + } + private JPopupMenu getPopupMenu() { + JPopupMenu contextMenu = new JPopupMenu("Options"); + JMenuItem saveMenu = new JMenuItem("Save Text"); + saveMenu.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + SelectFileAction action = new SelectFileAction("Save Output", null, null); + try { + action.actionPerformed(new ActionEvent(this, 0, "Save Output")); + if (action.selectedFile != null) { + FileWriter fos = new FileWriter(action.selectedFile); + fos.write(getText()); + fos.close(); + } + + } + catch (FileNotFoundException ex) { + System.err.println("FileNotFoundException"); + } + catch (IOException ex) { + System.err.println("IOException"); + } + } + }); + contextMenu.add(saveMenu); + + JMenuItem toggleFollowMenu = new JMenuItem("Toggle Follow"); + toggleFollowMenu.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + toggleFollow(); + } + }); + contextMenu.add(toggleFollowMenu); + + JMenuItem jumpToEndMenu = new JMenuItem("Jump To End"); + jumpToEndMenu.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + setCaretPosition(getDocument().getLength()); + } + }); + contextMenu.add(toggleFollowMenu); + + JMenuItem clearTextMenu = new JMenuItem("Clear Text"); + clearTextMenu.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + setText(""); + } + }); + contextMenu.add(clearTextMenu); + return contextMenu; + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/FollowingJTextArea.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/JTextAreaPrintStream.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/JTextAreaPrintStream.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/JTextAreaPrintStream.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,244 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.gui.widget; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; + +import javax.swing.JTextArea; + +/** + * <p>This subclass of PrintStream is designed to be compatible with System.out and System.err but it provides +* its own functionality and does not borrow from PrintStream. All methods are overridden. The calls to each method +* behave as expected with the exception of flush() which appears to insert a new line for each call. flush() sends +* the current line to the JTextArea with a call to JTextArea.append(String) which adds a +* line in the buffer.</p> + * @author Paul Hinds + * @version 1.0 + */ +public class JTextAreaPrintStream extends PrintStream{ + + private JTextArea textArea; + private StringBuffer line; + + public JTextAreaPrintStream(JTextArea textArea) { + super(new ByteArrayOutputStream(0));// wasted all methods are overridden + this.textArea = textArea; + line = new StringBuffer(); + } + + /** + * The stream can not be closed + */ + public void close(){ + } + + public synchronized void flush(){ + if(line.length()>0){ + textArea.append(line.toString()); + line = new StringBuffer(); + } + } + + public synchronized void write(byte[] b){ + line.append(new String(b)); + } + + public synchronized void write(byte[] b, int off, int len){ + line.append(new String(b,off,len)); + } + + + public synchronized void write(int c){ + line.append(c); + } + + public synchronized boolean checkError() { + return false; + } + + public synchronized void print(Object obj) { + line.append(obj); + } + + + public synchronized void print(String s) { + line.append(s); + } + + + public synchronized void print(boolean b) { + line.append(b); + } + + + public synchronized void print(char c) { + line.append(c); + } + + + public synchronized void print(char[] s) { + line.append(s); + } + + + public synchronized void print(double d) { + line.append(d); + } + + + public synchronized void print(float f) { + line.append(f); + } + + + public synchronized void print(int i) { + line.append(i); + } + + + public synchronized void print(long l) { + line.append(l); + } + + + public synchronized void println() { + line.append('\n'); + flush(); + } + + + public synchronized void println(Object x) { + if(line.length()>0){ + textArea.append(line.append(String.valueOf(x)).toString()); + textArea.append("\n"); + line = new StringBuffer(); + } + else { + textArea.append(String.valueOf(x)); + textArea.append("\n"); + } + } + + + public synchronized void println(String x) { + if(line.length()>0){ + textArea.append(line.append(x).toString()); + textArea.append("\n"); + line = new StringBuffer(); + } + else { + textArea.append(x); + textArea.append("\n"); + } + } + + public synchronized void println(boolean x) { + if(line.length()>0){ + textArea.append(line.append(String.valueOf(x)).toString()); + textArea.append("\n"); + line = new StringBuffer(); + } + else { + textArea.append(String.valueOf(x)); + textArea.append("\n"); + } + } + + + public synchronized void println(char x) { + if(line.length()>0){ + textArea.append(line.append(String.valueOf(x)).toString()); + textArea.append("\n"); + line = new StringBuffer(); + } + else { + textArea.append(String.valueOf(x)); + textArea.append("\n"); + } + } + + + public synchronized void println(char[] x) { + if(line.length()>0){ + textArea.append(line.append(String.valueOf(x)).toString()); + textArea.append("\n"); + line = new StringBuffer(); + } + else { + textArea.append(String.valueOf(x)); + textArea.append("\n"); + } + } + + + public synchronized void println(double x) { + if(line.length()>0){ + textArea.append(line.append(String.valueOf(x)).toString()); + textArea.append("\n"); + line = new StringBuffer(); + } + else { + textArea.append(String.valueOf(x)); + textArea.append("\n"); + } + } + + + public synchronized void println(float x) { + if(line.length()>0){ + textArea.append(line.append(String.valueOf(x)).toString()); + textArea.append("\n"); + line = new StringBuffer(); + } + else { + textArea.append(String.valueOf(x)); + textArea.append("\n"); + } + } + + + public synchronized void println(int x) { + if(line.length()>0){ + textArea.append(line.append(String.valueOf(x)).toString()); + textArea.append("\n"); + line = new StringBuffer(); + } + else { + textArea.append(String.valueOf(x)); + textArea.append("\n"); + } + } + + + public synchronized void println(long x) { + if(line.length()>0){ + textArea.append(line.append(String.valueOf(x)).toString()); + textArea.append("\n"); + line = new StringBuffer(); + } + else { + textArea.append(String.valueOf(x)); + textArea.append("\n"); + } + } + + + protected void setError() { + } + + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/JTextAreaPrintStream.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/SelectFileAction.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/SelectFileAction.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/SelectFileAction.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,60 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.gui.widget; + +import java.awt.event.ActionEvent; +import java.io.File; + +import javax.swing.AbstractAction; +import javax.swing.ImageIcon; +import javax.swing.JComponent; +import javax.swing.JFileChooser; + +public class SelectFileAction extends AbstractAction { + protected JComponent component = null; + protected File selectedFile = null; + protected String buttonText = null; + + public SelectFileAction(String text, ImageIcon icon, JComponent component) { + super(text, icon); + this.component = component; + } + public SelectFileAction(String text, ImageIcon icon, JComponent component,String buttonText) { + super(text, icon); + this.component = component; + } + public void actionPerformed(ActionEvent e) { + JFileChooser chooser = new JFileChooser(); + if(buttonText!=null)chooser.setApproveButtonText(buttonText); + if(selectedFile!=null && selectedFile.isFile()){ + if(selectedFile.exists())chooser.setSelectedFile(selectedFile); + else chooser.setCurrentDirectory(selectedFile.getParentFile()); + } + else if(selectedFile!=null && selectedFile.isDirectory()){ + chooser.setCurrentDirectory(selectedFile); + } + else if(selectedFile!=null && !selectedFile.exists()){ + chooser.setCurrentDirectory(selectedFile.getParentFile()); + } + + int returnVal = chooser.showDialog(component,e.getActionCommand()); + if(returnVal == JFileChooser.APPROVE_OPTION) { + selectedFile = chooser.getSelectedFile(); + } else { + selectedFile = null; + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/SelectFileAction.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/SystemOutJTextArea.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/SystemOutJTextArea.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/SystemOutJTextArea.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,75 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.gui.widget; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.PrintStream; + +import javax.swing.JButton; +import javax.swing.JScrollPane; + +/** + * + * <p>Title: A JTextArea that can be set to show System.out or System.err</p> + * <p>Description: </p> + * <p>Copyright: Copyright (c) 2004</p> + * <p>Company: </p> + * @author Paul Hinds + * @version 1.0 + */ + +public class SystemOutJTextArea extends JScrollPane{ + + private JTextAreaPrintStream stream; + private FollowingJTextArea textArea = new FollowingJTextArea(); + + public SystemOutJTextArea() { + jInit(); + } + + private void jInit(){ + this.getViewport().setView(textArea); + textArea.setEditable(false); + JButton jumpButton = new JButton(""); + setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_ALWAYS); + setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_ALWAYS); + setCorner(this.LOWER_RIGHT_CORNER,jumpButton); + jumpButton.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e) { + textArea.setCaretPosition(textArea.getDocument().getLength()); + } + }); + jumpButton.setToolTipText("Click to jump to the end"); + + + } + + public synchronized PrintStream getOut(){ + if(stream==null){ + stream = new JTextAreaPrintStream(textArea); + } + return stream; + } + public void setAsSystemErr(){ + System.setErr(getOut()); + } + public void setAsSystemOut(){ + System.setOut(getOut()); + } + + +} Property changes on: pal-portal/modules/ant-installer/trunk/src/org/tp23/gui/widget/SystemOutJTextArea.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/resources/AntInstaller.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/AntInstaller.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/LICENSE-ant-install.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/src/resources/LICENSE-ant-install.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/resources/LICENSE-ant-install.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2005 Paul Hinds + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/LICENSE-ant-install.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src/resources/antbar.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/antbar.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/banner23.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/banner23.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/extract-image.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/extract-image.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/gkmain_inv.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/gkmain_inv.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/gothbar.gif =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/gothbar.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: pal-portal/modules/ant-installer/trunk/src/resources/greens.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/greens.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/icons/LICENSE =================================================================== --- pal-portal/modules/ant-installer/trunk/src/resources/icons/LICENSE (rev 0) +++ pal-portal/modules/ant-installer/trunk/src/resources/icons/LICENSE 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,13 @@ +This copyright and license notice covers the images in this directory. +Note the license notice contains an add-on. + +KDE Crystal theme icons. +Copyright (C) 2002 and following years KDE Artists +This library is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free +Software Foundation, version 2.1 of the License. + +This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. You should have received a copy of the GNU Lesser General Public License along +with this library; if not, write to the Added: pal-portal/modules/ant-installer/trunk/src/resources/icons/back.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/icons/back.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/icons/cancel.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/icons/cancel.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/icons/finish.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/icons/finish.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/icons/next.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/icons/next.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/icons/ok.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/icons/ok.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/icons/showdetails.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/icons/showdetails.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/makewavesdawn.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/makewavesdawn.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src/resources/rockstiles.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/src/resources/rockstiles.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ReleaseNotesFilter.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ReleaseNotesFilter.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ReleaseNotesFilter.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,102 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ResourceBundle; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.renderer.text.Pager; +import org.tp23.antinstaller.runtime.Runner; +import org.tp23.antinstaller.runtime.SwingRunner; +import org.tp23.antinstaller.runtime.TextRunner; + + +/** + * A filter that launches a window with release notes if a property has been selected + * during the install. The notes are loaded from a resource on the classpath + * called /release-notes.txt + * @author Paul Hinds + * @version $Id: ReleaseNotesFilter.java,v 1.4 2007/01/04 22:57:18 teknopaul Exp $ + */ +public class ReleaseNotesFilter implements ExecuteFilter { + + private static final ResourceBundle res = ResourceBundle.getBundle("org.tp23.antinstaller.renderer.text.Res"); + private static final String nextChar = res.getString("nextChar"); + + /** + * The AntInstaller property that must be "true" for the release notes to show + */ + public static final String RELEASE_NOTES_PROPERTY = "show.release.notes"; + + public ReleaseNotesFilter() { + } + + public void exec(InstallerContext ctx) throws InstallException { + if(ctx.isInstallSucceded() ){ + String showReleaseNotes = ctx.getInstaller().getResultContainer().getProperty(RELEASE_NOTES_PROPERTY); + if(OutputField.isTrue(showReleaseNotes)){ + try { + InputStream is = ReleaseNotesFilter.class.getResourceAsStream("/release-notes.txt"); + BufferedReader br = new BufferedReader(new InputStreamReader(is)); + String line = null; + StringBuffer file = new StringBuffer(); + while((line = br.readLine())!=null){ + file.append(line).append('\n'); + } + br.close(); + Runner runner = ctx.getRunner(); + if(runner instanceof TextRunner){ + renderText(file.toString()); + + } + else{ // if(runner instanceof SwingRunner){ + //SwingRunner sRunner = (SwingRunner)runner; + ReleaseNotesFrame rFrame = new ReleaseNotesFrame("Readme"); + rFrame.init(file.toString()); + } + } + catch (IOException e) { + throw new InstallException("Could not render Release notes",e); + } + } + } + } + + private void renderText(String text) throws IOException{ + BufferedReader commandReader = new BufferedReader(new InputStreamReader(System.in)); + Pager pager = new Pager(text); + String command = null; + do { + if (!pager.next(System.out)) { + break; + } + System.out.println(); + System.out.println(getNextInstructions()); + command = commandReader.readLine(); + } + while (command.toUpperCase().startsWith(nextChar)); + pager.rest(System.out); + + } + private String getNextInstructions() { + return res.getString("large_select_next"); + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ReleaseNotesFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ReleaseNotesFrame.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ReleaseNotesFrame.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ReleaseNotesFrame.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,63 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.runtime.exe; + +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.GraphicsConfiguration; +import java.awt.HeadlessException; + +import javax.swing.JEditorPane; +import javax.swing.JFrame; +import javax.swing.JScrollPane; + + +/** + * ReleaseNotes frame for displaying plain text + * @author Paul Hinds + * @version $Id: ReleaseNotesFrame.java,v 1.3 2006/12/21 00:03:23 teknopaul Exp $ + */ +public class ReleaseNotesFrame extends JFrame { + + private BorderLayout borderLayout1 = new BorderLayout(); + private JEditorPane contentsEditorPane = new JEditorPane(); + private JScrollPane hPanelScrollPane = new JScrollPane(); + + public ReleaseNotesFrame(String title) throws HeadlessException { + super(title); + } + + public void init(String text){ + contentsEditorPane.setMinimumSize(new Dimension(200, 200)); + contentsEditorPane.setPreferredSize(new Dimension(1000, Integer.MAX_VALUE)); + contentsEditorPane.setEditable(false); + contentsEditorPane.setContentType("text/plain"); + contentsEditorPane.setCaretPosition(0); + contentsEditorPane.setText(text); + this.getContentPane().setLayout(borderLayout1); + hPanelScrollPane.setMinimumSize(new Dimension(200, 200)); + hPanelScrollPane.setPreferredSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE)); + this.getContentPane().add(hPanelScrollPane, BorderLayout.CENTER); + hPanelScrollPane.getViewport().add(contentsEditorPane); + hPanelScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); + this.setSize(new Dimension(500,500)); + hPanelScrollPane.setWheelScrollingEnabled(true); + this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + this.show(); + + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/runtime/exe/ReleaseNotesFrame.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/Installer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/Installer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/Installer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,399 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.tp23.antinstaller.taskdefs; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Project; +import org.apache.tools.ant.taskdefs.Jar; +import org.apache.tools.ant.taskdefs.Manifest; +import org.apache.tools.ant.taskdefs.ManifestException; +import org.apache.tools.ant.types.FileSet; +import org.apache.tools.ant.types.ZipFileSet; +import org.apache.tools.zip.ZipOutputStream; +import org.tp23.antinstaller.renderer.swing.plaf.LookAndFeelFactory; +import org.tp23.antinstaller.runtime.ConfigurationLoader; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +/** + * Creates a Installer archive. + * + * + * @ant.task category="packaging" + */ +public class Installer extends Jar { + + public static final String NON_EXTRACTOR = "NonExtractor"; + public static final String SELF_EXTRACTOR = "SelfExtractor"; + + /** The extract type to use NonExtractor or SelfExtractor */ + private String extractType; + + /** The AntInstall config file */ + private File installConfig; + + /** The Ant build.xml to be used*/ + private File buildFile; + + /** The location of ant-installer.jar and ant-installer-ext.jar and possibly jgoodies-edited-1_2_2.jar */ + private File antInstallLib; + + /** The location of xercesImpl.jar and xml-apis.jar + * This is not requried Xerces is optional and will increase the download size */ + private File xercesLib; + + /** The location of ant.jar and ant-launcher.jar */ + private File antLib; + + /** The AntInstaller Look And Feel to be used */ + private String laf; + + /** The icon set to use */ + private String icons; + + /** Stop the build if there is a known error in the config */ + protected boolean failOnError = false; + + /** perform the validation */ + protected boolean validateConfig = false; + + private boolean buildFileSet = false; + private boolean configFileSet = false; + /** Indicates that the build.xml and antinstall-config.xml have been added to the fileset already */ + private boolean startCheckDuplicates = false; + + /** constructor */ + public Installer() { + super(); + archiveType = "jar"; + emptyBehavior = "create"; + setEncoding("UTF8"); + } + + protected void cleanUp() { + super.cleanUp(); + } + + public void reset() { + super.reset(); + extractType = null; + installConfig = null; + buildFile = null; + } + + /** + * @param installConfig The installConfig to set. + */ + public void setInstallConfig(File installConfig) { + this.installConfig = installConfig; + if (!installConfig.exists()) { + throw new BuildException("AntInstall config: " + + installConfig + + " does not exist."); + } + // Create a ZipFileSet for this file, and pass it up. + ZipFileSet fs = new ZipFileSet(); + fs.setFile(installConfig); + fs.setFullpath("antinstall-config.xml"); + super.addFileset(fs); + if(this.buildFile != null) { + startCheckDuplicates = true; + } + } + /** + * @param buildFile The buildFile to set. + */ + public void setBuildFile(File buildFile) { + this.buildFile = buildFile; + if (!buildFile.exists()) { + throw new BuildException("AntInstall build file: " + + buildFile + + " does not exist."); + } + // Create a ZipFileSet for this file, and pass it up. + ZipFileSet fs = new ZipFileSet(); + fs.setFile(buildFile); + fs.setFullpath("build.xml"); + super.addFileset(fs); + if(this.installConfig != null) { + startCheckDuplicates = true; + } + } + /** + * @param icons The ocons pack to use for buttons. + */ + public void setIcons(String icons) { + this.icons = icons; + // Create a ZipFileSet for this file, and pass it up. + File iconJar = new File(antInstallLib, "ai-icons-" + icons + ".jar"); + if (!iconJar.exists()) { + throw new BuildException("Missing icons: " + + iconJar + + " does not exist."); + } + FileSet set = new FileSet(); + set.setFile(iconJar); + addZipGroupFileset(set); + + } + /** + * @param extractType The extractType to set. + */ + public void setExtractType(String extractType) { + this.extractType = extractType; + } + + public void setFailOnError(boolean fail) { + failOnError = fail; + } + + public void setValidateConfig(boolean validate) { + validateConfig = validate; + } + + /** + * The location of ant-installer.jar and possibly jgoodies-edited-1_2_2.jar + * @param antInstallLib The antInstallLib to set. + */ + public void setAntInstallLib(File antInstallLib) { + this.antInstallLib = antInstallLib; + FileSet set = new FileSet(); + set.setFile(new File(antInstallLib, "ant-installer.jar")); + addZipGroupFileset(set); + } + /** + * The location of ant.jar and ant-launcher.jar + * @param antLib The antLib to set. + */ + public void setAntLib(File antLib) { + this.antLib = antLib; + FileSet set = new FileSet(); + set.setFile(new File(antLib, "ant.jar")); + set.setFile(new File(antLib, "ant-launcher.jar")); + addZipGroupFileset(set); + } + /** + * @param xercesLib The xercesLib to set. + */ + public void setXercesLib(File xercesLib) { + this.xercesLib = xercesLib; + FileSet set = new FileSet(); + set.setFile(new File(xercesLib, "xercesImpl.jar")); + set.setFile(new File(xercesLib, "xml-apis.jar")); + addZipGroupFileset(set); + } + + /** + * Overrides the ZIP execute() method which creates filesets + */ + public void execute(){ + log(".-------------------------------."); + log("|-(o--~AntInstaller.sf.net~--o)-|"); + log("`-----------------by-Paul-Hinds-卒"); + + if(validateConfig) { + validateConfig(); + } else if(extractType.equals(SELF_EXTRACTOR)){ + // this reads the config just + // to extract the lookAndFeel attribute for the manifest at the moment + readConfig(); + } + if( LookAndFeelFactory.isDefault(getLaf()) ){ + FileSet set = new FileSet(); + set.setFile(new File(antInstallLib, "jgoodies-edited-1_2_2.jar")); + addZipGroupFileset(set); + } + + super.execute(); + } + + /** + * override of parent; validates configuration + * before initializing the output stream. The Manifest is set in the Jar superclass's + * method so Manifest modifications must be performed in this method + */ + protected void initZipOutputStream(ZipOutputStream zOut) + throws IOException, BuildException { + // If no buildFile file is specified, it's an error. + if (buildFile == null && !isInUpdateMode()) { + throw new BuildException("buildFile attribute is required", getLocation()); + } + // If no installConfig file is specified, it's an error. + if (installConfig == null && !isInUpdateMode()) { + throw new BuildException("installConfig attribute is required", getLocation()); + } + try{ + addConfiguredManifest(this.getManifest()); + } + catch(ManifestException me){ + throw new BuildException("Cant add AntInstaller Manifest", me, getLocation()); + } + super.initZipOutputStream(zOut); + } + + protected void zipFile(InputStream is, ZipOutputStream zOut, String vPath, + long lastModified, File fromArchive, int mode) + throws IOException { + + if(vPath.equalsIgnoreCase("antinstall-config.xml")) { + if(buildFileSet) { + log("Two antinstall-config.xml files in jar", Project.MSG_WARN); + } + buildFileSet = true; + } + if(vPath.equalsIgnoreCase("build.xml")) { + if(configFileSet) { + log("Two build.xml files in jar", Project.MSG_WARN); + } + configFileSet = true; + } + + super.zipFile(is, zOut, vPath, lastModified, fromArchive, mode); + } + + /** + * This method is only valid after readConfig() or validateConfig() have been run + * @return Returns the Look And Feel class. + */ + private String getLaf() { + if(laf == null){ + return LookAndFeelFactory.DEFAULT_LAF; + } + return laf; + } + + private Manifest getManifest() throws ManifestException{ + if(extractType.equalsIgnoreCase(NON_EXTRACTOR)){ + return getNonExtractorManifest(); + } + else if(extractType.equalsIgnoreCase(SELF_EXTRACTOR)){ + return getSelfExtractorManifest(); + } + else { + throw new BuildException("Invalid extractType: " + extractType); + } + } + + private Manifest getNonExtractorManifest() throws ManifestException{ + return getCustomManifest("org.tp23.antinstaller.selfextract.NonExtractor"); + } + private Manifest getSelfExtractorManifest() throws ManifestException{ + return getCustomManifest("org.tp23.antinstaller.selfextract.SelfExtractor"); + } + private Manifest getCustomManifest(String mainClass) throws ManifestException{ + log("Creating MANIFEST.mf"); + Manifest newManifest = new Manifest(); + Manifest.Section mainSection = newManifest.getMainSection(); + Manifest.Attribute attmc = new Manifest.Attribute(); + attmc.setName("Main-Class"); + attmc.setValue(mainClass); + mainSection.addAttributeAndCheck(attmc); + Manifest.Attribute attlaf = new Manifest.Attribute(); + attlaf.setName("Look-And-Feel"); + attlaf.setValue(getLaf()); + mainSection.addAttributeAndCheck(attlaf); + return newManifest; + + } + + protected void validateConfig(){ + + int ret = 1; + try { + log("validating config..."); + ConfigurationLoader configurationLoader = new ConfigurationLoader(); + configurationLoader.readConfig(installConfig.getParentFile(), installConfig.getName()); + ret = configurationLoader.validate(); + laf = configurationLoader.getInstaller().getLookAndFeel(); + if(ret != 0){ + err(); + } + } + catch (Exception ex) { + ex.printStackTrace(); + err(); + } + + try{ + log("parsing included build.xml..."); + InputSource xmlInp = new InputSource(new FileInputStream(buildFile)); + SAXParserFactory parserFactory = SAXParserFactory.newInstance(); + SAXParser parser = parserFactory.newSAXParser(); + parser.parse(xmlInp, new DefaultHandler(){ + public void error(SAXParseException e) throws SAXException{ + throw e; + } + public void fatalError(SAXParseException e) throws SAXException{ + throw e; + } + } ); + log("build.xml is well formed"); + } + catch (Exception ex) { + ex.printStackTrace(); + errNestedBuildXml(); + } + } + + protected void readConfig(){ + + try { + log("reading config..."); + ConfigurationLoader configurationLoader = new ConfigurationLoader(); + configurationLoader.readConfig(installConfig.getParentFile(), installConfig.getName()); + laf = configurationLoader.getInstaller().getLookAndFeel(); + } + catch (Exception ex) { + ex.printStackTrace(); + err(); + } + } + + /** + * error found on validation of the antinstall config + */ + private void err(){ + String errorMsg = "Error in config file:" + installConfig.getAbsolutePath(); + if (failOnError) { + throw new BuildException(errorMsg); + } else { + log(errorMsg, Project.MSG_ERR); + } + } + /** + * error found in the build.xml used by ant installer (not the one + * running this task) + */ + private void errNestedBuildXml(){ + String errorMsg = "Error in included build file:" + buildFile.getAbsolutePath(); + if (failOnError) { + throw new BuildException(errorMsg); + } else { + log(errorMsg, Project.MSG_ERR); + } + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/Installer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/KdeIconTask.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/KdeIconTask.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/KdeIconTask.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,146 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.taskdefs; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.io.StringWriter; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.tp23.antinstaller.selfextract.ResourceExtractor; +/** + * + * @author teknopaul + * + */ +public class KdeIconTask extends Task{ + + private String desktop; + private String icon; + private String installDir; + + public void execute() throws BuildException{ + if(desktop == null || icon == null || installDir == null){ + throw new BuildException("Missing attribute in KdeIconTask"); + } + + ResourceExtractor re = new ResourceExtractor(); + + File appsDir = null; + try { + appsDir = getAppsDir(); + } catch (Exception e) { + throw new BuildException("Can not determine KDE directory"); + } + if( appsDir != null && appsDir.exists() ) { + try { + String desktopFileName = desktop.substring( desktop.lastIndexOf('/') + 1 ); + log("creating: " + new File( appsDir, desktopFileName).getCanonicalPath()); + re.copyResource(desktop, new File( appsDir, desktopFileName), "@installDir@", installDir); + } catch (Exception e) { + StringWriter sw = new StringWriter(); + e.printStackTrace(new PrintWriter(sw)); + throw new BuildException(sw.getBuffer().toString()); + } + } + else{ + log("apps dir does not exist"); + } + File iconDir = null; + try { + iconDir = getIconDir(); + } catch (Exception e) { + throw new BuildException("Can not determine KDE directory"); + } + if(iconDir != null && iconDir.exists()){ + try { + String iconFileName = icon.substring( icon.lastIndexOf('/') + 1 ); + log("creating: " + new File( iconDir, iconFileName).getCanonicalPath()); + re.copyResourceBinary(icon, new File( iconDir, iconFileName )); + } catch (IOException e) { + throw new BuildException(e.getMessage()); + } + } + else{ + log("icon dir does not exist"); + } + try { + Process proc = Runtime.getRuntime().exec("kbuildsycoca"); + } catch (Exception e) { + log("error running kbuildsycoca: " + e.getMessage()); + } + + } + + private File getKdeDir(String pathdef, String extension) throws IOException, InterruptedException{ + String[] args = {"kde-config", "--path", pathdef}; + Process proc = Runtime.getRuntime().exec(args); + BufferedReader br = new BufferedReader( new InputStreamReader(proc.getInputStream())); + String appsDirs = br.readLine(); + int idx = -1; + if(appsDirs != null) { + idx = appsDirs.indexOf(':'); + } + br.close(); + + if(idx > -1 && idx < appsDirs.length() - 1){ + String privatedir = appsDirs.substring(0, idx - 1); + if(!privatedir.endsWith("/")){ + privatedir = privatedir + "/"; + } + return new File(privatedir + extension); + } + else{ + if(!appsDirs.endsWith("/")){ + appsDirs = appsDirs + "/"; + } + return new File(appsDirs + extension); + } + } + private File getAppsDir() throws IOException, InterruptedException{ + return getKdeDir("xdgdata-apps", ""); + } + private File getIconDir() throws IOException, InterruptedException{ + return getKdeDir("icon", "hicolor/48x48/apps"); + } + + + public String getDesktop() { + return desktop; + } + public void setDesktop(String desktop) { + this.desktop = desktop; + } + public String getIcon() { + return icon; + } + public void setIcon(String icon) { + this.icon = icon; + } + + public String getInstallDir() { + return installDir; + } + + public void setInstallDir(String installDir) { + this.installDir = installDir; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/KdeIconTask.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/ValidateConfig.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/ValidateConfig.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/ValidateConfig.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,26 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.taskdefs; + +public class ValidateConfig extends Installer { + + public void execute(){ + log(".-------------------------------."); + log("|-(o--~AntInstaller.sf.net~--o)-|"); + log("`-----------------by-Paul-Hinds-卒"); + validateConfig(); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/taskdefs/ValidateConfig.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/CreateLanguagePack.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/CreateLanguagePack.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/CreateLanguagePack.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,112 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.util; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; + +import javax.swing.JDialog; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JOptionPane; +import javax.swing.filechooser.FileFilter; + +import org.tp23.antinstaller.InstallException; +import org.tp23.antinstaller.Installer; +import org.tp23.antinstaller.InstallerContext; +import org.tp23.antinstaller.runtime.exe.LoadConfigFilter; + +public class CreateLanguagePack { + + + public static void main(String[] args) { + try { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + + System.out.println("Create LanguagePack for antinstall-config.xml in the current directory?"); + br.readLine(); + + System.out.println("Enter Locale to create e.g. es_EU"); + String locale = br.readLine().trim(); + + createLanguagePack(loadConfigFile(new File("."), "antinstall-config.xml" ), locale, new File(".")); + + System.out.println("done."); + } catch (IOException e) { + e.printStackTrace(); + } catch (InstallException e) { + e.printStackTrace(); + } + } + + public static File guiMain(JFrame root) { + try { + JFileChooser chooser = new JFileChooser(); + chooser.setDialogTitle("Select antinstall-config.xml file"); + chooser.setApproveButtonText("Select file"); + FileFilter ff = new FileFilter(){ + public boolean accept(File file){ + return file.getName().equals("antinstall-config.xml") || file.isDirectory(); + } + public String getDescription() { + return "antinstall-config.xml files"; + } + }; + chooser.setFileFilter(ff); + chooser.showOpenDialog(root); + File chosen = chooser.getSelectedFile(); + if(chosen != null){ + chooser = new JFileChooser(); + chooser.setDialogTitle("Select output directory"); + chooser.setApproveButtonText("Internationalise file"); + chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + chooser.setCurrentDirectory(chosen.getParentFile()); + chooser.showOpenDialog(root); + File dir = chooser.getSelectedFile(); + if(dir != null){ + createLanguagePack(loadConfigFile(chosen.getParentFile(), chosen.getName()), null, dir); + if(! dir.getName().equals("resources")){ + JOptionPane.showMessageDialog(root, "When the resources files are added to the installer jar\n the parent directory must be /resources/"); + } + return new File(dir, "LanguagePack.properties"); + } + } + + } catch (IOException e) { + e.printStackTrace(); + } catch (InstallException e) { + e.printStackTrace(); + } + return null; + } + + private static Installer loadConfigFile(File rootDir, String configName) throws InstallException{ + InstallerContext ctx = new InstallerContext(); + ctx.setFileRoot(rootDir); + ctx.setInstallerConfigFile(configName); + LoadConfigFilter configLoader = new LoadConfigFilter(); + configLoader.exec(ctx); + Installer installer = ctx.getInstaller(); + return installer; + } + + private static void createLanguagePack(Installer installer, String locale, File outputDir) throws IOException{ + LangPackFileRenderer renderer = new LangPackFileRenderer(); + renderer.renderProperties(installer, outputDir, locale); + } +} Property changes on: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/CreateLanguagePack.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/LangPackFileRenderer.java =================================================================== --- pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/LangPackFileRenderer.java (rev 0) +++ pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/LangPackFileRenderer.java 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,227 @@ +/* + * Copyright 2005 Paul Hinds + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tp23.antinstaller.util; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.util.Date; +import java.util.Iterator; +import java.util.List; + +import org.tp23.antinstaller.Installer; +import org.tp23.antinstaller.PropertiesFileRenderer; +import org.tp23.antinstaller.input.CommentOutput; +import org.tp23.antinstaller.input.InputField; +import org.tp23.antinstaller.input.LargeSelectInput; +import org.tp23.antinstaller.input.OutputField; +import org.tp23.antinstaller.input.SecretPropertyField; +import org.tp23.antinstaller.input.ConditionalField; +import org.tp23.antinstaller.input.SelectInput; +import org.tp23.antinstaller.input.TargetSelectInput; +import org.tp23.antinstaller.input.SelectInput.Option; +import org.tp23.antinstaller.page.Page; + +/** + * <p>Outputs the text from Pages as a Java Properties file. The file produced is compatible + * with java.util.Properties. </p> + * <p>It can be used as a stub for creating language packs, the default text is included as a guide but can be deleted</p> + * @author Paul Hinds + */ +public class LangPackFileRenderer{ + + private static String newLine = System.getProperty("line.separator"); + private static final char[] hexidecimals = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + + public LangPackFileRenderer() { + } + + public void renderProperties(Installer installer, File baseDir, String locale) throws IOException { + Page[] pages = installer.getPages(); + + StringBuffer propertiesData = new StringBuffer(); + propertiesData.append("### Ant Installer - language pack auto generated on "); + propertiesData.append(new Date().toString()); + propertiesData.append(newLine); + propertiesData.append(newLine); + + propertiesData.append("finishButtonText = " + installer.getFinishButtonText()); + propertiesData.append(newLine); + propertiesData.append(newLine); + + String property = null; + String value = null; + + for (int i = 0; i < pages.length; i++) { + OutputField[] fields = pages[i].getOutputField(); + + propertiesData.append(newLine); + propertiesData.append("## Text from Page:" + pages[i].getName()); + propertiesData.append(newLine); + property = "page." + pages[i].getName() + ".displayText"; + value = convert(pages[i].getDisplayText(), false); + propertiesData.append(property + " = " + value); + propertiesData.append(newLine); + + retrievePropertiesData( fields, propertiesData ); + + } + // create the stub + if(locale != null) { + File languagePackStub = new File(baseDir.getAbsolutePath(), "LanguagePack_" + locale + ".properties"); + FileWriter fos = new FileWriter(languagePackStub); + BufferedWriter writer = new BufferedWriter(fos); + writer.write(propertiesData.toString()); + writer.flush(); + fos.close(); + } + else { + // create the default + File languagePack = new File(baseDir.getAbsolutePath(), "LanguagePack.properties"); + FileWriter fos = new FileWriter(languagePack); + BufferedWriter writer = new BufferedWriter(fos); + writer.write(propertiesData.toString()); + writer.flush(); + fos.close(); + } + } + + private void retrievePropertiesData( OutputField[] fields, StringBuffer propertiesData ) { + String property = null; + String value = null; + String explProperty = null; + String explValue = null; + + for (int f = 0; f < fields.length; f++) { + + // use getName() for comments + if(fields[f] instanceof CommentOutput){ + property = fields[f].getName() + ".displayText"; + value = convert(fields[f].getDisplayText(), false); + propertiesData.append(property + " = " + value); + propertiesData.append(newLine); + + if (fields[f].getExplanatoryText() != null && fields[f].getExplanatoryText().trim().length() > 0) { + explProperty = fields[f].getName() + ".explanatoryText"; + explValue = convert(fields[f].getExplanatoryText(), false); + propertiesData.append(explProperty + " = " + explValue); + propertiesData.append(newLine); + } + } + // use getProperty for input types + else { + InputField iField = (InputField)fields[f]; + property = iField.getProperty() + ".displayText"; + value = convert(iField.getDisplayText(), false); + propertiesData.append(property + " = " + value); + propertiesData.append(newLine); + if (iField.getExplanatoryText() != null && iField.getExplanatoryText().trim().length() > 0) { + explProperty = iField.getProperty() + ".explanatoryText"; + explValue = convert(iField.getExplanatoryText(), false); + propertiesData.append(explProperty + " = " + explValue); + propertiesData.append(newLine); + } + if(iField instanceof SelectInput) { + SelectInput selectInput = (SelectInput)iField; + for (int o = 0; o < selectInput.getOptions().length; o++) { + SelectInput.Option option = selectInput.getOptions()[o]; + property = selectInput.getProperty() + "." + (o + 1) + ".displayText"; + value = convert(option.getText(), false); + propertiesData.append(property + " = " + value); + propertiesData.append(newLine); + } + } + if(fields[f] instanceof LargeSelectInput) { + LargeSelectInput selectInput = (LargeSelectInput)iField; + for (int o = 0; o < selectInput.getOptions().length; o++) { + LargeSelectInput.Option option = selectInput.getOptions()[o]; + property = selectInput.getProperty() + "." + (o + 1) + ".displayText"; + value = convert(option.getText(), false); + propertiesData.append(property + " = " + value); + propertiesData.append(newLine); + } + } + } + } + } + + private String convert(String input, boolean doSpaces) { + if (input == null) { + // this happens when a page is skipped in text mode + return ""; + } + int num = input.length(); + StringBuffer sb = new StringBuffer(num); + + for (int i = 0; i < num; i++) { + char c = input.charAt(i); + switch (c) { + case ' ': + if (i == 0 || doSpaces) { + sb.append('\\'); + } + sb.append(' '); + break; + case '\n': + sb.append("\\n"); + break; + case '\r': + sb.append("\\r"); + break; + case '\\': + sb.append("\\\\"); + break; + case '\t': + sb.append("\\t"); + break; + case '\f': + sb.append("\\f"); + break; + case '=': + sb.append("\\="); + break; + case ':': + sb.append("\\:"); + break; + case '#': + sb.append("\\#"); + break; + case '!': + sb.append("\\!"); + break; + + default: + if ( (c < 0x0020) || (c > 0x007e) ) { + sb.append("\\u") + .append(hex( (c >> 12) & 0xF)) + .append(hex( (c >> 8) & 0xF)) + .append(hex( (c >> 4) & 0xF)) + .append(hex(c & 0xF)); + } + else { + sb.append(c); + } + } + } + return sb.toString(); + } + + private char hex(int val) { + return hexidecimals[ (val & 0xF)]; + } + +} Property changes on: pal-portal/modules/ant-installer/trunk/src_ext/org/tp23/antinstaller/util/LangPackFileRenderer.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/templates/defaultproject/README.txt =================================================================== --- pal-portal/modules/ant-installer/trunk/templates/defaultproject/README.txt (rev 0) +++ pal-portal/modules/ant-installer/trunk/templates/defaultproject/README.txt 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,115 @@ +---+ Default Project Template Builder + +This template is a method of getting up and running with +AntInstaller quickly. The template will help you create +an installer for a Java project. + + +---++ Output + + * create-installer.xml - An ant build script to package the installer + * build.xml - An Ant script used by the installer + * antinstall-config.xml - The definition of the installer +All of the above can be edited to suit your needs + * Optionally the script will run the create-installer.xml Ant script to make the Jar immediately + + +---++ Usage + +Read this README first +Change directory to the location of this README file +Set the ANT_INSTALL_HOME variable to the directory where you have installed AntInstaller. +Set JAVA_HOME +> export ANT_INSTALL_HOME=/usr/local/AntInstaller-beta0.7.2 +Start the runtemplate.sh script +> ./runtemplate.sh +Follow the instructions + +---++ Project Structure + +AntInstaller launches and asks you for your project information +Generally it is assumed that your projects follow this structure + +/projects_root/ + +/projects_root/project-name/ + +for example if you use eclipse and CVS this will be +/workspace/cvs-module-name/ + +By default the template selects the following subdirectories +which can be modified. +/projects_root/project-name/src/ - source code +/projects_root/project-name/bin/ - scripts (these get chmod u+x) in the installer +/projects_root/project-name/doc/ - documentation +/projects_root/project-name/lib/ - Jars +/projects_root/project-name/classes/ - err... classes? + +The template only lets you select one directory for each, dont worry +AntInstaller itself is infinately configurable. + + +First time you run the script you should let the template +create a new empty directory for creating installers +/usr/local/installers/ +From this directory subdirectories will be created for each project +/usr/local/installers/project-name/ + +---++ Configuring the installer + +This template is NOT designed to create you the final installer you will +deploy. If you have a very simple standard project it may suffice, +but it is expected that you will want to modify the XML files created +to customise the build. + +Following the documentation on the web you can modify the +antinstall-config.xml file to add extra pages and collect extra input +when the user installs your application. +http://antinstaller.sourceforge.net + +The build.xml file can be modified to customise the install proces +that is run by AntInstaller on the users machine. +You have the full power of Ant so you can easily + * move files around + * replace text + * Zip Unzip + * run scripts + * call Java + * run sub ant build.xml files + * call SQL files via JDBC + * fix line ending s + * and anything in the CoreTypes in Ant. + +The create-installer.xml file is an Ant script that creates the installer +by modifying this file you can add extra resources to the final Jar +such as images that you want in the installer or extra source directories. +By adding Ant optional Jars to the installer you can then access any +additional features of Ant during the install enabling you to + * Call SSH or Telnet commands + * SCP/ FTP files + * Send emails + * and anything in the OptionaTypes in Ant + + + +---++ Contributions + +This tool itself (obviously) uses AntInstaller. +You are free to modify the scripts to extend the features of the tool. +If you do I would encourage you to submit the changes back so +everyone can benefit from your enhancement. +It is a good example of using AntInstaller to acheive tasks other +than just installing apps. + + + + + + + + + + + + + Property changes on: pal-portal/modules/ant-installer/trunk/templates/defaultproject/README.txt ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/templates/defaultproject/antinstall-config-template.xml =================================================================== --- pal-portal/modules/ant-installer/trunk/templates/defaultproject/antinstall-config-template.xml (rev 0) +++ pal-portal/modules/ant-installer/trunk/templates/defaultproject/antinstall-config-template.xml 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,71 @@ +<?xml version="1.0"?> +<!DOCTYPE installer PUBLIC "-//tp23 //DTD Ant Installer Config//EN" "http://antinstaller.sf.net/dtd/antinstall-config-0.8.dtd"> +<installer + ui="swing,text" + verbose="true" + debug="false" + lookAndFeel="org.tp23.jgoodies.plaf.plastic.PlasticXPLookAndFeel" + name="@PROJECT_NAME@ Installer" + windowIcon="/resources/gkmain_inv.png" + defaultImageResource="/resources/makewavesdawn.png" + minJavaVersion="1.4"> + <!-- each page element represents a page of the installer --> + <page + type="input" + name="intro" + displayText="Welcome to the @PROJECT_NAME@ installer"> + </page> + <!-- type="license" shows a license page to click through --> + <page + type="license" + name="license" + displayText="License conditions" + resource="/resources/License.txt"> + </page> + <!-- type="input" shows a list of editable options for the installer --> + <page + type="input" + name="properties" + displayText="Required install options"> + <directory + property="installDir" + defaultValue="/usr/local/@PROJECT_SHORT_NAME@" + defaultValueWin="${env.ProgramFiles}\@PROJECT_SHORT_NAME@" + displayText="Select an installation directory" + create="true"/> + </page> + <page + type="input" + name="selector" + displayText="Components to install"> + <comment + displayText="Choose the components you want to install" + bold="true"/> + <target + displayText="Core components" + target="default" + defaultValue="true" + force="true"/> + <!--SourceCode + <target + displayText="Source code" + target="tgsrc" + defaultValue="false"/> + SourceCode--> + <!--Documentation + <target + displayText="Documentation" + target="tgdoc" + defaultValue="true"/> + Documentation--> + </page> + <page + type="progress" + name="progress" + displayText="Installation progress" + showTargets="false" + target="cleanuptarget"> + </page> +</installer> + + Property changes on: pal-portal/modules/ant-installer/trunk/templates/defaultproject/antinstall-config-template.xml ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/templates/defaultproject/antinstall-config.xml =================================================================== --- pal-portal/modules/ant-installer/trunk/templates/defaultproject/antinstall-config.xml (rev 0) +++ pal-portal/modules/ant-installer/trunk/templates/defaultproject/antinstall-config.xml 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,177 @@ +<?xml version="1.0"?> +<!DOCTYPE installer PUBLIC "-//tp23 //DTD Ant Installer Config//EN" "http://antinstaller.sf.net/dtd/antinstall-config-0.8.dtd"> +<installer + ui="swing,text" + verbose="true" + lookAndFeel="org.tp23.jgoodies.plaf.plastic.PlasticXPLookAndFeel" + name="Installer Wizard" + windowIcon="/resources/gkmain_inv.png" + defaultImageResource="/resources/makewavesdawn.png" + minJavaVersion="1.4" + finishButtonText="Create Project"> + <!-- each page element represents a page of the installer --> + <page + type="input" + name="intro" + displayText="Welcome to the Default Installer Wizard" + target="Base"> + <comment + displayText="This tool creates a default installer project"/> + </page> + <!-- type="input" shows a list of editable options for the installer --> + <page + type="input" + name="properties" + displayText="Project Options"> + <text + property="PROJECT_NAME" + displayText="Project name" + defaultValue="My Project"/> + <directory + property="PROJECT_ROOT" + defaultValue="${java.user.home}/installers" + defaultValueWin="${java.user.home}\installers" + explanatoryText="The build directory is used to create the installer and some temporary files, it should be empty" + displayText="Select your build directory" + checkExists="true" + create="true"/> + <validated + property="PROJECT_SHORT_NAME" + displayText="Short name (no spaces)" + explanatoryText="The short name is generally the module name in CVS or the name used in Eclipse" + defaultValue="MyProject" + regex="^[a-zA-Z][_a-zA-Z0-9]+$"/> + <directory + property="RESOURCE_ROOT" + defaultValue="${java.user.home}/projects" + defaultValueWin="C:\projects" + displayText="Select your projects root" + explanatoryText="The projects root is the root directory where you keep your projects, for +example this might be the eclipse workspace or CVS root" + checkExists="true" + create="true"/> + <app-root + property="ANT_INSTALL_ROOT" + defaultValue="${env.ANT_INSTALL_HOME}" + displayText="Confirm the AntInstall directory" + checkFile1="antlib/ant.jar" + checkFile2="lib/ant-installer.jar" + checkDir1="lib" + checkDir2="antlib" + /> + <file + property="PROJECT_LIC" + defaultValue="${env.ANT_INSTALL_HOME}/lib/LICENSE-ant-install.txt" + defaultValueWin="${env.ANT_INSTALL_HOME}\lib\LICENSE-ant-install.txt" + displayText="Choose a License File" + checkExists="true"/> + </page> + <page + type="input" + name="targets" + displayText="Select resources to include in the installer"> + <target + target="SourceCode" + displayText="Include Source Code" + defaultValue="true"/> + <target + target="Libraries" + displayText="Include Libraries (Jars)" + defaultValue="true"/> + <target + target="Scripts" + displayText="Include Scripts" + defaultValue="true"/> + <target + target="Documentation" + displayText="Include Documents" + defaultValue="true"/> + <target + target="Classes" + displayText="Include Classes" + defaultValue="true"/> + </page> + <page + type="input" + name="resources" + displayText="Source Code" + ifTarget="SourceCode"> + <directory + property="PROJECT_SRC" + defaultValue="${RESOURCE_ROOT}/${PROJECT_SHORT_NAME}/src" + defaultValueWin="${RESOURCE_ROOT}\${PROJECT_SHORT_NAME}\src" + displayText="Select the source code" + checkExists="true" + create="false"/> + </page> + <page + type="input" + name="resources" + displayText="Libraries" + ifTarget="Libraries"> + <directory + property="PROJECT_LIB" + defaultValue="${RESOURCE_ROOT}/${PROJECT_SHORT_NAME}/lib" + defaultValueWin="${RESOURCE_ROOT}\${PROJECT_SHORT_NAME}\lib" + displayText="Select the libraries" + checkExists="true" + create="false"/> + </page> + <page + type="input" + name="resources" + displayText="Scripts" + ifTarget="Scripts"> + <directory + property="PROJECT_BIN" + defaultValue="${RESOURCE_ROOT}/${PROJECT_SHORT_NAME}/bin" + defaultValueWin="${RESOURCE_ROOT}\${PROJECT_SHORT_NAME}\bin" + displayText="Select the scripts" + checkExists="true" + create="false"/> + </page> + <page + type="input" + name="resources" + displayText="Documentation" + ifTarget="Documentation"> + <directory + property="PROJECT_DOC" + defaultValue="${RESOURCE_ROOT}/${PROJECT_SHORT_NAME}/doc" + defaultValueWin="${RESOURCE_ROOT}\${PROJECT_SHORT_NAME}\doc" + displayText="Select the documentation" + checkExists="true" + create="false"/> + </page> + <page + type="input" + name="resources" + displayText="Classes" + ifTarget="Classes"> + <directory + property="PROJECT_CLASSES" + defaultValue="${RESOURCE_ROOT}/${PROJECT_SHORT_NAME}/classes" + defaultValueWin="${RESOURCE_ROOT}\${PROJECT_SHORT_NAME}\classes" + displayText="Select the classes" + checkExists="true" + create="false"/> + </page> + <page + type="input" + name="createinstaller" + displayText="Create Installer"> + <target + target="CreateInstaller" + defaultValue="true" + explanatoryText="You may wish to edit the project files this tool will create. If not, select 'Create the installer' to create a selfextracting jar file from the resources previously chosen" + displayText="Create the installer"/> + </page> + <page + type="progress" + name="progress" + displayText="Build progress" + showTargets="false"> + </page> +</installer> + + Property changes on: pal-portal/modules/ant-installer/trunk/templates/defaultproject/antinstall-config.xml ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/templates/defaultproject/build-self-extractor-template.sh =================================================================== --- pal-portal/modules/ant-installer/trunk/templates/defaultproject/build-self-extractor-template.sh (rev 0) +++ pal-portal/modules/ant-installer/trunk/templates/defaultproject/build-self-extractor-template.sh 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,25 @@ +#!/bin/sh +dir=`expr match "$0" '\(.*\)build-self-extractor.sh'` +# if it we did not call ./ change to the directory we called +if [ "$dir" != "./" ] ; then + if [ "$dir" != "" ] ; then + echo changing to $dir + cd "$dir" ; + fi +fi + + + +if [ "$JAVA_HOME" = "" ] ; then + echo set JAVA_HOME; + exit 1; +fi + +# Ant classpath +ANT_INSTALLER_HOME=@ANT_INSTALL_ROOT@ +CLASSPATH=$ANT_INSTALLER_HOME/antlib/ant.jar +CLASSPATH=$CLASSPATH:$ANT_INSTALLER_HOME/antlib/xml-apis.jar +CLASSPATH=$CLASSPATH:$ANT_INSTALLER_HOME/antlib/xercesImpl.jar +CLASSPATH=$CLASSPATH:$ANT_INSTALLER_HOME/antlib/ant-launcher.jar + +$JAVA_HOME/bin/java -cp $CLASSPATH org.apache.tools.ant.Main -buildfile ./create-installer.xml Property changes on: pal-portal/modules/ant-installer/trunk/templates/defaultproject/build-self-extractor-template.sh ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/templates/defaultproject/build-template.xml =================================================================== --- pal-portal/modules/ant-installer/trunk/templates/defaultproject/build-template.xml (rev 0) +++ pal-portal/modules/ant-installer/trunk/templates/defaultproject/build-template.xml 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,80 @@ +<?xml version="1.0"?> +<!-- +This is the build.xml run by AntInstaller for the installer +--> + +<project name="Installation" default="" basedir="${basedir}"> + + <!-- this is required to pick up the properties generated during the install pages --> + <property file="${basedir}/ant.install.properties"/> + + + <target name="default" depends=""> + <echo message="Createing Installation directory"/> + <mkdir dir="${installDir}"/> + + <!--Scripts + <echo message="Installing Scripts files"/> + <mkdir dir="${installDir}/bin"/> + <unzip src="${antinstaller.jar}" dest="${installDir}"> + <patternset> + <include name="bin/*.sh"/> + <include name="bin/*.ksh"/> + <include name="bin/*.csh"/> + <include name="bin/*.cmd"/> + <include name="bin/*.bat"/> + </patternset> + </unzip> + <chmod file="${installDir}/bin/*.sh" perm="774"/> + <chmod file="${installDir}/bin/*.ksh" perm="774"/> + <chmod file="${installDir}/bin/*.csh" perm="774"/> + Scripts--> + + <!--Libraries + <echo message="Installing Libraries files"/> + <mkdir dir="${installDir}/lib"/> + <unzip src="${antinstaller.jar}" dest="${installDir}"> + <patternset> + <include name="lib/*"/> + </patternset> + </unzip> + Libraries--> + + <!--Classes + <echo message="Installing Class files"/> + <mkdir dir="${installDir}/classes"/> + <unzip src="${antinstaller.jar}" dest="${installDir}"> + <patternset> + <include name="classes/**/*"/> + </patternset> + </unzip> + Classes--> + </target> + + <!--Documentation + <target name="tgdoc" depends=""> + <echo message="Installing Documentation files"/> + <mkdir dir="${installDir}/doc"/> + <unzip src="${antinstaller.jar}" dest="${installDir}"> + <patternset> + <include name="doc/**/*"/> + </patternset> + </unzip> + </target> + Documentation--> + + <!--SourceCode + <target name="tgsrc" depends=""> + <echo message="Installing Source files"/> + <mkdir dir="${installDir}/src"/> + <unzip src="${antinstaller.jar}" dest="${installDir}"> + <patternset> + <include name="src/**/*"/> + </patternset> + </unzip> + </target> + SourceCode--> + + <target name="cleanuptarget" depends=""> + </target> +</project> Property changes on: pal-portal/modules/ant-installer/trunk/templates/defaultproject/build-template.xml ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/templates/defaultproject/build.xml =================================================================== --- pal-portal/modules/ant-installer/trunk/templates/defaultproject/build.xml (rev 0) +++ pal-portal/modules/ant-installer/trunk/templates/defaultproject/build.xml 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,143 @@ +<?xml version="1.0"?> + +<!-- this file is creates a build directory --> +<project name="Create Default Installer" default="" basedir="${basedir}"> + + + <property file="${basedir}/ant.install.properties"/> + <!-- the above file sets the following --> + <property name="ANT_INSTALL_ROOT" value=""/> + <property name="PROJECT_NAME" value=""/> + <property name="PROJECT_SHORT_NAME" value=""/> + <property name="PROJECT_ROOT" value=""/> + <property name="PROJECT_SRC" value=""/> + <property name="PROJECT_LIB" value=""/> + <property name="PROJECT_LIC" value=""/> + <property name="PROJECT_BIN" value=""/> + <property name="PROJECT_DOC" value=""/> + <property name="PROJECT_CLASSES" value=""/> + + <property name="THIS_PROJECT_ROOT" value="${PROJECT_ROOT}/${PROJECT_SHORT_NAME}"/> + + <target name="Base"> + <mkdir dir="${THIS_PROJECT_ROOT}"/> + <copy + file="${ANT_INSTALL_ROOT}/templates/defaultproject/build-template.xml" + tofile="${THIS_PROJECT_ROOT}/build.xml"> + </copy> + <copy + file="${ANT_INSTALL_ROOT}/templates/defaultproject/antinstall-config-template.xml" + tofile="${THIS_PROJECT_ROOT}/antinstall-config.xml"> + </copy> + <replace file="${THIS_PROJECT_ROOT}/antinstall-config.xml"> + <replacefilter token="@PROJECT_NAME@" value="${PROJECT_NAME}"/> + <replacefilter token="@PROJECT_SHORT_NAME@" value="${PROJECT_SHORT_NAME}"/> + </replace> + <copy + file="${ANT_INSTALL_ROOT}/templates/defaultproject/create-installer-template.xml" + tofile="${THIS_PROJECT_ROOT}/create-installer.xml"> + </copy> + <replace file="${THIS_PROJECT_ROOT}/create-installer.xml"> + <replacefilter token="@ANT_INSTALL_ROOT@" value="${ANT_INSTALL_ROOT}"/> + <replacefilter token="@PROJECT_NAME@" value="${PROJECT_NAME}"/> + <replacefilter token="@PROJECT_SHORT_NAME@" value="${PROJECT_SHORT_NAME}"/> + <replacefilter token="@PROJECT_ROOT@" value="${PROJECT_ROOT}"/> + <replacefilter token="@PROJECT_SRC@" value="${PROJECT_SRC}"/> + <replacefilter token="@PROJECT_LIB@" value="${PROJECT_LIB}"/> + <replacefilter token="@PROJECT_LIC@" value="${PROJECT_LIC}"/> + <replacefilter token="@PROJECT_BIN@" value="${PROJECT_BIN}"/> + <replacefilter token="@PROJECT_DOC@" value="${PROJECT_DOC}"/> + <replacefilter token="@PROJECT_CLASSES@" value="${PROJECT_CLASSES}"/> + </replace> + + <copy + file="${ANT_INSTALL_ROOT}/templates/defaultproject/build-self-extractor-template.sh" + tofile="${THIS_PROJECT_ROOT}/build-self-extractor.sh"> + </copy> + <replace file="${THIS_PROJECT_ROOT}/build-self-extractor.sh"> + <replacefilter token="@ANT_INSTALL_ROOT@" value="${ANT_INSTALL_ROOT}"/> + </replace> + <chmod file="${THIS_PROJECT_ROOT}/build-self-extractor.sh" perm="774"/> + </target> + + <target name="SourceCode"> + <replace file="${THIS_PROJECT_ROOT}/create-installer.xml"> + <replacefilter token="<!--SourceCode" value=""/> + <replacefilter token="SourceCode-->" value=""/> + </replace> + <replace file="${THIS_PROJECT_ROOT}/build.xml"> + <replacefilter token="<!--SourceCode" value=""/> + <replacefilter token="SourceCode-->" value=""/> + </replace> + <replace file="${THIS_PROJECT_ROOT}/antinstall-config.xml"> + <replacefilter token="<!--SourceCode" value=""/> + <replacefilter token="SourceCode-->" value=""/> + </replace> + </target> + + <target name="Libraries"> + <replace file="${THIS_PROJECT_ROOT}/create-installer.xml"> + <replacefilter token="<!--Libraries" value=""/> + <replacefilter token="Libraries-->" value=""/> + </replace> + <replace file="${THIS_PROJECT_ROOT}/build.xml"> + <replacefilter token="<!--Libraries" value=""/> + <replacefilter token="Libraries-->" value=""/> + </replace> + <replace file="${THIS_PROJECT_ROOT}/antinstall-config.xml"> + <replacefilter token="<!--Libraries" value=""/> + <replacefilter token="Libraries-->" value=""/> + </replace> + </target> + + <target name="Documentation"> + <replace file="${THIS_PROJECT_ROOT}/create-installer.xml"> + <replacefilter token="<!--Documentation" value=""/> + <replacefilter token="Documentation-->" value=""/> + </replace> + <replace file="${THIS_PROJECT_ROOT}/build.xml"> + <replacefilter token="<!--Documentation" value=""/> + <replacefilter token="Documentation-->" value=""/> + </replace> + <replace file="${THIS_PROJECT_ROOT}/antinstall-config.xml"> + <replacefilter token="<!--Documentation" value=""/> + <replacefilter token="Documentation-->" value=""/> + </replace> + </target> + + <target name="Classes"> + <replace file="${THIS_PROJECT_ROOT}/create-installer.xml"> + <replacefilter token="<!--Classes" value=""/> + <replacefilter token="Classes-->" value=""/> + </replace> + <replace file="${THIS_PROJECT_ROOT}/build.xml"> + <replacefilter token="<!--Classes" value=""/> + <replacefilter token="Classes-->" value=""/> + </replace> + <replace file="${THIS_PROJECT_ROOT}/antinstall-config.xml"> + <replacefilter token="<!--Classes" value=""/> + <replacefilter token="Classes-->" value=""/> + </replace> + </target> + + <target name="Scripts"> + <replace file="${THIS_PROJECT_ROOT}/create-installer.xml"> + <replacefilter token="<!--Scripts" value=""/> + <replacefilter token="Scripts-->" value=""/> + </replace> + <replace file="${THIS_PROJECT_ROOT}/build.xml"> + <replacefilter token="<!--Scripts" value=""/> + <replacefilter token="Scripts-->" value=""/> + </replace> + <replace file="${THIS_PROJECT_ROOT}/antinstall-config.xml"> + <replacefilter token="<!--Scripts" value=""/> + <replacefilter token="Scripts-->" value=""/> + </replace> + </target> + + <target name="CreateInstaller"> + <echo message="Creating the Selfextracting installer"/> + <ant antfile="${THIS_PROJECT_ROOT}/create-installer.xml"/> + </target> + +</project> Property changes on: pal-portal/modules/ant-installer/trunk/templates/defaultproject/build.xml ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/templates/defaultproject/cp/resources/makewavesdawn.png =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/templates/defaultproject/cp/resources/makewavesdawn.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: pal-portal/modules/ant-installer/trunk/templates/defaultproject/create-installer-template.xml =================================================================== --- pal-portal/modules/ant-installer/trunk/templates/defaultproject/create-installer-template.xml (rev 0) +++ pal-portal/modules/ant-installer/trunk/templates/defaultproject/create-installer-template.xml 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,81 @@ +<?xml version="1.0"?> +<!-- +this ant build file can be re-run with the following command if Ant is installer locally +> ant -buildfile create-installer.xml +or by running the script @PROJECT_ROOT@/@PROJECT_SHORT_NAME@/build-self-extractor.sh +--> +<!-- this file is creates an installer for the Project @PROJECT_NAME@ --> +<project name="Create @PROJECT_NAME@ Installer" default="MakeNonExtractor" basedir="."> + + <path id="taskdef.cp" path="@ANT_INSTALL_ROOT@/lib/ant-installer-ext.jar"/> + <taskdef + name="installer" + classname="org.tp23.antinstaller.taskdefs.Installer" + classpathref="taskdef.cp"/> + + + <property name="ANT_INSTALL_ROOT" value="@ANT_INSTALL_ROOT@"/> + <property name="PROJECT_NAME" value="@PROJECT_NAME@"/> + <property name="PROJECT_SHORT_NAME" value="@PROJECT_SHORT_NAME@"/> + <property name="PROJECT_ROOT" value="@PROJECT_ROOT@"/> + <property name="PROJECT_SRC" value="@PROJECT_SRC@"/> + <property name="PROJECT_LIB" value="@PROJECT_LIB@"/> + <property name="PROJECT_LIC" value="@PROJECT_LIC@"/> + <property name="PROJECT_BIN" value="@PROJECT_BIN@"/> + <property name="PROJECT_DOC" value="@PROJECT_DOC@"/> + <property name="PROJECT_CLASSES" value="@PROJECT_CLASSES@"/> + + <property name="THIS_PROJECT_ROOT" value="${PROJECT_ROOT}/${PROJECT_SHORT_NAME}"/> + + <!-- This task only needs to run once it can be deleted once the self-extract files exist on the build host --> + <target name="Base"> + <echo message="Building NonExtractor runnable jar file"/> + </target> + + + <target name="MakeNonExtractor" depends="Base"> + + <installer file="${THIS_PROJECT_ROOT}/${PROJECT_SHORT_NAME}-installer.jar" compress="true" + extractType="NonExtractor" + installConfig="${THIS_PROJECT_ROOT}/antinstall-config.xml" + buildFile="${THIS_PROJECT_ROOT}/build.xml" + antInstallLib="${ANT_INSTALL_ROOT}/lib" + antLib="${ANT_INSTALL_ROOT}/antlib" + validateConfig="true" + icons="bluecurve"> + <zipfileset fullpath="resources/License.txt" file="${PROJECT_LIC}"/> + <zipfileset dir="cp" includes="resources/*"/> + <!--SourceCode + <zipfileset dir="${PROJECT_SRC}" prefix="src"> + <include name="**/*"/> + </zipfileset> + SourceCode--> + <!--Libraries + <zipfileset dir="${PROJECT_LIB}" prefix="lib"> + <include name="**/*.jar"/> + </zipfileset> + Libraries--> + <!--Documentation + <zipfileset dir="${PROJECT_DOC}" prefix="docs"> + <include name="**/*"/> + </zipfileset> + Documentation--> + <!--Classes + <zipfileset dir="${PROJECT_CLASSES}" prefix="classes"> + <include name="**/*"/> + </zipfileset> + Classes--> + <!--Scripts + <zipfileset dir="${PROJECT_BIN}" prefix="bin" > + <include name="**/*.sh"/> + <include name="**/*.ksh"/> + <include name="**/*.csh"/> + <include name="**/*.cmd"/> + <include name="**/*.bat"/> + </zipfileset> + Scripts--> + </installer> + </target> + + +</project> Property changes on: pal-portal/modules/ant-installer/trunk/templates/defaultproject/create-installer-template.xml ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/templates/defaultproject/runtemplate.cmd =================================================================== --- pal-portal/modules/ant-installer/trunk/templates/defaultproject/runtemplate.cmd (rev 0) +++ pal-portal/modules/ant-installer/trunk/templates/defaultproject/runtemplate.cmd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,56 @@ + @ echo off + +if "%JAVA_HOME%" == "" goto nojava +if "%ANT_INSTALL_HOME%" == "" goto trydot + +goto setclasspath + +:trydot +if EXIST ..\..\lib\ant-installer.jar set ANT_INSTALL_HOME=..\.. +if NOT EXIST ..\..\lib\ant-installer.jar goto noai +echo ANT_INSTALL_HOME = %ANT_INSTALL_HOME% + +:setclasspath +REM Ant classpath +set CLASSPATH=%ANT_INSTALL_HOME%\antlib\ant.jar;%ANT_INSTALL_HOME%\antlib\ant-launcher.jar + +REM Images classpath +set CLASSPATH=%CLASSPATH%;.\cp +set CLASSPATH=%CLASSPATH%;..\..\images\navicons\amaranth + +REM XML classpath +set CLASSPATH=%CLASSPATH%;%ANT_INSTALL_HOME%\lib\xercesImpl.jar;%ANT_INSTALL_HOME%\lib\xml-apis.jar + +REM AntInstaller classpath +set CLASSPATH=%CLASSPATH%;%ANT_INSTALL_HOME%\lib\ant-installer.jar +set CLASSPATH=%CLASSPATH%;%ANT_INSTALL_HOME%\lib\jgoodies-edited-1_2_2.jar + +if "%1" == "text" goto settext +if "%1" == "swing" goto setswing +goto setswing + +:settext +set COMMAND=%JAVA_HOME%\bin\java +set INTERFACE=text +goto install + +:setswing +set COMMAND=%JAVA_HOME%\bin\javaw +set INTERFACE=swing +goto install + +:install +start "Antinstaller" "%COMMAND%" -classpath "%CLASSPATH%" org.tp23.antinstaller.runtime.ExecInstall %INTERFACE% . +goto end + +:nojava +echo set JAVA_HOME +echo you must install java to install this application +goto end + +:noai +echo set ANT_INSTALL_HOME +echo you must install AntInstaller to install this application +goto end + +:end \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/templates/defaultproject/runtemplate.cmd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/templates/defaultproject/runtemplate.sh =================================================================== --- pal-portal/modules/ant-installer/trunk/templates/defaultproject/runtemplate.sh (rev 0) +++ pal-portal/modules/ant-installer/trunk/templates/defaultproject/runtemplate.sh 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,39 @@ +#!/bin/sh + +dir=`expr match "$0" '\(.*\)runtemplate.sh'` +# if it we did not call ./ change to the directory we called +if [ "$dir" != "./" ] ; then + if [ "$dir" != "" ] ; then + echo changing to $dir + cd "$dir" ; + fi +fi + +if [ "$ANT_INSTALL_HOME" == "" ] ; then + export ANT_INSTALL_HOME=../.. +fi + +if [ ! -f $ANT_INSTALL_HOME/lib/ant-installer.jar ] ; then + echo "set ANT_INSTALL_HOME" + exit 1; +fi + +if [ "$JAVA_HOME" = "" ] ; then + echo set JAVA_HOME; + exit 1; +fi + + +CLASSPATH=$ANT_INSTALL_HOME/lib/xercesImpl.jar:$ANT_INSTALL_HOME/lib/xml-apis.jar:$ANT_INSTALL_HOME/lib/ant-installer.jar:$ANT_INSTALL_HOME/lib/ai-icons-eclipse.jar +CLASSPATH=$CLASSPATH:$ANT_INSTALL_HOME/antlib/ant.jar:$ANT_INSTALL_HOME/antlib/ant-launcher.jar +CLASSPATH=$CLASSPATH:$ANT_INSTALL_HOME/lib/jgoodies-edited-1_2_2.jar +CLASSPATH=$CLASSPATH:./cp +CLASSPATH=$CLASSPATH:../../images/navicons/amaranth + +COMMAND=$JAVA_HOME/bin/java +INTERFACE=swing +if [ "$1" = "text" ] ; then + INTERFACE=text; +fi + +$COMMAND -classpath $CLASSPATH org.tp23.antinstaller.runtime.ExecInstall $INTERFACE . Property changes on: pal-portal/modules/ant-installer/trunk/templates/defaultproject/runtemplate.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/windows-icons/AntInstaller.ico =================================================================== (Binary files differ) Property changes on: pal-portal/modules/ant-installer/trunk/windows-icons/AntInstaller.ico ___________________________________________________________________ Name: svn:mime-type + image/x-icon Added: pal-portal/modules/ant-installer/trunk/windows-icons/installIcons-docs.cmd =================================================================== --- pal-portal/modules/ant-installer/trunk/windows-icons/installIcons-docs.cmd (rev 0) +++ pal-portal/modules/ant-installer/trunk/windows-icons/installIcons-docs.cmd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,3 @@ + @ echo off +REM this batch file exists so that the parameters of this line are NOT quoted +rundll32 setupapi,InstallHinfSection DefaultInstall 128 @installDir@\windows-icons\installIcons-docs.inf Property changes on: pal-portal/modules/ant-installer/trunk/windows-icons/installIcons-docs.cmd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/windows-icons/installIcons-docs.inf =================================================================== --- pal-portal/modules/ant-installer/trunk/windows-icons/installIcons-docs.inf (rev 0) +++ pal-portal/modules/ant-installer/trunk/windows-icons/installIcons-docs.inf 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,11 @@ +[version] +signature="$chicago$" + +[DefaultInstall] +UpdateInis=Addlink + +[AddLink] +setup.ini, progman.groups,, "group0=AntInstaller" +setup.ini, group0,, ""AntInstaller"" +setup.ini, group0,, """AntInstaller Docs"",""cmd /c """"@installDir@\web\index.html"""""", ""@installDir@\AntInstaller.ico"",0," +setup.ini, group0,, """AntInstaller Wizard"",""cmd /c """"@installDir@\wizard.cmd"""""", ""@installDir@\AntInstaller.ico"",0," Added: pal-portal/modules/ant-installer/trunk/wizard.cmd =================================================================== --- pal-portal/modules/ant-installer/trunk/wizard.cmd (rev 0) +++ pal-portal/modules/ant-installer/trunk/wizard.cmd 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,19 @@ + @ echo off + +if "%JAVA_HOME%" == "" goto nojava + +set DIR=%~dp0 +cd %DIR% + +cd .\templates\defaultproject +call runtemplate.cmd %1 +cd ..\.. +goto end + +:nojava +echo set JAVA_HOME +echo you must install java use the wizard +pause +goto end + +:end \ No newline at end of file Property changes on: pal-portal/modules/ant-installer/trunk/wizard.cmd ___________________________________________________________________ Name: svn:eol-style + native Added: pal-portal/modules/ant-installer/trunk/wizard.sh =================================================================== --- pal-portal/modules/ant-installer/trunk/wizard.sh (rev 0) +++ pal-portal/modules/ant-installer/trunk/wizard.sh 2008-06-11 13:36:41 UTC (rev 975) @@ -0,0 +1,11 @@ +#!/bin/sh + +dir=`expr match "$0" '\(.*\)wizard.sh'` +# if it we did not call ./ change to the directory we called +if [ "$dir" != "./" ] ; then + if [ "$dir" != "" ] ; then + echo changing to $dir + cd "$dir" ; + fi +fi +./templates/defaultproject/runtemplate.sh $1 Property changes on: pal-portal/modules/ant-installer/trunk/wizard.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native