From: erik Date: Tue, 13 Apr 2010 18:38:13 +0000 (+0000) Subject: [maven-release-plugin] copy for tag wamblee-utils-0.2 X-Git-Tag: wamblee-utils-0.2~1 X-Git-Url: http://wamblee.org/gitweb/?a=commitdiff_plain;h=ee26f9544a0bf7f49390990c68981676e0e51014;hp=7c284a3ffcc051909d2318902d1f2a03aaa52f15;p=utils [maven-release-plugin] copy for tag wamblee-utils-0.2 --- diff --git a/branches/TO_MAVEN/ABOUT.txt b/ABOUT.txt similarity index 100% rename from branches/TO_MAVEN/ABOUT.txt rename to ABOUT.txt diff --git a/branches/TO_MAVEN/LICENSE b/LICENSE similarity index 100% rename from branches/TO_MAVEN/LICENSE rename to LICENSE diff --git a/trunk/README.txt b/README.txt similarity index 100% rename from trunk/README.txt rename to README.txt diff --git a/trunk/TODO.txt b/TODO.txt similarity index 100% rename from trunk/TODO.txt rename to TODO.txt diff --git a/branches/TO_MAVEN/.classpath b/branches/TO_MAVEN/.classpath deleted file mode 100644 index 918f2c28..00000000 --- a/branches/TO_MAVEN/.classpath +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/TO_MAVEN/.mymetadata b/branches/TO_MAVEN/.mymetadata deleted file mode 100644 index d2fe841a..00000000 --- a/branches/TO_MAVEN/.mymetadata +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - diff --git a/branches/TO_MAVEN/.project b/branches/TO_MAVEN/.project deleted file mode 100644 index 42411d06..00000000 --- a/branches/TO_MAVEN/.project +++ /dev/null @@ -1,49 +0,0 @@ - - - utils - - - - - - com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator - - - - - com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator - - - - - com.ibm.etools.validation.validationbuilder - - - - - com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder - - - - - com.ibm.sse.model.structuredbuilder - - - - - - com.genuitec.eclipse.ast.deploy.core.deploymentnature - com.genuitec.eclipse.j2eedt.core.webnature - org.eclipse.jdt.core.javanature - - diff --git a/branches/TO_MAVEN/README.txt b/branches/TO_MAVEN/README.txt deleted file mode 100644 index 5b52a77e..00000000 --- a/branches/TO_MAVEN/README.txt +++ /dev/null @@ -1,4 +0,0 @@ -Quickstart: Type 'ant dist-lite' to build everything and download dependencies. - -You must use a java 5 compiler, jdk 1.4.* or earlier will not work. - diff --git a/branches/TO_MAVEN/build.xml b/branches/TO_MAVEN/build.xml deleted file mode 100644 index 04c61c70..00000000 --- a/branches/TO_MAVEN/build.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - -]> - - - - - - &header; - - - - &delegator; - - diff --git a/branches/TO_MAVEN/build/delegator.xml b/branches/TO_MAVEN/build/delegator.xml deleted file mode 100644 index e8192969..00000000 --- a/branches/TO_MAVEN/build/delegator.xml +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - - - - - - -===================================================================== -Executing target '@{target}' for @{proj} -===================================================================== - - - - - - - - - - - - Delegator build file for delegating a task - to several other build files. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/TO_MAVEN/build/header.xml b/branches/TO_MAVEN/build/header.xml deleted file mode 100644 index e284f44c..00000000 --- a/branches/TO_MAVEN/build/header.xml +++ /dev/null @@ -1,724 +0,0 @@ - - - - Using properties file ${user.property.file} - - - - Properties file ${user.property.file} not found, reverting to defaults - - - - - - - - - - - - - - - - - - - Getting dependence ${group}/${artifact}/${version} - - - - - - - - - Getting dependence ${group}/${version} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Preparation: - - To execute with a specific proxy host and port, start ant with the - command-line options -Dproxyhost=hostname -Dproxyport=portnumber. - - deps: Download dependencies, this is necessary for using - any of the build targets. - clean-deps: Remove downloaded dependencies. - - General build targets: - - clean: Cleans up all build results (excluding the dist location). - compile: Compiles all java clasess. Target dir ${module.classes.dir} - jar: Creates a jar file. Target: ${module.jar.file} - dist: Makes the build results available for other modules Target: ${module.dist.dir}. - dist-lite: Similar to dist but only creates the jars for code and test code. Useful - during development because it takes much less time than the dist - target - clean-dist: Cleans up the dist directories. - - Test: - - test: Compile and run tests. - junit-reports: As test but generates a test report. Target: ${module.report.dir}(/html/unit) - reports: As junit-reports but also generates an emma test coverage - report - - Note: By specifying -Dtest=TestCaseName on the ant command line, - only the specified testcase will be run. - - Emma can also be executed manually: - - emma: Overwrites the production classes by their instrumented versions. - emma-reports: Generates emma code coverage reports after running the - testcases with instrumented classes. - - Javadoc targets: - - javadoc: Generates javadoc. Target: ${module.javadoc.dir} - doccheck: Checks documentation. Target: ${module.doccheck.dir} - - Forrest: - - forrest: Generates project docs using forrest. - - Code analysis: - - checkstyle: Checks the style of the code. - format: Formats to the code in accordance with the checkstyle rules. - simian: Analyse similarities in the code. - - Building a web application: - - To build a web application archive (WAR) you must set the property - webroot.dir to the value of the directory which is the root of your - web application. This must be done before the header.xl is - sourced. The build support will then make sure that - classes and libs are put in the correct directories below - ${webroot.dir}/WEB-INF, and it will build a web archive. - - Database targets: ** database targets are not functional yet ** - - For all targets below the database is configured using - hibernate.properties (hibernate.dialect property) and - the JDBC connection properties in database.properties. - - The schemaexport and schemaupdate targets require the - setting of a property named hibernate.filelist. The value - of the property must be the fully qualified class name of - a concrete subclass of ConfigFileList which has a default - public constructor and defines the Hibernate mapping files that - can be used. - - schemaexport: Generate SQL code to create the required database structures. - - startdb: Startup a lightweight database. The database - type to start is obtained from the currently - configured database. - - schemaupdate: Populate the database with a schema by running - Hibernate schemaupdate against the currently - configured database. - - - - diff --git a/branches/TO_MAVEN/build/lib/ant/ant-contrib-1.0b2/README.txt b/branches/TO_MAVEN/build/lib/ant/ant-contrib-1.0b2/README.txt deleted file mode 100644 index 2e97de8f..00000000 --- a/branches/TO_MAVEN/build/lib/ant/ant-contrib-1.0b2/README.txt +++ /dev/null @@ -1,46 +0,0 @@ -Ant-Contrib library - -This library is for contributed Ant tasks that have -not been approved for inclusion into the ant core or -optional library. - -Requirements -------------------------- -Runtime: - Requires APACHE Ant Version 1.5 or above. Note, that output - handlers on the ForEach task will not properly report the - task which is outputting the message unless you are using - Ant version 1.5.2 or greater. - - In addition, the task will not work on versions prior - to Ant 1.6 - -Compilation: - Requires Ant Version 1.6 or greater to compile and build the - package. - - -Inclusion in your project -------------------------- - The easiest way to use the tasks is to use - - - - - - - -in your build file. If the jar file is on your CLASSPATH or in -ANT_HOME/lib you can even simplify this to read - - - -For projects which will run under 1.5 versions, you would -use the .properties file instead of the antlib.xml file: - - - - - - - diff --git a/branches/TO_MAVEN/build/lib/ant/ant-contrib-1.0b2/ant-contrib.jar b/branches/TO_MAVEN/build/lib/ant/ant-contrib-1.0b2/ant-contrib.jar deleted file mode 100644 index ea817cd4..00000000 Binary files a/branches/TO_MAVEN/build/lib/ant/ant-contrib-1.0b2/ant-contrib.jar and /dev/null differ diff --git a/branches/TO_MAVEN/build/lib/ant/ant-dependencies.jar b/branches/TO_MAVEN/build/lib/ant/ant-dependencies.jar deleted file mode 100644 index 83c7abf5..00000000 Binary files a/branches/TO_MAVEN/build/lib/ant/ant-dependencies.jar and /dev/null differ diff --git a/branches/TO_MAVEN/build/lib/ant/doccheck1.2b2/doccheck.jar b/branches/TO_MAVEN/build/lib/ant/doccheck1.2b2/doccheck.jar deleted file mode 100644 index 0b831051..00000000 Binary files a/branches/TO_MAVEN/build/lib/ant/doccheck1.2b2/doccheck.jar and /dev/null differ diff --git a/branches/TO_MAVEN/build/lib/ant/pdfdoclet-1.0.2-all.jar b/branches/TO_MAVEN/build/lib/ant/pdfdoclet-1.0.2-all.jar deleted file mode 100644 index 2a209156..00000000 Binary files a/branches/TO_MAVEN/build/lib/ant/pdfdoclet-1.0.2-all.jar and /dev/null differ diff --git a/branches/TO_MAVEN/build/lib/special/hibernate/antlr-2.7.5H3.jar b/branches/TO_MAVEN/build/lib/special/hibernate/antlr-2.7.5H3.jar deleted file mode 100644 index d02328e2..00000000 Binary files a/branches/TO_MAVEN/build/lib/special/hibernate/antlr-2.7.5H3.jar and /dev/null differ diff --git a/branches/TO_MAVEN/build/lib/special/hibernate/asm-attrs.jar b/branches/TO_MAVEN/build/lib/special/hibernate/asm-attrs.jar deleted file mode 100644 index f07bcb2b..00000000 Binary files a/branches/TO_MAVEN/build/lib/special/hibernate/asm-attrs.jar and /dev/null differ diff --git a/branches/TO_MAVEN/build/lib/special/hibernate/asm.jar b/branches/TO_MAVEN/build/lib/special/hibernate/asm.jar deleted file mode 100644 index ee0c7ccd..00000000 Binary files a/branches/TO_MAVEN/build/lib/special/hibernate/asm.jar and /dev/null differ diff --git a/branches/TO_MAVEN/build/lib/special/jaf-1.0.2/activation.jar b/branches/TO_MAVEN/build/lib/special/jaf-1.0.2/activation.jar deleted file mode 100644 index ab80b388..00000000 Binary files a/branches/TO_MAVEN/build/lib/special/jaf-1.0.2/activation.jar and /dev/null differ diff --git a/branches/TO_MAVEN/build/lib/special/javamail-1.3.3_01/mail.jar b/branches/TO_MAVEN/build/lib/special/javamail-1.3.3_01/mail.jar deleted file mode 100644 index 97fad98c..00000000 Binary files a/branches/TO_MAVEN/build/lib/special/javamail-1.3.3_01/mail.jar and /dev/null differ diff --git a/branches/TO_MAVEN/build/lib/special/jfreechart-1.0.1/jcommon-1.0.0.jar b/branches/TO_MAVEN/build/lib/special/jfreechart-1.0.1/jcommon-1.0.0.jar deleted file mode 100644 index c5d23f4a..00000000 Binary files a/branches/TO_MAVEN/build/lib/special/jfreechart-1.0.1/jcommon-1.0.0.jar and /dev/null differ diff --git a/branches/TO_MAVEN/build/lib/special/jfreechart-1.0.1/jfreechart-1.0.1.jar b/branches/TO_MAVEN/build/lib/special/jfreechart-1.0.1/jfreechart-1.0.1.jar deleted file mode 100644 index 6a015249..00000000 Binary files a/branches/TO_MAVEN/build/lib/special/jfreechart-1.0.1/jfreechart-1.0.1.jar and /dev/null differ diff --git a/branches/TO_MAVEN/build/lib/special/test/jdbc2_0-stdext.jar b/branches/TO_MAVEN/build/lib/special/test/jdbc2_0-stdext.jar deleted file mode 100644 index ddafa130..00000000 Binary files a/branches/TO_MAVEN/build/lib/special/test/jdbc2_0-stdext.jar and /dev/null differ diff --git a/branches/TO_MAVEN/build/lib/special/test/jdbc2_0-stdext.licence.txt b/branches/TO_MAVEN/build/lib/special/test/jdbc2_0-stdext.licence.txt deleted file mode 100644 index b4fc38ab..00000000 --- a/branches/TO_MAVEN/build/lib/special/test/jdbc2_0-stdext.licence.txt +++ /dev/null @@ -1,199 +0,0 @@ - Sun Microsystems, Inc. -Binary Code License Agreement - -READ THE TERMS OF THIS AGREEMENT AND ANY PROVIDED -SUPPLEMENTAL LICENSE TERMS (COLLECTIVELY -"AGREEMENT") CAREFULLY BEFORE OPENING THE SOFTWARE -MEDIA PACKAGE. BY OPENING THE SOFTWARE MEDIA -PACKAGE, YOU AGREE TO THE TERMS OF THIS AGREEMENT. -IF YOU ARE ACCESSING THE SOFTWARE ELECTRONICALLY, -INDICATE YOUR ACCEPTANCE OF THESE TERMS BY -SELECTING THE "ACCEPT" BUTTON AT THE END OF THIS -AGREEMENT. IF YOU DO NOT AGREE TO ALL THESE -TERMS, PROMPTLY RETURN THE UNUSED SOFTWARE TO YOUR -PLACE OF PURCHASE FOR A REFUND OR, IF THE SOFTWARE -IS ACCESSED ELECTRONICALLY, SELECT THE "DECLINE" -BUTTON AT THE END OF THIS AGREEMENT. - -1. LICENSE TO USE. Sun grants you a -non-exclusive and non-transferable license for the -internal use only of the accompanying software and -documentation and any error corrections provided -by Sun (collectively "Software"), by the number of -users and the class of computer hardware for which -the corresponding fee has been paid. - -2. RESTRICTIONS Software is confidential and -copyrighted. Title to Software and all associated -intellectual property rights is retained by Sun -and/or its licensors. Except as specifically -authorized in any Supplemental License Terms, you -may not make copies of Software, other than a -single copy of Software for archival purposes. -Unless enforcement is prohibited by applicable -law, you may not modify, decompile, or reverse -engineer Software. Software is not designed or -licensed for use in on-line control of aircraft, -air traffic, aircraft navigation or aircraft -communications; or in the design, construction, -operation or maintenance of any nuclear facility. -No right, title or interest in or to any -trademark, service mark, logo or trade name of Sun -or its licensors is granted under this Agreement. - -3. LIMITED WARRANTY. Sun warrants to you that for -a period of ninety (90) days from the date of -purchase, as evidenced by a copy of the receipt, -the media on which Software is furnished (if any) -will be free of defects in materials and -workmanship under normal use. Except for the -foregoing, Software is provided "AS IS". Your -exclusive remedy and Sun's entire liability under -this limited warranty will be at Sun's option to -replace Software media or refund the fee paid for -Software. - -4. DISCLAIMER OF WARRANTY. UNLESS SPECIFIED IN -THIS AGREEMENT, ALL EXPRESS OR IMPLIED CONDITIONS, -REPRESENTATIONS AND WARRANTIES, INCLUDING ANY -IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE OR NON-INFRINGEMENT ARE -DISCLAIMED, EXCEPT TO THE EXTENT THAT THESE -DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. - -5. LIMITATION OF LIABILITY. TO THE EXTENT NOT -PROHIBITED BY LAW, IN NO EVENT WILL SUN OR ITS -LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT -OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, -INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED -REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT -OF OR RELATED TO THE USE OF OR INABILITY TO USE -SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. In no event will -Sun's liability to you, whether in contract, tort -(including negligence), or otherwise, exceed the -amount paid by you for Software under this -Agreement. The foregoing limitations will apply -even if the above stated warranty fails of its -essential purpose. - -6. Termination. This Agreement is effective -until terminated. You may terminate this -Agreement at any time by destroying all copies of -Software. This Agreement will terminate -immediately without notice from Sun if you fail to -comply with any provision of this Agreement. Upon -Termination, you must destroy all copies of -Software. - -7. Export Regulations. All Software and -technical data delivered under this Agreement are -subject to US export control laws and may be -subject to export or import regulations in other -countries. You agree to comply strictly with all -such laws and regulations and acknowledge that you -have the responsibility to obtain such licenses to -export, re-export, or import as may be required -after delivery to you. - -8. U.S. Government Restricted Rights. If -Software is being acquired by or on behalf of the -U.S. Government or by a U.S. Government prime -contractor or subcontractor (at any tier), then -the Government's rights in Software and -accompanying documentation will be only as set -forth in this Agreement; this is in accordance -with 48 CFR 227.7201 through 227.7202-4 (for -Department of Defense (DOD) acquisitions) and with -48 CFR 2.101 and 12.212 (for non-DOD -acquisitions). - -9. Governing Law. Any action related to this -Agreement will be governed by California law and -controlling U.S. federal law. No choice of law -rules of any jurisdiction will apply. - -10. Severability. If any provision of this -Agreement is held to be unenforceable, this -Agreement will remain in effect with the provision -omitted, unless omission would frustrate the -intent of the parties, in which case this -Agreement will immediately terminate. - -11. Integration. This Agreement is the entire -agreement between you and Sun relating to its -subject matter. It supersedes all prior or -contemporaneous oral or written communications, -proposals, representations and warranties and -prevails over any conflicting or additional terms -of any quote, order, acknowledgment, or other -communication between the parties relating to its -subject matter during the term of this Agreement. -No modification of this Agreement will be binding, -unless in writing and signed by an authorized -representative of each party. - -For inquiries please contact: Sun Microsystems, -Inc. 901 San Antonio Road, Palo Alto, California -94303 - - -SUPPLEMENTAL LICENSE TERMS -JDBCTM 2.0 INTERFACE CLASSES - -These supplemental license terms ("Supplement") -add to or modify the terms of the Binary Code -License Agreement (collectively, the -"Agreement"). Capitalized terms not defined in -this Supplement shall have the same meanings -ascribed to them in the Agreement. These -Supplement terms shall supersede any inconsistent -or conflicting terms in the Agreement, or in any -license contained within the Software. - -1. License to Distribute. Sun grants you a -non-exclusive, non-transferable, limited license -to reproduce and distribute the binary and/or -source code form of the Software to third party -end users through multiple tiers of distribution, -provided that you: (i) distribute the Software -complete and unmodified in its original Java -Archive file, and only bundled as a part of your -program that incorporates the Software -("Program"); (ii) do not distribute additional -software intended to replace any component(s) of -the Software; (iii) agree to incorporate the most -current version of the Software that was available -from Sun no later than 180 days prior to each -production release of the Program; (iv) do not -remove or alter any proprietary legends or notices -contained in or on the Software; (v) only -distribute the Program pursuant to a license -agreement that protects Sun's interest consistent -with the terms contained in the Agreement; (vi) -may not create, or authorize your licensees to cr! -eate additional classes, interfaces, or -subpackages that are contained in the "java" -"javax" or "sun" packages or similar as specified -by Sun in any class file naming convention; and -(vii) agree to defend and indemnify Sun and its -licensors from and against any damages, costs, -liabilities, settlement amounts and/or expenses -(including attorneys' fees) incurred in connection -with any claim, lawsuit or action by any third -party that arises or results from the use or -distribution of any and all Programs. - -2. Trademarks and Logos. You acknowledge as -between you and Sun that Sun owns the Java -trademark and all Java-related trademarks, logos -and icons including the Coffee Cup and Duke ("Java -Marks") and agree to comply with the Java -Trademark Guidelines at -http://java.sun.com/trademarks.html. - - - - - - \ No newline at end of file diff --git a/branches/TO_MAVEN/build/lib/special/test/jta.jar b/branches/TO_MAVEN/build/lib/special/test/jta.jar deleted file mode 100644 index e0822a96..00000000 Binary files a/branches/TO_MAVEN/build/lib/special/test/jta.jar and /dev/null differ diff --git a/branches/TO_MAVEN/build/lib/special/test/jta.licence.txt b/branches/TO_MAVEN/build/lib/special/test/jta.licence.txt deleted file mode 100644 index 45328c10..00000000 --- a/branches/TO_MAVEN/build/lib/special/test/jta.licence.txt +++ /dev/null @@ -1,49 +0,0 @@ - -Sun Microsystems, Inc. -Binary Code License Agreement - -READ THE TERMS OF THIS AGREEMENT AND ANY PROVIDED SUPPLEMENTAL LICENSE TERMS (COLLECTIVELY "AGREEMENT") CAREFULLY BEFORE OPENING THE SOFTWARE MEDIA PACKAGE. BY OPENING THE SOFTWARE MEDIA PACKAGE, YOU AGREE TO THE TERMS OF THIS AGREEMENT. IF YOU ARE ACCESSING THE SOFTWARE ELECTRONICALLY, INDICATE YOUR ACCEPTANCE OF THESE TERMS BY SELECTING THE "ACCEPT" BUTTON AT THE END OF THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL THESE TERMS, PROMPTLY RETURN THE UNUSED SOFTWARE TO YOUR PLACE OF PURCHASE FOR A REFUND OR, IF THE SOFTWARE IS ACCESSED ELECTRONICALLY, SELECT THE "DECLINE" BUTTON AT THE END OF THIS AGREEMENT. - -1. LICENSE TO USE. Sun grants you a non-exclusive and non-transferable license for the internal use only of the accompanying software and documentation and any error corrections provided by Sun (collectively "Software"), by the number of users and the class of computer hardware for which the corresponding fee has been paid. - -2. RESTRICTIONS. Software is confidential and copyrighted. Title to Software and all associated intellectual property rights is retained by Sun and/or its licensors. Except as specifically authorized in any Supplemental License Terms, you may not make copies of Software, other than a single copy of Software for archival purposes. Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software. Licensee acknowledges that Licensed Software is not designed or intended for use in the design, construction, operation or maintenance of any nuclear facility. Sun Microsystems, Inc. disclaims any express or implied warranty of fitness for such uses. No right, title or interest in or to any trademark, service mark, logo or trade name of Sun or its licensors is granted under this Agreement. - -3. LIMITED WARRANTY. Sun warrants to you that for a period of ninety (90) days from the date of purchase, as evidenced by a copy of the receipt, the media on which Software is furnished (if any) will be free of defects in materials and workmanship under normal use. Except for the foregoing, Software is provided "AS IS". Your exclusive remedy and Sun's entire liability under this limited warranty will be at Sun's option to replace Software media or refund the fee paid for Software. - -4. DISCLAIMER OF WARRANTY. UNLESS SPECIFIED IN THIS AGREEMENT, ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. - -5. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. In no event will Sun's liability to you, whether in contract, tort (including negligence), or otherwise, exceed the amount paid by you for Software under this Agreement. The foregoing limitations will apply even if the above stated warranty fails of its essential purpose. - -6. Termination. This Agreement is effective until terminated. You may terminate this Agreement at any time by destroying all copies of Software. This Agreement will terminate immediately without notice from Sun if you fail to comply with any provision of this Agreement. Upon Termination, you must destroy all copies of Software. - -7. Export Regulations. All Software and technical data delivered under this Agreement are subject to US export control laws and may be subject to export or import regulations in other countries. You agree to comply strictly with all such laws and regulations and acknowledge that you have the responsibility to obtain such licenses to export, re-export, or import as may be required after delivery to you. - -8. U.S. Government Restricted Rights. If Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in Software and accompanying documentation will be only as set forth in this Agreement; this is in accordance with 48 CFR 227.7201 through 227.7202-4 (for Department of Defense (DOD) acquisitions) and with 48 CFR 2.101 and 12.212 (for non-DOD acquisitions). - -9. Governing Law. Any action related to this Agreement will be governed by California law and controlling U.S. federal law. No choice of law rules of any jurisdiction will apply. - -10. Severability. If any provision of this Agreement is held to be unenforceable, this Agreement will remain in effect with the provision omitted, unless omission would frustrate the intent of the parties, in which case this Agreement will immediately terminate. - -11. Integration. This Agreement is the entire agreement between you and Sun relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification of this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - -JAVATM INTERFACE CLASSES -JAVA TRANSACTION API (JTA), VERSION 1.0.1B, MAINTENANCE RELEASE -SUPPLEMENTAL LICENSE TERMS - -These supplemental license terms ("Supplemental Terms") add to or modify the terms of the Binary Code License Agreement (collectively, the "Agreement"). Capitalized terms not defined in these Supplemental Terms shall have the same meanings ascribed to them in the Agreement. These Supplemental Terms shall supersede any inconsistent or conflicting terms in the Agreement, or in any license contained within the Software. - -1. Software Internal Use and Development License Grant. Subject to the terms and conditions of this Agreement, including, but not limited to Section 3 (Java Technology Restrictions) of these Supplemental Terms, Sun grants you a non-exclusive, non-transferable, limited license to reproduce internally and use internally the binary form of the Software, complete and unmodified, for the sole purpose of designing, developing and testing your Java applets and applications ("Programs"). - -2. License to Distribute Software. In addition to the license granted in Section 1 (Software Internal Use and Development License Grant) of these Supplemental Terms, subject to the terms and conditions of this Agreement, including but not limited to Section 3 (Java Technology Restrictions), Sun grants you a non-exclusive, non-transferable, limited license to reproduce and distribute the Software in binary form only, provided that you (i) distribute the Software complete and unmodified and only bundled as part of your Programs, (ii) do not distribute additional software intended to replace any component(s) of the Software, (iii) do not remove or alter any proprietary legends or notices contained in the Software, (iv) only distribute the Software subject to a license agreement that protects Sun's interests consistent with the terms contained in this Agreement, and (v) agree to defend and indemnify Sun and its licensors from and against any damages, costs, liabilities, settlement amounts and/or expenses (including attorneys' fees) incurred in connection with any claim, lawsuit or action by any third party that arises or results from the use or distribution of any and all Programs and/or Software. - -3. Java Technology Restrictions. You may not modify the Java Platform Interface ("JPI", identified as classes contained within the "java" package or any subpackages of the "java" package), by creating additional classes within the JPI or otherwise causing the addition to or modification of the classes in the JPI. In the event that you create an additional class and associated API(s) which (i) extends the functionality of the Java Platform, and (ii) is exposed to third party software developers for the purpose of developing additional software which invokes such additional API, you must promptly publish broadly an accurate specification for such API for free use by all developers. You may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are in any way identified as "java", "javax", "sun" or similar convention as specified by Sun in any naming convention designation. - -4. Trademarks and Logos. You acknowledge and agree as between you and Sun that Sun owns the SUN, SOLARIS, JAVA, JINI, FORTE, and iPLANET trademarks and all SUN, SOLARIS, JAVA, JINI, FORTE, and iPLANET-related trademarks, service marks, logos and other brand designations ("Sun Marks"), and you agree to comply with the Sun Trademark and Logo Usage Requirements currently located at http://www.sun.com/policies/trademarks. Any use you make of the Sun Marks inures to Sun's benefit. - -5. Source Code. Software may contain source code that is provided solely for reference purposes pursuant to the terms of this Agreement. Source code may not be redistributed unless expressly provided for in this Agreement. - -6. Termination for Infringement. Either party may terminate this Agreement immediately should any Software become, or in either party's opinion be likely to become, the subject of a claim of infringement of any intellectual property right. - -For inquiries please contact: Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, California 95054. - - diff --git a/branches/TO_MAVEN/build/trailer.xml b/branches/TO_MAVEN/build/trailer.xml deleted file mode 100644 index d210ff5c..00000000 --- a/branches/TO_MAVEN/build/trailer.xml +++ /dev/null @@ -1,568 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Result is available in ${module.pdfdoc.dir}" - - - - - - - - - Results are available in ${module.doccheck.dir}" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -

CheckStyle Audit

Designed for use with CheckStyle and Ant.
-
- - - -
- - - -
- - - - - -

-

- -


- - - - - - - - - -

Files

- - - - - - - - - - - - - - -
NameErrors
-
- - - - -

File

- - - - - - - - - - - - - -
Error DescriptionLine
- Back to top -
- - - -

Summary

- - - - - - - - - - - - -
FilesErrors
-
- - - - a - b - - - - - diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/checkstyle-simple.xsl b/tags/BEFORE_MAVEN_MIGRATION/build/checkstyle-simple.xsl deleted file mode 100644 index d98cbcbe..00000000 --- a/tags/BEFORE_MAVEN_MIGRATION/build/checkstyle-simple.xsl +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - Sun Coding Style Violations - - -

Coding Style Check Results

- - - - - - - - - - - - - - - - - - - - -
Summary
Total files checked
Files with errors
Total errors
Errors per file
-
-

The following are violations of the Sun Coding-Style Standards:

-

- - - - - - - - - - - -
File: - -
- - - - - - -
Line Number Error Message
-

- - - - - - - - - - - - - - diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/delegator.xml b/tags/BEFORE_MAVEN_MIGRATION/build/delegator.xml deleted file mode 100644 index e8192969..00000000 --- a/tags/BEFORE_MAVEN_MIGRATION/build/delegator.xml +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - - - - - - -===================================================================== -Executing target '@{target}' for @{proj} -===================================================================== - - - - - - - - - - - - Delegator build file for delegating a task - to several other build files. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/header.xml b/tags/BEFORE_MAVEN_MIGRATION/build/header.xml deleted file mode 100644 index e284f44c..00000000 --- a/tags/BEFORE_MAVEN_MIGRATION/build/header.xml +++ /dev/null @@ -1,724 +0,0 @@ - - - - Using properties file ${user.property.file} - - - - Properties file ${user.property.file} not found, reverting to defaults - - - - - - - - - - - - - - - - - - - Getting dependence ${group}/${artifact}/${version} - - - - - - - - - Getting dependence ${group}/${version} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Preparation: - - To execute with a specific proxy host and port, start ant with the - command-line options -Dproxyhost=hostname -Dproxyport=portnumber. - - deps: Download dependencies, this is necessary for using - any of the build targets. - clean-deps: Remove downloaded dependencies. - - General build targets: - - clean: Cleans up all build results (excluding the dist location). - compile: Compiles all java clasess. Target dir ${module.classes.dir} - jar: Creates a jar file. Target: ${module.jar.file} - dist: Makes the build results available for other modules Target: ${module.dist.dir}. - dist-lite: Similar to dist but only creates the jars for code and test code. Useful - during development because it takes much less time than the dist - target - clean-dist: Cleans up the dist directories. - - Test: - - test: Compile and run tests. - junit-reports: As test but generates a test report. Target: ${module.report.dir}(/html/unit) - reports: As junit-reports but also generates an emma test coverage - report - - Note: By specifying -Dtest=TestCaseName on the ant command line, - only the specified testcase will be run. - - Emma can also be executed manually: - - emma: Overwrites the production classes by their instrumented versions. - emma-reports: Generates emma code coverage reports after running the - testcases with instrumented classes. - - Javadoc targets: - - javadoc: Generates javadoc. Target: ${module.javadoc.dir} - doccheck: Checks documentation. Target: ${module.doccheck.dir} - - Forrest: - - forrest: Generates project docs using forrest. - - Code analysis: - - checkstyle: Checks the style of the code. - format: Formats to the code in accordance with the checkstyle rules. - simian: Analyse similarities in the code. - - Building a web application: - - To build a web application archive (WAR) you must set the property - webroot.dir to the value of the directory which is the root of your - web application. This must be done before the header.xl is - sourced. The build support will then make sure that - classes and libs are put in the correct directories below - ${webroot.dir}/WEB-INF, and it will build a web archive. - - Database targets: ** database targets are not functional yet ** - - For all targets below the database is configured using - hibernate.properties (hibernate.dialect property) and - the JDBC connection properties in database.properties. - - The schemaexport and schemaupdate targets require the - setting of a property named hibernate.filelist. The value - of the property must be the fully qualified class name of - a concrete subclass of ConfigFileList which has a default - public constructor and defines the Hibernate mapping files that - can be used. - - schemaexport: Generate SQL code to create the required database structures. - - startdb: Startup a lightweight database. The database - type to start is obtained from the currently - configured database. - - schemaupdate: Populate the database with a schema by running - Hibernate schemaupdate against the currently - configured database. - - - - diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/lib/ant/ant-contrib-1.0b2/README.txt b/tags/BEFORE_MAVEN_MIGRATION/build/lib/ant/ant-contrib-1.0b2/README.txt deleted file mode 100644 index 2e97de8f..00000000 --- a/tags/BEFORE_MAVEN_MIGRATION/build/lib/ant/ant-contrib-1.0b2/README.txt +++ /dev/null @@ -1,46 +0,0 @@ -Ant-Contrib library - -This library is for contributed Ant tasks that have -not been approved for inclusion into the ant core or -optional library. - -Requirements -------------------------- -Runtime: - Requires APACHE Ant Version 1.5 or above. Note, that output - handlers on the ForEach task will not properly report the - task which is outputting the message unless you are using - Ant version 1.5.2 or greater. - - In addition, the task will not work on versions prior - to Ant 1.6 - -Compilation: - Requires Ant Version 1.6 or greater to compile and build the - package. - - -Inclusion in your project -------------------------- - The easiest way to use the tasks is to use - - - - - - - -in your build file. If the jar file is on your CLASSPATH or in -ANT_HOME/lib you can even simplify this to read - - - -For projects which will run under 1.5 versions, you would -use the .properties file instead of the antlib.xml file: - - - - - - - diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/lib/ant/ant-contrib-1.0b2/ant-contrib.jar b/tags/BEFORE_MAVEN_MIGRATION/build/lib/ant/ant-contrib-1.0b2/ant-contrib.jar deleted file mode 100644 index ea817cd4..00000000 Binary files a/tags/BEFORE_MAVEN_MIGRATION/build/lib/ant/ant-contrib-1.0b2/ant-contrib.jar and /dev/null differ diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/lib/ant/ant-dependencies.jar b/tags/BEFORE_MAVEN_MIGRATION/build/lib/ant/ant-dependencies.jar deleted file mode 100644 index 83c7abf5..00000000 Binary files a/tags/BEFORE_MAVEN_MIGRATION/build/lib/ant/ant-dependencies.jar and /dev/null differ diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/lib/ant/doccheck1.2b2/doccheck.jar b/tags/BEFORE_MAVEN_MIGRATION/build/lib/ant/doccheck1.2b2/doccheck.jar deleted file mode 100644 index 0b831051..00000000 Binary files a/tags/BEFORE_MAVEN_MIGRATION/build/lib/ant/doccheck1.2b2/doccheck.jar and /dev/null differ diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/lib/ant/pdfdoclet-1.0.2-all.jar b/tags/BEFORE_MAVEN_MIGRATION/build/lib/ant/pdfdoclet-1.0.2-all.jar deleted file mode 100644 index 2a209156..00000000 Binary files a/tags/BEFORE_MAVEN_MIGRATION/build/lib/ant/pdfdoclet-1.0.2-all.jar and /dev/null differ diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/hibernate/antlr-2.7.5H3.jar b/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/hibernate/antlr-2.7.5H3.jar deleted file mode 100644 index d02328e2..00000000 Binary files a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/hibernate/antlr-2.7.5H3.jar and /dev/null differ diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/hibernate/asm-attrs.jar b/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/hibernate/asm-attrs.jar deleted file mode 100644 index f07bcb2b..00000000 Binary files a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/hibernate/asm-attrs.jar and /dev/null differ diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/hibernate/asm.jar b/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/hibernate/asm.jar deleted file mode 100644 index ee0c7ccd..00000000 Binary files a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/hibernate/asm.jar and /dev/null differ diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/jaf-1.0.2/activation.jar b/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/jaf-1.0.2/activation.jar deleted file mode 100644 index ab80b388..00000000 Binary files a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/jaf-1.0.2/activation.jar and /dev/null differ diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/javamail-1.3.3_01/mail.jar b/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/javamail-1.3.3_01/mail.jar deleted file mode 100644 index 97fad98c..00000000 Binary files a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/javamail-1.3.3_01/mail.jar and /dev/null differ diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/jfreechart-1.0.1/jcommon-1.0.0.jar b/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/jfreechart-1.0.1/jcommon-1.0.0.jar deleted file mode 100644 index c5d23f4a..00000000 Binary files a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/jfreechart-1.0.1/jcommon-1.0.0.jar and /dev/null differ diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/jfreechart-1.0.1/jfreechart-1.0.1.jar b/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/jfreechart-1.0.1/jfreechart-1.0.1.jar deleted file mode 100644 index 6a015249..00000000 Binary files a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/jfreechart-1.0.1/jfreechart-1.0.1.jar and /dev/null differ diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/test/jdbc2_0-stdext.jar b/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/test/jdbc2_0-stdext.jar deleted file mode 100644 index ddafa130..00000000 Binary files a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/test/jdbc2_0-stdext.jar and /dev/null differ diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/test/jdbc2_0-stdext.licence.txt b/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/test/jdbc2_0-stdext.licence.txt deleted file mode 100644 index b4fc38ab..00000000 --- a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/test/jdbc2_0-stdext.licence.txt +++ /dev/null @@ -1,199 +0,0 @@ - Sun Microsystems, Inc. -Binary Code License Agreement - -READ THE TERMS OF THIS AGREEMENT AND ANY PROVIDED -SUPPLEMENTAL LICENSE TERMS (COLLECTIVELY -"AGREEMENT") CAREFULLY BEFORE OPENING THE SOFTWARE -MEDIA PACKAGE. BY OPENING THE SOFTWARE MEDIA -PACKAGE, YOU AGREE TO THE TERMS OF THIS AGREEMENT. -IF YOU ARE ACCESSING THE SOFTWARE ELECTRONICALLY, -INDICATE YOUR ACCEPTANCE OF THESE TERMS BY -SELECTING THE "ACCEPT" BUTTON AT THE END OF THIS -AGREEMENT. IF YOU DO NOT AGREE TO ALL THESE -TERMS, PROMPTLY RETURN THE UNUSED SOFTWARE TO YOUR -PLACE OF PURCHASE FOR A REFUND OR, IF THE SOFTWARE -IS ACCESSED ELECTRONICALLY, SELECT THE "DECLINE" -BUTTON AT THE END OF THIS AGREEMENT. - -1. LICENSE TO USE. Sun grants you a -non-exclusive and non-transferable license for the -internal use only of the accompanying software and -documentation and any error corrections provided -by Sun (collectively "Software"), by the number of -users and the class of computer hardware for which -the corresponding fee has been paid. - -2. RESTRICTIONS Software is confidential and -copyrighted. Title to Software and all associated -intellectual property rights is retained by Sun -and/or its licensors. Except as specifically -authorized in any Supplemental License Terms, you -may not make copies of Software, other than a -single copy of Software for archival purposes. -Unless enforcement is prohibited by applicable -law, you may not modify, decompile, or reverse -engineer Software. Software is not designed or -licensed for use in on-line control of aircraft, -air traffic, aircraft navigation or aircraft -communications; or in the design, construction, -operation or maintenance of any nuclear facility. -No right, title or interest in or to any -trademark, service mark, logo or trade name of Sun -or its licensors is granted under this Agreement. - -3. LIMITED WARRANTY. Sun warrants to you that for -a period of ninety (90) days from the date of -purchase, as evidenced by a copy of the receipt, -the media on which Software is furnished (if any) -will be free of defects in materials and -workmanship under normal use. Except for the -foregoing, Software is provided "AS IS". Your -exclusive remedy and Sun's entire liability under -this limited warranty will be at Sun's option to -replace Software media or refund the fee paid for -Software. - -4. DISCLAIMER OF WARRANTY. UNLESS SPECIFIED IN -THIS AGREEMENT, ALL EXPRESS OR IMPLIED CONDITIONS, -REPRESENTATIONS AND WARRANTIES, INCLUDING ANY -IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE OR NON-INFRINGEMENT ARE -DISCLAIMED, EXCEPT TO THE EXTENT THAT THESE -DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. - -5. LIMITATION OF LIABILITY. TO THE EXTENT NOT -PROHIBITED BY LAW, IN NO EVENT WILL SUN OR ITS -LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT -OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, -INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED -REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT -OF OR RELATED TO THE USE OF OR INABILITY TO USE -SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. In no event will -Sun's liability to you, whether in contract, tort -(including negligence), or otherwise, exceed the -amount paid by you for Software under this -Agreement. The foregoing limitations will apply -even if the above stated warranty fails of its -essential purpose. - -6. Termination. This Agreement is effective -until terminated. You may terminate this -Agreement at any time by destroying all copies of -Software. This Agreement will terminate -immediately without notice from Sun if you fail to -comply with any provision of this Agreement. Upon -Termination, you must destroy all copies of -Software. - -7. Export Regulations. All Software and -technical data delivered under this Agreement are -subject to US export control laws and may be -subject to export or import regulations in other -countries. You agree to comply strictly with all -such laws and regulations and acknowledge that you -have the responsibility to obtain such licenses to -export, re-export, or import as may be required -after delivery to you. - -8. U.S. Government Restricted Rights. If -Software is being acquired by or on behalf of the -U.S. Government or by a U.S. Government prime -contractor or subcontractor (at any tier), then -the Government's rights in Software and -accompanying documentation will be only as set -forth in this Agreement; this is in accordance -with 48 CFR 227.7201 through 227.7202-4 (for -Department of Defense (DOD) acquisitions) and with -48 CFR 2.101 and 12.212 (for non-DOD -acquisitions). - -9. Governing Law. Any action related to this -Agreement will be governed by California law and -controlling U.S. federal law. No choice of law -rules of any jurisdiction will apply. - -10. Severability. If any provision of this -Agreement is held to be unenforceable, this -Agreement will remain in effect with the provision -omitted, unless omission would frustrate the -intent of the parties, in which case this -Agreement will immediately terminate. - -11. Integration. This Agreement is the entire -agreement between you and Sun relating to its -subject matter. It supersedes all prior or -contemporaneous oral or written communications, -proposals, representations and warranties and -prevails over any conflicting or additional terms -of any quote, order, acknowledgment, or other -communication between the parties relating to its -subject matter during the term of this Agreement. -No modification of this Agreement will be binding, -unless in writing and signed by an authorized -representative of each party. - -For inquiries please contact: Sun Microsystems, -Inc. 901 San Antonio Road, Palo Alto, California -94303 - - -SUPPLEMENTAL LICENSE TERMS -JDBCTM 2.0 INTERFACE CLASSES - -These supplemental license terms ("Supplement") -add to or modify the terms of the Binary Code -License Agreement (collectively, the -"Agreement"). Capitalized terms not defined in -this Supplement shall have the same meanings -ascribed to them in the Agreement. These -Supplement terms shall supersede any inconsistent -or conflicting terms in the Agreement, or in any -license contained within the Software. - -1. License to Distribute. Sun grants you a -non-exclusive, non-transferable, limited license -to reproduce and distribute the binary and/or -source code form of the Software to third party -end users through multiple tiers of distribution, -provided that you: (i) distribute the Software -complete and unmodified in its original Java -Archive file, and only bundled as a part of your -program that incorporates the Software -("Program"); (ii) do not distribute additional -software intended to replace any component(s) of -the Software; (iii) agree to incorporate the most -current version of the Software that was available -from Sun no later than 180 days prior to each -production release of the Program; (iv) do not -remove or alter any proprietary legends or notices -contained in or on the Software; (v) only -distribute the Program pursuant to a license -agreement that protects Sun's interest consistent -with the terms contained in the Agreement; (vi) -may not create, or authorize your licensees to cr! -eate additional classes, interfaces, or -subpackages that are contained in the "java" -"javax" or "sun" packages or similar as specified -by Sun in any class file naming convention; and -(vii) agree to defend and indemnify Sun and its -licensors from and against any damages, costs, -liabilities, settlement amounts and/or expenses -(including attorneys' fees) incurred in connection -with any claim, lawsuit or action by any third -party that arises or results from the use or -distribution of any and all Programs. - -2. Trademarks and Logos. You acknowledge as -between you and Sun that Sun owns the Java -trademark and all Java-related trademarks, logos -and icons including the Coffee Cup and Duke ("Java -Marks") and agree to comply with the Java -Trademark Guidelines at -http://java.sun.com/trademarks.html. - - - - - - \ No newline at end of file diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/test/jta.jar b/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/test/jta.jar deleted file mode 100644 index e0822a96..00000000 Binary files a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/test/jta.jar and /dev/null differ diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/test/jta.licence.txt b/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/test/jta.licence.txt deleted file mode 100644 index 45328c10..00000000 --- a/tags/BEFORE_MAVEN_MIGRATION/build/lib/special/test/jta.licence.txt +++ /dev/null @@ -1,49 +0,0 @@ - -Sun Microsystems, Inc. -Binary Code License Agreement - -READ THE TERMS OF THIS AGREEMENT AND ANY PROVIDED SUPPLEMENTAL LICENSE TERMS (COLLECTIVELY "AGREEMENT") CAREFULLY BEFORE OPENING THE SOFTWARE MEDIA PACKAGE. BY OPENING THE SOFTWARE MEDIA PACKAGE, YOU AGREE TO THE TERMS OF THIS AGREEMENT. IF YOU ARE ACCESSING THE SOFTWARE ELECTRONICALLY, INDICATE YOUR ACCEPTANCE OF THESE TERMS BY SELECTING THE "ACCEPT" BUTTON AT THE END OF THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL THESE TERMS, PROMPTLY RETURN THE UNUSED SOFTWARE TO YOUR PLACE OF PURCHASE FOR A REFUND OR, IF THE SOFTWARE IS ACCESSED ELECTRONICALLY, SELECT THE "DECLINE" BUTTON AT THE END OF THIS AGREEMENT. - -1. LICENSE TO USE. Sun grants you a non-exclusive and non-transferable license for the internal use only of the accompanying software and documentation and any error corrections provided by Sun (collectively "Software"), by the number of users and the class of computer hardware for which the corresponding fee has been paid. - -2. RESTRICTIONS. Software is confidential and copyrighted. Title to Software and all associated intellectual property rights is retained by Sun and/or its licensors. Except as specifically authorized in any Supplemental License Terms, you may not make copies of Software, other than a single copy of Software for archival purposes. Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software. Licensee acknowledges that Licensed Software is not designed or intended for use in the design, construction, operation or maintenance of any nuclear facility. Sun Microsystems, Inc. disclaims any express or implied warranty of fitness for such uses. No right, title or interest in or to any trademark, service mark, logo or trade name of Sun or its licensors is granted under this Agreement. - -3. LIMITED WARRANTY. Sun warrants to you that for a period of ninety (90) days from the date of purchase, as evidenced by a copy of the receipt, the media on which Software is furnished (if any) will be free of defects in materials and workmanship under normal use. Except for the foregoing, Software is provided "AS IS". Your exclusive remedy and Sun's entire liability under this limited warranty will be at Sun's option to replace Software media or refund the fee paid for Software. - -4. DISCLAIMER OF WARRANTY. UNLESS SPECIFIED IN THIS AGREEMENT, ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. - -5. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. In no event will Sun's liability to you, whether in contract, tort (including negligence), or otherwise, exceed the amount paid by you for Software under this Agreement. The foregoing limitations will apply even if the above stated warranty fails of its essential purpose. - -6. Termination. This Agreement is effective until terminated. You may terminate this Agreement at any time by destroying all copies of Software. This Agreement will terminate immediately without notice from Sun if you fail to comply with any provision of this Agreement. Upon Termination, you must destroy all copies of Software. - -7. Export Regulations. All Software and technical data delivered under this Agreement are subject to US export control laws and may be subject to export or import regulations in other countries. You agree to comply strictly with all such laws and regulations and acknowledge that you have the responsibility to obtain such licenses to export, re-export, or import as may be required after delivery to you. - -8. U.S. Government Restricted Rights. If Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in Software and accompanying documentation will be only as set forth in this Agreement; this is in accordance with 48 CFR 227.7201 through 227.7202-4 (for Department of Defense (DOD) acquisitions) and with 48 CFR 2.101 and 12.212 (for non-DOD acquisitions). - -9. Governing Law. Any action related to this Agreement will be governed by California law and controlling U.S. federal law. No choice of law rules of any jurisdiction will apply. - -10. Severability. If any provision of this Agreement is held to be unenforceable, this Agreement will remain in effect with the provision omitted, unless omission would frustrate the intent of the parties, in which case this Agreement will immediately terminate. - -11. Integration. This Agreement is the entire agreement between you and Sun relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification of this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - -JAVATM INTERFACE CLASSES -JAVA TRANSACTION API (JTA), VERSION 1.0.1B, MAINTENANCE RELEASE -SUPPLEMENTAL LICENSE TERMS - -These supplemental license terms ("Supplemental Terms") add to or modify the terms of the Binary Code License Agreement (collectively, the "Agreement"). Capitalized terms not defined in these Supplemental Terms shall have the same meanings ascribed to them in the Agreement. These Supplemental Terms shall supersede any inconsistent or conflicting terms in the Agreement, or in any license contained within the Software. - -1. Software Internal Use and Development License Grant. Subject to the terms and conditions of this Agreement, including, but not limited to Section 3 (Java Technology Restrictions) of these Supplemental Terms, Sun grants you a non-exclusive, non-transferable, limited license to reproduce internally and use internally the binary form of the Software, complete and unmodified, for the sole purpose of designing, developing and testing your Java applets and applications ("Programs"). - -2. License to Distribute Software. In addition to the license granted in Section 1 (Software Internal Use and Development License Grant) of these Supplemental Terms, subject to the terms and conditions of this Agreement, including but not limited to Section 3 (Java Technology Restrictions), Sun grants you a non-exclusive, non-transferable, limited license to reproduce and distribute the Software in binary form only, provided that you (i) distribute the Software complete and unmodified and only bundled as part of your Programs, (ii) do not distribute additional software intended to replace any component(s) of the Software, (iii) do not remove or alter any proprietary legends or notices contained in the Software, (iv) only distribute the Software subject to a license agreement that protects Sun's interests consistent with the terms contained in this Agreement, and (v) agree to defend and indemnify Sun and its licensors from and against any damages, costs, liabilities, settlement amounts and/or expenses (including attorneys' fees) incurred in connection with any claim, lawsuit or action by any third party that arises or results from the use or distribution of any and all Programs and/or Software. - -3. Java Technology Restrictions. You may not modify the Java Platform Interface ("JPI", identified as classes contained within the "java" package or any subpackages of the "java" package), by creating additional classes within the JPI or otherwise causing the addition to or modification of the classes in the JPI. In the event that you create an additional class and associated API(s) which (i) extends the functionality of the Java Platform, and (ii) is exposed to third party software developers for the purpose of developing additional software which invokes such additional API, you must promptly publish broadly an accurate specification for such API for free use by all developers. You may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are in any way identified as "java", "javax", "sun" or similar convention as specified by Sun in any naming convention designation. - -4. Trademarks and Logos. You acknowledge and agree as between you and Sun that Sun owns the SUN, SOLARIS, JAVA, JINI, FORTE, and iPLANET trademarks and all SUN, SOLARIS, JAVA, JINI, FORTE, and iPLANET-related trademarks, service marks, logos and other brand designations ("Sun Marks"), and you agree to comply with the Sun Trademark and Logo Usage Requirements currently located at http://www.sun.com/policies/trademarks. Any use you make of the Sun Marks inures to Sun's benefit. - -5. Source Code. Software may contain source code that is provided solely for reference purposes pursuant to the terms of this Agreement. Source code may not be redistributed unless expressly provided for in this Agreement. - -6. Termination for Infringement. Either party may terminate this Agreement immediately should any Software become, or in either party's opinion be likely to become, the subject of a claim of infringement of any intellectual property right. - -For inquiries please contact: Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, California 95054. - - diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/style.xml b/tags/BEFORE_MAVEN_MIGRATION/build/style.xml deleted file mode 100644 index 58b854ea..00000000 --- a/tags/BEFORE_MAVEN_MIGRATION/build/style.xml +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/BEFORE_MAVEN_MIGRATION/build/trailer.xml b/tags/BEFORE_MAVEN_MIGRATION/build/trailer.xml deleted file mode 100644 index d210ff5c..00000000 --- a/tags/BEFORE_MAVEN_MIGRATION/build/trailer.xml +++ /dev/null @@ -1,568 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Result is available in ${module.pdfdoc.dir}" - - - - - - - - - Results are available in ${module.doccheck.dir}" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -

CheckStyle Audit

Designed for use with CheckStyle and Ant.
-


- - - -
- - - -
- - - - - -

-

- -


- - - - -
- - - - -

Files

- - - - - - - - - - - - - - -
NameErrors
-
- - - - -

File

- - - - - - - - - - - - - -
Error DescriptionLine
- Back to top -
- - - -

Summary

- - - - - - - - - - - - -
FilesErrors
-
- - - - a - b - - -
- - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/build/checkstyle-simple.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/build/checkstyle-simple.xsl deleted file mode 100644 index d98cbcbe..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/build/checkstyle-simple.xsl +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - Sun Coding Style Violations - - -

Coding Style Check Results

- - - - - - - - - - - - - - - - - - - - -
Summary
Total files checked
Files with errors
Total errors
Errors per file
-
-

The following are violations of the Sun Coding-Style Standards:

-

- - - - - - - - - - - -
File: - -
- - - - - - -
Line Number Error Message
-

- - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/build/style.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/build/style.xml deleted file mode 100644 index 58b854ea..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/build/style.xml +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/ABOUT.txt b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/ABOUT.txt deleted file mode 100644 index ba9a7ad3..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/ABOUT.txt +++ /dev/null @@ -1,2 +0,0 @@ -This directory contains a generic web crawler (basic directory) and several useful implementations build on top of this. - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/ABOUT.txt b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/ABOUT.txt deleted file mode 100644 index b61c613d..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/ABOUT.txt +++ /dev/null @@ -1,9 +0,0 @@ -This is a general library for implementing a web crawler. - -The crawler works by retrieving an HTML page and transforming the HTML -(content + presentation) into content using XSLT stylesheets. Using a convention -for links in the converted content, it becomes possible to build a generic interface on the retrieved pages for navigating through the content. - -A configuration file determines how a certain page must be retrieved and transformed. - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/deps.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/deps.xml deleted file mode 100644 index e1a94e91..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/deps.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/pom.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/pom.xml deleted file mode 100644 index efeb63a5..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/pom.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - org.wamblee - wamblee-crawler - 0.2-SNAPSHOT - - - 4.0.0 - org.wamblee - wamblee-crawler-basic - jar - wamblee.org Basic crawler framework - http://wamblee.org - - - org.wamblee - wamblee-support - - - - commons-httpclient - commons-httpclient - - - jtidy - jtidy - - - dom4j - dom4j - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/log4j.properties b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/log4j.properties deleted file mode 100644 index ab710b36..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/log4j.properties +++ /dev/null @@ -1,56 +0,0 @@ - -############################################################################################ -# Default configuration file for log4j. -# -# This properties file is used if no other configuration if log4j is done explicitly. -############################################################################################ - - -# Root logger reports everything and uses the console appender -log4j.rootLogger=ERROR, console - -# Log level for wamblee.org -log4j.logger.org.wamblee=DEBUG -log4j.logger.org.wamblee.usermgt.UserAdministrationImplTest=INFO -log4j.logger.org.wamblee.security.authorization=ERROR -log4j.logger.org.wamblee.cache=INFO - - -log4j.logger.org.springframework=ERROR -log4j.logger.net.sf.ehcache=WARN - -# Default log level for hibernate -log4j.logger.org.hibernate=ERROR -log4j.logger.org.hibernate3=ERROR - -log4j.appender.console=org.apache.log4j.ConsoleAppender -log4j.appender.console.layout=org.apache.log4j.PatternLayout -log4j.appender.console.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n - -###################################################################################### -# Hibernate SQL logging, switch the log level to DEBUG to see the output. -###################################################################################### - -log4j.logger.org.wamblee.test.SpringTestCase=ERROR, console -log4j.additivity.org.wamblee.test.SpringTestCase=false - -# Logging for queries. -log4j.logger.org.hibernate.SQL=ERROR, sql -log4j.additivity.org.hibernate.SQL=false - -# Logging for query parameters and return values. -log4j.logger.org.hibernate.type=ERROR, sqltype -log4j.additivity.org.hibernate.type=false - -# Appender for the queries -log4j.appender.sql=org.apache.log4j.ConsoleAppender -log4j.appender.sql.layout=org.apache.log4j.PatternLayout -log4j.appender.sql.layout.ConversionPattern=%n%-4r [%t] SQL: %x - %m%n - -# Appender to show the actual parameters and return values of the queries. -log4j.appender.sqltype=org.apache.log4j.ConsoleAppender -log4j.appender.sqltype.layout=org.apache.log4j.PatternLayout -log4j.appender.sqltype.layout.ConversionPattern=%-4r [%t] SQL: %x - %m%n - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/AbstractPageRequest.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/AbstractPageRequest.java deleted file mode 100644 index 2e598005..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/AbstractPageRequest.java +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.apache.commons.httpclient.Header; -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.HttpMethod; -import org.apache.commons.httpclient.HttpStatus; -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.httpclient.methods.GetMethod; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.xml.serialize.OutputFormat; -import org.apache.xml.serialize.XMLSerializer; -import org.w3c.dom.Document; -import org.w3c.tidy.Tidy; -import org.wamblee.xml.DomUtils; -import org.wamblee.xml.XslTransformer; - -/** - * General support claas for all kinds of requests. - */ -public abstract class AbstractPageRequest implements PageRequest { - - private static final Log LOG = LogFactory.getLog(AbstractPageRequest.class); - - private static final String REDIRECT_HEADER = "Location"; - - private int _maxTries; - - private int _maxDelay; - - private NameValuePair[] _params; - - private NameValuePair[] _headers; - - private String _xslt; - - private XslTransformer _transformer; - - /** - * Constructs the request. - * - * @param aMaxTries - * Maximum retries to perform. - * @param aMaxDelay - * Maximum delay before executing a request. - * @param aParams - * Request parameters to use. - * @param aHeaders - * Request headers to use. - * @param aXslt - * XSLT used to convert the response. - */ - protected AbstractPageRequest(int aMaxTries, int aMaxDelay, - NameValuePair[] aParams, NameValuePair[] aHeaders, String aXslt, XslTransformer aTransformer) { - if (aParams == null) { - throw new IllegalArgumentException("aParams is null"); - } - if (aHeaders == null) { - throw new IllegalArgumentException("aHeaders is null"); - } - if (aXslt == null) { - throw new IllegalArgumentException("aXslt is null"); - } - _maxTries = aMaxTries; - _maxDelay = aMaxDelay; - _params = aParams; - _headers = aHeaders; - _xslt = aXslt; - _transformer = aTransformer; - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.crawler.PageRequest#overrideXslt(java.lang.String) - */ - public void overrideXslt(String aXslt) { - _xslt = aXslt; - } - - /** - * Gets the parameters for the request. - * - * @param aParams Additional parameters to use, obtained from another page, most likely as - * hidden form fields. - * @return Request parameters. - */ - protected NameValuePair[] getParameters(NameValuePair[] aParams) { - List params = new ArrayList(); - params.addAll(Arrays.asList(_params)); - params.addAll(Arrays.asList(aParams)); - return params.toArray(new NameValuePair[0]); - } - - /** - * Gets the headers for the request. - * @return Request headers. - */ - protected NameValuePair[] getHeaders() { - return _headers; - } - - /** - * Executes the request with a random delay and with a maximum number of - * retries. - * - * @param aClient - * HTTP client to use. - * @param aMethod - * Method representing the request. - * @return XML document describing the response. - * @throws IOException - * In case of IO problems. - * @throws TransformerException - * In case transformation of the HTML to XML fails. - */ - protected Document executeMethod(HttpClient aClient, HttpMethod aMethod) - throws IOException, TransformerException { - - for (NameValuePair header: getHeaders()) { - aMethod.setRequestHeader(header.getName(), header.getValue()); - } - - int triesLeft = _maxTries; - while (triesLeft > 0) { - triesLeft--; - try { - return executeMethodWithoutRetries(aClient, aMethod); - } catch (TransformerException e) { - if (triesLeft == 0) { - throw e; - } - } - } - throw new RuntimeException("Code should never reach this point"); - } - - /** - * Executes the request without doing any retries in case XSLT - * transformation fails. - * - * @param aClient - * HTTP client to use. - * @param aMethod - * Method to execute. - * @return XML document containing the result. - * @throws IOException - * In case of IO problems. - * @throws TransformerException - * In case transformation of the result to XML fails. - */ - protected Document executeMethodWithoutRetries(HttpClient aClient, - HttpMethod aMethod) throws IOException, TransformerException { - try { - aMethod = executeWithRedirects(aClient, aMethod); - byte[] xhtmlData = getXhtml(aMethod); - - - Document transformed = _transformer.transform(xhtmlData, - _transformer.resolve(_xslt)); - ByteArrayOutputStream os = new ByteArrayOutputStream(); - Transformer transformer = TransformerFactory.newInstance() - .newTransformer(); - transformer.setParameter(OutputKeys.INDENT, "yes"); - transformer.setParameter(OutputKeys.METHOD, "xml"); - transformer.transform(new DOMSource(transformed), new StreamResult( - os)); - LOG.debug("Transformed result is \n" + os.toString()); - return transformed; - } catch (TransformerConfigurationException e) { - throw new TransformerException("Transformer configuration problem", e); - } finally { - // Release the connection. - aMethod.releaseConnection(); - } - } - - /** - * Gets the result of the HTTP method as an XHTML document. - * - * @param aMethod - * Method to invoke. - * @return XHTML as a byte array. - * @throws IOException - * In case of problems obtaining the XHTML. - */ - private byte[] getXhtml(HttpMethod aMethod) throws IOException { - // Transform the HTML into wellformed XML. - Tidy tidy = new Tidy(); - tidy.setXHTML(true); - tidy.setQuiet(true); - tidy.setShowWarnings(false); - - // We write the jtidy output to XML since the DOM tree it produces is - // not namespace aware and namespace awareness is required by XSLT. - // An alternative is to configure namespace awareness of the XML parser - // in a system wide way. - ByteArrayOutputStream os = new ByteArrayOutputStream(); - Document w3cDoc = tidy.parseDOM(aMethod.getResponseBodyAsStream(), os); - DomUtils.removeDuplicateAttributes(w3cDoc); - LOG.debug("Content of response is \n" + os.toString()); - - ByteArrayOutputStream xhtml = new ByteArrayOutputStream(); - XMLSerializer serializer = new XMLSerializer(xhtml, new OutputFormat()); - serializer.serialize(w3cDoc); - xhtml.flush(); - - return xhtml.toByteArray(); - } - - /** - * Sleeps for a random time but no more than the maximum delay. - * - */ - private void delay() { - try { - Thread.sleep((long) ((float) _maxDelay * Math.random())); - } catch (InterruptedException e) { - return; // to satisfy checkstyle - } - } - - /** - * Executes the request and follows redirects if needed. - * - * @param aClient - * HTTP client to use. - * @param aMethod - * Method to use. - * @return Final HTTP method used (differs from the parameter passed in in - * case of redirection). - * @throws IOException - * In case of network problems. - */ - private HttpMethod executeWithRedirects(HttpClient aClient, - HttpMethod aMethod) throws IOException { - delay(); - int statusCode = aClient.executeMethod(aMethod); - - switch (statusCode) { - case HttpStatus.SC_OK: { - return aMethod; - } - case HttpStatus.SC_MOVED_PERMANENTLY: - case HttpStatus.SC_MOVED_TEMPORARILY: - case HttpStatus.SC_SEE_OTHER: { - aMethod.releaseConnection(); - Header header = aMethod.getResponseHeader(REDIRECT_HEADER); - aMethod = new GetMethod(header.getValue()); - return executeWithRedirects(aClient, aMethod); // TODO protect - // against infinite - // recursion. - } - default: { - throw new IOException("Method failed: " - + aMethod.getStatusLine()); - } - } - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/Action.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/Action.java deleted file mode 100644 index cd9b4e2a..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/Action.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler; - -import org.dom4j.Element; - -/** - * An action defined on a page. - */ -public interface Action { - - /** - * The name of the action. - * @return Action name. - */ - String getName(); - - /** - * Executes the action. - * @return New page as a result of the action. - * @throws PageException In case of an error obtaining the page. - */ - Page execute() throws PageException; - - /** - * Gets a description of the action. THe element returned is the action element - * itself. - * @return Content as XML. - */ - Element getContent(); -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/Configuration.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/Configuration.java deleted file mode 100644 index 93372b83..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/Configuration.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler; - -/** - * Configuration which determines how a specific page must be retrieved and - * what transformation should be applied to it. - */ -public interface Configuration { - - /** - * Gets the page request based on the URL. - * @param aUrl Url of the page to retrieve. - * @return Page request. - */ - PageRequest getRequest(String aUrl); - - /** - * Gets the page request based on the type of the page instead - * of on the URL. - * @param aType Type of page. - * @return Page request. - */ - PageRequest getRequest(PageType aType); -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/Crawler.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/Crawler.java deleted file mode 100644 index 3615d9bc..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/Crawler.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler; - -import org.apache.commons.httpclient.NameValuePair; - - -/** - * The object that actually obtains pages based on URL. - */ -public interface Crawler { - - /** - * Gets the content for a specific page. - * @param aUrl Url of page. - * @param aParameters Paremeters to supply. - * @return Page to retrieve. - * @throws PageException In case of problems retrieving the page. - */ - Page getPage(String aUrl, NameValuePair[] aParameters) throws PageException; - - /** - * Gets the content for a specific page. - * @param aUrl Url of page. - * @param aParameters Parameters to supply. - * @param aType Type of page. - * @return Page. - * @throws PageException In case of problems retrieving the page. - */ - Page getPage(String aUrl, NameValuePair[] aParameters, PageType aType) throws PageException; -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/GetPageRequest.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/GetPageRequest.java deleted file mode 100644 index b737723d..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/GetPageRequest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler; - -import java.io.IOException; - -import javax.xml.transform.TransformerException; - -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.HttpMethod; -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.httpclient.methods.GetMethod; -import org.w3c.dom.Document; -import org.wamblee.xml.XslTransformer; - -/** - * Gets a page by issueing a get request. - */ -public class GetPageRequest extends AbstractPageRequest { - - /** - * Constructs the request. - * @param aMaxTries Maximum number of retries. - * @param aMaxDelay Maximum delay before executing the request. - * @param aParams Request parameters to use. - * @param aHeaders Request headers to use. - * @param aXslt XSLT to use. - */ - public GetPageRequest(int aMaxTries, int aMaxDelay, NameValuePair[] aParams, - NameValuePair[] aHeaders, String aXslt, XslTransformer aTransformer) { - super(aMaxTries, aMaxDelay, aParams, aHeaders, aXslt, aTransformer); - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.crawler.PageRequest#getPage(org.apache.commons.httpclient.HttpClient) - */ - public Document execute(String aUrl, NameValuePair[] aParams, HttpClient aClient) - throws PageException { - HttpMethod method = new GetMethod(aUrl); - NameValuePair[] params = getParameters(aParams); - if (params.length > 0) { - String oldQueryString = method.getQueryString(); - method.setQueryString(params); - String queryString = method.getQueryString(); - if (oldQueryString.length() > 0) { - queryString = queryString + '&' + oldQueryString; - method.setQueryString(queryString); - } - } - try { - return executeMethod(aClient, method); - } catch (TransformerException e) { - throw new PageException("Transformation problem for url " + aUrl, e); - } catch (IOException e) { - throw new PageException("Problem getting " + aUrl, e); - } - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/Page.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/Page.java deleted file mode 100644 index 18cf37a6..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/Page.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler; - -import org.dom4j.Element; - -/** - * Represents a retrieved page. - */ -public interface Page { - - /** - * Gets the content of the page as raw XML. - * @return Page content. - */ - Element getContent(); - - /** - * Obtains the links available on the page. - * @return Link names. - */ - Action[] getActions(); - - /** - * Gets the named action. Only works if the action name is unique. - * @param aName Name of the action. - * @return Action object. - */ - Action getAction(String aName); -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/PageException.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/PageException.java deleted file mode 100644 index 22a1e1bb..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/PageException.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler; - -/** - * Exception thrown when there is a problem in retrieving or transforming the - * page. - */ -public class PageException extends Exception { - - /** - * Constructs the exception. - * @param aMsg Message. - */ - public PageException(String aMsg) { - super(aMsg); - } - - /** - * Constructs the exception. - * @param aMsg Message. - * @param aCause Cause of the exception. - */ - public PageException(String aMsg, Throwable aCause) { - super(aMsg, aCause); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/PageRequest.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/PageRequest.java deleted file mode 100644 index be729069..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/PageRequest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler; - -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.NameValuePair; -import org.w3c.dom.Document; - -/** - * Represents a specific request to obtain and transform a page. - */ -public interface PageRequest { - - /** - * Gets a page as an XML document. - * @param aUrl Url of the page. - * @param aParams Additional parameters to supply. - * @param aClient Http client to use. - * @return Client. - * @throws PageException In case of problems retrieving the page. - */ - Document execute(String aUrl, NameValuePair[] aParams, HttpClient aClient) throws PageException; - - /** - * Overrides the Xslt to use. This is used when the transformed page specifies - * the page type explicitly for an action. - * @param aXslt Xslt to use. - */ - void overrideXslt(String aXslt); -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/PageType.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/PageType.java deleted file mode 100644 index 8320c0be..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/PageType.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler; - -/** - * Represents the type of a page determining how the HTML should be transformed into - * XML. - */ -public class PageType { - - /** - * Type string. - */ - private String _type; - - /** - * Constructs the type. - * @param aType Type. - */ - public PageType(String aType) { - _type = aType; - } - - /** - * Gets the type. - * @return Type. - */ - public String getType() { - return _type; - } - - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "PageType(type='" + _type + "')"; - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { - if (!(obj instanceof PageType)) { - return false; - } - return toString().equals(obj.toString()); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/PostPageRequest.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/PostPageRequest.java deleted file mode 100644 index 4a6a073c..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/PostPageRequest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler; - -import java.io.IOException; - -import javax.xml.transform.TransformerException; - -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.httpclient.methods.PostMethod; -import org.w3c.dom.Document; -import org.wamblee.xml.XslTransformer; - -/** - * Retrieving pages using the post method. - */ -public class PostPageRequest extends AbstractPageRequest { - - /** - * Constructs the request. - * @param aMaxTries Maximum number of retries. - * @param aMaxDelay Maximum delay before executing the request. - * @param aParams Request parameters to use. - * @param aHeaders Request headers to use. - * @param aXslt XSLT to use. - */ - public PostPageRequest(int aMaxTries, int aMaxDelay, - NameValuePair[] aParams, - NameValuePair[] aHeaders, - String aXslt, XslTransformer aTransformer) { - super(aMaxTries, aMaxDelay, aParams, aHeaders, aXslt, aTransformer); - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.crawler.PageRequest#execute(java.lang.String, - * org.apache.commons.httpclient.HttpClient) - */ - public Document execute(String aUrl, NameValuePair[] aParams, HttpClient aClient) - throws PageException { - PostMethod method = new PostMethod(aUrl); - method.addParameters(getParameters(aParams)); - try { - return executeMethod(aClient, method); - } catch (TransformerException e) { - throw new PageException("Transformation problem for url " + aUrl, e); - } catch (IOException e) { - throw new PageException("Problem getting page " + aUrl, e); - } - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/ActionImpl.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/ActionImpl.java deleted file mode 100644 index ab7068cb..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/ActionImpl.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.impl; - -import org.apache.commons.httpclient.NameValuePair; -import org.dom4j.Element; -import org.wamblee.crawler.Action; -import org.wamblee.crawler.Crawler; -import org.wamblee.crawler.Page; -import org.wamblee.crawler.PageException; -import org.wamblee.crawler.PageType; - -/** - * Action implementation. - */ -public class ActionImpl implements Action { - - private Crawler _crawler; - - private Element _content; - - private String _name; - - private String _reference; - - private PageType _type; - - private NameValuePair[] _parameters; - - /** - * Constructs the action. - * - * @param aCrawler - * Crawler to use. - * @param aContent - * Content of the action element in the page where the action - * occurs. - * @param aName - * Name of the action. - * @param aReference - * URL of the reference. - * @param aParameters Parameters to use for the action. - */ - public ActionImpl(Crawler aCrawler, Element aContent, String aName, - String aReference, NameValuePair[] aParameters) { - _crawler = aCrawler; - _content = aContent; - _name = aName; - _reference = aReference; - _type = null; - _parameters = aParameters; - } - - /** - * Constructs the action. - * - * @param aCrawler - * Crawler to use. - * @param aContent - * Content of the action element in the page where the action - * occurs. - * @param aName - * Name of the action. - * @param aReference - * URL of the reference. - * @param aType - * Type of the referenced page. - * @param aParameters Parameters to use. - */ - public ActionImpl(Crawler aCrawler, Element aContent, String aName, - String aReference, PageType aType, NameValuePair[] aParameters) { - _crawler = aCrawler; - _content = aContent; - _name = aName; - _reference = aReference; - _type = aType; - _parameters = aParameters; - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.crawler.Action#getName() - */ - public String getName() { - return _name; - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.crawler.Action#execute() - */ - public Page execute() throws PageException { - if (_type == null) { - return _crawler.getPage(_reference, _parameters); - } - return _crawler.getPage(_reference, _parameters, _type); - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.crawler.Action#getContent() - */ - public Element getContent() { - return _content; - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { - if ( !(obj instanceof ActionImpl )) { - return false; - } - ActionImpl action = (ActionImpl)obj; - return _reference.equals(action._reference) && - _type.equals(action._type); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/App.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/App.java deleted file mode 100644 index b0339f4b..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/App.java +++ /dev/null @@ -1,116 +0,0 @@ -package org.wamblee.crawler.impl; - -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; - -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.NameValuePair; -import org.dom4j.Element; -import org.wamblee.crawler.Action; -import org.wamblee.crawler.Configuration; -import org.wamblee.crawler.Crawler; -import org.wamblee.crawler.Page; -import org.wamblee.crawler.PageException; -import org.wamblee.xml.XslTransformer; - -/* - * Copyright 2005 the original author or authors. - * - * 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. - */ - -/** - * Test application which uses the crawler. - */ -public final class App { - - /** - * Disabled constructor. - * - */ - private App() { - // Empty - } - - /** - * Runs a test program. - * - * @param aArgs - * Arguments. First argument is the crawler config file name and - * second argument is the start url. - * @throws Exception - * In case of problems. - */ - public static void main(String[] aArgs) throws Exception { - String configFileName = aArgs[0]; - String starturl = aArgs[1]; - - ConfigurationParser parser = new ConfigurationParser(new XslTransformer()); - InputStream configFile = new FileInputStream(new File(configFileName)); - Configuration config = parser.parse(configFile); - - HttpClient client = new HttpClient(); - // client.getHostConfiguration().setProxy("localhost", 3128); - - Crawler crawler = new CrawlerImpl(client, config); - - System.out.println("Retrieving: " + starturl); - Page page = crawler.getPage(starturl, new NameValuePair[0]); - showPage(page); - page = page.getAction("channels-favorites").execute(); - recordInterestingShows(page); - showPage(page); - page = page.getAction("Nederland 1").execute(); - showPage(page); - page = page.getAction("right-now").execute(); - showPage(page); - page = page.getAction("Het elfde uur").execute(); - showPage(page); - } - - /** - * @param starturl - * @param crawler - */ - private static void showPage(Page aPage) { - Action[] links = aPage.getActions(); - for (Action link : links) { - System.out.println("Link found '" + link.getName() + "'"); - } - Element element = aPage.getContent(); - System.out.println("Retrieved content: " + element.asXML()); - } - - private static void recordInterestingShows(Page page) throws PageException { - Action[] channels = page.getActions(); - for (Action channel : channels) { - examineChannel(channel.getName(), channel.execute().getAction( - "right-now").execute()); - } - } - - private static void examineChannel(String aChannel, Page aPage) - throws PageException { - Action[] programs = aPage.getActions(); - for (Action program : programs) { - System.out.println(aChannel + " - " + program.getName()); - if (program.getName().toLowerCase().matches(".*babe.*")) { - Page programPage = program.execute(); - Action record = programPage.getAction("record"); - System.out.println("Recording possible: " + record != null); - } - } - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/ConfigItem.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/ConfigItem.java deleted file mode 100644 index 6349d2c1..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/ConfigItem.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.impl; - -import java.util.regex.Pattern; - -/** - * Configuration item for obtaining an object in case a pattern matches. - */ -class ConfigItem { - - private Pattern _pattern; - - private ValueType _value; - - /** - * Constructs the item. - * @param aPattern Pattern. - * @param aValue Value. - */ - protected ConfigItem(String aPattern, ValueType aValue) { - _pattern = Pattern.compile(aPattern); - _value = aValue; - } - - /** - * Returns the object in case the value matches. - * @param aValue Value to match. - * @return Object in case there is a match, null otherwise. - */ - protected ValueType match(String aValue) { - if (!_pattern.matcher(aValue).matches()) { - return null; - } - return _value; - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/ConfigurationImpl.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/ConfigurationImpl.java deleted file mode 100644 index 2b2680b5..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/ConfigurationImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.impl; - -import java.util.List; - -import org.wamblee.crawler.Configuration; -import org.wamblee.crawler.PageRequest; -import org.wamblee.crawler.PageType; - -/** - * Implementation of the configuration for the crawler. - */ -public class ConfigurationImpl implements Configuration { - - private List _urlConfig; - - private List _pageTypeConfig; - - /** - * Constructs the configuration. - * @param aUrlConfig List of URL configuration elements. - * @param aPageTypeConfig List of page type configuration elements. - */ - public ConfigurationImpl(List aUrlConfig, - List aPageTypeConfig) { - _urlConfig = aUrlConfig; - _pageTypeConfig = aPageTypeConfig; - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.crawler.Configuration#getRequest(java.lang.String) - */ - public PageRequest getRequest(String aUrl) { - - for (UrlConfig config : _urlConfig) { - PageRequest request = config.getRequest(aUrl); - if (request != null) { - return request; - } - } - throw new RuntimeException("No configuration matched the URL '" + aUrl - + "'"); - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.crawler.Configuration#getRequest(org.wamblee.crawler.PageType) - */ - public PageRequest getRequest(PageType aType) { - for (PageTypeConfig config : _pageTypeConfig) { - PageRequest request = config.getRequest(aType.getType()); - if (request != null) { - return request; - } - } - throw new RuntimeException("No configuration matched type '" + aType - + "'"); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/ConfigurationParser.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/ConfigurationParser.java deleted file mode 100644 index e88f4007..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/ConfigurationParser.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.impl; - -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.apache.commons.httpclient.NameValuePair; -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.Element; -import org.dom4j.io.SAXReader; -import org.wamblee.crawler.Configuration; -import org.wamblee.crawler.GetPageRequest; -import org.wamblee.crawler.PageRequest; -import org.wamblee.crawler.PostPageRequest; -import org.wamblee.xml.XslTransformer; - -/** - * Parsing of the configuration from an XML file. - */ -public class ConfigurationParser { - - private static final String ELEM_URL = "url"; - - private static final String ELEM_TYPE = "type"; - - private static final String ELEM_PATTERN = "pattern"; - - private static final String ELEM_METHOD = "method"; - - private static final String ELEM_XSLT = "xslt"; - - private static final String ELEM_PARAM = "param"; - - private static final String ELEM_HEADER = "header"; - - private static final String AT_NAME = "name"; - - private static final String AT_VALUE = "value"; - - private static final String METHOD_POST = "post"; - - private static final String METHOD_GET = "get"; - - private static final int MAX_TRIES = 3; - - private static final int MAX_DELAY = 10000; - - private XslTransformer _transformer; - - /** - * Constructs the configuration parser. - */ - public ConfigurationParser(XslTransformer aTransformer) { - _transformer = aTransformer; - } - - /** - * Parses the configuration from an input stream. - * @param aStream Input file. - * @return Configuration. - */ - public Configuration parse(InputStream aStream) { - try { - SAXReader reader = new SAXReader(); - Document document = reader.read(aStream); - - Element root = document.getRootElement(); - List urlConfigs = parseUrlConfigs(root); - List pageTypeConfigs = parsePageTypeConfigs(root); - return new ConfigurationImpl(urlConfigs, pageTypeConfigs); - } catch (DocumentException e) { - throw new RuntimeException("Problem parsing config file", e); - } - } - - /** - * Parses the URL-based configuration. - * @param aRoot Root of the configuration file document. - * @return List of URL-based configurations. - */ - private List parseUrlConfigs(Element aRoot) { - List configs = new ArrayList(); - for (Iterator i = aRoot.elementIterator(ELEM_URL); i.hasNext();) { - Element url = (Element) i.next(); - UrlConfig config = parseUrlConfig(url); - configs.add(config); - } - return configs; - } - - /** - * Parses the page type based configurations. - * @param aRoot Root of the configuration file document. - * @return LIst of page type based configurations. - */ - private List parsePageTypeConfigs(Element aRoot) { - List configs = new ArrayList(); - for (Iterator i = aRoot.elementIterator(ELEM_TYPE); i.hasNext();) { - Element url = (Element) i.next(); - PageTypeConfig config = parsePageTypeConfig(url); - configs.add(config); - } - return configs; - } - - /** - * Parses a URL-based configuration. - * @param aUrlElem Configuration element. - * @return Configuration. - */ - private UrlConfig parseUrlConfig(Element aUrlElem) { - String pattern = aUrlElem.elementText(ELEM_PATTERN); - PageRequest request = parseRequestConfig(aUrlElem); - return new UrlConfig(pattern, request); - } - - /** - * Parses a page type based configuration. - * @param aTypeElem Configuration element. - * @return Configuration. - */ - private PageTypeConfig parsePageTypeConfig(Element aTypeElem) { - String pattern = aTypeElem.elementText(ELEM_PATTERN); - PageRequest request = parseRequestConfig(aTypeElem); - return new PageTypeConfig(pattern, request); - } - - /** - * Parses a request configuration describing how to execute requests. - * @param aElem Configuration element. - * @return Page request. - */ - private PageRequest parseRequestConfig(Element aElem) { - String method = aElem.elementText(ELEM_METHOD); - String xslt = aElem.elementText(ELEM_XSLT); - List params = parseNameValuePairs(aElem, ELEM_PARAM); - List headers = parseNameValuePairs(aElem, ELEM_HEADER); - - NameValuePair[] paramsArray = params.toArray(new NameValuePair[0]); - NameValuePair[] headersArray = headers.toArray(new NameValuePair[0]); - PageRequest request; - if (METHOD_POST.equals(method)) { - request = new PostPageRequest(MAX_TRIES, MAX_DELAY, paramsArray, headersArray, - xslt, _transformer); - } else if (METHOD_GET.equals(method) || method == null) { - request = new GetPageRequest(MAX_TRIES, MAX_DELAY, paramsArray, headersArray, - xslt, _transformer); - } else { - throw new RuntimeException("Unknown request method '" + method - + "'. Only " + METHOD_GET + " and " + METHOD_POST - + " are supported"); - } - return request; - } - - /** - * @param aElem - * @return - */ - private List parseNameValuePairs(Element aElem, String aElemName) { - List headers = new ArrayList(); - for (Iterator i = aElem.elementIterator(aElemName); i.hasNext();) { - Element paramElem = (Element) i.next(); - NameValuePair header = parseParameter(paramElem); - headers.add(header); - } - return headers; - } - - /** - * Parses a parameter definition. - * @param aParam Parameter. - * @return Name value pair describing a parameter. - */ - private NameValuePair parseParameter(Element aParam) { - String name = aParam.attributeValue(AT_NAME); - String value = aParam.attributeValue(AT_VALUE); - return new NameValuePair(name, value); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/CrawlerImpl.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/CrawlerImpl.java deleted file mode 100644 index 098ed91f..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/CrawlerImpl.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.impl; - -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.dom4j.Element; -import org.dom4j.io.DOMReader; -import org.w3c.dom.Document; -import org.wamblee.crawler.Configuration; -import org.wamblee.crawler.Crawler; -import org.wamblee.crawler.Page; -import org.wamblee.crawler.PageException; -import org.wamblee.crawler.PageRequest; -import org.wamblee.crawler.PageType; - -/** - * Crawler implementation. - */ -public class CrawlerImpl implements Crawler { - - private static final Log LOG = LogFactory.getLog(CrawlerImpl.class); - - private HttpClient _client; - - private Configuration _config; - - /** - * Constructs the crawler. - * - * @param aClient - * Http client to use. - * @param aConfig - * Configuration. - */ - public CrawlerImpl(HttpClient aClient, Configuration aConfig) { - _client = aClient; - _config = aConfig; - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.crawler.Crawler#getPage(java.lang.String) - */ - public Page getPage(String aUrl, NameValuePair[] aParams) throws PageException { - LOG.debug("Getting page: url = '" + aUrl + "'"); - PageRequest request = _config.getRequest(aUrl); - Document content = request.execute(aUrl, aParams, _client); - return transformToDom4jDoc(aUrl, content); - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.crawler.Crawler#getPage(java.lang.String, - * java.lang.String) - */ - public Page getPage(String aUrl, NameValuePair[] aParams, PageType aType) throws PageException { - LOG.debug("Getting page: url = '" + aUrl + "', type = '" + aType + "'"); - PageRequest request = _config.getRequest(aType); - Document content = request.execute(aUrl, aParams, _client); - return transformToDom4jDoc(aUrl, content); - } - - /** - * Converts a w3c DOM document to a page object. - * @param content DOM document. - * @return - */ - private Page transformToDom4jDoc(String aUrl, Document content) { - DOMReader reader = new DOMReader(); - org.dom4j.Document dom4jDoc = reader.read(content); - Element root = dom4jDoc.getRootElement(); - dom4jDoc.remove(root); - - return new PageImpl(aUrl, this, replaceReferencesWithContent(root)); - } - - /** - * Perform crawling. Find references in the retrieved content and replace - * them by the content they refer to by retrieving the appropriate pages as - * well. - * - * @param content - * Content which must be made complete. - * @return Fully processed content. - */ - private Element replaceReferencesWithContent(Element content) { - return content; // TODO implement. - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/PageImpl.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/PageImpl.java deleted file mode 100644 index 1265bc29..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/PageImpl.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.impl; - -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.httpclient.NameValuePair; -import org.dom4j.DocumentHelper; -import org.dom4j.Element; -import org.dom4j.XPath; -import org.wamblee.crawler.Action; -import org.wamblee.crawler.Crawler; -import org.wamblee.crawler.Page; -import org.wamblee.crawler.PageType; - -/** - * Page implementation. - */ -public class PageImpl implements Page { - - private static final String ELEM_NAME = "action"; - - private static final String ATT_NAME = "name"; - - private static final String ATT_HREF = "reference"; - - private static final String ATT_TYPE = "type"; - - private static final String ELEM_PARAM = "param"; - - private static final String ATT_VALUE = "value"; - - private String _href; - - private Crawler _crawler; - - private Element _content; - - private Action[] _actions; - - /** - * Constructs a page. - * - * @param aContent - */ - public PageImpl(String aHref, Crawler aCrawler, Element aContent) { - _href = aHref; - _crawler = aCrawler; - _content = aContent; - _actions = computeActions(); - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.crawler.Page#getLinkNames() - */ - private Action[] computeActions() { - XPath xpath = DocumentHelper.createXPath(ELEM_NAME); - List results = (List) xpath.selectNodes(_content); - List names = new ArrayList(); - for (Element elem : results) { - String name = elem.attributeValue(ATT_NAME); - String href = elem.attributeValue(ATT_HREF); - String type = elem.attributeValue(ATT_TYPE); - NameValuePair[] params = getMandatoryParameters(elem); - href = absolutizeHref(_href, href); - if (type == null) { - names.add(new ActionImpl(_crawler, elem, name, href, params)); - } else { - names.add(new ActionImpl(_crawler, elem, name, href, - new PageType(type), params)); - } - } - return names.toArray(new Action[0]); - } - - /** - * Absolutize the hyperlink - * @param aPageHref Absolute page reference. - * @param aLinkHref Possibly relative link reference. - * @return Absolute hyperlink. - */ - private String absolutizeHref(String aPageHref, String aLinkHref) { - - try { - URL pageUrl = new URL(aPageHref); - URL newUrl = new URL(pageUrl, aLinkHref); - return newUrl.toString(); // TODO need to use URL instead of String throughout the code. - } catch (MalformedURLException e) { - throw new RuntimeException("Malformed URL", e); - } - } - - private NameValuePair[] getMandatoryParameters(Element aAction) { - List result = new ArrayList(); - for (Element param: (List)aAction.elements(ELEM_PARAM)) { - String name = param.attributeValue(ATT_NAME); - String value = param.attributeValue(ATT_VALUE); - result.add(new NameValuePair(name, value)); - } - return result.toArray(new NameValuePair[0]); - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.crawler.Page#getContent() - */ - public Element getContent() { - return _content; - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.crawler.Page#getActions() - */ - public Action[] getActions() { - return _actions; - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.crawler.Page#getAction(java.lang.String) - */ - public Action getAction(String aName) { - List results = new ArrayList(); - for (Action action : _actions) { - if (action.getName().equals(aName)) { - results.add(action); - } - } - if (results.size() == 0) { - return null; - } - if (results.size() > 1) { - throw new RuntimeException("Duplicate action '" + aName + "'"); - } - return results.get(0); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/PageTypeConfig.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/PageTypeConfig.java deleted file mode 100644 index b7fa5a3c..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/PageTypeConfig.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.impl; - -import org.wamblee.crawler.PageRequest; - -/** - * Page type configuration. - */ -public class PageTypeConfig extends ConfigItem { - - /** - * Constructs the configuration. - * @param aPattern Page type pattern. - * @param aRequest Page request. - */ - public PageTypeConfig(String aPattern, PageRequest aRequest) { - super(aPattern, aRequest); - } - - /** - * Returns the request in case the type matches. - * @param aType Page type. - * @return Request if the type matches, null otherwise. - */ - public PageRequest getRequest(String aType) { - return match(aType); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/UrlConfig.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/UrlConfig.java deleted file mode 100644 index 1a2b06ab..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/UrlConfig.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.impl; - -import org.wamblee.crawler.PageRequest; - -/** - * Represents the configuration for specific URLs. - */ -public class UrlConfig extends ConfigItem { - /** - * Constructs the information for how to perform a request for a specific - * URL. - * - * @param aPattern - * Pattern that the URL must match. - * @param aRequest - * Request that must be executed to retrieve the URL. - */ - public UrlConfig(String aPattern, PageRequest aRequest) { - super(aPattern, aRequest); - } - - /** - * Gets the request to execute. - * - * @return Request, or null if the URL does not match. - */ - public PageRequest getRequest(String aUrl) { - return match(aUrl); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/package.html b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/package.html deleted file mode 100644 index 2ba3c928..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/impl/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - wamblee.org - - - -This package provides the implementations of the web crawler interfaces. - - - -@since - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/package.html b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/package.html deleted file mode 100644 index 6423f15b..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/basic/src/main/java/org/wamblee/crawler/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - wamblee.org - - - -This package provides the basic interfaces for a web crawler. - - - -@since - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/ABOUT.txt b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/ABOUT.txt deleted file mode 100644 index 4f23b392..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/ABOUT.txt +++ /dev/null @@ -1,5 +0,0 @@ -This is a crawler for the KiSS Electronic Program Guide that can be used for instance with the KiSS DP558 hard-disc recorder. It uses the basic crawler for its implementation. - -Based on preferences for recording programs, the crawler automatically records programs that are scheduled to run on the same day. This saves a lot of manual work in recording programs. - -The final idea is to define ones own interests in television programs and have the crawler record them automatically or send notifications of possibly interesting programs. Whether programs should be recorded can be determined by several criteria such as program title, channel, time of day, and keywords in the description. diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/kiss/config.xml.example b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/kiss/config.xml.example deleted file mode 100644 index 37ae6667..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/kiss/config.xml.example +++ /dev/null @@ -1,57 +0,0 @@ - - - - - login - post - login-graphic.xsl - - - - - -

- - - - channels-favorites - channels-favorites-graphic.xsl - - - - channel-overview - channel-overview.xsl - - - - right-now - channel-right-now-graphic.xsl - - - - tomorrow - channel-right-now-graphic.xsl - - - - program-info - program-info-mobile.xsl - - - - recorded - recorded.xsl - - - - http://epg.kml.kiss-technology.com/login.php - mainpage.xsl - - - - .* - get - identity.xsl - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/kiss/org.wamblee.crawler.properties b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/kiss/org.wamblee.crawler.properties deleted file mode 100644 index f26a4329..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/kiss/org.wamblee.crawler.properties +++ /dev/null @@ -1,17 +0,0 @@ - - -############################################################################ -# Mail server configuration -############################################################################ -org.wamblee.crawler.smtp.host=falcon -org.wamblee.crawler.smtp.port=25 -org.wamblee.crawler.smtp.username= -org.wamblee.crawler.smtp.password= - -############################################################################ -# Mail notification configuration -############################################################################ -org.wamblee.crawler.notification.from=kiss@wamblee.org -org.wamblee.crawler.notification.to=erik@bladibla.org -org.wamblee.crawler.notification.subject=Recording summary for tomorrow - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/kiss/programs.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/kiss/programs.xml deleted file mode 100644 index 538ce257..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/kiss/programs.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - horror - notify - horror - - - - horror - notify - the.*ghost.*whisperer - - - - films - notify - film - horror|actie|thriller - - - - wetenschap - notify - wetenschap - - - - science fiction - notify - sf-|(sci-fi)|(science fiction) - - - - invasion - - - - notify - documentaires - (zembla)|(uur.*wolf)|(andere tijden)|(de.*leugen.*regeert) - - - - 20 - star.*gate - - - - six.*feet.*under - - - - 11 - battlestar - - - - 10 - star trek - - - - 9 - ((dr)|(doct.*)).*who - - - - 8 - little britain - - - - 9 - the.*x.*files - - - - 9 - buffy.*vampire.*slayer - - - - notify - de.*wereld.*draait.*door - - - - 8 - jag - - - - 5 - shouf shouf - - - - red dwarf - - - - top gear - - - - bedreigde.*paradijzen - - - - wie is de baas - - - - wetenschap - notify - brainiac - - - - auto - wegmisbruikers|(blik.*op.*weg) - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/kiss/run.bat b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/kiss/run.bat deleted file mode 100755 index a992c423..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/kiss/run.bat +++ /dev/null @@ -1,11 +0,0 @@ - - - -cd ../conf - - -set CP=.;../lib/wamblee-support-0.2-SNAPSHOT.jar;../lib/wamblee-crawler-kiss-0.2-SNAPSHOT.jar - - -java -classpath %CP% org.wamblee.crawler.kiss.main.KissCrawlerBootstrapper ../lib config.xml programs.xml - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/kiss/run.sh b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/kiss/run.sh deleted file mode 100755 index e788ed42..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/kiss/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/ksh - -cd $( dirname $0 )/../conf - -CP=.:../lib/wamblee-support-0.2-SNAPSHOT.jar:../lib/wamblee-crawler-kiss-0.2-SNAPSHOT.jar - -set -x -java -classpath $CP org.wamblee.crawler.kiss.main.KissCrawlerBootstrapper \ - ../lib config.xml programs.xml - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channel-overview.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channel-overview.xml deleted file mode 100644 index 528737ce..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channel-overview.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - -KiSS - Nederland 1 * - - -d> -

 Nederland 1 *

- -

What's on?

- - -Right now - 12:11, Monday 13th March
- -Evening - Starting 20:00
- -Afternoon - Starting 16:00
- -Noon - Starting 12:00
- -Morning - Starting 6:00
- -Tomorrow  Wednesday  Thursday  Friday  Saturday  Sunday 
-
- [  -Back ] [ Home ] [ Logout ]
- 12:11, Monday 13th March - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channel-right-now-graphic.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channel-right-now-graphic.xml deleted file mode 100644 index 4e71ee99..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channel-right-now-graphic.xml +++ /dev/null @@ -1,749 +0,0 @@ - - - - - - - - - - -KiSS - Nederland 1 - - -
-
- - - -

- -
- - - - - - -
-

 Nederland 1

- -

-
- - - - - - - -
-What's On Now? -Favorite Shows -Movies -Sports -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Wednesday 23rd Page -1/1   -Next 
-
 23:15 - -00:00 
-
- - - -Karels keuze
-
 00:00 - -00:30 
-
- - - -Nederland helpt
-
 00:30 - -00:55 
-
- - - -Man beet hond
-
 00:55 - -06:45 
-
- - - -Nacht-tv: Netwerk herhaling
-
 06:45 - -07:00 
-
- - - -Nederland in beweging
-
 07:00 - -09:00 
-
- - - -NOS-Journaal
-
 09:00 - -09:10 
-
- - - -NOS-Journaal
-
 09:10 - -09:30 
-
- - - -Nederland in beweging
-
 09:30 - -09:55 
-
- - - -That's the question
-
 09:55 - -11:00 
-
- - - -TROS Zomeravondcafé
-
 11:00 - -11:30 
-
- - - -Andere tijden
-
 11:30 - -12:00 
-
- - - -De vloer op
-
 12:00 - -12:10 
-
- - - -NOS-Journaal
-
 12:10 - -12:40 
-
- - - -Man beet hond
-
 12:40 - -13:00 
-
- - - -Lingo
-
 13:00 - -13:10 
-
- - - -NOS-Journaal
-
 13:10 - -13:15 
-
- - - -NOS-Sportjournaal
-
 13:15 - -14:05 
-
- - - -Warzone: Congo
-
 14:05 - -14:35 
-
- - - -Wroeten
-
 14:35 - -15:14 
-
- - - -Spraakmakende zaken
-
 15:14 - -15:16 
-
- - - -Wilde Ganzen
-
 15:16 - -16:00 
-
- - - -Opsporing verzocht
-
 16:00 - -16:05 
-
- - - -NOS-Journaal
-
 16:05 - -17:00 
-
- - - -Denkend aan Showroom
-
 17:00 - -17:05 
-
- - - -NOS-Journaal
-
 17:05 - -17:35 
-
- - - -God voor...
-
 17:35 - -18:30 
-
- - - -Himalaya with Michael Palin
-
 18:30 - -19:00 
-
- - - -That's the question
-
 19:00 - -19:30 
-
- - - -Man beet hond
-
 19:30 - -20:00 
-
- - - -De confrontatie
-
 20:00 - -20:30 
-
- - - -NOS-Journaal
-
 20:30 - -21:00 
-
- - - -Netwerk
-
 21:00 - -22:35 
-
- - - -KRO Detectives: Judge John Deed
-
 22:35 - -23:05 
-
- - - -Dochters + moeders
-
 23:05 - -23:32 
-
- - - -De God van Nederland
-
 23:32 - -23:40 
-
- - - -Wilde Ganzen
-
 23:40 - -00:05 
-
- - - -Man beet hond
-
 00:05 - -06:45 
-
- - - -Nacht-tv: Netwerk herhaling
- -
- - - - - - - - - - - - - - - - - - -
   Currently -showing
-
  Favorite
-
  Future showing
-
  Scheduled -recording
-
  Movie
-
 
- - - - - -

- -BackHomeLogout  22:38, Wednesday 23rd August
- - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channel-right-now-mobile-output.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channel-right-now-mobile-output.xml deleted file mode 100644 index eca47bcd..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channel-right-now-mobile-output.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channel-right-now-mobile.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channel-right-now-mobile.xml deleted file mode 100644 index 969c7ade..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channel-right-now-mobile.xml +++ /dev/null @@ -1,411 +0,0 @@ - - - - - - - - -KiSS - Nederland 1 - - - - -

Nederland 1

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Monday 21st Page -1/1   -Next 
-
 22:30 - -00:15 
-
-KRO Filmtheater: Hollywood ending
-
 00:15 - -06:45 
-
-NOS-Tekst tv
-
 06:45 - -07:00 
-
-Nederland in beweging
-
 07:00 - -09:00 
-
-NOS-Journaal
-
 09:00 - -09:10 
-
-NOS-Journaal
-
 09:10 - -09:30 
-
-Nederland in beweging
-
 09:30 - -10:00 
-
-That's the question
-
 10:00 - -11:00 
-
-TROS Muziekfeest in de ArenA 2004
-
 11:00 - -11:25 
-
-Hello Goodbye
-
 11:25 - -12:00 
-
-Wat Zou JIJ Doen?
-
 12:00 - -12:10 
-
-NOS-Journaal
-
 12:10 - -12:40 
-
-Taxi
-
 12:40 - -13:00 
-
-Lingo
-
 13:00 - -13:10 
-
-NOS-Journaal
-
 13:10 - -13:20 
-
-NOS-Sportjournaal
-
 13:20 - -14:05 
-
-Warzone: Zuid-Afrika
-
 14:05 - -15:20 
-
-Tien maal Mozart
-
 15:20 - -16:00 
-
-Kruispunt
-
 16:00 - -16:05 
-
-NOS-Journaal
-
 16:05 - -17:00 
-
-Oppassen & wegwezen
-
 17:00 - -17:05 
-
-NOS-Journaal
-
 17:05 - -17:30 
-
-Schepper & co
-
 17:30 - -18:30 
-
-Himalaya with Michael Palin
-
 18:30 - -18:55 
-
-That's the question
-
 18:55 - -19:30 
-
-Man beet hond
-
 19:30 - -20:00 
-
-Ingang Oost
-
 20:00 - -20:30 
-
-NOS-Journaal
-
 20:30 - -21:00 
-
-Netwerk
-
 21:00 - -22:00 
-
-Memories Tour d'Amour
-
 22:00 - -22:30 
-
-Hello Goodbye
-
 22:30 - -23:00 
-
-Villa historica
-
 23:00 - -23:45 
-
  -NCRV Dokument: Het recht om te sterven
-
 23:45 - -00:40 
-
  -Apocalyps Vietnam
-
 00:40 - -01:10 
-
  -Man beet hond
-
 01:10 - -06:45 
-
  -Nacht-tv: Netwerk herhaling
 Monday 21st Page -1/1   -Next 
- - - - - -

-
- -Back Home Logout 23:13, Monday 21st August
- - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channel-right-now-output.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channel-right-now-output.xml deleted file mode 100644 index 6597e6ad..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channel-right-now-output.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -BackHomeLogout diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channel-right-now.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channel-right-now.xml deleted file mode 100644 index e6fd80d3..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channel-right-now.xml +++ /dev/null @@ -1,166 +0,0 @@ - - - - - -KiSS - Nederland 1 - - - -

Nederland 1

- -Monday 13th
-Page 1/1   ->> 
-
- 23:55 - 00:40 - -Wintertijd
-00:50 - 06:15 - -Nacht-tv: Netwerk herhalingen
-06:45 - 06:59 - -Nederland in beweging
-06:59 - 09:00 - -Goedemorgen Nederland
- 07:00 - 07:10 - -NOS-Journaal
-07:10 - 07:30 - -Goedemorgen Nederland
-07:30 - 07:40 - -NOS-Journaal
-07:40 - 08:00 - -Goedemorgen Nederland
-08:00 - 08:10 - -NOS-Journaal
-08:10 - 08:30 - -Goedemorgen Nederland
- 08:30 - 08:40 - -NOS-Journaal
-08:40 - 09:00 - -Goedemorgen Nederland
-09:00 - 09:10 - -NOS-Journaal
-09:10 - 09:30 - -Nederland in beweging
-09:30 - 09:55 - -That's the question
-09:55 - 10:50 - -Schoondochter gezocht
- 10:50 - 11:15 - -Blauw bloed
-11:15 - 12:00 - -Appeltje voor de dorst
-12:00 - 12:10 - -NOS-Journaal
-12:10 - 12:35 - -Man bijt hond
-12:35 - 12:57 - -Voor alle fans: Drukwerk
-12:57 - 13:00 - -Trekking Lingo
- 13:00 - 13:10 - -NOS-Journaal
-13:10 - 13:20 - -NOS-Sportjournaal
-13:20 - 14:15 - -Buitenhof
-14:15 - 14:55 - -Hoge bomen in de misdaad
-14:55 - 15:20 - -AVRO Dierenpark
-15:20 - 16:00 - -Kruispunt
- 16:00 - 16:05 - -NOS-Journaal
-16:05 - 16:30 - -Helden van nu: Vrijwilligers in de gezondheidszorg
-16:30 - 17:00 - -Leven met verlies
-17:00 - 17:10 - -NOS-Journaal
-17:10 - 17:35 - -Schepper & co
- 17:35 - 18:30 - -MAX & Catherine
-18:30 - 18:55 - -That's the question
-18:55 - 19:25 - -Man bijt hond
-19:25 - 20:00 - -Ingang Oost
-20:00 - 20:30 - -NOS-Journaal
- 20:30 - 21:05 - -Netwerk
-21:05 - 22:05 - -Memories
-22:05 - 22:55 - -Keyzer & De Boer Advocaten
-22:55 - 23:50 - -NCRV Dokument: Een familie van vaders
-23:50 - 00:20 - -Blauw bloed
- 00:20 - 00:50 - -Man bijt hond
-00:50 - 06:45 - -Nacht-tv: Netwerk herhaling
-
-
-
- [  -Back ] [ Home ] [ Logout ]
- 12:04, Monday 13th March - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channels-favorites-graphic-output.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channels-favorites-graphic-output.xml deleted file mode 100644 index 4c26a2b7..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channels-favorites-graphic-output.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channels-favorites-graphic.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channels-favorites-graphic.xml deleted file mode 100644 index c07fa370..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channels-favorites-graphic.xml +++ /dev/null @@ -1,416 +0,0 @@ - - - - - - - - KiSS - Favorite Channels - - -

- - - - -

- -
- - - - - - -
-

Favorite Channels

- -

-

- - - - - - - -
- - - What's On Now? - Favorite Shows - Movies - Sports - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-   - Prev -   Page 1/2   - Next -  
-
-
 NL1 - - Nederland 1 - - - -   - -   - -
 NL2 - - Nederland 2 - - - -   - -   - -
 NL3 - - Nederland 3 - - - -   - -   - -
 NET5 - - Net5 - - - -   - -   - -
 RTL4 - - RTL4 - - - -   - -   - -
 SBS6 - - SBS6 - - - -   - -   - -
 RTL5 - - RTL5 - - - -   - -   - -
 DISC - - Discovery Channel - - - -   - -   - -
 RTL7 - - RTL7 - - - -   - -   - -
 VERO - - Veronica - - - -   - -   - -
 MTV - - MTV - - - -   - -   - -
 BOX - - TheBox - - - -   - -   - -
 ESPO - - Eurosport - - - -   - -   - -
 CNN - - CNN - - - -   - -   - -
 BBC1 - - BBC1 - - - -   - -   - -
- - - - - -

-
- - Back - - Home - - Logout -   17:15, Wednesday 23rd August
- - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channels-favorites-output.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channels-favorites-output.xml deleted file mode 100644 index cc8195d3..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channels-favorites-output.xml +++ /dev/null @@ -1,34 +0,0 @@ - - << >> << >>BackHomeLogout diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channels-favorites.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channels-favorites.xml deleted file mode 100644 index 4021c21f..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channels-favorites.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - -KiSS - Favorite Channels - - - -

Favorite Channels

- -  -<<  Page 1/1   ->> 
-
- NL1 - -Nederland 1
-NL2 - -Nederland 2
-NL3 - -Nederland 3
- NET5 - -Net5
-RTL4 - -RTL4
-SBS6 - -SBS6
-RTL5 - -RTL5
- DISC - -Discovery Channel
-RTL7 - -RTL7
-VERO - -Veronica
-ESPO - -Eurosport
- MTV - -MTV
-BOX - -TheBox
-CNN - -CNN
-BBC1 - -BBC1
- BBC2 - -BBC2
-
-<<  Page 1/1   ->> 
-
- [ Back ] [ Home ] [ Logout ]
- 12:08, Monday 13th March - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channels-whats-on.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channels-whats-on.xml deleted file mode 100644 index 1869c114..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/channels-whats-on.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - -KiSS - Favorite Channels - - - -

 Favorite Channels

- -

What's on?

- - -Right now - 11:43, Monday 13th March
- -Evening - Starting 20:00
- -Afternoon - Starting 16:00
- -Noon - Starting 12:00
- -Morning - Starting 6:00
- -Tomorrow  Wednesday  Thursday  Friday  Saturday  Sunday 
-
- [ Back ] [ Home ] [ Logout ]
- 11:43, Monday 13th March - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/login-graphic.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/login-graphic.xml deleted file mode 100644 index 1f983f66..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/login-graphic.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - KiSS - TV Guide - - -
-
-
- - - - - - -

-
-
-
- - - - - -
Welcome sf2np2ln9no1 / - web@brakkee.org   [  - Change email ]
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
  Favorite - Channels  
-
  -
  Favorite - Shows  
-
  -
  Movies  
-
- - - - - -
- - - -
- - - - -
  Sports  
-
- - - -
- - - - - -
-


- Recordings to be sent to the player: 0 [  - View ] [ Manual - recording ]
-
-

- -
-
- Time change: In order to see the correct time in the KiSS TV - Guide, do the following: - -
    -
  1. On your player press SETUP and set your timezone to reflect - summer time, for example for mainland Western Europe this should - be: "CEST (GMT+2)", UK and Ireland: "BST (GMT+1)", Finland and - Eastern Europe: "EEST (GMT+3)".
  2. - -
  3. Access the TV Guide at least once via your player.
  4. - -
  5. The KiSS TV Guide will now display the correct time for your tv - programs both via your player and through the web.
  6. -
- -
-
-
- KML favorites: 0 [  - View ]
-
-
- logout  16:29, - Wednesday 23rd August
- - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/login-mobile-output.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/login-mobile-output.xml deleted file mode 100644 index df82fb22..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/login-mobile-output.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/login-mobile.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/login-mobile.xml deleted file mode 100644 index 46ab328a..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/login-mobile.xml +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - - -KiSS - TV Guide - - - - -

TV Guide

- - - - - -
Welcome sf2np2ln9no1 / -web@brakkee.org   [  -Change email ]
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
  Favorite -Channels  
-
- -
- -
- -
-
  Favorite -Shows  
-
- -
- -
- -
- -
-
  Movies  
-
- -
-
  Sports  
-
- -
- - - - - -
-


-Recordings to be sent to the player: 0 [  -View ] [ Manual -recording ]
-
-  22:19, Monday -21st August

-
- - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/login-output.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/login-output.xml deleted file mode 100644 index e9a01521..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/login-output.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/login.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/login.xml deleted file mode 100644 index 26370797..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/login.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - KiSS - TV Guide - - - - -

TV Guide

- - Welcome sf2np2ln9no1 / - erik@brakkee.org   [  - Change email ]
-
- - -

Favorite Channels

- - - What's on now?
- - What's on?
- - Favorites - -

Favorite Shows

- - - What's on?
- - Search a show
- - Favorites
- - Add a favorite - -

Movies

- - - What's on? - -

Sports

- - - What's on? - -


- Recordings to be sent to the player: 0
- [  - View ] [ Manual - recording ]
-
- [ Logout ]
- 21:09, Sunday 12th March

- - - \ No newline at end of file diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/mainpage.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/mainpage.xml deleted file mode 100644 index 49ae9c8d..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/mainpage.xml +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - - - KiSS Technology Online Portal - - - -
-

 Web Services:
-
-

-
- - - - - - - -
-

   Login

-
- -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-

-
Player ID 
- or Email: 
*
-
Password:  - **
-

-
 

-
Save - PlayerID ***
-

-
 

-
Desktop mode
- Mobile - mode
- Text mode

-

-

-

-

-
-
- -
[ Text version ]
- -
- - - - - - - - - - - - - - - - -
* You can find your - player id by pressing Menu on your remote control > Online - KML Services > Reveal PlayerID.
- You can use your email address instead of player id only when you - have already logged in once and associated your email address with - your player id.
** You must have - already configured your password by going to the EPG start page - > Configure > Set Password
*** Saving player - id / email requires cookies
- -
- - \ No newline at end of file diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/program-info-mobile-output.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/program-info-mobile-output.xml deleted file mode 100644 index a5e5d796..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/program-info-mobile-output.xml +++ /dev/null @@ -1,5 +0,0 @@ -IMDbWhen is it on?  KRO Filmtheater: Hollywood ending    Film  Komisch filmdrama De regisseur Val Waxman was ooit erg succesvol. - Tegenwoordig regisseert hij echter alleen nog maar tv-commercials. Eindelijk krijgt hij weer - eens een aanbod om een grote film te maken. Het lot wil echter dat Val op dat moment tijdelijk - blind wordt, als resultaat van zijn paranoia. Hij probeert samen met enkele vrienden op de set - zijn handicap te verbergen. diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/program-info-mobile.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/program-info-mobile.xml deleted file mode 100644 index 262c57ed..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/program-info-mobile.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - KiSS - Program info - - - - -

 Program info

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -  KRO Filmtheater: Hollywood ending  - - - - -  Nederland 1   - Prev -    - Next -   - -
- - - - - - -
- Sunday 20th August - - -   Film  
- - - - - - -
- 22:30 - 00:15 - - (01:45 hours) - -
    
-
- - - - - - -
Komisch filmdrama De regisseur Val Waxman was ooit erg succesvol. - Tegenwoordig regisseert hij echter alleen nog maar tv-commercials. Eindelijk krijgt hij weer - eens een aanbod om een grote film te maken. Het lot wil echter dat Val op dat moment tijdelijk - blind wordt, als resultaat van zijn paranoia. Hij probeert samen met enkele vrienden op de set - zijn handicap te verbergen.
- - - - - - -
IMDb ]  [ When is it on? ] 
- - - - - -

-
- - Back -   - Home -   - Logout -  23:50, Monday 21st August
- - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/program-info-output.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/program-info-output.xml deleted file mode 100644 index f7366652..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/program-info-output.xml +++ /dev/null @@ -1,12 +0,0 @@ - -<< ->>IMDb - - When is it on? -BackHomeLogoutKruispunt - Religieus - - Achtergronden uit kerk en samenleving. - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/program-info.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/program-info.xml deleted file mode 100644 index be5cc438..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/program-info.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - -KiSS - Program info - - - -

 Program info

- -

Kruispunt

- -

Nederland 1   -<<   ->>

- -Monday 13th March
- Religieus
- 15:20 - 16:00 (40 minutes)
-
- Achtergronden uit kerk en samenleving.
-
-
-[ IMDb ]  [ Record ]  [ When is it on? ]
-
- [  -Back ] [ Home ] [ Logout ]
- 12:16, Monday 13th March - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/record-alreadyrecorded.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/record-alreadyrecorded.xml deleted file mode 100644 index d1b5e575..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/record-alreadyrecorded.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - -KiSS - TV Guide - - -

Error

- -Show is already in the recording queue!
-
-[ -Back ]
- - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/record-conflict.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/record-conflict.xml deleted file mode 100644 index 78af4d02..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/record-conflict.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - -KiSS - TV Guide - - -

Error

- -This show conflicts with a recording that is already in the -recording queue!
-
-[ -Back ]
- - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/record-ok.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/record-ok.xml deleted file mode 100644 index 674c9e32..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/record-ok.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - -KiSS - TV Guide - Recordings - - - -

TV Guide - Recordings

- -

Recordings already sent to player

- -SBS6 - Lois & Clark: The new adventures of Superman - - 08:00 - 09:00  - - Fri 17th  - -Delete
- VERO - Brainiac - - 19:40 - 20:10  - - Fri 17th  - -Delete - Error (Recording conflict)
-VERO - Brainiac -  19:40 - 20:10  --  Fri 17th  - -Delete - Error (Recording conflict)
- DISC - Brainiac - - 22:00 - 23:00  - - Fri 17th  - -Delete - Error (Recording conflict)
-DISC - Brainiac -  22:00 - 23:00  --  Fri 17th  - -Delete - Error (Recording conflict)
- NL3 - The Kumars at no. 42 - - 15:55 - 16:26  - - Sat 18th  - -Delete
-VERO - Stargate SG-1 - - 18:10 - 18:55  - - Sat 18th  - -Delete
- VERO - Battlestar Galactica - - 19:35 - 20:25  - - Sat 18th  - -Delete
-
- -

Recordings to be sent to player

- -NL1 - Samen tegen Kanker - - 20:30 - 22:25  - - Sat 18th  - -Delete
-
-
- [  -Back ] [ Home ] [ Logout ]
- 19:46, Friday 17th March - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/report.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/report.xml deleted file mode 100644 index afb27fc8..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/conf/xml/report.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - Hello world! - and another message - - - - - Wintertijd - Some description MINSK - De presidentsverkiezingen in Wit-Rusland zijn zondag met ruime cijfers gewonnen door zittend president Aleksandr Loekasjenko. Dat bleek zondag uit exitpolls uitgevoerd in opdracht van het totalitaire regime. Het staatshoofd zou kunnen rekenen op ruim 82 procent van de stemmen. Volgens de eerste gedeeltelijke uitslagen zou Loekasjenko zelfs kunnen rekenen op bijna 89 procent. - Documentaire - Nederland 1 - - 23:25 - 00:10 - - - - - - - Brainiac - Humor - science - Discovery Channel - - 23:30 - 00:15 - - - - - Andere tijden - Documentaire - docu - Nederland 1 - - 23:30 - 00:15 - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/deps.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/deps.xml deleted file mode 100644 index 6e9095ab..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/deps.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/README.txt b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/README.txt deleted file mode 100644 index 9bc261b2..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/README.txt +++ /dev/null @@ -1,7 +0,0 @@ -This is the base documentation directory. - -skinconf.xml # This file customizes Forrest for your project. In it, you - # tell forrest the project name, logo, copyright info, etc - -sitemap.xmap # Optional. This sitemap is consulted before all core sitemaps. - # See http://forrest.apache.org/docs/project-sitemap.html diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/classes/CatalogManager.properties b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/classes/CatalogManager.properties deleted file mode 100644 index af7b5ab3..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/classes/CatalogManager.properties +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2002-2005 The Apache Software Foundation or its licensors, -# as applicable. -# -# 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. - -#======================================================================= -# CatalogManager.properties for Catalog Entity Resolver. -# -# This is the default properties file for your project. -# This facilitates local configuration of application-specific catalogs. -# If you have defined any local catalogs, then they will be loaded -# before Forrest's core catalogs. -# -# See the Apache Forrest documentation: -# http://forrest.apache.org/docs/your-project.html -# http://forrest.apache.org/docs/validation.html - -# verbosity: -# The level of messages for status/debug (messages go to standard output). -# The setting here is for your own local catalogs. -# The verbosity of Forrest's core catalogs is controlled via -# main/webapp/WEB-INF/cocoon.xconf -# -# The following messages are provided ... -# 0 = none -# 1 = ? (... not sure yet) -# 2 = 1+, Loading catalog, Resolved public, Resolved system -# 3 = 2+, Catalog does not exist, resolvePublic, resolveSystem -# 10 = 3+, List all catalog entries when loading a catalog -# (Cocoon also logs the "Resolved public" messages.) -verbosity=1 - -# catalogs ... list of additional catalogs to load -# (Note that Apache Forrest will automatically load its own default catalog -# from main/webapp/resources/schema/catalog.xcat) -# Use either full pathnames or relative pathnames. -# pathname separator is always semi-colon (;) regardless of operating system -# directory separator is always slash (/) regardless of operating system -catalogs=../resources/schema/catalog.xcat - -# relative-catalogs -# If false, relative catalog URIs are made absolute with respect to the -# base URI of the CatalogManager.properties file. This setting only -# applies to catalog URIs obtained from the catalogs property in the -# CatalogManager.properties file -# Example: relative-catalogs=[yes|no] -relative-catalogs=no diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/test1.html b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/test1.html deleted file mode 100644 index 1a174a8b..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/test1.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - Raw un-processed HTML page (test1) - - -

raw un-processed HTML page (test1)

-

- This raw HTML page is linked to from xdocs/samples/static.xml - and from xdocs/samples/linking.xml -

-

All linked-to pages (for example: - <a href="test2.html">) are - also available. -

-
-

- [return to Index]
- [return to Linking demonstration] -

- - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/details.html b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/details.html deleted file mode 100644 index d977ac74..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/details.html +++ /dev/null @@ -1,194 +0,0 @@ - - - -KiSS crawler report - - -

KiSS crawler report

-

Successfully recorded programs

- - - - - - - - - - - - - - - -
18:00 - 18:55: Stargate SG-1 (Veronica/Serie/soap)
-
-Sf-serie SG-1 krijgt een aanbod van een buitenaardse wereld voor een wondermedicijn. -
-
19:25 - 20:25: Stargate SG-1 (Veronica/Serie/soap)
-
-Sf-serie Tijdens een vlucht van de nieuwe X-303, codenaam Prometheus, wordt het schip overmand door NID-agenten. -
-
-
-

-

-

Conflicts with other recorded programs

- - - - - - - - -
20:00 - 20:45: Doctor Who (BBC1/Drama)
-
-Madame de Pompadour finds the court at Versailles under attack from sinister clockwork killers. Her only hope of salvation lies with the man who has haunted her dreams since childhood - a mysterious stranger known only as the Doctor. -
-
-
-

-

-

Possibly interesting programs

-

-
- -
-

-

Category: documentaires

-

- - - - - - - - - - - - - - -
11:50 - 12:30: Zembla (Nederland 3/Documentaire)
-
- - -
-
13:10 - 13:35: Andere tijden (Nederland 3/Film)
-
-Geschiedenisrubriek met reportages over (bijna) vergeten gebeurtenissen uit de twintigste eeuw. De redactie gaat op zoek naar ooggetuigen en betrokkenen en naar historische filmbeelden om aan de hand daarvan de verhalen van vroeger opnieuw te vertellen. -
-
-
-

-

Category: films

-

- - - - - - - - - - - - - - - - - - - - -
13:10 - 13:35: Andere tijden (Nederland 3/Film)
- -
-Geschiedenisrubriek met reportages over (bijna) vergeten gebeurtenissen uit de twintigste eeuw. De redactie gaat op zoek naar ooggetuigen en betrokkenen en naar historische filmbeelden om aan de hand daarvan de verhalen van vroeger opnieuw te vertellen. -
-
22:00 - 06:00: Face off (Veronica/Film)
-
-Actiefilm Een FBI-agent wil kost wat het kost een psychotische terrorist pakken, die verantwoordelijk is voor de moord op zijn zoontje. In de strijd om de terrorist in te rekenen raakt deze in een coma. Hij heeft de agent echter nog net kunnen vertellen dat ergens in Los Angeles een bom verborgen ligt. Om op het spoor van deze bom te komen vragen regeringsfunctionarissen of de FBI-agent zich uit wil geven als de moordenaar van zijn zoon. Door middel van een medische ingreep worden de gezichten van beiden verwisseld met alle gevolgen van dien. - -
-
23:25 - 01:00: Gossip (Net5/Film)
-
-Thriller Drie studenten doen voor een schoolproject een proef over roddelen. Ze verspreiden een gerucht om te zien hoe lang het duurt voordat deze zich heeft verspreid. Maar wat begint als een onschuldige roddel, escaleert tot een groot misverstand en leidt zelfs tot een arrestatie wegens verkrachting. Het drietal beseft dat hun vooropgezete plan desastreuze gevolgen heeft en dat hun experiment niet meer te stoppen is. -
-
-
-

-

Category: science fiction

-

- - - - - - - - -
08:00 - 09:00: Lois & Clark: The new adventures of Superman (SBS6/Serie/soap)
-
-Sf-serie Lex Luthor ontwikkelt verschillende tests om de kracht van Superman te doorgronden. -
-
-
-

-

Category: wetenschap

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
11:30 - 12:25: Triumph of life (RTL4/Documentaire)
-
-Serie documentaires over de evolutie. Al het leven op aarde is ooit ontstaan uit een organisme dat zich door omstandigheden heeft kunnen ontwikkelen tot een wezen dat zich wist voort te planten. Dit ingewikkelde proces voltrok zich miljarden jaren geleden en is sindsdien gaande. Het werd in de negentiende eeuw voor het eerst in kaart gebracht door de Britse bioloog Charles Darwin. Sindsdien wordt de evolutietheorie wetenschappelijk onderzocht en betwijfeld, maar het feit is dat het leven zich in diverse vormen blijft ontwikkelen. -
-
00:00 - 00:30: Sex sense: Bi way (Discovery Channel/Wetenschap)
-
-Documentaireserie Onderzoek naar de wetenschap van seksualiteit, gecombineerd met levendige beelden en ondeugende humor. -
-
00:30 - 01:00: Sex sense: Baring it all (Discovery Channel/Wetenschap)
-
- -Documentaireserie Onderzoek naar de wetenschap van seksualiteit, gecombineerd met levendige beelden en ondeugende humor. -
-
00:40 - 02:10: Top secret! (SBS6/Comedy)
-
-Filmkomedie De knappe jaren '50 rock-'n-roll-ster Nick Rivers is in Oost-Duitsland om op te treden. Daar wordt hij verliefd op de dochter van een ontvoerde wetenschapper en komt hij in contact met het Franse verzet. - -
-
-
-

- - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/hello.pdf b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/hello.pdf deleted file mode 100644 index 5ca4f313..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/hello.pdf +++ /dev/null @@ -1,70 +0,0 @@ -%PDF-1.3 -%ª«¬­ -4 0 obj -<< /Type /Info -/Producer (FOP 0.20.4) >> -endobj -5 0 obj -<< /Length 203 /Filter [ /ASCII85Decode /FlateDecode ] - >> -stream -Gar'!]afWZ&;9q-MRA)RFnblL2&]tQSZsjOOT[ck2SQkp(bfQ[R7ZPq=U24c0dqq_i?B[A.0s\)5f5 -endstream -endobj -6 0 obj -<< /Type /Page -/Parent 1 0 R -/MediaBox [ 0 0 595 842 ] -/Resources 3 0 R -/Contents 5 0 R ->> -endobj -7 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F1 -/BaseFont /Helvetica -/Encoding /WinAnsiEncoding >> -endobj -8 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F5 -/BaseFont /Times-Roman -/Encoding /WinAnsiEncoding >> -endobj -1 0 obj -<< /Type /Pages -/Count 1 -/Kids [6 0 R ] >> -endobj -2 0 obj -<< /Type /Catalog -/Pages 1 0 R - >> -endobj -3 0 obj -<< -/Font << /F1 7 0 R /F5 8 0 R >> -/ProcSet [ /PDF /ImageC /Text ] >> -endobj -xref -0 9 -0000000000 65535 f -0000000687 00000 n -0000000745 00000 n -0000000795 00000 n -0000000015 00000 n -0000000071 00000 n -0000000365 00000 n -0000000471 00000 n -0000000578 00000 n -trailer -<< -/Size 9 -/Root 2 0 R -/Info 4 0 R ->> -startxref -883 -%%EOF diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/images/group-logo.gif b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/images/group-logo.gif deleted file mode 100644 index f017f324..00000000 Binary files a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/images/group-logo.gif and /dev/null differ diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/images/group.svg b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/images/group.svg deleted file mode 100644 index 584cedb8..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/images/group.svg +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - Anteater logo - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/images/icon.png b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/images/icon.png deleted file mode 100644 index 3be8bbbe..00000000 Binary files a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/images/icon.png and /dev/null differ diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/images/project-logo.gif b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/images/project-logo.gif deleted file mode 100644 index a60277a4..00000000 Binary files a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/images/project-logo.gif and /dev/null differ diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/images/project.svg b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/images/project.svg deleted file mode 100644 index 01abcdbb..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/images/project.svg +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - Anteater logo - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/images/usemap.gif b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/images/usemap.gif deleted file mode 100644 index c10732ca..00000000 Binary files a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/images/usemap.gif and /dev/null differ diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/index.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/index.xml deleted file mode 100644 index 54dd1d23..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/index.xml +++ /dev/null @@ -1,313 +0,0 @@ - - - - -
- Automatic Recording for KiSS Hard Disk Recorders -
- - KiSS makes regular updates to their site that sometimes require adaptations to the - crawler. If it stops working, check out the most recent version here. -
- Changelog -
- 21 November 2006 -
    -
  • Corrected the config.xml again.
  • -
  • Corrected errors in the documentation for the web application. It starts running at 19:00 - and not at 5:00.
  • -
-
-
- 19 November 2006 -
    -
  • Corrected the config.xml file to deal with changes in the login procedure.
  • -
-
-
- 17 November 2006 -
    -
  • Corrected the packed distributions. The standalone distribution had an error in the - scripts and was missing libraries
  • - -
-
-
- 7 September 2006 -
    -
  • KiSS modified the login procedure. It is now working again.
  • -
  • Generalized the startup scripts. They should now be insensitive to the specific - libraries used.
  • -
-
-
- 31 August 2006 -
    -
  • Added windows bat file for running the crawler under windows. Very add-hoc, will be - generalized.
  • -
-
-
- 24 August 2006 -
    -
  • The crawler now uses desktop login for crawling. Also, it is much more efficient since - it no longer needs to crawl the individual programs. This is because the channel page - includes descriptions of programs in javascript popups which can be used by the crawler. - The result is a significant reduction of the load on the KiSS EPG site. Also, the delay - between requests has been increased to further reduce load on the KiSS EPG site.
  • -
  • The crawler now crawls programs for tomorrow instead of for today.
  • -
  • The web based crawler is configured to run only between 7pm and 12pm. It used to run - at 5am.
  • -
-
- -
- 13-20 August 2006 -

There were several changes to the login procedure, requiring modifications to the - crawler.

-
    -
  • The crawler now uses the 'Referer' header field correctly at login.
  • -
  • KiSS now uses hidden form fields in their login process which are now also handled - correctly by the crawler.
  • -
-
-
-
- Overview - -

In 2005, KiSS introduced the ability to schedule recordings - on KiSS hard disk recorder (such as the DP-558) through a web site on the internet. When a - new recording is scheduled through the web site, the KiSS recorder finds out about this new - recording by polling a server on the internet. This is a really cool feature since it - basically allows programming the recorder when away from home.

-

After using this feature for some time, I started noticing regular patterns. Often you - are looking for the same programs and for certain types of programs. So, wouldn't it be nice - to have a program do this work for you and automatically record programs and notify you of - possibly interesting ones?

-

This is where the KiSS crawler comes in. This is a simple crawler which logs on to the - KiSS electronic programme guide web site and gets programme information from there. Then - based on that it automatically records programs for you or sends notifications about - interesting ones.

-

In its current version, the crawler can be used in two ways:

-
    -
  • standalone program: - A standalone program run from the command-line or as a scheduled task.
  • -
  • web application: A web application running on a java application - server. With this type of use, the crawler also features an automatic retry mechanism in - case of failures, as well as a simple web interface.
  • -
-
- -
- Downloading - -

At this moment, no formal releases have been made and only the latest version can be - downloaded.

-

The easy way to start is the standalone program - binary version or using the web application.

-

The latest source can be obtained from subversion with the URL - https://wamblee.org/svn/public/utils. The subversion repository allows - read-only access to anyone.

-

The application was developed and tested on SuSE linux 10.1 with - JBoss 4.0.4 application - server. An application server or servlet container is only required for the - web application. The crawler requires at least a Java Virtual Machine - 1.5 or greater to run.

-
- -
- Configuring the crawler - -

The crawler comes with three configuration files:

-
    -
  • crawler.xml: basic crawler configuration tailored to the KiSS electronic - programme guide.
  • -
  • programs.xml: containing a description of which programs must be recorded - and which programs are interesting.
  • -
  • org.wamblee.crawler.properties: Containing a configuration
  • -
-

For the standalone program, all configuration files are in the conf - directory. For the web application, the properties files is located in the - WEB-INF/classes directory of the web application, and - crawler.xml and programs.xml are located outside of the web - application at a location configured in the properties file.

- - -
- Crawler configuration <code>crawler.xml</code> - -

First of all, copy the config.xml.example file to config.xml. - After that, edit the first entry of that file and replace user and - passwd with your personal user id and password for the KiSS Electronic - Programme Guide.

-
- -
- Program configuration -

Interesting TV shows are described using program elements. Each - program element contains one or more match elements that - describe a condition that the interesting program must match.

-

Matching can be done on the following properties of a program:

- - - - - - - - - - - - - - - - - - - - - -
Field nameDescription
nameProgram name
descriptionProgram description
channelChannel name
keywordsKeywords/classification of the program.
-

The field to match is specified using the field attribute of the - match element. If no field name is specified then the program name is - matched. Matching is done by converting the field value to lowercase and then doing a - perl-like regular expression match of the provided value. As a result, the content of the - match element should be specified in lower case otherwise the pattern will never match. If - multiple match elements are specified for a given program - element, then all matches must apply for a program to be interesting.

-

Example patterns:

- - - - - - - - - - - - - -
PatternExamples of matching field values
the.*x.*files"The X files", "The X-Files: the making of"
star trek"Star Trek Voyager", "Star Trek: The next generation"
- -

It is possible that different programs cannot be recorded since they overlap. To deal - with such conflicts, it is possible to specify a priority using the priority - element. Higher values of the priority value mean a higher priority. If two programs have - the same priority, then it is (more or less) unspecified which of the two will be - recorded, but it will at least record one program. If no priority is specified, then the - priority is 1 (one).

- -

Since it is not always desirable to try to record every program that matches the - criteria, it is also possible to generate notifications for interesting programs only - without recording them. This is done by specifying the action alement with - the content notify. By default, the action is - record. To make the mail reports more readable it is possible to also assign - a category to a program for grouping interesting programs. This can be done using the - category element. Note that if the action is - notify. then the priority element is not used.

- -
- -
- Notification configuration -

Edit the configuration file org.wamblee.crawler.properties. The properties - file is self-explanatory.

-
-
- - - - -
- Installing and running the crawler - -
- Standalone application -

In the binary distribution, execute the run script for your operating - system (run.bat for windows, and run.sh for unix).

-
- -
- Web application -

After deploying the web application, navigate to the application in your browser (e.g. - http://localhost:8080/wamblee-crawler-kissweb). The screen should show an - overview of the last time it ran (if it ran before) as well as a button to run the crawler - immediately. Also, the result of the last run can be viewed. The crawler will run - automatically starting after 19:00, - and will retry at 1 hour intervals in case - of failure to retrieve programme information. -

- -

- Since the crawler checks the status at - 1 hour intervals it can run for the first time anytime between 19:00 and 20:00. This is done - on purpose since it means that crawlers run by different people will not all start running - simultaneously and is thus more friendly to the KiSS servers.

-
- -
- Source distribution -

With the source code, build everything with maven2 as follows:

- - mvn -Dmaven.test.skip=true install - cd crawler - mvn package assembly:assembly - -

- After this, locate the - binary distribution in the target subdirectory of the crawler - directory. Then - proceed as for the binary distribution.

- -
- -
- General usage -

When the crawler runs, it retrieves the programs for tomorrow. -

- If you deploy the web application today, it will run automatically on the next (!) - day. This even holds if you deploy the application before the normal scheduled time. -
- - -
- -
- Examples - -

The best example is in the distribution itself. It is my personal - programs.xml file.

-
- -
- Contributing - -

You are always welcome to contribute. If you find a problem just tell me about it and if - you have ideas am I always interested to hear about them.

-

If you are a programmer and have a fix for a bug, just send me a patch and if you are - fanatic enough and have ideas, I can also give you write access to the repository.

-
- - - -
diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/main.html b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/main.html deleted file mode 100644 index e700881a..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/main.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - KiSS Crawler overview page - - - - - - - - - - - - -

KiSS Crawler Overview

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Currently running: - - false -
- Last executed at: - - Sat May 06 05:18:54 CEST 2006 -
- Last result: - - true -
- Last message: - - -
- Last report: - - details -
- -
- - -
- - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/ascii-art.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/ascii-art.xml deleted file mode 100644 index 4f984d07..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/ascii-art.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - -
- Ascii Art sample -
- -
- Sample Ascii Art -

To create a .png image like the one below with ASCII art, just save - the text file with the .aart extension and then link from any page - as an image (<image src="asci-art-file.png"/>).

-

cocoon pyramid of management-(logic-content-style)

-

Here is the source file that has created the above image.

- - - +-------------------+ - | Management | - +-+-------+-------+-+ - | | | - | | | - +-------+ +----+----+ +-------+ - | logic +--+ content +--+ style | - +-------+ +---------+ +-------+ - - -

An ascii art pad recognized following ascii characters:

-
    -
  • '-' horizontal SVG line
  • -
  • '|' vertical SVG line
  • -
  • '+' corner
  • -
  • \ oblique line
  • -
  • String starting with letter, digit, or '_' is converted to a SVG text.
  • -
-
- -
- Copyright 2002-2004 The Apache Software Foundation or its licensors, as applicable. -
-
diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/cocoon-pyramid.aart b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/cocoon-pyramid.aart deleted file mode 100644 index 090a0e0e..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/cocoon-pyramid.aart +++ /dev/null @@ -1,11 +0,0 @@ - - +-------------------+ - | Management | - +-+-------+-------+-+ - | | | - | | | - +-------+ +----+----+ +-------+ - | logic +--+ content +--+ style | - +-------+ +---------+ +-------+ - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/custom.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/custom.xml deleted file mode 100644 index dff5776e..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/custom.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - -Hello XML Custom World!! - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/customSchema.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/customSchema.xml deleted file mode 100644 index 81c7c1a9..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/customSchema.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - -
- Custom Schema -
- -

Forrest comes with a set of schemas for common documents, however, if you have existing documents - that use a different schema you will want to tell Forrest how to work with them. The best way of doing - this is to build a plugin - so that you can easily reuse the functionality on different projects. Plugins also allow you to share - this new functionality with other users, and to benefit from their contributions to your work.

- -

If you don't want to build a plugin you can make Forrest process them within your project sitemap - (but this won't really save you any work since the process is almost the same). This sample site has - a demonstration of using a custom DTD. If you request <a href="custom.html"> - you can see the results. Take a look at the project sitemap.xmap to see how it is done.

- - Adding custom schemas with a plugin has the added benefit of being able to add the schema - definition to the catalog file rather than having to reference it directly from within the XML - document. - -
diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/document-v13.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/document-v13.xml deleted file mode 100644 index 9ca3809f..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/document-v13.xml +++ /dev/null @@ -1,381 +0,0 @@ - - - - -
- The Apache Forrest xdocs document-v1.3 DTD - The content of this document doesn't make any sense at all. - This is a demonstration document using all possible elements in - the current Apache Forrest xdocs document-v13.dtd - -
- - - This is a demonstration document using all possible elements in the - current Apache Forrest xdocs document-v13.dtd - (See the DTD changes section at the bottom.) - -
- Sample Content -

Hint: See the xml source to see how the various - elements are used and see the - - DTD reference documentation. -

-
- Block and inline elements -

This is a simple paragraph. Most documents contain a fair amount of - paragraphs. Paragraphs are called <p>.

-

With the <p xml:space="preserve"> attribute, you can declare - that whitespace should be preserved, without implying it is in any other - way special.

-

- This next paragraph has a class attribute of 'quote'. CSS can - be used to present this <p class='quote'> in - a different style than the other paragraphs. The handling of - this quoted paragraph is defined in the <extra-css> - element in the skinconf.xml. -

-

- Anyway, like I was sayin', shrimp is the fruit of the sea. You can - barbecue it, boil it, broil it, bake it, sautee it. Dey's uh, - shrimp-kabobs, shrimp creole, shrimp gumbo. Pan fried, deep fried, - stir-fried. There's pineapple shrimp, lemon shrimp, coconut shrimp, - pepper shrimp, shrimp soup, shrimp stew, shrimp salad, shrimp and - potatoes, shrimp burger, shrimp sandwich. That- that's about it. -

-

A number of in-line elements are available in the DTD, we will show them - inside an unordered list (<ul>):

-
    -
  • Here is a simple list item (<li>).
  • -
  • Have you seen the use of the <code> element in the - previous item?
  • -
  • Also, we have <sub> and <sup> - elements to show content above or below the text - baseline.
  • -
  • There is a facility to emphasize certain words using the - <em> <strong> - elements.
  • -
  • We can use - - <icon>s too.
  • -
  • Another possibility is the <img> element: - another feather, - which offers the ability to refer to an image map.
  • -
  • We have elements for hyperlinking: -
    -
    <link href="faq.html">
    -
    Use this to - link - to another document. As per normal, this will open the new document - in the same browser window.
    - -
    <link href="#section">
    -
    Use this to - link - to the named anchor in the current document. -
    - -
    <link href="faq.html#forrest">
    -
    Use this to - link - to another document and go to the named anchor. This will open - the new document in the same browser window. -
    - -
    <jump href="faq.html">
    -
    Use this to - jump - to another document and optionally go to a named - anchor - within that document. This will open the new document in the same - browser window. So what is the difference between link and jump? - The jump behaves differently, in that it will replace any frames - in the current window. - This is the equivalent of - <a ... target="_top"> -
    - -
    <fork href="faq.html">
    -
    Use this to - fork - your webbrowser to another document. This will open the document - in a new, unnamed browser window. - This is the equivalent of - <a ... target="_blank"> -
    -
  • - -
  • Oh, by the way, a definition list <dl> was used inside - the previous list item. We could put another -
      -
    • unordered list
    • -
    • inside the list item
    • -
    - - - - -
    A sample nested table
    Or even tables.. -
    inside tables..
    -
    or inside lists, but I believe this liberty gets quickly quite - hairy as you see.
    -
  • -
-

So far for the in-line elements, let's look at some paragraph-level - elements.

- The <fixme> element is used for stuff - which still needs work. Mind the author attribute! - Use the <note> element to draw attention to something, e.g. ...The <code> element is used when the author can't - express himself clearly using normal sentences ;-) - Sleep deprivation can be the result of being involved in an open - source project. (a.k.a. the <warning> element). - - If you want your own labels for notes and - warnings, specify them using the label attribute. - -

Apart from unordered lists, we have ordered lists too, of course.

-
    -
  1. Item 1
  2. -
  3. Item 2
  4. -
  5. This should be 3 if my math is still OK.
  6. -
-
- -
- Various presentation formats - -

This sample document, written in document-v13 XML can be presented - via Forrest in a number of different formats. The links in the - following list show this document in each of the currently available - formats.

- -

Each of the formats can be made available as a link near the top of - the page. Actual placement of those links depends on the skin - currently in use. Those links are enabled in the skinconf.xml via the - <disable-XXX-link> elements in the skinconf.xml

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation FormatDescriptionskinconf.xml Element
HTMLThis document in HTML format. Always generated by default. Cannot be turned off.
XMLThis document in its raw XML format.<disable-xml-link>. By default, set to true, meaning - that this link will not be shown.
PDFThis document as Adobe PDF<disable-pdf-link>. By default, set to false, meaning - that this link will be shown.
Text

This document as straight text.

-

For additional information see the Forrest text-output - plugin.

<disable-txt-link>. By default, set to true, meaning - that this link will not be shown.
POD

This document as Perl POD (Plain Old Documentation). Text - with minimal formatting directives. If on a *nix system with perl - installed, see "man perlpod".

-

For additional information see the Forrest pod-output - plugin.

<disable-pod-link>. By default, set to true, meaning - that this link will not be shown.
-
-
- Using sections -

You can use sections to put some structure in your document. For some - strange historical reason, the section title is an attribute of the - <section> element.

-
-
- Sections, the sequel -

Just some second section.

-
- Section 2.1 -

Which contains a subsection (2.1).

-
-
- -
- Showing preformatted source code -

Enough about these sections. Let's have a look at more interesting - elements, <source> for instance:

- -// This example is from the book _Java in a Nutshell_ by David Flanagan. -// Written by David Flanagan. Copyright (c) 1996 O'Reilly & Associates. -// You may study, use, modify, and distribute this example for any purpose. -// This example is provided WITHOUT WARRANTY either expressed or implied. - -import java.applet.*; // Don't forget these import statements! -import java.awt.*; - -public class FirstApplet extends Applet { - // This method displays the applet. - // The Graphics class is how you do all drawing in Java. - public void paint(Graphics g) { - g.drawString("Hello World", 25, 50); - } -} -

CDATA sections are used within - <source> elements so that you can write pointy - brackets without needing to escape them with messy - &lt; entities ... -

- - easy - -]]> -

Please take care to still use a sensible line-length within your - source elements.

-
- -
- Using tables -

And now for a table:

- - - - - - - - - - - - - - - - -
Table caption
heading cell 1heading cell 2heading cell 3
data cellthis data cell spans two columns
- Tables can be nested: - - - - - - - - - - -
column 1column 2
cell Acell B
-
-
  • and can include most other elements
  • such as lists
-
-
- - -
- Using figures -

And a <figure> to end all of this. - Note that this can also be implemented with an - <img> element. -

-
-
-
- -
- DTD changes -

See the generated - - DTD reference documentation. -

-
- Changes since document-v12 -

- All v1.2 docs will work fine as v1.3 DTD. The main change is the - addition of a @class attribute to every element, which enables the - "extra-css" section in the skinconf to be put to good use. -

-
-
- Changes since document-v11 -

- doc-v12 enhances doc-v11 by relaxing various restrictions that were - found to be unnecessary. -

-
    -
  • - Links ((link|jump|fork) and inline elements (br|img|icon|acronym) are - allowed inside title. -
  • -
  • - Paragraphs (p|source|note|warning|fixme), table and figure|anchor are - allowed inside li. -
  • -
  • - Paragraphs (p|source|note|warning|fixme), lists (ol|ul|dl), table, - figure|anchor are allowed inside definition lists (dd) and tables (td - and dh). -
  • -
  • - Inline content - (strong|em|code|sub|sup|br|img|icon|acronym|link|jump|fork) is - allowed in strong and em. -
  • -
-
-
- -
- This is a legal notice, so it is important. -
-
diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/embedded_html.html b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/embedded_html.html deleted file mode 100644 index 29b2d6a5..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/embedded_html.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - Embedded HTML demonstration page - - - -

Embedded HTML demonstration page

- -

An HTML document is used as the source for this page, and translated -to the intermediate Apache Forrest xdocs document structure. The sitemap then -does the normal aggregation with the navigation content and application of -the skin. -

- -

-The html is being interpreted by Forrest and transformed to the -intermediate Apache xdocs document structure. That stylesheet cannot deal -with every possibility in unstructured html, so it tries to guess how to -build <section> elements and such. -It needs <h1> (<h2> etc.) headings in the source html -in order to identify sections. Patches are welcome to enhance -that transformer. -

- -

-You can still take advantage of Forrest's -"site:" -method of linking, for example: -<a href="site:index"> -

- -
-XHTML can also be used, but it is just treated as interpreted -html. Future versions of Forrest will take much more advantage of XHTML. - -
- -

Some example uses of HTML

-

-There are situations when the Apache Forrest xdocs DTD is not sufficient. -The use of embedded HTML enables you to use HTML code in these situations. -

- -

Embedded applets and Javascript

- -

-See the -Javascript alert pop-up -

- -

HTML forms for user interaction

-

-Search the Forrest website via Google: - -

- - - - -Google Search - -  - -
- -

- -

-See a demonstration of "html" and "html forms" with our -Forrest download mirror -facility and the -explanation howto document. -

- -

Invalid HTML

-

-This paragraph has a missing closing tag for the <p> element. If you look -at the XML created by Forrest you'll notice that -Forrest has fixed this. - -

Potentially Invalid XDocs

- -However, it should also be noted that the resultant XML is not a valid document -since it contains the additional HTML elements. If you are intending to use -the intermediate XDocs for any purpose be aware of this fact. - -

Other non-standard html-type abilities

-

-Use other HTML delights (???) and tricks. -

- - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/faq.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/faq.xml deleted file mode 100644 index 62b41ca5..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/faq.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - Frequently Asked Questions - - - Documentation - - - How can I help write documentation? - - -

- This project uses Apache Forrest to - generate documentation from XML. Please download a copy of Forrest, - which can be used to validate, develop and render a project site. -

- - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/hello-v10.dtd b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/hello-v10.dtd deleted file mode 100644 index ee62644d..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/hello-v10.dtd +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/helloAgain.pdf b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/helloAgain.pdf deleted file mode 100644 index 5ca4f313..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/helloAgain.pdf +++ /dev/null @@ -1,70 +0,0 @@ -%PDF-1.3 -%ª«¬­ -4 0 obj -<< /Type /Info -/Producer (FOP 0.20.4) >> -endobj -5 0 obj -<< /Length 203 /Filter [ /ASCII85Decode /FlateDecode ] - >> -stream -Gar'!]afWZ&;9q-MRA)RFnblL2&]tQSZsjOOT[ck2SQkp(bfQ[R7ZPq=U24c0dqq_i?B[A.0s\)5f5 -endstream -endobj -6 0 obj -<< /Type /Page -/Parent 1 0 R -/MediaBox [ 0 0 595 842 ] -/Resources 3 0 R -/Contents 5 0 R ->> -endobj -7 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F1 -/BaseFont /Helvetica -/Encoding /WinAnsiEncoding >> -endobj -8 0 obj -<< /Type /Font -/Subtype /Type1 -/Name /F5 -/BaseFont /Times-Roman -/Encoding /WinAnsiEncoding >> -endobj -1 0 obj -<< /Type /Pages -/Count 1 -/Kids [6 0 R ] >> -endobj -2 0 obj -<< /Type /Catalog -/Pages 1 0 R - >> -endobj -3 0 obj -<< -/Font << /F1 7 0 R /F5 8 0 R >> -/ProcSet [ /PDF /ImageC /Text ] >> -endobj -xref -0 9 -0000000000 65535 f -0000000687 00000 n -0000000745 00000 n -0000000795 00000 n -0000000015 00000 n -0000000071 00000 n -0000000365 00000 n -0000000471 00000 n -0000000578 00000 n -trailer -<< -/Size 9 -/Root 2 0 R -/Info 4 0 R ->> -startxref -883 -%%EOF diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/index.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/index.xml deleted file mode 100644 index 41f7ac5c..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/index.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - -
- Samples -
- -
- If something goes wrong.. -

Patches are welcome: Forrest FAQ

-
- -
diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/linking.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/linking.xml deleted file mode 100644 index 31b82af9..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/linking.xml +++ /dev/null @@ -1,353 +0,0 @@ - - - - -
- Demonstration of linking -
- - -
- Overview -

Forrest has many powerful techniques for linking between documents - and for managing the site navigation. This document demonstrates those - techniques. - The document "Menus and Linking" - has the full details. -

-
- -
- Building and maintaining consistent URI space -

- When Forrest builds your site, it starts from the front page. Like - a robot, it traverses all of the links that it finds in the documents - and builds the corresponding pages. Any new links are further traversed. -

-

- Sometimes those links lead to documents that are generated directly - from xml source files, sometimes they are generated from other source - via an intermediate xml format. Other times the links lead to raw - un-processed content. -

-

- The site navigation configuration file "site.xml" provides - a way to manage this URI space. In the future, when documents are - re-arranged and renamed, the site.xml configuration will enable this - smoothly. -

-
- -
- Mapping the local resource space to the final URI space -

- For both generated and raw (un-processed) files, the top-level of the - URI space corresponds to the "content/xdocs/" directory, - i.e. the location of the "site.xml" configuration file. -

- - In versions prior to 0.7 raw un-processed content was stored in - the "content/" directory. In 0.7 onwards, raw - un-processed data is stored alongside the xdocs. In addition, - in 0.6 and earlier, HTML documents could be stored in the xdocs - directory and served without processing. If you - you wish to emulate the behaviour of 0.6 and earlier see the - next section. - -

- A diagram will help. -

- The final URI space ------------------- ------------------- -Generated content ... - content/xdocs/index.xml index.html - content/xdocs/samples/index.xml samples/index.html - content/xdocs/samples/faq.xml samples/faq.html - content/xdocs/test1.html test1.html - content/xdocs/samples/test3.html samples/test3.html - content/xdocs/samples/subdir/test4.html samples/subdir/test4.html - -Raw un-processed content ... - content/xdocs/hello.pdf hello.pdf - content/xdocs/hello.sxw hello.sxw - content/xdocs/subdir/hello.sxw subdir/hello.sxw -]]> - -
- How Plugins May Affect The URI Space -

By using Forrest Input Plugins - you can process some file formats, such as - OpenOffice.org documents and produce processed content from them. For example, - the file content/xdocs/hello.sxw can be used to produce a - skinned version of the document at with the name hello.html. - Similarly, you can use Forrest Output - Plugins to create different output formats such as PDF, in this - case content/xdocs/hello.sxw can produce - hello.pdf.

- -

However, this does not affect the handling of raw content. That is, you - can still retrieve the raw un-processed version with, for example, - hello.sxw. If you want to prevent the user retrieving the - un-processed version you will have to create matchers that intercept - these requests within your project sitemap.

-
- -
- -
- Basic link to internal generated pages -

- When this type of link is encountered, Forrest will look for a - corresponding xml file, relative to this document (i.e. in - content/xdocs/samples/). -

-

A generated document in the current directory, which corresponds to - content/xdocs/samples/sample.html ... -

- ]]>sample.html]]> -

In a sub-directory, which corresponds to - content/xdocs/samples/subdir/index.html ... -

- ]]>subdir/index.html]]> -
- -
- Basic link to raw un-processed content -

- Raw content files are not intended for any processing, they are just - linked to (e.g. pre-prepared PDFs, zip archives). - These files are placed alongside your normal content in the - "content/xdocs" directory. -

-

A raw document in the current directory, which corresponds to - content/xdocs/samples/helloAgain.pdf ... -

- ]]>helloAgain.pdf]]> -

A raw document in a sub-directory, which corresponds to - content/xdocs/samples/subdir/hello.zip ... -

- ]]>subdir/hello.zip]]> -

A raw document at the next level up, which corresponds to - content/hello.pdf ... -

- ]]>../hello.pdf]]> - -
- Serving (X)HTML content without Skinning - -

Prior to version 0.7, the raw un-processed content was stored in - the "content/" directory. In 0.7 onwards, raw - un-processed data is stored alongside the xdocs. In addition - in 0.6 and earlier, HTML files could be stored in the xdocs - directory and they would be served without further processing. - As described above, this is not the case in 0.7 where HTML files - are, by default, skinned by Forrest.

- -

If you - you wish to emulate the behaviour of 0.6 and earlier then you - must add the following to your project sitemap.

- - -<map:match pattern="**.html"> - <map:select type="exists"> - <map:when test="{project:content}{0}"> - <map:read src="{project:content}/{0}" mime-type="text/html"/> - <!-- - Use this instead if you want JTidy to clean up your HTML - <map:generate type="html" src="{project:content}/{0}" /> - <map:serialize type="html"/> - --> - </map:when> - <map:when test="{project:content.xdocs}{0}"> - <map:read src="{project:content.xdocs}/{0}" mime-type="text/html"/> - <!-- - Use this instead if you want JTidy to clean up your HTML - <map:generate type="html" src="{project:content.xdocs}/{0}" /> - <map:serialize type="html"/> - --> - </map:when> - </map:select> -</map:match> - - -

The above allows us to create links to un-processed skinned files stored - in the {project:content} or {project:content.xdocs} - directory. For example: - <a href="/test1.html">HTML content</a>. However, it will - break the 0.7 behaviour of skinning HTML content. For this reason the old - ".ehtml" extension can be used to embed HTML content in a Forrest skinned - site

- -

Note that you can change the matchers above to selectively serve some - content as raw un-processed content, whilst still serving other content - as skinned documents. For example, the following snippet would allow - you to serve the content of an old, deprecated site without processing - from Forrest, whilst still allowing all other content to be processed - by Forrest in the normal way:

- - -<map:match pattern="old_site/**.html"> - <map:select type="exists"> - <map:when test="{project:content}{1}.html"> - <map:read src="{project:content}/{1}.html" mime-type="text/html"/> - <!-- - Use this instead if you want JTidy to clean up your HTML - <map:generate type="html" src="{project:content}/{0}" /> - <map:serialize type="html"/> - --> - </map:when> -</map:match> - - -

For example, HTML content.

-
-
- -
- Full URL to external documents -

A full URL ...

- ]]>http://forrest.apache.org/]]> -

A full URL with a fragment identifier ...

- ]]>http://forrest.apache.org/faq.html#link_raw]]> -

- Note that Forrest does not traverse external links to look for - other links. -

-
- -
- Using site.xml to manage the links -

As you will have discovered, using pathnames with ../../ etc. will - get very nasty. Real problems occur when you use a smart text editor - that tries to manage the links for you. For example, it will have - trouble linking to the raw content files which are not yet in their - final location. -

-

- Links and filenames are bound to change and re-arrange. It is - essential to only change those links in one central place, not in every - document. -

-

- The "site.xml" configuration file to the rescue. It maps - symbolic names to actual resources. -

- -
- Basic link to internal generated pages -

This single entry ...

- ]]> -

- enables a simple link to a generated document, which corresponds to - content/xdocs/index.xml ... -

- ]]>site:index]]> -
- -
- Group some items -

This compound entry ...

- - - ... - -]]> -

- enables a link to a generated document, which corresponds to - content/xdocs/samples/index.xml ... -

- ]]>site:samples]]> -

- and a link to a generated document, which corresponds to - content/xdocs/samples/faq.xml ... -

- -]]>site:faq]]> -which can also be a complete reference -]]>site:samples/faq]]> - -
- -
- Fragment identifiers -

This compound entry ...

- - - -
- - ... - -]]> -

- enables a link to a fragment identifier within the - samples/sample.html document ... -

- ]]>site:samples/sample/section]]> -
- -
- Define items for raw content -

This entry ...

- ]]> -

- enables a link to a raw document, which corresponds to - content/hello.pdf ... -

- ]]>site:hello_print]]> - -
- -
- External links -

This compound entry ...

- - - - - - -]]> -

- enables a link to an external URL ... -

- ]]>ext:forrest]]> -

- and a link to another external URL ... -

- -]]>ext:linking]]> -which can also be a complete reference -]]>ext:forrest/linking]]> - -

- and a link to another external URL with a fragment identifier ... -

- -]]>ext:webapp]]> -which can also be a complete reference -]]>ext:forrest/webapp]]> - -
-
- - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/sample.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/sample.xml deleted file mode 100644 index 52774f7d..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/sample.xml +++ /dev/null @@ -1,407 +0,0 @@ - - - - -
- The Apache Forrest xdocs document-v2.0 DTD - The content of this document doesn't make any sense at all. - This is a demonstration document using all possible elements in - the current Apache Forrest xdocs document-v20.dtd - -
- - - This is a demonstration document using all possible elements in the - current Apache Forrest xdocs document-v20.dtd - (See the DTD changes section at the bottom.) - -
- Sample Content -

Hint: See the xml source to see how the various - elements are used and see the - - DTD reference documentation. -

-
- Block and inline elements -

This is a simple paragraph. Most documents contain a fair amount of - paragraphs. Paragraphs are called <p>.

-

With the <p xml:space="preserve"> attribute, you can declare - that whitespace should be preserved, without implying it is in any other - way special.

-

- This next paragraph has a class attribute of 'quote'. CSS can - be used to present this <p class='quote'> in - a different style than the other paragraphs. The handling of - this quoted paragraph is defined in the <extra-css> - element in the skinconf.xml. -

-

- Anyway, like I was sayin', shrimp is the fruit of the sea. You can - barbecue it, boil it, broil it, bake it, sautee it. Dey's uh, - shrimp-kabobs, shrimp creole, shrimp gumbo. Pan fried, deep fried, - stir-fried. There's pineapple shrimp, lemon shrimp, coconut shrimp, - pepper shrimp, shrimp soup, shrimp stew, shrimp salad, shrimp and - potatoes, shrimp burger, shrimp sandwich. That- that's about it. -

-

A number of in-line elements are available in the DTD, we will show them - inside an unordered list (<ul>):

-
    -
  • Here is a simple list item (<li>).
  • -
  • Have you seen the use of the <code> element in the - previous item?
  • -
  • Also, we have <sub> and <sup> - elements to show content above or below the text - baseline.
  • -
  • There is a facility to emphasize certain words using the - <em> <strong> - elements.
  • -
  • We can use - - <icon>s too.
  • -
  • Another possibility is the <img> element: - another feather, - which offers the ability to refer to an image map.
  • -
  • We have elements for hyperlinking: -
    -
    <a href="faq.html">
    -
    Use this to - link - to another document. As per normal, this will open the new document - in the same browser window.
    - -
    <a href="#section">
    -
    Use this to - link - to the named anchor in the current document. -
    - -
    <a href="faq.html#forrest">
    -
    Use this to - link - to another document and go to the named anchor. This will open - the new document in the same browser window. -
    -
    Targetted window control with jump and fork.
    -
    See demonstration - using class attribute on links. -
    -
  • - -
  • Oh, by the way, a definition list <dl> was used inside - the previous list item. We could put another -
      -
    • unordered list
    • -
    • inside the list item
    • -
    - - - - -
    A sample nested table
    Or even tables.. -
    inside tables..
    -
    or inside lists, but I believe this liberty gets quickly quite - hairy as you see.
    -
  • -
-

So far for the in-line elements, let's look at some paragraph-level - elements.

- The <fixme> element is used for stuff - which still needs work. Mind the author attribute! - Use the <note> element to draw attention to something, e.g. ...The <code> element is used when the author can't - express himself clearly using normal sentences ;-) - Sleep deprivation can be the result of being involved in an open - source project. (a.k.a. the <warning> element). - - If you want your own labels for notes and - warnings, specify them using the label attribute. - -

Apart from unordered lists, we have ordered lists too, of course.

-
    -
  1. Item 1
  2. -
  3. Item 2
  4. -
  5. This should be 3 if my math is still OK.
  6. -
-
- -
- Various presentation formats - -

This sample document, written in document-v20 XML can be presented - via Forrest in a number of different formats. The links in the - following list show this document in each of the currently available - formats.

- -

Each of the formats can be made available as a link near the top of - the page. Actual placement of those links depends on the skin - currently in use. Those links are enabled in the skinconf.xml via the - <disable-XXX-link> elements in the skinconf.xml

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation FormatDescriptionskinconf.xml Element
HTMLThis document in HTML format. Always generated by default. Cannot be turned off.
XMLThis document in its raw XML format.<disable-xml-link>. By default, set to true, meaning - that this link will not be shown.
PDFThis document as Adobe PDF<disable-pdf-link>. By default, set to false, meaning - that this link will be shown.
Text

This document as straight text.

-

For additional information see the Forrest text-output - plugin.

<disable-txt-link>. By default, set to true, meaning - that this link will not be shown.
POD

This document as Perl POD (Plain Old Documentation). Text - with minimal formatting directives. If on a *nix system with perl - installed, see "man perlpod".

-

For additional information see the Forrest pod-output - plugin.

<disable-pod-link>. By default, set to true, meaning - that this link will not be shown.
-
-
- Using sections -

You can use sections to put some structure in your document. For some - strange historical reason, the section title is an attribute of the - <section> element.

-
-
- Sections, the sequel -

Just some second section.

-
- Section 2.1 -

Which contains a subsection (2.1).

-
-
- -
- Showing preformatted source code -

Enough about these sections. Let's have a look at more interesting - elements, <source> for instance:

- -// This example is from the book _Java in a Nutshell_ by David Flanagan. -// Written by David Flanagan. Copyright (c) 1996 O'Reilly & Associates. -// You may study, use, modify, and distribute this example for any purpose. -// This example is provided WITHOUT WARRANTY either expressed or implied. - -import java.applet.*; // Don't forget these import statements! -import java.awt.*; - -public class FirstApplet extends Applet { - // This method displays the applet. - // The Graphics class is how you do all drawing in Java. - public void paint(Graphics g) { - g.drawString("Hello World", 25, 50); - } -} -

CDATA sections are used within - <source> elements so that you can write pointy - brackets without needing to escape them with messy - &lt; entities ... -

- - easy - -]]> -

Please take care to still use a sensible line-length within your - source elements.

-
- -
- Using tables -

And now for a table:

- - - - - - - - - - - - - - - - -
Table caption
heading cell 1heading cell 2heading cell 3
data cellthis data cell spans two columns
- Tables can be nested: - - - - - - - - - - -
column 1column 2
cell Acell B
-
-
  • and can include most other elements
  • such as lists
-
-
- - -
- Using figures -

And a <figure> to end all of this. - Note that this can also be implemented with an - <img> element. -

-
-
- -
- -
- DTD changes -

See the generated - - DTD reference documentation. -

-
- Changes between document-v13 and document-v20 - -
-
- Changes between document-v12 and document-v13 -

- All v1.2 docs will work fine as v1.3 DTD. The main change is the - addition of a @class attribute to every element, which enables the - "extra-css" section in the skinconf to be put to good use. -

-
-
- Changes between document-v11 and document-v12 -

- doc-v12 enhances doc-v11 by relaxing various restrictions that were - found to be unnecessary. -

-
    -
  • - Links ((link|jump|fork) and inline elements (br|img|icon|acronym) are - allowed inside title. -
  • -
  • - Paragraphs (p|source|note|warning|fixme), table and figure|anchor are - allowed inside li. -
  • -
  • - Paragraphs (p|source|note|warning|fixme), lists (ol|ul|dl), table, - figure|anchor are allowed inside definition lists (dd) and tables (td - and dh). -
  • -
  • - Inline content - (strong|em|code|sub|sup|br|img|icon|acronym|link|jump|fork) is - allowed in strong and em. -
  • -
-
-
- -
- This is a legal notice, so it is important. -
-
diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/static.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/static.xml deleted file mode 100644 index 9553525c..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/static.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - -
- Static content - including raw un-processed files and documents -
- -
- Linking to static content -

- You can place some types of raw content into the xdocs directory. For example, - you can place a PDF file in src/documentation/content/xdocs and link - to it normally, - <a href="../hello.pdf">hello.pdf</a> - However, note that if the file is one that Forrest is able to process, for example - an HTML file, these files will be processed accordingly.

- -

- It is also worth noting that files in the xdocs directory will only be copied - into your final site if there is a link to them somewhere in the site. See the next - section for details of how to include content that is not linked.

- -

- For more information see the - Linking demonstration.

-
- -
- Including Static Content that is Not Linked - -

- You can include raw HTML, PDFs, plain-text, and other files. In your final site by - placing them in the src/documentation/content directory. Files in this - directory will be copied over automatically but will not be processed in any way by - Forrest, that is they will be linked to as raw files.

- -

- You can also have sub-directories such as - src/documentation/content/samples/subdir/ which - reflects your main - xdocs/ tree. The raw files will then end up - beside your documents. -

-
- -
diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/subdir/book-sample.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/subdir/book-sample.xml deleted file mode 100644 index f5396c66..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/subdir/book-sample.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/subdir/hello.zip b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/subdir/hello.zip deleted file mode 100644 index b4fb6aae..00000000 Binary files a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/subdir/hello.zip and /dev/null differ diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/subdir/index.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/subdir/index.xml deleted file mode 100644 index d060da5b..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/subdir/index.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - -
- Page generated from a sub-directory - - - - -
- - -
- A sub-directory -

This was generated from a sub-directory.

-

When creating new subdirectories, remember that these must - be declared in site.xml or each directory must have a book.xml file. -

-
- -
- diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/usemap.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/usemap.xml deleted file mode 100644 index 50bf2afa..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/samples/usemap.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - -
- Interactive client-side imagemaps - the usemap attribute -
- -
- Imagemap demo -

- usemap demo -

-

- - Rectangle - Circle - Default - -

-
-
- Source code - - usemap demo -

-

- - Rectangle - Circle - Default - -

-]]> -
- -
diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/site.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/site.xml deleted file mode 100644 index 4c286509..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/site.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/tabs.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/tabs.xml deleted file mode 100644 index e56b9c56..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/content/xdocs/tabs.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/resources/schema/catalog.xcat b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/resources/schema/catalog.xcat deleted file mode 100644 index 91da4103..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/resources/schema/catalog.xcat +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/resources/schema/hello-v10.dtd b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/resources/schema/hello-v10.dtd deleted file mode 100644 index 4fab270f..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/resources/schema/hello-v10.dtd +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/resources/stylesheets/hello2document.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/resources/stylesheets/hello2document.xsl deleted file mode 100644 index 1a8e453b..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/resources/stylesheets/hello2document.xsl +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - -
- - <xsl:value-of select="greeting"/> - -
- - - -
-
- -
diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/sitemap.xmap b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/sitemap.xmap deleted file mode 100644 index 76557f9b..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/sitemap.xmap +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/skinconf.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/skinconf.xml deleted file mode 100644 index a3127e6d..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/skinconf.xml +++ /dev/null @@ -1,441 +0,0 @@ - - - - - - - - - - - - true - - false - - true - - true - - - true - - - true - - - false - - - true - .at. - - - true - - - KiSS Crawler - Automatic recording for KiSS harddisk recorders - http://kiss.wamblee.org - images/project.png - - - - wamblee.org - - http://wamblee.org - images/group.png - - - - - - - - - - - 2006 - wamblee.org - - - - - - - - - - - - - - - - - - Send feedback about the website to: - - - - - - - - - p.quote { - margin-left: 2em; - padding: .5em; - background-color: #f0f0f0; - font-family: monospace; - } - - #footer a { color: #0F3660; } - #footer a:visited { color: #009999; } - - - - - - - - - - - - - - - - - - - - - - - - Page 1 - - - - 1in - 1in - 1.25in - 1in - - - - false - - - false - - - - - - Built with Apache Forrest - http://forrest.apache.org/ - images/built-with-forrest-button.png - 88 - 31 - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/langcode.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/langcode.xml deleted file mode 100644 index ed09f417..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/langcode.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - English - Espanol - Italiano - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/languages_en.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/languages_en.xml deleted file mode 100644 index 1037e0e4..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/languages_en.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - English - Spanish - Dutch - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/languages_es.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/languages_es.xml deleted file mode 100644 index a5d17dd0..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/languages_es.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - Inglés - Español - Holandés - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu.xml deleted file mode 100644 index 003da620..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - About - Index - Changes - Todo - Samples - Apache document - Static content - Linking - Wiki page - Ihtml page - Ehtml page - FAQ - Simplifed Docbook - XSP page - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_af.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_af.xml deleted file mode 100644 index 108faa75..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_af.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - Aangaande - Inhoud - Veranderinge - Om te doen - Voorbeelde - Apache dokument - Statise Inhoud - Linking - Wiki bladsy - Ihtml bladsy - Ehtml bladsy - FAQ - Vereenvoudigde Docbook - XSP bladsy - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_de.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_de.xml deleted file mode 100644 index 3cb39f49..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_de.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - Über - Index - Änderungen - Todo - Beispiele - Apache Dokumentationsseite - Statischer Inhalt - Linking - Wiki Seite - ihtml Seite - ehtml Seite - FAQ - Vereinfachte Docbook - XSP Seite - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_es.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_es.xml deleted file mode 100644 index 690808dd..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_es.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - Acerca de - Indice - Cambios - Tareas pendientes - Ejemplos - Documento Apache - Contenido Estático - Linking - Página Wiki - Página ihtml - Página ehtml - Preguntas Frecuentes - Página Simplifed Docbook - Página XSP - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_it.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_it.xml deleted file mode 100644 index fce8cccb..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_it.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - Riguardo a - Indice - Cambiamenti - Cose da fare - Esempi - Apache document - Contenuto Statico - Linking - Pagina Wiki - Pagina ihtml - Pagina ehtml - Domande frequenti - Simplifed Docbook - Pagina XSP - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_no.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_no.xml deleted file mode 100644 index 7b094ed2..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_no.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - Om - Indeks - Endringer - Oppgave liste - Eksempler - Apache Dokument - Statisk innhold - Linking - Wiki side - ihtml side - ehtml side - FAQ - Simplifed Docbook - XSP side - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_ru.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_ru.xml deleted file mode 100644 index 7454faca..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_ru.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - О проекте - Содержание - Изменения - План - Примеры - Страница документа Apache - Статическое содержание - Linking - Страница Wiki - Страница ihtml - Страница ehtml - Вопросы/Ответы - Docbook страница - XSP страница - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_sk.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_sk.xml deleted file mode 100644 index 801c5e27..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/menu_sk.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - O programe - Zoznám - Zmeny - Úlohy - Príklady - Apache Document - Statický Obsah - Linking - Wiki stránka - ihtml stránka - ehtml stránka - Casté Otázky - Simplifed Docbook stránka - XSP stránka - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/tabs.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/tabs.xml deleted file mode 100644 index 1cfbca61..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/tabs.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - Home - Samples - Apache XML Projects - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/tabs_es.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/tabs_es.xml deleted file mode 100644 index adf5a65a..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/docs/translations/tabs_es.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - Inicio - Ejemplos - Projectos XML Apache - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/forrest.properties b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/forrest.properties deleted file mode 100644 index ab7e802a..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/forrest.properties +++ /dev/null @@ -1,131 +0,0 @@ -# Copyright 2002-2005 The Apache Software Foundation or its licensors, -# as applicable. -# -# 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. - -############## -# Properties used by forrest.build.xml for building the website -# These are the defaults, un-comment them only if you need to change them. -############## - -# Prints out a summary of Forrest settings for this project -#forrest.echo=true - -# Project name (used to name .war file) -#project.name=my-project - -# Specifies name of Forrest skin to use -# See list at http://forrest.apache.org/docs/skins.html -#project.skin=pelt - -# Descriptors for plugins and skins -# comma separated list, file:// is supported -#forrest.skins.descriptors=http://forrest.apache.org/skins/skins.xml,file:///c:/myskins/skins.xml -#forrest.plugins.descriptors=http://forrest.apache.org/plugins/plugins.xml,http://forrest.apache.org/plugins/whiteboard-plugins.xml - -############## -# behavioural properties -#project.menu-scheme=tab_attributes -#project.menu-scheme=directories - -############## -# layout properties - -# Properties that can be set to override the default locations -# -# Parent properties must be set. This usually means uncommenting -# project.content-dir if any other property using it is uncommented - -project.build-dir=${project.home}/target/forrest - -#project.status=status.xml -project.content-dir=docs -#project.raw-content-dir=${project.content-dir}/content -#project.conf-dir=${project.content-dir}/conf -#project.sitemap-dir=${project.content-dir} -#project.xdocs-dir=${project.content-dir}/content/xdocs -#project.resources-dir=${project.content-dir}/resources -#project.stylesheets-dir=${project.resources-dir}/stylesheets -#project.images-dir=${project.resources-dir}/images -#project.schema-dir=${project.resources-dir}/schema -#project.skins-dir=${project.content-dir}/skins -#project.skinconf=${project.content-dir}/skinconf.xml -#project.lib-dir=${project.content-dir}/lib -#project.classes-dir=${project.content-dir}/classes -#project.translations-dir=${project.content-dir}/translations - -############## -# validation properties - -# This set of properties determine if validation is performed -# Values are inherited unless overridden. -# e.g. if forrest.validate=false then all others are false unless set to true. -#forrest.validate=true -#forrest.validate.xdocs=${forrest.validate} -#forrest.validate.skinconf=${forrest.validate} -#forrest.validate.sitemap=${forrest.validate} -#forrest.validate.stylesheets=${forrest.validate} -#forrest.validate.skins=${forrest.validate} -#forrest.validate.skins.stylesheets=${forrest.validate.skins} - -# *.failonerror=(true|false) - stop when an XML file is invalid -#forrest.validate.failonerror=true - -# *.excludes=(pattern) - comma-separated list of path patterns to not validate -# e.g. -#forrest.validate.xdocs.excludes=samples/subdir/**, samples/faq.xml -#forrest.validate.xdocs.excludes= - - -############## -# General Forrest properties - -# The URL to start crawling from -#project.start-uri=linkmap.html - -# Set logging level for messages printed to the console -# (DEBUG, INFO, WARN, ERROR, FATAL_ERROR) -#project.debuglevel=ERROR - -# Max memory to allocate to Java -#forrest.maxmemory=64m - -# Any other arguments to pass to the JVM. For example, to run on an X-less -# server, set to -Djava.awt.headless=true -#forrest.jvmargs= - -# The bugtracking URL - the issue number will be appended -#project.bugtracking-url=http://issues.apache.org/bugzilla/show_bug.cgi?id= -#project.bugtracking-url=http://issues.apache.org/jira/browse/ - -# The issues list as rss -#project.issues-rss-url= - -#I18n Property. Based on the locale request for the browser. -#If you want to use it for static site then modify the JVM system.language -# and run once per language -#project.i18n=true - -# The names of plugins that are required to build the project -# comma separated list (no spaces) -# You can request a specific version by appending "-VERSION" to the end of -# the plugin name. If you exclude a version number the latest released version -# will be used, however, be aware that this may be a development version. In -# a production environment it is recomended that you specify a known working -# version. -# Run "forrest available-plugins" for a list of plug-ins currently available -project.required.plugins=org.apache.forrest.plugin.output.pdf - -# Proxy configuration -# proxy.host= -# proxy.port= diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/pom.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/pom.xml deleted file mode 100644 index 3c7eb5c4..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - org.wamblee - wamblee-crawler - 0.2-SNAPSHOT - - - 4.0.0 - org.wamblee - wamblee-crawler-kiss - jar - wamblee.org KiSS crawler - http://wamblee.org - - - - org.wamblee - wamblee-crawler-basic - - - commons-email - commons-email - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/AbstractVisitor.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/AbstractVisitor.java deleted file mode 100644 index a6c0d69a..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/AbstractVisitor.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.kiss.guide; - -/** - * Abstract visitor of the tv guide with default looping behavior. - */ -public abstract class AbstractVisitor implements Visitor { - - /** - * Constructs the visitor. - * - */ - protected AbstractVisitor() { - // Empty - } - - /** - * Visits the channel by visiting all programs of the channel. - * - * @param aChannel - * Channel to visit. - */ - public void visitChannel(Channel aChannel) { - for (Program program : aChannel.getPrograms()) { - program.accept(this); - } - } - - /** - * Visits the TV guide by visiting all channels of the guide. - * - * @param aGuide - * TV guide to visit. - */ - public void visitTvGuide(TVGuide aGuide) { - for (Channel channel : aGuide.getChannels()) { - channel.accept(this); - } - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/Channel.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/Channel.java deleted file mode 100644 index 3a0d5800..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/Channel.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.kiss.guide; - -import java.util.Collections; -import java.util.List; - - -/** - * Represents the programme for a tv channel. - */ -public class Channel { - - /** - * TV channel name. - */ - private String _name; - - /** - * List of programs in chronological order. - */ - private List _programs; - - /** - * Constructs the channel. - * @param aName Channel name. - * @param aPrograms Programs. - */ - public Channel(String aName, List aPrograms) { - _name = aName; - _programs = aPrograms; - } - - /** - * Gets the channel name. - * @return channel name. - */ - public String getName() { - return _name; - } - - /** - * Gets the list of program. - * @return Programs. - */ - public List getPrograms() { - return Collections.unmodifiableList(_programs); - } - - /** - * Accepts a visitor. - * @param aVisitor Visitor. - */ - public void accept(Visitor aVisitor) { - aVisitor.visitChannel(this); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/MatchVisitor.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/MatchVisitor.java deleted file mode 100644 index e8138ed8..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/MatchVisitor.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.kiss.guide; - -import java.util.ArrayList; -import java.util.List; - -import org.wamblee.conditions.Condition; - -/** - * Visitor which determines the interesting programs in the TV guide. - */ -public class MatchVisitor extends AbstractVisitor { - - /** - * Criterion that determines which programs are interesting. - */ - private Condition _matcher; - - /** - * List of interesting programs. - */ - private List _programs; - - /** - * Constructs the visitor. - * @param aMatcher Condition describing interesting programs. - */ - public MatchVisitor(Condition aMatcher) { - _matcher = aMatcher; - _programs = new ArrayList(); - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.crawler.kiss.Visitor#visitProgram(org.wamblee.crawler.kiss.Program) - */ - public void visitProgram(Program aProgram) { - if (_matcher.matches(aProgram)) { - _programs.add(aProgram); - } - } - - /** - * Gets the list of interesting programs. To be called after applying - * the visitor on a tv guide. - * @return List of interesting programs. - */ - public List getMatches() { - return _programs; - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/PrintVisitor.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/PrintVisitor.java deleted file mode 100644 index 028cdf55..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/PrintVisitor.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.kiss.guide; - -import java.io.PrintStream; - - -/** - * Print visitor for pretty printing the TV guide. - */ -public class PrintVisitor extends AbstractVisitor { - - /** - * Stream to print the guide on. - */ - private PrintStream _stream; - - /** - * Constructs the print visitor. - * @param aStream Stream to print on. - */ - public PrintVisitor(PrintStream aStream) { - _stream = aStream; - } - - /* (non-Javadoc) - * @see org.wamblee.crawler.kiss.Visitor#visitProgram(org.wamblee.crawler.kiss.Program) - */ - public void visitProgram(Program aProgram) { - _stream.println(" " + aProgram.toString()); - } - - /* (non-Javadoc) - * @see org.wamblee.crawler.kiss.AbstractVisitor#visitChannel(org.wamblee.crawler.kiss.Channel) - */ - @Override - public void visitChannel(Channel aChannel) { - _stream.println(aChannel.getName()); - super.visitChannel(aChannel); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/Program.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/Program.java deleted file mode 100644 index 44bdc521..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/Program.java +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.kiss.guide; - -import java.util.Comparator; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.dom4j.DocumentFactory; -import org.dom4j.Element; -import org.wamblee.crawler.Action; -import org.wamblee.crawler.Page; -import org.wamblee.crawler.PageException; -import org.wamblee.crawler.kiss.main.SystemProperties; - -/** - * Represents a television program. - */ -public class Program { - - private static final String ELEM_PROGRAM = "program"; - - private static final String ELEM_NAME = "name"; - - private static final String ELEM_KEYWORDS = "keywords"; - - private static final String ELEM_DESCRIPTION = "description"; - - private static final String ELEM_CHANNEL = "channel"; - - private static final String ELEM_INTERVAL = "interval"; - - private static final String ELEM_END_TIME = "end"; - - private static final String ELEM_BEGIN_TIME = "begin"; - - /** - * Lexicographical comparison of programs based on (time, title, channel). - * - */ - public static class TimeComparator implements Comparator { - - /** - * Lexicographical comparison based on start time, program name, and - * channel. - * - * @param aProgram1 - * First program. - * @param aProgram2 - * Second program. - * @return See {@link Comparator#compare(T, T)} - */ - public int compare(Program aProgram1, Program aProgram2) { - int value = aProgram1.getInterval().getBegin().compareTo( - aProgram2.getInterval().getBegin()); - if (value != 0) { - return value; - } - value = aProgram1.getName().compareTo(aProgram2.getName()); - if (value != 0) { - return value; - } - return aProgram1.getChannel().compareTo(aProgram2.getChannel()); - } - } - - private static final Log LOG = LogFactory.getLog(Program.class); - - /** - * Name of the record action on the program details page. - */ - private static final String RECORD_ACTION = "record"; - - /** - * Result of recording a program. - * - */ - public enum RecordingResult { - /** - * Successfully recorded. - */ - OK, - - /** - * Already recorded program. - */ - DUPLICATE, - - /** - * Recording conflict with another program. - */ - CONFLICT, - - /** - * Program occurred in the past. - */ - OLDSHOW, - - /** - * Program could not be recorded for technical reasons. - */ - ERROR; - }; - - /** - * Indent string to use for pretty printing. - */ - private static final String INDENT = " "; - - /** - * Channel the program is on. - */ - private String _channel; - - /** - * Program name. - */ - private String _name; - - /** - * Program description. - */ - private String _description; - - /** - * Keywords or classification of the program. - */ - private String _keywords; - - /** - * Time interval for the program (from/to). - */ - private TimeInterval _interval; - - /** - * Action to execute to obtain program information and/or record the - * program. - */ - private Action _programInfo; - - /** - * Constructs the program. - * - * @param aChannel - * Channel name. - * @param aName - * Program name. - * @param aDescription - * Description. - * @param aKeywords - * Keywords/classification. - * @param aInterval - * Time interval. - * @param aProgramInfo - * Action to execute for detailed program information or for - * recording the page. - */ - public Program(String aChannel, String aName, String aDescription, - String aKeywords, TimeInterval aInterval, Action aProgramInfo) { - _channel = aChannel; - _name = aName; - _description = aDescription; - _keywords = aKeywords; - _interval = aInterval; - _programInfo = aProgramInfo; - } - - /** - * Gets the channel. - * - * @return Channel. - */ - public String getChannel() { - return _channel; - } - - /** - * Gets the program name. - * - * @return Name. - */ - public String getName() { - return _name; - } - - /** - * Gets the description. - * - * @return Description. - */ - public String getDescription() { - return _description; - } - - /** - * Gets the keywords/classification. - * - * @return Keywords/classification - */ - public String getKeywords() { - return _keywords; - } - - /** - * Gets the time interval. - * - * @return Time interval. - */ - public TimeInterval getInterval() { - return _interval; - } - - /** - * Checks if recording is possible. - * - * @return True iff recording is possible. - */ - public boolean isRecordingPossible() { - try { - return _programInfo.execute().getAction(RECORD_ACTION) != null; - } catch (PageException e) { - return false; - } - } - - /** - * Records the show. - * - * @return Status describing the result of recording. - */ - public RecordingResult record() { - LOG.info("Recording " + this); - if (SystemProperties.isRecordDisabled()) { - return RecordingResult.OK; - } - try { - Action record = _programInfo.execute().getAction(RECORD_ACTION); - if (record == null) { - LOG.info(" result: " + RecordingResult.OLDSHOW); - return RecordingResult.OLDSHOW; - } - Page result = record.execute(); - RecordingResult recordingResult = RecordingResult.valueOf(result - .getContent().getText()); - LOG.info(" result: " + recordingResult); - return recordingResult; - } catch (PageException e) { - LOG.warn("Technical problem recording program: '" + this + "'", e); - LOG.info(" result: " + RecordingResult.ERROR); - return RecordingResult.ERROR; - } - } - - /** - * Accepts the visitor. - * - * @param aVisitor - * Visitor. - */ - public void accept(Visitor aVisitor) { - aVisitor.visitProgram(this); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return _interval + " - " + _name + " (" + _channel + "/" + _keywords - + ")" + "\n" - + (INDENT + _description).replaceAll("\n", "\n" + INDENT); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object aObject) { - if (!(aObject instanceof Program)) { - return false; - } - Program program = (Program) aObject; - return getName().equals(program.getName()) - && _programInfo.equals(program._programInfo); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - return getName().hashCode(); - } - - /** - * Converts program information to XML. - * - * @return XML representation of program information. - */ - public Element asXml() { - DocumentFactory factory = DocumentFactory.getInstance(); - Element program = factory.createElement(ELEM_PROGRAM); - program.addElement(ELEM_NAME).setText(getName()); - program.addElement(ELEM_DESCRIPTION).setText(getDescription()); - program.addElement(ELEM_KEYWORDS).setText(getKeywords()); - program.addElement(ELEM_CHANNEL).setText(getChannel()); - Element interval = program.addElement(ELEM_INTERVAL); - interval.addElement(ELEM_BEGIN_TIME).setText( - getInterval().getBegin().toString()); - interval.addElement(ELEM_END_TIME).setText( - getInterval().getEnd().toString()); - return program; - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/TVGuide.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/TVGuide.java deleted file mode 100644 index d21a47ea..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/TVGuide.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.kiss.guide; - -import java.util.Collections; -import java.util.List; - - -/** - * The TV guide. - */ -public class TVGuide { - - /** - * List of channels. - */ - private List _channels; - - /** - * Constructs the guide. - * @param aChannels Channels of the guide. - */ - public TVGuide(List aChannels) { - _channels = aChannels; - } - - /** - * Gets the channels. - * @return Channels. - */ - public List getChannels() { - return Collections.unmodifiableList(_channels); - } - - /** - * Accepts the visitor. - * @param aVisitor Visitor. - */ - public void accept(Visitor aVisitor) { - aVisitor.visitTvGuide(this); - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/Time.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/Time.java deleted file mode 100644 index de206f55..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/Time.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.kiss.guide; - -import java.text.DecimalFormat; -import java.text.NumberFormat; - -/** - * TIme at which a program starts or ends. - */ -public class Time implements Comparable { - - /** - * - */ - private static final int HOURS_PER_DAY = 24; - - /** - * - */ - private static final int EARLY_HOUR = 3; - - /** - * Number of seconds per minute. - */ - private static final double SECONDS_PER_MINUTE = 60.0; - - /** - * Hour of the time. - */ - private int _hour; - - /** - * Minute of the hour. - */ - private int _minute; - - /** - * Constructs the time. - * - * @param aHour - * Hour. - * @param aMinute - * Minute. - */ - public Time(int aHour, int aMinute) { - _hour = aHour; - _minute = aMinute; - } - - /** - * Gets the hour. - * - * @return Hour. - */ - public int getHour() { - return _hour; - } - - /** - * Gets te minute. - * - * @return Minute. - */ - public int getMinute() { - return _minute; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - NumberFormat format = new DecimalFormat("00"); - return format.format(_hour) + ":" + format.format(_minute); - } - - /** - * Convert time to floating point value. Useful for comparing two times. - * - * @return Converted value. - */ - float asFloat() { - int hour = _hour; - // Hack to make sure that programs appearing shortly after midnight are - // sorted - // after those running during the day. - if (hour <= EARLY_HOUR) { - hour += HOURS_PER_DAY; - } - return (float) hour + (float) _minute / (float) SECONDS_PER_MINUTE; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object aObject) { - if (!(aObject instanceof Time)) { - return false; - } - return toString().equals(aObject.toString()); - } - - /** - * Compares based on time. - * - * @param aObject - * Time object to compare to. - * @return See {@link Comparable#compareTo(T)}. - */ - public int compareTo(Object aObject) { - if (!(aObject instanceof Time)) { - throw new IllegalArgumentException("object not an instance of Time"); - } - Time time = (Time) aObject; - return new Float(asFloat()).compareTo(new Float(time.asFloat())); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - return toString().hashCode(); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/TimeInterval.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/TimeInterval.java deleted file mode 100644 index a189e039..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/TimeInterval.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.kiss.guide; - -/** - * Time interval. - */ -public class TimeInterval { - - /** - * Begin time. - */ - private Time _begin; - - /** - * End time. - */ - private Time _end; - - /** - * Construts the interval. - * - * @param aBegin - * Start time. - * @param aEnd - * End time. - */ - public TimeInterval(Time aBegin, Time aEnd) { - _begin = aBegin; - _end = aEnd; - } - - /** - * Gets the begin time. - * - * @return Begin time. - */ - public Time getBegin() { - return _begin; - } - - /** - * Gets the end time. - * - * @return End time. - */ - public Time getEnd() { - return _end; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return _begin + " - " + _end; - } - - /** - * Determines if there is an overlap between the current interval and given - * one. - * - * @param aInterval - * Interval to compare with. - * @return True iff there is overlap - */ - public boolean overlap(TimeInterval aInterval) { - - if (isUncertain() || aInterval.isUncertain()) { - // Optimistic assume there is no overlap if one of the intervals is - // uncertain. - return false; - } - - if (_end.asFloat() <= aInterval._begin.asFloat() - || aInterval._end.asFloat() <= _begin.asFloat()) { - return false; - } - - return true; - } - - /** - * Determines if the actual time that the program corresponds to is - * uncertain due to the representation of a period of more than 24 hours - * using a 24 hour clock. - * - * @return True iff the interval is uncertain. - */ - boolean isUncertain() { - return _begin.asFloat() > _end.asFloat(); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object)j - */ - @Override - public boolean equals(Object aObject) { - if (!(aObject instanceof TimeInterval)) { - return false; - } - return aObject.toString().equals(aObject.toString()); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - return _begin.hashCode(); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/Visitor.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/Visitor.java deleted file mode 100644 index 526626cc..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/Visitor.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.kiss.guide; - - -/** - * Visitor of the TV guide. - */ -public interface Visitor { - - /** - * Visits a program. - * @param aProgram Program. - */ - void visitProgram(Program aProgram); - - /** - * Visits a channel. - * @param aChannel Channel. - */ - void visitChannel(Channel aChannel); - - /** - * Visits the guide. - * @param aGuide Guide. - */ - void visitTvGuide(TVGuide aGuide); -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/package.html b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/package.html deleted file mode 100644 index 5f9643fd..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/guide/package.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - wamblee.org - - - -This package contains the object model for the TV guide and the classes for -searching the TV guide for relevant programs. - - - -@since - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/InterestingProgramAction.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/InterestingProgramAction.java deleted file mode 100644 index 2ce30de2..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/InterestingProgramAction.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.kiss.main; - -import org.wamblee.crawler.kiss.guide.Program; - -/** - * Represents an action to execute for an interesting program. - */ -public class InterestingProgramAction implements ProgramAction { - - /** - * Category under which the interesting program is listed. - */ - private String _category; - - /** - * Constructs the action. - * - * @param aCategory - * Category of the program. Useful for structuring the output. - */ - public InterestingProgramAction(String aCategory) { - _category = aCategory; - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.crawler.kiss.ProgramAction#execute(org.wamblee.crawler.kiss.Program, - * org.wamblee.crawler.kiss.Report) - */ - public void execute(Program aProgram, ProgramActionExecutor aReport) { - if (aProgram.isRecordingPossible()) { - aReport.interestingProgram(_category, aProgram); - } - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/KissCrawler.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/KissCrawler.java deleted file mode 100644 index c637f34c..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/KissCrawler.java +++ /dev/null @@ -1,369 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.kiss.main; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.mail.MessagingException; - -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.dom4j.Element; -import org.wamblee.crawler.Action; -import org.wamblee.crawler.Configuration; -import org.wamblee.crawler.Crawler; -import org.wamblee.crawler.Page; -import org.wamblee.crawler.PageException; -import org.wamblee.crawler.impl.ConfigurationParser; -import org.wamblee.crawler.impl.CrawlerImpl; -import org.wamblee.crawler.kiss.guide.Channel; -import org.wamblee.crawler.kiss.guide.PrintVisitor; -import org.wamblee.crawler.kiss.guide.Program; -import org.wamblee.crawler.kiss.guide.TVGuide; -import org.wamblee.crawler.kiss.guide.Time; -import org.wamblee.crawler.kiss.guide.TimeInterval; -import org.wamblee.crawler.kiss.notification.NotificationException; -import org.wamblee.crawler.kiss.notification.Notifier; -import org.wamblee.general.BeanFactory; -import org.wamblee.xml.ClasspathUriResolver; -import org.wamblee.xml.XslTransformer; - -/** - * The KiSS crawler for automatic recording of interesting TV shows. - * - */ -public class KissCrawler { - - private static final Log LOG = LogFactory.getLog(KissCrawler.class); - - /** - * Start URL of the electronic programme guide. - */ - private static final String START_URL = "http://epg.kml.kiss-technology.com/login.php"; - - /** - * Default socket timeout to use. - */ - private static final int SOCKET_TIMEOUT = 10000; - - /** - * Regular expression for matching time interval strings in the retrieved - * pages. - */ - private static final String TIME_REGEX = "[^0-9]*([0-9]{2}):([0-9]{2})[^0-9]*([0-9]{2}):([0-9]{2}).*"; - - /** - * Compiled pattern for the time regular expression. - */ - private Pattern _pattern; - - /** - * Runs the KiSS crawler. - * - * @param aArgs - * Arguments: First argument is the crawler configuration file, - * and second is the program configuration file. - * @throws Exception - * In case of problems. - */ - public static void main(String[] aArgs) throws Exception { - String crawlerConfig = new File(aArgs[0]).getCanonicalPath(); - String programConfig = new File(aArgs[1]).getCanonicalPath(); - - BeanFactory factory = new StandaloneCrawlerBeanFactory(); - Notifier notifier = factory.find(Notifier.class); - new KissCrawler(START_URL, SOCKET_TIMEOUT, crawlerConfig, - programConfig, notifier, new Report()); - } - - /** - * Constructs the crawler. This retrieves the TV guide by crawling the KiSS - * EPG guide, filters the guide for interesting programs, tries to record - * them, and sends a summary mail to the user. - * - * @param aCrawlerConfig - * Configuration file for the crawler. - * @param aProgramConfig - * Configuration file describing interesting shows. - * @param aNotifier - * Object used to send notifications of the results. - * @param aReport - * Report to use. - * @throws IOException - * In case of problems reading files. - * @throws NotificationException - * In case notification fails. - * @throws PageException - * In case of problems retrieving the TV guide. - */ - public KissCrawler(String aCrawlerConfig, String aProgramConfig, - Notifier aNotifier, Report aReport) throws IOException, - NotificationException, PageException { - this(START_URL, SOCKET_TIMEOUT, aCrawlerConfig, aProgramConfig, - aNotifier, aReport); - } - - /** - * Constructs the crawler. This retrieves the TV guide by crawling the KiSS - * EPG guide, filters the guide for interesting programs, tries to record - * them, and sends a summary mail to the user. - * - * @param aStartUrl - * Start URL of the electronic programme guide. - * @param aSocketTimeout - * Socket timeout to use. - * @param aCrawlerConfig - * Configuration file for the crawler. - * @param aProgramConfig - * Configuration file describing interesting shows. - * @param aNotifier - * Object used to send notifications of the results. - * @param aReport - * Report to use. - * @throws IOException - * In case of problems reading files. - * @throws NotificationException - * In case notification fails. - * @throws PageException - * In case of problems retrieving the TV guide. - */ - public KissCrawler(String aStartUrl, int aSocketTimeout, - String aCrawlerConfig, String aProgramConfig, Notifier aNotifier, - Report aReport) throws IOException, NotificationException, - PageException { - - _pattern = Pattern.compile(TIME_REGEX); - - try { - HttpClient client = new HttpClient(); - // client.getHostConfiguration().setProxy("127.0.0.1", 3128); - client.getParams().setParameter("http.socket.timeout", - SOCKET_TIMEOUT); - - XslTransformer transformer = new XslTransformer( - new ClasspathUriResolver()); - - Crawler crawler = createCrawler(aCrawlerConfig, client, transformer); - InputStream programConfigFile = new FileInputStream(new File( - aProgramConfig)); - ProgramConfigurationParser parser = new ProgramConfigurationParser(); - parser.parse(programConfigFile); - List programFilters = parser.getFilters(); - - try { - Page page = getStartPage(aStartUrl, crawler, aReport); - TVGuide guide = createGuide(page, aReport); - PrintVisitor printer = new PrintVisitor(System.out); - guide.accept(printer); - processResults(programFilters, guide, aNotifier, aReport); - } catch (PageException e) { - aReport.addMessage("Problem getting TV guide", e); - LOG.info("Problem getting TV guide", e); - throw e; - } - aNotifier.send(aReport.asXml()); - } finally { - System.out.println("Crawler finished"); - } - } - - /** - * Records interesting shows. - * - * @param aProgramCondition - * Condition determining which shows are interesting. - * @param aGuide - * Television guide. - * @throws MessagingException - * In case of problems sending a summary mail. - */ - private void processResults(List aProgramCondition, - TVGuide aGuide, Notifier aNotifier, Report aReport) { - ProgramActionExecutor executor = new ProgramActionExecutor(aReport); - for (ProgramFilter filter : aProgramCondition) { - List programs = filter.apply(aGuide); - ProgramAction action = filter.getAction(); - for (Program program : programs) { - action.execute(program, executor); - } - } - executor.commit(); - - } - - /** - * Creates the crawler. - * - * @param aCrawlerConfig - * Crawler configuration file. - * @param aOs - * Logging output stream for the crawler. - * @param aClient - * HTTP Client to use. - * @return Crawler. - * @throws FileNotFoundException - * In case configuration files cannot be found. - */ - private Crawler createCrawler(String aCrawlerConfig, HttpClient aClient, - XslTransformer aTransformer) throws FileNotFoundException { - ConfigurationParser parser = new ConfigurationParser(aTransformer); - InputStream crawlerConfigFile = new FileInputStream(new File( - aCrawlerConfig)); - Configuration config = parser.parse(crawlerConfigFile); - Crawler crawler = new CrawlerImpl(aClient, config); - return crawler; - } - - /** - * Gets the start page of the electronic programme guide. This involves - * login and navigation to a suitable start page after logging in. - * - * @param aStartUrl - * URL of the electronic programme guide. - * @param aCrawler - * Crawler to use. - * @param aReport - * Report to use. - * @return Starting page. - */ - private Page getStartPage(String aStartUrl, Crawler aCrawler, Report aReport) - throws PageException { - try { - Page page = aCrawler.getPage(aStartUrl, new NameValuePair[0]); - page = page.getAction("login").execute(); - Action favorites = page.getAction("channels-favorites"); - if (favorites == null) { - String msg = "Channels favorites action not found on start page"; - throw new PageException(msg); - } - return favorites.execute(); - } catch (PageException e) { - String msg = "Could not complete login to electronic programme guide."; - throw new PageException(msg, e); - } - } - - /** - * Creates the TV guide by web crawling. - * - * @param aPage - * Starting page. - * @param aReport - * Report to use. - * @return TV guide. - * @throws PageException - * In case of problem getting the tv guide. - */ - private TVGuide createGuide(Page aPage, Report aReport) - throws PageException { - LOG.info("Obtaining full TV guide"); - Action[] actions = aPage.getActions(); - if (actions.length == 0) { - LOG.error("No channels found"); - throw new PageException("No channels found"); - } - List channels = new ArrayList(); - for (Action action : actions) { - try { - LOG.info("Getting channel info for '" + action.getName() + "'"); - Action tomorrow = action.execute().getAction("tomorrow"); - if (tomorrow == null) { - throw new PageException("Channel summary page for '" - + action.getName() - + "' does not contain required information"); - } - Channel channel = createChannel(action.getName(), tomorrow - .execute(), aReport); - channels.add(channel); - if (SystemProperties.isDebugMode()) { - break; // Only one channel is crawled. - } - } catch (PageException e) { - aReport.addMessage("Could not create channel information for '" - + action.getName() + "'"); - LOG.error("Could not create channel information for '" - + action.getName() + "'", e); - } - } - return new TVGuide(channels); - } - - /** - * Create channel information for a specific channel. - * - * @param aChannel - * Channel name. - * @param aPage - * Starting page for the channel. - * @return Channel. - */ - private Channel createChannel(String aChannel, Page aPage, Report aReport) { - LOG.info("Obtaining program for " + aChannel); - Action[] programActions = aPage.getActions(); - List programs = new ArrayList(); - for (Action action : programActions) { - String time = action.getContent().element("time").getText().trim(); - Matcher matcher = _pattern.matcher(time); - if (matcher.matches()) { - Time begin = new Time(Integer.parseInt(matcher.group(1)), - Integer.parseInt(matcher.group(2))); - Time end = new Time(Integer.parseInt(matcher.group(3)), Integer - .parseInt(matcher.group(4))); - TimeInterval interval = new TimeInterval(begin, end); - String description = ""; - String keywords = ""; - - if (!SystemProperties.isNoProgramDetailsRequired()) { - Element descriptionElem = action.getContent().element( - "description"); - if (descriptionElem == null) { - try { - Page programInfo = action.execute(); - description = programInfo.getContent().element( - "description").getText().trim(); - keywords = programInfo.getContent().element( - "keywords").getText().trim(); - } catch (PageException e) { - String msg = "Program details could not be determined for '" - + action.getName() + "'"; - aReport.addMessage(msg, e); - LOG.warn(msg, e); - } - } else { - description = descriptionElem.getTextTrim(); - } - } - Program program = new Program(aChannel, action.getName(), - description, keywords, interval, action); - - LOG.info("Got program " + program); - programs.add(program); - } - } - return new Channel(aChannel, programs); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/KissCrawlerBootstrapper.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/KissCrawlerBootstrapper.java deleted file mode 100644 index 0f9b52d3..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/KissCrawlerBootstrapper.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.crawler.kiss.main; - -import java.io.File; - -import org.wamblee.general.ClassLoaderUtils; - -/** - * Bootstrapper for the kiss crawler which adds all files in the directory - * given by the first argument to the classpath. - */ -public class KissCrawlerBootstrapper { - - public static void main(String[] aArgs) throws Exception { - File libdir = new File(aArgs[0]); - if ( !libdir.isDirectory() ) { - throw new IllegalArgumentException("'" + aArgs[0] + "' is not a directory."); - } - ClassLoaderUtils.addJarsInDirectory(libdir); - String[] args = new String[2]; - args[0] = aArgs[1]; - args[1] = aArgs[2]; - KissCrawler.main(args); - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/ProgramAction.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/ProgramAction.java deleted file mode 100644 index 5211a5e9..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/ProgramAction.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.kiss.main; - -import org.wamblee.crawler.kiss.guide.Program; - -/** - * Represents an action configured for a program. - */ -public interface ProgramAction { - - /** - * Executes the action. - * - * @param aProgram - * Program to execute the action for. - * @param aExecutor - * Executor to use. - */ - void execute(Program aProgram, ProgramActionExecutor aExecutor); -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/ProgramActionExecutor.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/ProgramActionExecutor.java deleted file mode 100644 index 68a4c13d..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/ProgramActionExecutor.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.kiss.main; - -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; -import java.util.TreeSet; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wamblee.crawler.kiss.guide.Program; -import org.wamblee.crawler.kiss.guide.TimeInterval; -import org.wamblee.crawler.kiss.guide.Program.RecordingResult; - -/** - * Provides execution of actions for programs. Actions use this class to tell - * the executor what to do. The executor then decides on exactly what to do and - * in what order and makes decisions in case of conflicts. - */ -public class ProgramActionExecutor { - - private static final Log LOG = LogFactory - .getLog(ProgramActionExecutor.class); - - /** - * Map of priority to set of programs. - */ - private Map> _showsToRecord; - - /** - * Report to use. - */ - private Report _report; - - /** - * Constructs the program action executor. - * - * @param aReport Report to use. - */ - public ProgramActionExecutor(Report aReport) { - _showsToRecord = new TreeMap>(); - _report = aReport; - } - - /** - * Called by an action to indicate the desire to record a program. - * - * @param aPriority - * Priority of the program. Used to resolve conflicts. - * @param aProgram - * Program to record. - */ - public void recordProgram(int aPriority, Program aProgram) { - LOG.info("priority = " + aPriority + ", program: " + aProgram); - // Putting -priority into the set makes sure that iteration order - // over the priorities will go from higher priority to lower priority. - Set programs = _showsToRecord.get(-aPriority); - if (programs == null) { - programs = new TreeSet(new Program.TimeComparator()); - _showsToRecord.put(-aPriority, programs); - } - programs.add(aProgram); - } - - /** - * Called by an action to indicate that a program is interesting. - * - * @param aCategory - * Category of the program. - * @param aProgram - * Program. - */ - public void interestingProgram(String aCategory, Program aProgram) { - LOG.info("category = '" + aCategory + "', program: " + aProgram); - _report.interestingProgram(aCategory, aProgram); - } - - /** - * Makes sure that the actions are performed. - */ - public void commit() { - Set previouslyRecorded = new HashSet(); - for (Integer priority : _showsToRecord.keySet()) { - for (Program program : _showsToRecord.get(priority)) { - TimeInterval interval = program.getInterval(); - if (recordingConflictExists(previouslyRecorded, interval)) { - _report.setRecordingResult(RecordingResult.CONFLICT, program); - } else { - RecordingResult result = program.record(); - _report.setRecordingResult(result, program); - previouslyRecorded.add(interval); - } - } - } - } - - /** - * Checks an interval for overlap with a previously recorded program. - * - * @param aPreviouslyRecorded - * Previously recorded programs. - * @param aInterval - * Interval. - * @return True iff there is a recording conflict. - */ - private boolean recordingConflictExists( - Set aPreviouslyRecorded, TimeInterval aInterval) { - for (TimeInterval recordedInterval : aPreviouslyRecorded) { - if (aInterval.overlap(recordedInterval)) { - return true; - } - } - return false; - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/ProgramConfigurationParser.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/ProgramConfigurationParser.java deleted file mode 100644 index 8a5d5aca..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/ProgramConfigurationParser.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.kiss.main; - -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.dom4j.Attribute; -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.Element; -import org.dom4j.io.SAXReader; -import org.wamblee.conditions.AndCondition; -import org.wamblee.conditions.Condition; -import org.wamblee.conditions.PropertyRegexCondition; -import org.wamblee.crawler.kiss.guide.Program; - -/** - * Parse the configuration of desired programs. - */ -class ProgramConfigurationParser { - private static final int DEFAULT_PRIORITY = 1; - - // Configuration of interesting programs. - - private static final String ELEM_PROGRAM = "program"; - - private static final String ELEM_PRIORITY = "priority"; - - private static final String ELEM_PATTERN = "match"; - - private static final String ELEM_ACTION = "action"; - - private static final String ELEM_CATEGORY = "category"; - - private static final String ACTION_NOTIFY = "notify"; - - private List _filters; - - ProgramConfigurationParser() { - _filters = null; - } - - /** - * Parses the condition used to match the desired programs. - * - * @param aStream - * Input stream to parse from. - * @return Condition. - */ - void parse(InputStream aStream) { - List filters = new ArrayList(); - try { - SAXReader reader = new SAXReader(); - Document document = reader.read(aStream); - - Element root = document.getRootElement(); - - for (Iterator i = root.elementIterator(ELEM_PROGRAM); i.hasNext();) { - Element program = (Element) i.next(); - - Element categoryElem = program.element(ELEM_CATEGORY); - String category = ""; - if (categoryElem != null) { - category = categoryElem.getText().trim(); - } - - Element actionElem = program.element(ELEM_ACTION); - int priority = DEFAULT_PRIORITY; - String priorityString = program.elementTextTrim(ELEM_PRIORITY); - if ( priorityString != null ) { - priority = Integer.valueOf(priorityString); - } - ProgramAction action = new RecordProgramAction(priority); - if (actionElem != null) { - if (actionElem.getText().equals(ACTION_NOTIFY)) { - action = new InterestingProgramAction(category); - } - } - - List> regexConditions = new ArrayList>(); - for (Iterator j = program.elementIterator(ELEM_PATTERN); j - .hasNext();) { - Element patternElem = (Element) j.next(); - String fieldName = "name"; - Attribute fieldAttribute = patternElem.attribute("field"); - if (fieldAttribute != null) { - fieldName = fieldAttribute.getText(); - } - String pattern = ".*(" + patternElem.getText() + ").*"; - regexConditions.add(new PropertyRegexCondition( - fieldName, pattern, true)); - } - Condition condition = new AndCondition( - regexConditions); - filters.add(new ProgramFilter(condition, action)); - } - _filters = filters; - } catch (DocumentException e) { - throw new RuntimeException("Error parsing program configuraiton", e); - } - } - - /** - * Returns the list of program filters. - * - * @return Filter list. - */ - public List getFilters() { - return _filters; - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/ProgramFilter.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/ProgramFilter.java deleted file mode 100644 index e8633401..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/ProgramFilter.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.kiss.main; - -import java.util.List; - -import org.wamblee.conditions.Condition; -import org.wamblee.crawler.kiss.guide.MatchVisitor; -import org.wamblee.crawler.kiss.guide.Program; -import org.wamblee.crawler.kiss.guide.TVGuide; - -/** - * Obtains a list of interesting programs from a TV guide and decides what to do - * with them. - */ -public class ProgramFilter { - - private Condition _condition; - - private ProgramAction _action; - - /** - * Constructs the program filter. - * @param aCondition Condition used to find interesting programs. - * @param aAction Corresponding action to execute for matching programs. - */ - public ProgramFilter(Condition aCondition, ProgramAction aAction) { - _condition = aCondition; - _action = aAction; - } - - /** - * Gets the action. - * @return Action. - */ - public ProgramAction getAction() { - return _action; - } - - /** - * Applies the filter to a TV guide. - * @param aGuide TV guide. - * @return List of matching programs. - */ - public List apply(TVGuide aGuide) { - MatchVisitor matcher = new MatchVisitor(_condition); - aGuide.accept(matcher); - return matcher.getMatches(); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/RecordProgramAction.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/RecordProgramAction.java deleted file mode 100644 index 4cbe12bc..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/RecordProgramAction.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.kiss.main; - -import org.wamblee.crawler.kiss.guide.Program; - -/** - * Represents an action to record a program. - */ -public class RecordProgramAction implements ProgramAction { - - private int _priority; - - /** - * Constructs the action. - * @param aPriority Priority of the recording action. Higher values have higher - * priority. - */ - public RecordProgramAction(int aPriority) { - _priority = aPriority; - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.crawler.kiss.ProgramAction#execute(org.wamblee.crawler.kiss.Program, - * org.wamblee.crawler.kiss.Report) - */ - public void execute(Program aProgram, ProgramActionExecutor aReport) { - aReport.recordProgram(_priority, aProgram); - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/Report.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/Report.java deleted file mode 100644 index a3d75fea..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/Report.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.kiss.main; - -import java.util.ArrayList; -import java.util.EnumMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; -import java.util.TreeSet; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.dom4j.DocumentFactory; -import org.dom4j.Element; -import org.wamblee.crawler.kiss.guide.Program; -import org.wamblee.crawler.kiss.guide.Program.RecordingResult; - -/** - * Represents a report on the actions of the crawler. - */ -public class Report { - - private static final Log LOG = LogFactory - .getLog(Report.class); - - /** - * A map of category name to a set of program. Useful for displaying the - * output of possibly interesting programs on a per category basis. - */ - private Map> _interestingShows; - - /** - * Map or recording result to a set of programs. - */ - private EnumMap> _recordings; - - /** - * Messages generated while doing all the work. - */ - private List _messages; - - /** - * Constructs the report. - * - */ - public Report() { - _interestingShows = new TreeMap>(); - _recordings = new EnumMap>( - RecordingResult.class); - for (RecordingResult result : RecordingResult.values()) { - _recordings.put(result, new TreeSet( - new Program.TimeComparator())); - } - _messages = new ArrayList(); - } - - /** - * Adds a message. - * - * @param aMessage - * Message to add. - */ - public void addMessage(String aMessage) { - _messages.add(aMessage); - } - - /** - * Adds a message. - * - * @param aMessage - * Message to add. - * @param aException Exception that caused the problem. - */ - public void addMessage(String aMessage, Exception aException) { - String msg = aMessage; - for (Throwable e = aException; e != null; e = e.getCause()) { - msg += ": " + e.getMessage(); - } - addMessage(msg); - } - - /** - * Called to indicate that a program is interesting. - * - * @param aCategory - * Category of the program. - * @param aProgram - * Program. - */ - public void interestingProgram(String aCategory, Program aProgram) { - LOG.info("category = '" + aCategory + "', program: " + aProgram); - Set programs = _interestingShows.get(aCategory); - if (programs == null) { - programs = new TreeSet(new Program.TimeComparator()); - _interestingShows.put(aCategory, programs); - } - programs.add(aProgram); - } - - /** - * Called to specify the result of recording a program. - * @param aResult Result. - * @param aProgram Program. - */ - public void setRecordingResult(RecordingResult aResult, Program aProgram) { - _recordings.get(aResult).add(aProgram); - } - - - /** - * Get report as XML. - * - * @return XML report - */ - public Element asXml() { - DocumentFactory factory = DocumentFactory.getInstance(); - Element report = factory.createElement("report"); - - if (_messages.size() > 0) { - Element messages = report.addElement("messages"); - for (String message : _messages) { - messages.addElement("message").setText(message); - } - } - - Set reportedPrograms = new HashSet(); - - for (RecordingResult result : RecordingResult.values()) { - if (_recordings.get(result).size() > 0) { - Element recordingResult = report.addElement("recorded") - .addAttribute("result", result.toString()); - - for (Program program : _recordings.get(result)) { - recordingResult.add(program.asXml()); - reportedPrograms.add(program); - } - } - } - - if (_interestingShows.size() > 0) { - Element interesting = report.addElement("interesting"); - for (String category : _interestingShows.keySet()) { - Element categoryElem = interesting; - if (category.length() > 0) { - categoryElem = interesting.addElement("category"); - categoryElem.addAttribute("name", category); - } - for (Program program : _interestingShows.get(category)) { - if (!reportedPrograms.contains(program)) { - categoryElem.add(program.asXml()); - } else { - LOG.info("Category '" + category + "', program " - + program + " already reported"); - } - } - if (categoryElem.elements().size() == 0) { - // Remove empty category element. - LOG - .info("Removing element for category '" + category - + "'"); - interesting.remove(categoryElem); - } - } - - } - - return report; - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/StandaloneCrawlerBeanFactory.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/StandaloneCrawlerBeanFactory.java deleted file mode 100644 index ad43c0a4..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/StandaloneCrawlerBeanFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.crawler.kiss.main; - -import org.wamblee.general.SpringBeanFactory; - -/** - * Bean factory used for the standalone crawler application. - */ -public class StandaloneCrawlerBeanFactory extends SpringBeanFactory { - - private static final String LOCATOR = "crawler-standalone.xml"; - private static final String FACTORY_NAME = "crawlerStandalone"; - - /** - * Constructs the factory. - * - */ - public StandaloneCrawlerBeanFactory() { - super(LOCATOR, FACTORY_NAME); - } -} \ No newline at end of file diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/SystemProperties.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/SystemProperties.java deleted file mode 100644 index 87003af4..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/SystemProperties.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.kiss.main; - -/** - * Access to system properties for the crawler. - */ -public final class SystemProperties { - - private static final String DEBUG_PROPERTY = "kiss.debug"; - - private static final String NO_PROGRAM_DETAILS = "kiss.nodetails"; - - private static final String DISABLE_RECORD = "kiss.norecord"; - - /** - * Disabled constructor. - * - */ - private SystemProperties() { - // Empty. - } - - /** - * Determines if the system is run in debug mode. When in debug mode, less - * extensive crawling is done. - * - * @return True iff we are running in debug mode. - */ - public static boolean isDebugMode() { - return System.getProperties().getProperty(DEBUG_PROPERTY) != null; - } - - /** - * Determines if no program details are required. - * - * @return True iff no program details are required. - */ - public static boolean isNoProgramDetailsRequired() { - return System.getProperties().getProperty(NO_PROGRAM_DETAILS) != null; - } - - /** - * Determines if recording is disabled. - * - * @return True iff no recording should be done. - */ - public static boolean isRecordDisabled() { - return System.getProperties().getProperty(DISABLE_RECORD) != null; - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/package.html b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/package.html deleted file mode 100644 index 79b98c3e..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/main/package.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - wamblee.org - - - -This package contains the crawling logic of the KiSS EPG site as well -as the configuration classes. - - - -@since - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/notification/MailNotifier.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/notification/MailNotifier.java deleted file mode 100644 index e4646572..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/notification/MailNotifier.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.crawler.kiss.notification; - -import java.io.IOException; -import java.util.Arrays; -import java.util.Date; - -import javax.mail.internet.AddressException; -import javax.mail.internet.InternetAddress; -import javax.xml.transform.TransformerException; - -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.HtmlEmail; -import org.dom4j.Element; -import org.wamblee.xml.XslTransformer; - -/** - * A notifier that uses SMTP to notify users by mail. - * - */ -public class MailNotifier implements Notifier { - - private String _from; - - private String _to; - - private String _subject; - - private String _htmlXslt; - - private String _textXslt; - - private MailServer _server; - - private XslTransformer _transformer; - - /** - * Constructs the notifier. - * - * @param aFrom - * Sender mail address to use. - * @param aTo - * Recipient mail address to use. - * @param aSubject - * Subject to use in the email. - * @param aHtmlXslt - * XSLT file to transform the report into HTML. - * @param aTextXslt - * XSLT file to transform the report into text. - * @param aServer - * Mail server to use. - * @param aTransformer Transformer to use. - */ - public MailNotifier(String aFrom, String aTo, String aSubject, - String aHtmlXslt, String aTextXslt, MailServer aServer, XslTransformer aTransformer) { - _from = aFrom; - _to = aTo; - _subject = aSubject; - _htmlXslt = aHtmlXslt; - _textXslt = aTextXslt; - _server = aServer; - _transformer = aTransformer; - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.crawler.kiss.Notifier#send(org.dom4j.Element) - */ - public void send(Element aReport) throws NotificationException { - HtmlEmail mail = new HtmlEmail(); - try { - mail.setFrom(_from); - mail - .setTo(Arrays - .asList(new InternetAddress[] { new InternetAddress( - _to) })); - mail.setSentDate(new Date()); - mail.setSubject(_subject); - - String htmlText = transformReport(aReport, _htmlXslt); - String plainText = transformReport(aReport, _textXslt); - - mail.setHtmlMsg(htmlText); - mail.setTextMsg(plainText); - - _server.send(mail); - } catch (EmailException e) { - throw new NotificationException(e.getMessage(), e); - } catch (TransformerException e) { - throw new NotificationException(e.getMessage(), e); - } catch (IOException e) { - throw new NotificationException(e.getMessage(), e); - } catch (AddressException e) { - throw new NotificationException(e.getMessage(), e); - } - } - - /** - * Transforms a report into a destination format. - * - * @param aReport - * Report to transform - * @param aXslt - * XSLT to use. - * @return Transformed result. - * @throws IOException - * In case of IO problems. - * @throws TransformerException - * In case of problems transforming. - */ - private String transformReport(Element aReport, String aXslt) - throws IOException, TransformerException { - String reportXmlText = aReport.asXML(); - return _transformer.textTransform(reportXmlText.getBytes(), _transformer.resolve(aXslt)); - } - - /* (non-Javadoc) - * @see org.wamblee.crawler.kiss.notification.Notifier#asHtml(org.dom4j.Element) - */ - public String asHtml(Element aReport) throws IOException, TransformerException { - return transformReport(aReport, _htmlXslt); - } - - /* (non-Javadoc) - * @see org.wamblee.crawler.kiss.notification.Notifier#asText(org.dom4j.Element) - */ - public String asText(Element aReport) throws IOException, TransformerException { - return transformReport(aReport, _textXslt); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/notification/MailServer.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/notification/MailServer.java deleted file mode 100644 index fd0bd2df..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/notification/MailServer.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.crawler.kiss.notification; - -import java.util.Properties; - -import javax.mail.Session; - -import org.apache.commons.mail.Email; -import org.apache.commons.mail.EmailException; - -/** - * Mail server. - */ -public class MailServer { - - private String _host; - - private int _port; - - private String _username; - - private String _password; - - /** - * Constructs the mail server. - * - * @param aHost - * Host name of the SMTP server. - * @param aPort - * Port name of the SMTP server. - * @param aUsername - * Username to use for authentication or null if no - * authentication is required. - * @param aPassword - * Password to use for authentication or null if no authenticatio - * is required. - */ - public MailServer(String aHost, int aPort, String aUsername, - String aPassword) { - _host = aHost; - _port = aPort; - _username = aUsername; - _password = aPassword; - } - - /** - * Sends an e-mail. - * - * @param aMail - * Mail to send. - * @throws EmailException - * In case of problems sending the mail. - */ - public void send(Email aMail) throws EmailException { - Properties props = new Properties(); - props.put("mail.transport.protocol", "smtp"); - props.put("mail.smtp.host", _host); - props.put("mail.smtp.port", "" + _port); - - Session mailSession = Session.getInstance(props, - new UsernamePasswordAuthenticator(_username, _password)); - aMail.setMailSession(mailSession); - aMail.send(); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/notification/NotificationException.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/notification/NotificationException.java deleted file mode 100644 index 82a7ab95..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/notification/NotificationException.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.crawler.kiss.notification; - -/** - * Notification exception thrown in case of problems sending a notification to a - * user. - * - */ -public class NotificationException extends Exception { - - /** - * Constructs the notification. - * - * @param aMsg - * Message. - */ - public NotificationException(String aMsg) { - super(aMsg); - } - - /** - * Constructs the notification. - * - * @param aMsg - * Message. - * @param aCause - * Cause. - */ - public NotificationException(String aMsg, Throwable aCause) { - super(aMsg, aCause); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/notification/Notifier.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/notification/Notifier.java deleted file mode 100644 index eda91ba9..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/notification/Notifier.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.crawler.kiss.notification; - -import java.io.IOException; - -import javax.xml.transform.TransformerException; - -import org.dom4j.Element; - -/** - * Object used to send notifications about the actions of the crawler. - * - */ -public interface Notifier { - - /** - * Sends a notification. - * - * @param aReport - * Report to send. - */ - void send(Element aReport) throws NotificationException; - - /** - * Converts the report to html. - * @param aReport Report to convert. - * @return - */ - String asHtml(Element aReport) throws IOException, TransformerException; - - /** - * Converts the report to text. - * @param aReport Report to convert. - * @return - */ - String asText(Element aReport) throws IOException, TransformerException; -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/notification/UsernamePasswordAuthenticator.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/notification/UsernamePasswordAuthenticator.java deleted file mode 100644 index cf814bde..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/notification/UsernamePasswordAuthenticator.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.crawler.kiss.notification; - -import javax.mail.Authenticator; -import javax.mail.PasswordAuthentication; - -/** - * Authenticator to supply username and password to the mail server (if needed). - * - */ -public class UsernamePasswordAuthenticator extends Authenticator { - - private String _username; - - private String _password; - - /** - * Constructs the authenticator. - * - * @param aUsername - * User name. - * @param aPassword - * Password. - */ - public UsernamePasswordAuthenticator(String aUsername, String aPassword) { - _username = aUsername; - _password = aPassword; - } - - /* - * (non-Javadoc) - * - * @see javax.mail.Authenticator#getPasswordAuthentication() - */ - @Override - protected PasswordAuthentication getPasswordAuthentication() { - if (_username == null) { - return null; - } - return new PasswordAuthentication(_username, _password); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/notification/package.html b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/notification/package.html deleted file mode 100644 index e685c6a1..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/notification/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - wamblee.org - - - -Contains the classes for notifying users of the results of crawling. - - - -@since - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/package.html b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/package.html deleted file mode 100644 index 91bbeabd..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/java/org/wamblee/crawler/kiss/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - wamblee.org - - - -This package provides a crawler for the KiSS electronic program guide. -It provides automatic recording of programs that satisfy criteria specified -by the user. - -The following packages are defined: -
    -
  • {@link org.wamblee.crawler.kiss.main}: Contains the crawling functionality and - configuration classes. -
  • -
  • {@link org.wamblee.crawler.kiss.guide}: Contains the TV guide object model and the - classes for searching relevant programs in the guide. -
  • -
  • {@link org.wamblee.crawler.kiss.notification}: Contains the classes for - notification. -
  • -
- - - -@since - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channel-overview.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channel-overview.xsl deleted file mode 100644 index 59c807b1..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channel-overview.xsl +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - right-now - - - evening - - - afternoon - - - noon - - - morning - - - tomorrow - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channel-right-now-graphic.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channel-right-now-graphic.xsl deleted file mode 100644 index 6b5070c4..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channel-right-now-graphic.xsl +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - program-info - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channel-right-now-mobile.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channel-right-now-mobile.xsl deleted file mode 100644 index ea5ba680..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channel-right-now-mobile.xsl +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - program-info - - - - - - - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channel-right-now-output.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channel-right-now-output.xml deleted file mode 100644 index 6597e6ad..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channel-right-now-output.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -BackHomeLogout diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channel-right-now.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channel-right-now.xsl deleted file mode 100644 index 5885f71e..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channel-right-now.xsl +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - program-info - - - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channels-favorites-graphic.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channels-favorites-graphic.xsl deleted file mode 100644 index 75865029..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channels-favorites-graphic.xsl +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channels-favorites.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channels-favorites.xsl deleted file mode 100644 index ec9b1d6d..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/channels-favorites.xsl +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - channel-overview - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/crawler-standalone.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/crawler-standalone.xml deleted file mode 100644 index 860240bb..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/crawler-standalone.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - org.wamblee.crawler.properties.xml - org.wamblee.crawler.notification.xml - - - - - \ No newline at end of file diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/identity.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/identity.xsl deleted file mode 100644 index 822e8e83..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/identity.xsl +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/login-graphic.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/login-graphic.xsl deleted file mode 100644 index 692d196c..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/login-graphic.xsl +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - channels-whats-on-now - - - channels-whats-on - - - channels-favorites - - - - - - - - - - shows-whats-on - - - shows-search - - - shows-favorites - - - shows-add-favorite - - - - - - - movies-whats-on - - - - - - sports-whats-on - - - - logout - - - manual-recording - - - view-recordings - - - unknown - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/login-mobile.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/login-mobile.xsl deleted file mode 100644 index 70f4a5b6..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/login-mobile.xsl +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - channels-whats-on-now - - - channels-whats-on - - - channels-favorites - - - - - - - - - shows-whats-on - - - shows-search - - - shows-favorites - - - shows-add-favorite - - - - - - - movies-whats-on - - - - - - sports-whats-on - - - - logout - - - manual-recording - - - view-recordings - - - unknown - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/login.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/login.xsl deleted file mode 100644 index 069cb939..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/login.xsl +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - channels-whats-on-now - - - channels-whats-on - - - channels-favorites - - - - shows-whats-on - - - shows-search - - - shows-favorites - - - shows-add-favorite - - - - movies-whats-on - - - - - sports-whats-on - - - - logout - - - manual-recording - - - view-recordings - - - unknown - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/mainpage.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/mainpage.xsl deleted file mode 100644 index 11c81fcd..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/mainpage.xsl +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - login - - login - - - - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/org.wamblee.crawler.notification.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/org.wamblee.crawler.notification.xml deleted file mode 100644 index 3b8d58a3..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/org.wamblee.crawler.notification.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - ${org.wamblee.crawler.smtp.host} - ${org.wamblee.crawler.smtp.port} - ${org.wamblee.crawler.smtp.username} - ${org.wamblee.crawler.smtp.password} - - - - - - - - - - - ${org.wamblee.crawler.notification.from} - ${org.wamblee.crawler.notification.to} - ${org.wamblee.crawler.notification.subject} - reportToHtml.xsl - reportToText.xsl - - - - \ No newline at end of file diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/org.wamblee.crawler.properties.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/org.wamblee.crawler.properties.xml deleted file mode 100644 index e92b028d..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/org.wamblee.crawler.properties.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - org.wamblee.crawler.properties - - - - \ No newline at end of file diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/program-info-mobile.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/program-info-mobile.xsl deleted file mode 100644 index d92391f4..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/program-info-mobile.xsl +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - record - - - - - - recorded - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/program-info.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/program-info.xsl deleted file mode 100644 index ec0f9797..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/program-info.xsl +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - record - - - - - - recorded - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/recorded.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/recorded.xsl deleted file mode 100644 index 866c51bb..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/recorded.xsl +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - DUPLICATE - - - CONFLICT - - - ERROR - - - - - OK - - - - - - - - - - - - TEXT NODE - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/reportToHtml.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/reportToHtml.xsl deleted file mode 100644 index 23bc1730..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/reportToHtml.xsl +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - KiSS crawler report - - -

KiSS crawler report

- - -

Possibly interesting programs

- -
- - No suitable programs found - - - - - -
- - -

- - - -
-
-

-
- - -

- - - Successfully recorded programs - - - - Already recorded programs - - - - Conflicts with other recorded programs - - - - Programs that could not be recorded for - technical reasons. - - - -

-
- - - - - : - - (/) - - - - -
- - - -
- - - - -
- - - - - - - - - - - -

Category:

- -
- - -

Messages

-
    - -
  • - - -
  • -
    -
-
-
- diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/reportToText.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/reportToText.xsl deleted file mode 100644 index 741a678d..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/reportToText.xsl +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - KiSS crawler report - - - - - - Possibly interesting programs - - - - - - - - - - - - - - - - Successfully recorded programs - - - - - - Already recorded programs - - - - - - Conflicts with other recorded programs - - - - - - Programs that could not be recorded for technical reasons. - - - - - - - - - - * - - - : - - ( - - / - ) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Category: - - - - - - - Messages - - - - * - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/utilities.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/utilities.xsl deleted file mode 100644 index c98c1139..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kiss/src/main/resources/utilities.xsl +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/pom.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/pom.xml deleted file mode 100644 index 0a03cbdb..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - org.wamblee - wamblee-crawler - 0.2-SNAPSHOT - - - 4.0.0 - org.wamblee - wamblee-crawler-kissweb - war - wamblee.org KiSS crawler web interface - http://wamblee.org - - - - org.wamblee - wamblee-crawler-kiss - - - quartz - quartz - - - javax.servlet - servlet-api - - - jstl - jstl - - - taglibs - standard - - - - - - - - org.apache.maven.plugins - maven-war-plugin - - ${basedir}/src/webapp/WEB-INF/web.xml - wamblee-crawler-kissweb - src/webapp - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/scheduling/CrawlerExecutor.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/scheduling/CrawlerExecutor.java deleted file mode 100644 index c5dba6fd..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/scheduling/CrawlerExecutor.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.crawler.kiss.scheduling; - -import java.util.Date; - -import org.wamblee.crawler.kiss.main.Report; - -/** - * Encapsulates the actual execution of the crawler. - * This interface makes it possible to test the scheduling logic - * in isolation. - * - */ -public interface CrawlerExecutor { - - /** - * Executes the crawler. - * @param aDate Date the crawler is being triggered. - * @param The report from the crawler. - * @throws Exception - */ - void execute(Date aDate, Report aReport) throws Exception; -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/scheduling/CrawlerExecutorImpl.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/scheduling/CrawlerExecutorImpl.java deleted file mode 100644 index d807d57f..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/scheduling/CrawlerExecutorImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.crawler.kiss.scheduling; - -import java.util.Date; - -import org.wamblee.crawler.kiss.main.KissCrawler; -import org.wamblee.crawler.kiss.main.Report; -import org.wamblee.crawler.kiss.notification.Notifier; - -/** - * Implementation which executes the KiSS crawler for retrieving web content. - */ -public class CrawlerExecutorImpl implements CrawlerExecutor { - - private String _crawlerConfig; - private String _programConfig; - private Notifier _notifier; - - /** - * Constructs the crawler executor. - * @param aCrawlerConfig Crawler configuration file. - * @param aProgramConfig Program configuration file. - * @param aNotifier Object used to send notifications. - */ - public CrawlerExecutorImpl(String aCrawlerConfig, String aProgramConfig, Notifier aNotifier) { - _crawlerConfig = aCrawlerConfig; - _programConfig = aProgramConfig; - _notifier = aNotifier; - } - - /* (non-Javadoc) - * @see org.wamblee.crawler.kiss.scheduling.CrawlerScheduler.CrawlerExecutor#execute(java.util.Date) - */ - public void execute(Date aDate, Report aReport) throws Exception { - new KissCrawler(_crawlerConfig, _programConfig, _notifier, aReport); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/scheduling/CrawlerScheduler.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/scheduling/CrawlerScheduler.java deleted file mode 100644 index fefb8d98..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/scheduling/CrawlerScheduler.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.crawler.kiss.scheduling; - -/** - * Interface to the scheduler specific for working with the crawler. - */ -public interface CrawlerScheduler { - - /** - * Initializes the scheduler. - * @throws Exception In case of problems. - */ - void initialize() throws Exception; - - /** - * Checks if the crawler is running. - * @return True iff the crawler is running. - * @throws Exception In case of problems. - */ - boolean isCrawlerRunning() throws Exception; - - /** - * Schedules the crawler for immediate execution. - * @throws Exception In case of problems. - */ - void scheduleNow() throws Exception; - - /** - * Shuts down the scheduler. - * @throws Exception In case of problems. - */ - void shutdown() throws Exception; -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/scheduling/CrawlerStatus.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/scheduling/CrawlerStatus.java deleted file mode 100644 index 065a2294..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/scheduling/CrawlerStatus.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.crawler.kiss.scheduling; - -import java.io.Serializable; -import java.util.Calendar; -import java.util.Date; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wamblee.crawler.kiss.main.Report; - -/** - * This class encapsulates the logic for deciding whether to - * run the crawler. This provides the mechanism to keep the - * scheduler simple (e.g. scheduling every hour) and providing - * more complex logic for determining whether to run the - * crawler. - */ -public class CrawlerStatus implements Serializable { - - private static final Log LOG = LogFactory.getLog(CrawlerStatus.class); - - private CrawlerExecutor _crawler; - private Date _lastExecuted; - private boolean _lastResult; - private Exception _lastException; - private Report _lastReport; - private int _hourMin; - private int _hourMax; - private boolean _mustExecute; - - /** - * Constructs the scheduler. - * The crawler will run if it is triggered in the range between the minimum (included) - * and maximum (included) hour of the day if either - *
    - *
  • it is triggered for the first time on the current day.
  • - *
  • an earlier crawling attempt on the same day failed.
  • - *
- * @param aCrawler The interface through which the crawler is executed. - * @param aHourMin The crawler may only run if hour >= aHourMin - * @param aHourMax The crawler may only run if hour <= aHourMax - */ - public CrawlerStatus(CrawlerExecutor aCrawler, int aHourMin, int aHourMax) { - _crawler = aCrawler; - _lastExecuted = new Date(); - _lastResult = true; // the crawler will automatically run the next day. - _lastException = null; - _lastReport = null; - _hourMin = aHourMin; - _hourMax = aHourMax; - _mustExecute = false; - } - - /** - * Determines whether or not the crawler must be run the next time it is triggered. - * @param aMustExecute If true then the crawler will run the next time it is triggered - * by the scheduler. - */ - public void setMustExecute(boolean aMustExecute) { - _mustExecute = aMustExecute; - } - - /** - * Called by a scheduled job. This determines whether the crawler must be run or - * not. This encapsulates the rukes for retrying and scheduling the crawler. - * @param aDate Time at which we are executing now. - */ - public void execute(Date aDate) { - - if (mustExecute(aDate)) { - LOG.info("Executing crawler at " + aDate); - Report report = new Report(); - try { - _crawler.execute(aDate, report); - _lastResult = true; - _lastException = null; - } catch (Exception e) { - _lastResult = false; - _lastException = e; - } finally { - _lastExecuted = aDate; - _lastReport = report; - } - } - } - - /** - * Gets the time the crawler was last executed. - * @return Time of last execution. - */ - public Date getLastExecuted() { - return _lastExecuted; - } - - /** - * Gets the result of the last execution. - * @return True iff last execution was a success. - */ - public boolean getLastResult() { - return _lastResult; - } - - /** - * Gets the exception thrown by the last execution. - * @return null if the last execution was successful or an exception - * otherwise. - */ - public Exception getLastException() { - return _lastException; - } - - /** - * Gets the last report from the scheduler. - * @return Report. - */ - public Report getLastReport() { - return _lastReport; - } - - /** - * Determines whether or not the crawler must be run. - * @param aDate Current time. - * @return True iff the crawler must be run. - */ - private boolean mustExecute(Date aDate) { - if (_mustExecute) { - _mustExecute = false; - return true; - } - if ( _lastExecuted == null ) { - return false; // crawler must be started manually at least once after deployment. - } - Calendar calendar = Calendar.getInstance(); - calendar.setTime(aDate); - int hour = calendar.get(Calendar.HOUR_OF_DAY); - if ( hour < _hourMin ) { - return false; - } - if (hour > _hourMax ) { - return false; - } - - if ( !lastExecutionWasOnSameDay(aDate)) { - return true; // First execution of today. - } - // last execution was on the same day. - if ( !_lastResult ) { - return true; // last execution of today was unsuccessful, retry. - } - return false; // already run successfully today. - } - - /** - * Determines if the last execution was on the same day. - * @param aDate Current time. - * @return True iff last execution was on the same day. - */ - private boolean lastExecutionWasOnSameDay(Date aDate) { - if ( _lastExecuted == null ) { - return false; - } - int curDay = getDayOfYear(aDate); - int lastDay = getDayOfYear(_lastExecuted); - return curDay == lastDay; // check can be invalid only if scheduling interval is one year, - // which is ridiculous. - } - - /** - * Gets the day of the year - * @param aDate Date to compute day for. - */ - private int getDayOfYear(Date aDate) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(aDate); - return calendar.get(Calendar.DAY_OF_YEAR); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/scheduling/quartz/CrawlerJob.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/scheduling/quartz/CrawlerJob.java deleted file mode 100644 index 60e59e83..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/scheduling/quartz/CrawlerJob.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.crawler.kiss.scheduling.quartz; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.quartz.JobExecutionContext; -import org.quartz.JobExecutionException; -import org.quartz.StatefulJob; -import org.wamblee.crawler.kiss.scheduling.CrawlerStatus; -import org.wamblee.general.BeanKernel; - -/** - * Quartz job to execute the crawler. - */ -public class CrawlerJob implements StatefulJob { - - private static final Log LOG = LogFactory.getLog(CrawlerJob.class); - - /** - * Constructs the job. - * - */ - public CrawlerJob() { - // Empty. - } - - /* - * (non-Javadoc) - * - * @see org.quartz.Job#execute(org.quartz.JobExecutionContext) - */ - public void execute(JobExecutionContext aContext) - throws JobExecutionException { - LOG.info("Job triggered"); - try { - CrawlerStatus schedule = BeanKernel.getBeanFactory().find( - CrawlerStatus.class); - schedule.execute(aContext.getFireTime()); - } catch (Exception e) { - throw new JobExecutionException("Error executing crawler", e, false); - } - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/scheduling/quartz/QuartzCrawlerScheduler.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/scheduling/quartz/QuartzCrawlerScheduler.java deleted file mode 100644 index 5fa7cf86..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/scheduling/quartz/QuartzCrawlerScheduler.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.crawler.kiss.scheduling.quartz; - -import java.util.Date; -import java.util.List; - -import org.quartz.JobDetail; -import org.quartz.Scheduler; -import org.quartz.SchedulerException; -import org.quartz.SchedulerFactory; -import org.quartz.SimpleTrigger; -import org.quartz.Trigger; -import org.quartz.TriggerUtils; -import org.quartz.impl.StdSchedulerFactory; -import org.wamblee.crawler.kiss.scheduling.CrawlerScheduler; - -/** - * Interface to the Quartz scheduler. - */ -public class QuartzCrawlerScheduler implements CrawlerScheduler { - - /** - * - */ - private static final String TRIGGER_NAME = "interval"; - - /** - * - */ - private static final String JOB_NAME = "kisscrawler"; - - private Scheduler _scheduler; - - private int _intervalInSeconds; - - /** - * Constructs the quartz interface. - * @param aIntervalInSeconds Scheduling interval in seconds. - * @throws SchedulerException - */ - public QuartzCrawlerScheduler(int aIntervalInSeconds) throws SchedulerException { - SchedulerFactory schedulerFactory = new StdSchedulerFactory(); - _scheduler = schedulerFactory.getScheduler(); - _intervalInSeconds = aIntervalInSeconds; - } - - /** - * Initializes the scheduler. - * @throws SchedulerException - */ - public void initialize() throws SchedulerException { - _scheduler.start(); - - JobDetail jobDetail = new JobDetail(JOB_NAME, null, CrawlerJob.class); - Trigger trigger = TriggerUtils.makeSecondlyTrigger(_intervalInSeconds); - //trigger.setStartTime(TriggerUtils.getEvenHourDate(new Date())); - trigger.setStartTime(new Date()); - trigger.setName(TRIGGER_NAME); - - _scheduler.scheduleJob(jobDetail, trigger); - } - - /* (non-Javadoc) - * @see org.wamblee.crawler.kiss.scheduling.CrawlerScheduler#isCrawlerRunning() - */ - public boolean isCrawlerRunning() throws Exception { - List jobs = _scheduler.getCurrentlyExecutingJobs(); - return jobs.size() > 0; - } - - /* (non-Javadoc) - * @see org.wamblee.crawler.kiss.scheduling.CrawlerScheduler#scheduleNow() - */ - public void scheduleNow() throws Exception { - Trigger trigger = new SimpleTrigger("immediate", null); - trigger.setJobName(JOB_NAME); - _scheduler.scheduleJob(trigger); - } - - /** - * Shuts down the scheduler. - * @throws SchedulerException - */ - public void shutdown() throws SchedulerException { - _scheduler.shutdown(); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/servlet/Application.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/servlet/Application.java deleted file mode 100644 index 9220a62f..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/servlet/Application.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.crawler.kiss.servlet; - -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; - -import org.wamblee.crawler.kiss.scheduling.CrawlerScheduler; -import org.wamblee.general.BeanKernel; - -/** - * The mechanism for kick starting the scheduling of the KiSS crawler. - */ -public class Application implements ServletContextListener { - - /** - * Constructs the listener. - * - */ - public Application() { - // Empty. - } - - /* - * (non-Javadoc) - * - * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent) - */ - public void contextInitialized(ServletContextEvent aEvent) { - aEvent.getServletContext().log("KiSS Crawler initializing"); - try { - getScheduler().initialize(); - } catch (Exception e) { - aEvent.getServletContext().log("Error scheduling job", e); - return; - } - aEvent.getServletContext().log("KiSS Crawler initialized"); - } - - /* - * (non-Javadoc) - * - * @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent) - */ - public void contextDestroyed(ServletContextEvent aEvent) { - aEvent.getServletContext().log("KiSS Crawler shutting down"); - try { - getScheduler().shutdown(); - } catch (Exception e) { - aEvent.getServletContext().log("Error scheduling job", e); - return; - } - aEvent.getServletContext().log("KiSS Crawler shut down complete"); - } - - /** - * Gets the scheduler from Spring. - * @return Scheduler. - */ - private CrawlerScheduler getScheduler() { - return BeanKernel.getBeanFactory().find(CrawlerScheduler.class); - } - - public static void main(String[] aArgs) throws Exception { - Application application = new Application(); - application.getScheduler().initialize(); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/servlet/CrawlerServlet.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/servlet/CrawlerServlet.java deleted file mode 100644 index a8d3597c..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/servlet/CrawlerServlet.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.crawler.kiss.servlet; - -import java.io.IOException; -import java.io.OutputStream; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.wamblee.crawler.kiss.main.Report; -import org.wamblee.crawler.kiss.notification.Notifier; -import org.wamblee.crawler.kiss.scheduling.CrawlerScheduler; -import org.wamblee.crawler.kiss.scheduling.CrawlerStatus; -import org.wamblee.general.BeanKernel; - -/** - * - */ -public class CrawlerServlet extends HttpServlet { - - /* - * (non-Javadoc) - * - * @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, - * javax.servlet.http.HttpServletResponse) - */ - @Override - protected void doPost(HttpServletRequest aRequest, - HttpServletResponse aResponse) throws ServletException, IOException { - - CrawlerScheduler scheduler = BeanKernel.getBeanFactory().find( - CrawlerScheduler.class); - CrawlerStatus status = BeanKernel.getBeanFactory().find( - CrawlerStatus.class); - - try { - if (aRequest.getParameter("details") != null) { - Report report = status.getLastReport(); - if (report != null) { - Notifier notifier = BeanKernel.getBeanFactory().find(Notifier.class); - aResponse.setContentType("text/html"); - OutputStream os = aResponse.getOutputStream(); - os.write(notifier.asHtml(report.asXml()).getBytes()); - return; - } - } - if (aRequest.getParameter("runnow") != null) { - status.setMustExecute(true); - scheduler.scheduleNow(); - aResponse.sendRedirect(""); - return; - } - aRequest.setAttribute("running", scheduler.isCrawlerRunning()); - aRequest.setAttribute("lastExecuted", status.getLastExecuted()); - aRequest.setAttribute("lastResult", status.getLastResult()); - aRequest.setAttribute("lastException", status.getLastException()); - aRequest.setAttribute("lastReport", status.getLastReport()); - String msg = ""; - Throwable e = status.getLastException(); - while (e != null) { - msg = msg + e.getClass().getName() + ": " + e.getMessage() - + "
"; - e = e.getCause(); - } - aRequest.setAttribute("lastMessage", msg); - } catch (Exception e) { - throw new ServletException("Error getting status", e); - } - aRequest.getRequestDispatcher("WEB-INF/overview.jsp").forward(aRequest, - aResponse); - } - - /* - * (non-Javadoc) - * - * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, - * javax.servlet.http.HttpServletResponse) - */ - @Override - protected void doGet(HttpServletRequest aRequest, - HttpServletResponse aResponse) throws ServletException, IOException { - doPost(aRequest, aResponse); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/spring/CrawlerBeanFactory.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/spring/CrawlerBeanFactory.java deleted file mode 100644 index e101b9e7..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/java/org/wamblee/crawler/kiss/spring/CrawlerBeanFactory.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.crawler.kiss.spring; -import org.wamblee.general.SpringBeanFactory; - - -/** - * Bean factory for the crawler application. - */ -public class CrawlerBeanFactory extends SpringBeanFactory { - private static final String SELECTOR_NAME = "beanRefContext.xml"; - private static final String FACTORY_NAME = "crawler"; - - /** - * Constructs the bean factory. - * - */ - public CrawlerBeanFactory() { - super(SELECTOR_NAME, FACTORY_NAME); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/resources/beanRefContext.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/resources/beanRefContext.xml deleted file mode 100644 index 2e139dbc..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/resources/beanRefContext.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - org.wamblee.crawler.properties.xml - org.wamblee.crawler.notification.xml - org.wamblee.crawler.kiss.xml - - - - - \ No newline at end of file diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/resources/org.wamblee.beanfactory.properties b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/resources/org.wamblee.beanfactory.properties deleted file mode 100644 index 73239e65..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/resources/org.wamblee.beanfactory.properties +++ /dev/null @@ -1,7 +0,0 @@ - -############################################################################## -# Class name of the beanfactory used by the crawler application -############################################################################## - -org.wamblee.beanfactory.class=org.wamblee.crawler.kiss.spring.CrawlerBeanFactory - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/resources/org.wamblee.crawler.kiss.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/resources/org.wamblee.crawler.kiss.xml deleted file mode 100644 index 022b4aa0..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/resources/org.wamblee.crawler.kiss.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - 3600 - - - - - ${org.wamblee.crawler.config.epg} - ${org.wamblee.crawler.config.programs} - - - - - - - - 19 - 24 - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/resources/org.wamblee.crawler.properties b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/resources/org.wamblee.crawler.properties deleted file mode 100644 index 0b98d7c3..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/main/resources/org.wamblee.crawler.properties +++ /dev/null @@ -1,23 +0,0 @@ - - -############################################################################ -# Mail server configuration -############################################################################ -org.wamblee.crawler.smtp.host=shikra -org.wamblee.crawler.smtp.port=25 -org.wamblee.crawler.smtp.username= -org.wamblee.crawler.smtp.password= - -############################################################################ -# Mail notification configuration -############################################################################ -org.wamblee.crawler.notification.from=kiss@wamblee.org -org.wamblee.crawler.notification.to=erik@brakkee.org -org.wamblee.crawler.notification.subject=Recording summary for tomorrow - -############################################################################ -# Configuration of the crawler -############################################################################ -org.wamblee.crawler.config.epg=/home/erik/crawler/config.xml -org.wamblee.crawler.config.programs=/home/erik/crawler/programs.xml - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/webapp/META-INF/MANIFEST.MF b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/webapp/META-INF/MANIFEST.MF deleted file mode 100644 index 5e949512..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/webapp/META-INF/MANIFEST.MF +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -Class-Path: - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/webapp/WEB-INF/overview.jsp b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/webapp/WEB-INF/overview.jsp deleted file mode 100644 index ce749492..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/webapp/WEB-INF/overview.jsp +++ /dev/null @@ -1,74 +0,0 @@ - -<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> - - - - - KiSS Crawler overview page - - - - - - - - - - - -

KiSS Crawler Overview

- - - - - - - - - - - - - - - - - - - - - - - - -
- Currently running: - - -
- Last executed at: - - -
- Last result: - - -
- Last message: - - -
- Last report: - - details -
- -
- -
-
- - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/webapp/WEB-INF/web.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/webapp/WEB-INF/web.xml deleted file mode 100644 index 2ff8779f..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/kissweb/src/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - org.wamblee.crawler.kiss.servlet.Application - - - - CrawlerServlet - org.wamblee.crawler.kiss.servlet.CrawlerServlet - - - - CrawlerServlet - / - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/pom.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/pom.xml deleted file mode 100644 index 5ecc0df3..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - org.wamblee - wamblee-utils - 0.2-SNAPSHOT - - 4.0.0 - org.wamblee - wamblee-crawler - pom - 0.2-SNAPSHOT - wamblee.org KiSS crawler all - http://wamblee.org - - basic - kiss - kissweb - - - - - - - - - org.wamblee - wamblee-crawler-basic - ${project.version} - - - org.wamblee - wamblee-crawler-kiss - ${project.version} - - - - - - - - - maven-assembly-plugin - 2.1 - - - src/assembly/kiss-application.xml - - - - - binpackage - package - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/src/assembly/kiss-application.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/src/assembly/kiss-application.xml deleted file mode 100644 index 881e868d..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/crawler/src/assembly/kiss-application.xml +++ /dev/null @@ -1,60 +0,0 @@ - - kissbin - - zip - - false - - - - - org.wamblee:wamblee-crawler-kiss - - - true - lib - false - - - - - - - - kiss/conf/kiss - - conf - - config.xml.example - programs.xml - org.wamblee.crawler.properties - - - - - kiss/conf/kiss - - bin - - run.* - - - - - kiss/target - - lib - - *.jar - - - - - - - runtime - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/pom.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/pom.xml deleted file mode 100644 index 18732e43..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/pom.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - org.wamblee - wamblee-crawler - 0.2-SNAPSHOT - - - 4.0.0 - org.wamblee - wamblee-gps - jar - wamblee.org GPS utilities - http://wamblee.org - - - org.wamblee - wamblee-support - - - jfree - jfreechart - - - jfree - jcommon - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/CoordinateSystem.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/CoordinateSystem.java deleted file mode 100644 index 98fee484..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/CoordinateSystem.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.gps.geometry; - -import java.io.Serializable; - - -/** - * Represents a coordinate system. - */ -public interface CoordinateSystem extends Serializable { - - /** - * Conversion to a reference coordinate system. - * @param aCoordinates Coordinates. - * @return Coordinates in the reference system. - */ - Coordinates toReferenceSystem(Coordinates aCoordinates); -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/Coordinates.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/Coordinates.java deleted file mode 100644 index 4a9b820d..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/Coordinates.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.gps.geometry; - -import java.io.Serializable; - -/** - * Coordinates in some 3-dimensional coordinate system. - */ -public class Coordinates implements Serializable { - - private double _x1; - private double _x2; - private double _x3; - - /** - * Constructs the coordinates. - * @param aX1 First coordinate. - * @param aX2 Second coordinate. - * @param aX3 Third coordinate. - */ - public Coordinates(double aX1, double aX2, double aX3) { - _x1 = aX1; - _x2 = aX2; - _x3 = aX3; - } - - public double getX1() { - return _x1; - } - - public double getX2() { - return _x2; - } - - public double getX3() { - return _x3; - } - - public double getX(int i) { - switch (i) { - case 1: return _x1; - case 2: return _x2; - case 3: return _x3; - } - throw new IllegalArgumentException("coordinate out of range " + i); - } - - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "(" + getX1() + ", " + getX2() + ", " + getX3() + ")"; - } - - public Coordinates add(Coordinates aC) { - return new Coordinates(_x1 + aC._x1, _x2 + aC._x2, _x3 + aC._x3); - } - - public Coordinates subtract(Coordinates aC) { - return new Coordinates(_x1 - aC._x1, _x2 - aC._x2, _x3 - aC._x3); - } - - public double innerProduct(Coordinates aC) { - return _x1 * aC._x1 + _x2 * aC._x2 + _x3 * aC._x3; - } - - public Coordinates outerProduct(Coordinates aC) { - return new Coordinates( - _x2*aC._x3 - _x3*aC._x2, - -_x1*aC._x3 + _x3*aC._x1, - _x1*aC._x2 - _x2*aC._x1 - ); - } - - public double norm() { - return Math.sqrt(innerProduct(this)); - } - - public Coordinates scale(double aMultiplier) { - return new Coordinates(_x1*aMultiplier, _x2*aMultiplier, _x3*aMultiplier); - } - - public Coordinates normalize() { - return scale(1.0/norm()); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/Plane.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/Plane.java deleted file mode 100644 index 1be9b545..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/Plane.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.gps.geometry; - -import org.wamblee.general.Pair; - -/** - * Represents a plane. Usually used to represent a tangent plane to the earth surface to - * locally approximate the earth as flat. - */ -public class Plane { - - private static final double EPS = 1e-4; - - private Coordinates _point; - private Coordinates _normal; - private Coordinates _north; - private Coordinates _east; - - /** - * Constructs a plane. - * @param aPoint Point on the plane. - * @param aNormal Normal, not necessarily normalized. - */ - public Plane(Point aPoint, Point aNormal) { - _point = aPoint.getReferenceCoordinates(); - _normal = aNormal.getReferenceCoordinates().normalize(); - Coordinates north = new Coordinates(0.0, 0.0, 1.0); - _north = north.subtract(_normal.scale(north.innerProduct(_normal))).normalize(); - _east = _north.outerProduct(_normal); - - if ( _normal.innerProduct(_north) > EPS ) { - throw new IllegalArgumentException("North access is not within the plane"); - } - } - - /** - * Projects a point onto the plane. - * @param aPoint Point to project. - * @return Projected point. - */ - private Coordinates project(Point aPoint) { - Coordinates ref = aPoint.getReferenceCoordinates(); - double lambda = _normal.innerProduct( - _point.subtract(ref)); - return ref.add(_normal.scale(lambda)); - } - - /** - * Returns normalized coordinates within the plane of the projection of a point. - */ - public Pair normalizedProjection(Point aPoint) { - Coordinates projection = project(aPoint); - Coordinates delta = projection.subtract(_point); - double x1 = delta.innerProduct(_north); - double x2 = delta.innerProduct(_east); - return new Pair(x1, x2); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/Point.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/Point.java deleted file mode 100644 index f3d614da..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/Point.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.gps.geometry; - -import java.io.Serializable; - - -/** - * Represents a point in some coordinate system. - */ -public class Point implements Serializable { - - private Coordinates _coordinates; - private CoordinateSystem _system; - - /** - * Constructs the point. - * @param aCoordinates Coordinates of the point in its coordinate system. - * @param aSystem Coordinate system. - */ - public Point(Coordinates aCoordinates, CoordinateSystem aSystem) { - _coordinates = aCoordinates; - _system = aSystem; - } - - /** - * Gets the coordinates in the point's coordinate system. - * @return Coordinates. - */ - public Coordinates getCoordinates() { - return _coordinates; - } - - public Coordinates getReferenceCoordinates() { - return _system.toReferenceSystem(_coordinates); - } - - /** - * Gets the coordinate system. - * @return Coordinate system. - */ - public CoordinateSystem getCoordinateSystem() { - return _system; - } - - - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return getCoordinates().toString(); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/ReferenceCoordinateSystem.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/ReferenceCoordinateSystem.java deleted file mode 100644 index 6d249313..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/ReferenceCoordinateSystem.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.gps.geometry; - - -/** - * Reference coordinate system which is the basis for defining metrics. - * This is a Cartesian coordinate system. - */ -public class ReferenceCoordinateSystem implements CoordinateSystem { - - /** - * Constructs the coordinate system. - * - */ - public ReferenceCoordinateSystem() { - // Empty - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.gpx.CoordinateSystem#toReferenceSystem(org.wamblee.gpx.Coordinates) - */ - public Coordinates toReferenceSystem(Coordinates aCoordinates) { - return aCoordinates; - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.gpx.CoordinateSystem#distance(org.wamblee.gpx.Coordinates, - * org.wamblee.gpx.Coordinates) - */ - private static double distance(Coordinates aC1, Coordinates aC2) { - return Math.sqrt(square(aC1.getX1() - aC2.getX1()) - + square(aC1.getX2() - aC2.getX2()) - + square(aC1.getX3() - aC2.getX3())); - } - - private static double square(double x) { - return x * x; - } - - /** - * Computes the distance between two points in arbitrary coordinate systems. - * @param aP1 First point. - * @param aP2 Second point. - * @return Distance. - */ - public static double distance(Point aP1, Point aP2) { - return distance( aP1.getCoordinateSystem().toReferenceSystem(aP1.getCoordinates()), - aP2.getCoordinateSystem().toReferenceSystem(aP2.getCoordinates())); - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/SphericalCoordinateSystem.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/SphericalCoordinateSystem.java deleted file mode 100644 index d62cef88..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/SphericalCoordinateSystem.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.gps.geometry; - -import static java.lang.Math.PI; -import static java.lang.Math.cos; -import static java.lang.Math.sin; - - -/** - * Represents the coordinate system for a GPS measurement identified by - *
    - *
  • x1: latitude in degrees
  • - *
  • x2: longitude in degrees
  • - *
  • x3: elevation in meters
  • - *
- * This coordinate system models the earth as a sphere of a specific radius. - */ -public class SphericalCoordinateSystem implements CoordinateSystem { - /** - * Earth radius in meters. - */ - private static final double EARTH_RADIUS = 6371000; - - - /* (non-Javadoc) - * @see org.wamblee.gpx.CoordinateSystem#toReferenceSystem(org.wamblee.gpx.Coordinates) - */ - public Coordinates toReferenceSystem(Coordinates aCoordinates) { - double latrad = radians(aCoordinates.getX1()); - double lonrad = radians(aCoordinates.getX2()); - double coslat = cos(latrad); - double sinlat = sin(latrad); - double coslon = cos(lonrad); - double sinlon = sin(lonrad); - - double trueElevation = EARTH_RADIUS + aCoordinates.getX3(); - return new Coordinates(trueElevation*coslat*coslon, - trueElevation*coslat*sinlon, - trueElevation*sinlat); - - } - - private double radians(double aDegrees) { - return aDegrees/180.0*PI; - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/Wgs84CoordinateSystem.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/Wgs84CoordinateSystem.java deleted file mode 100644 index 38b0fcc6..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/geometry/Wgs84CoordinateSystem.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.gps.geometry; - -import static java.lang.Math.PI; -import static java.lang.Math.cos; -import static java.lang.Math.sin; - - -/** - * Represents the WGS 84 coordinate system for a GPS measurement identified by - *
    - *
  • x1: latitude in degrees
  • - *
  • x2: longitude in degrees
  • - *
  • x3: elevation in meters
  • - *
- * WGS84 models the earth as an ellipse. - */ -public class Wgs84CoordinateSystem implements CoordinateSystem { - /* - * Ellipsoide parameters, where the ellipsoide is defined by - * - * (x^2 + y^2)/a^2 + z^2/b^2 = 1 - */ - - /** - * The radius of the ellipse at the equator - */ - private static final double A = 6378137.000; - - /** - * The distance of the North and South poles to the center of the ellipsoide. - */ - private static final double B = 6356752.314; - - - /* (non-Javadoc) - * @see org.wamblee.gpx.CoordinateSystem#toReferenceSystem(org.wamblee.gpx.Coordinates) - */ - public Coordinates toReferenceSystem(Coordinates aCoordinates) { - double latrad = radians(aCoordinates.getX1()); - double lonrad = radians(aCoordinates.getX2()); - double coslat = cos(latrad); - double sinlat = sin(latrad); - double coslon = cos(lonrad); - double sinlon = sin(lonrad); - - double r = A*B/Math.sqrt(B*B*coslat*coslat + A*A*sinlat*sinlat) + aCoordinates.getX3(); - - return new Coordinates(r*coslat*coslon, - r*coslat*sinlon, - r*sinlat); - - } - - private double radians(double aDegrees) { - return aDegrees/180.0*PI; - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/track/Track.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/track/Track.java deleted file mode 100644 index 30e49f01..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/track/Track.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.gps.track; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import org.wamblee.gps.geometry.Point; - -/** - * Represents a GPS track. - */ -public class Track implements Serializable { - - private List _points; - - /** - * Constructs an empty track. - * - */ - public Track() { - _points = new ArrayList(); - } - - /** - * Adds a point to a track. - * @param aPoint Point. - */ - public void addPoint(TrackPoint aPoint) { - _points.add(aPoint); - } - - /** - * @return Number of points in the track. - */ - public int size() { - return _points.size(); - } - - public double getMinCoordinate(int i) { - if ( size() == 0 ) { - throw new IllegalArgumentException("empty track"); - } - double min = getPoint(0).getCoordinates().getX(i); - for (int j = 1; j < size(); j++) { - min = Math.min(min, getPoint(j).getCoordinates().getX(i)); - } - return min; - } - - public double getMaxCoordinate(int i) { - if ( size() == 0 ) { - throw new IllegalArgumentException("empty track"); - } - double max = getPoint(0).getCoordinates().getX(i); - for (int j = 1; j < size(); j++) { - max = Math.max(max, getPoint(j).getCoordinates().getX(i)); - } - return max; - } - - /** - * Gets the point at the given inded. - * @param aIndex 0 <= aIndex < size() - * @return Point. - */ - public Point getPoint(int aIndex) { - return _points.get(aIndex); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/track/TrackPoint.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/track/TrackPoint.java deleted file mode 100644 index aa7a6fe2..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gps/track/TrackPoint.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.gps.track; - -import org.wamblee.gps.geometry.Coordinates; -import org.wamblee.gps.geometry.Point; -import org.wamblee.gps.geometry.Wgs84CoordinateSystem; - - -/** - * A point from a GPS track. - * - * TODO should be extended with additional information (e.g. date/time if available). - */ -public class TrackPoint extends Point { - - /** - * Constructs the point. - * @param aLatitude Latitude in degrees. - * @param aLongitude Longitude in degrees. - * @param aElevation Elevation in metres. - */ - public TrackPoint(double aLatitude, double aLongitude, double aElevation) { - super(new Coordinates(aLatitude, aLongitude, aElevation), new Wgs84CoordinateSystem()); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gpx/GpxParser.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gpx/GpxParser.java deleted file mode 100644 index fe675ce6..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gpx/GpxParser.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.gpx; - -import java.io.InputStream; -import java.util.Iterator; - -import org.dom4j.Document; -import org.dom4j.Element; -import org.wamblee.gps.track.Track; -import org.wamblee.gps.track.TrackPoint; -import org.wamblee.xml.DomUtils; -import org.wamblee.xml.XMLException; - -/** - * Parser for GPX tracks. - */ -public class GpxParser { - - private static final String SCHEMA_RESOURCE = "gpx.xsd"; - - public GpxParser() { - // Empty. - } - - public Track parse(InputStream aIs) throws XMLException { - Document doc = DomUtils.convert(DomUtils.read(aIs)); - return parse(doc); - } - - /** - * @param doc - */ - public Track parse(Document doc) { - Track track = new Track(); - Element root = doc.getRootElement().element("trk").element("trkseg"); - for ( Iterator i =root.elementIterator("trkpt"); i.hasNext(); ) { - Element trkpt = (Element)i.next(); - track.addPoint(parseTrackPoint(trkpt)); - } - return track; - } - - /** - * @param trkpt - */ - private TrackPoint parseTrackPoint(Element trkpt) { - //System.out.println(trkpt.asXML() + "|\n"); - double latitude = new Double(trkpt.attributeValue("lat")); - double longitude = new Double(trkpt.attributeValue("lon")); - Element ele = trkpt.element("ele"); - double elevation = 0.0; - if ( ele != null ) { - elevation = new Double(ele.getText()); - } - //System.out.println(" lat = " + lat + " lon = " + lon + " ele = " + ele); - return new TrackPoint(latitude, longitude, elevation); - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gpx/GpxPlotter.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gpx/GpxPlotter.java deleted file mode 100644 index f239cabf..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gpx/GpxPlotter.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.gpx; - -import java.awt.Color; -import java.awt.Image; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.jfree.chart.ChartFactory; -import org.jfree.chart.ChartFrame; -import org.jfree.chart.ChartUtilities; -import org.jfree.chart.JFreeChart; -import org.jfree.chart.axis.NumberAxis; -import org.jfree.chart.plot.PlotOrientation; -import org.jfree.chart.plot.XYPlot; -import org.jfree.chart.renderer.xy.XYItemRenderer; -import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; -import org.jfree.data.xy.XYSeries; -import org.jfree.data.xy.XYSeriesCollection; -import org.wamblee.general.Pair; -import org.wamblee.gps.geometry.Plane; -import org.wamblee.gps.geometry.Point; -import org.wamblee.gps.geometry.ReferenceCoordinateSystem; -import org.wamblee.gps.track.Track; -import org.wamblee.utils.JpegUtils; - -/** - * Parses a GPX file and prints out a data file with each trackpoints distance from the start of the - * track and its elevation, separated 0by a space. - */ -public class GpxPlotter { - - public static void main(String[] aArgs) throws Exception { - File file = new File(aArgs[0]); - GpxParser parser = new GpxParser(); - Track track = parser.parse(new FileInputStream(file)); - - List> elevationProfile = computeElevationProfile(track); - printTrack(elevationProfile); - computeTotalClimb(elevationProfile); - plotElevationProfile(elevationProfile); - List> trackXy = computeTrackXY(track); - List> trackLatLon = computeTrackLatLon(track); - plotTrack(trackLatLon); - } - - private static List> computeElevationProfile(Track aTrack) { - List> results = new ArrayList>(); - double distance = 0.0; - for (int i = 0; i < aTrack.size(); i++) { - Point point = aTrack.getPoint(i); - results.add(new Pair(distance, point.getCoordinates().getX3())); - if ( i+1 < aTrack.size()) { - Point nextPoint = aTrack.getPoint(i+1); - distance += ReferenceCoordinateSystem.distance(point, nextPoint); - } - } - return results; - } - - private static List> computeTrackXY(Track aTrack) { - Point reference = aTrack.getPoint(0); - Plane plane = new Plane(reference, reference); // assume the earth is spherical. - List> results = new ArrayList>(); - for (int i = 0; i < aTrack.size(); i++) { - Point point = aTrack.getPoint(i); - Pair projection = plane.normalizedProjection(point); - results.add(projection); - System.out.println(point); - } - return results; - } - - private static List> computeTrackLatLon(Track aTrack) { - List> results = new ArrayList>(); - for (int i = 0; i < aTrack.size(); i++) { - Point point = aTrack.getPoint(i); - results.add(new Pair(point.getCoordinates().getX1(), point.getCoordinates().getX2())); - } - return results; - } - - - - private static void printTrack(List> aHeightProfile) { - for (Pair point: aHeightProfile) { - System.out.println(point.getFirst() + " " + point.getSecond()); - } - } - - private static void computeTotalClimb(List> aHeightProfile) { - double result = 0.0; - - double lastHeight = aHeightProfile.get(0).getSecond(); - for ( int i = 1; i < aHeightProfile.size(); i++) { - double height = aHeightProfile.get(i).getSecond(); - if ( height > lastHeight) { - result += (height-lastHeight); - } - lastHeight = height; - } - System.out.println("Total climb: " + result); - } - - private static void plotElevationProfile(List> aHeightProfile) throws IOException { - XYSeriesCollection dataset = createDataset(aHeightProfile, "height"); - JFreeChart chart = ChartFactory.createXYLineChart( - "Height Profile", - "Distance(m)", - "Height(m)", - dataset, - PlotOrientation.VERTICAL, - true, - true, - false); - ChartUtilities.writeChartAsPNG(new FileOutputStream("height.png"), chart, 600, 300); - ChartFrame frame = new ChartFrame("test", chart); - frame.pack(); - frame.setVisible(true); - } - - private static void plotTrack(List> aPoints) throws IOException, InterruptedException { - XYSeriesCollection dataset = createDataset(aPoints, "track"); - JFreeChart chart = createLineChart(dataset); - - Pair,Pair> bounds = getBounds(aPoints); - - chart.getXYPlot().getDomainAxis().setLowerBound(bounds.getFirst().getFirst()); - chart.getXYPlot().getDomainAxis().setUpperBound(bounds.getFirst().getSecond()); - - chart.getXYPlot().getRangeAxis().setLowerBound(bounds.getSecond().getFirst()); - chart.getXYPlot().getRangeAxis().setUpperBound(bounds.getSecond().getSecond()); - - Image background = JpegUtils.loadJpegImage(new FileInputStream("/home/erik/vakantie.jpg")); - chart.getPlot().setBackgroundImage(background); - - XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer)chart.getXYPlot().getRenderer(); - renderer.setShapesVisible(true); - renderer.setShapesFilled(true); - renderer.setPaint(Color.BLACK); - - ChartUtilities.writeChartAsPNG(new FileOutputStream("test.png"), chart, 1280, 800); - ChartFrame frame = new ChartFrame("test", chart); - frame.pack(); - frame.setVisible(true); - } - - /** - * @param dataset - * @return - */ - private static JFreeChart createLineChart(XYSeriesCollection dataset) { - NumberAxis xAxis = new NumberAxis("S->N"); - xAxis.setAutoRangeIncludesZero(false); - - NumberAxis yAxis = new NumberAxis("W->E"); - yAxis.setAutoRangeIncludesZero(false); - - XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false); - XYPlot plot = new ZoomableBackgroundXYPlot(dataset, xAxis, yAxis, renderer); - plot.setOrientation(PlotOrientation.HORIZONTAL); - - JFreeChart chart = new JFreeChart( - "Track", JFreeChart.DEFAULT_TITLE_FONT, plot, true - ); - - return chart; - /* - JFreeChart chart = ChartFactory.createXYLineChart( - "Track", - "S->N", - "W->E", - dataset, - PlotOrientation.HORIZONTAL, - true, - true, - false); - return chart; - */ - } - - /** - * @param aHeightProfile - * @return - */ - private static XYSeriesCollection createDataset(List> aHeightProfile, String aName) { - XYSeries series = new XYSeries(aName, false); - for (Pair point: aHeightProfile) { - series.add(point.getFirst(), point.getSecond()); - } - XYSeriesCollection dataset = new XYSeriesCollection(series); - return dataset; - } - - private static Pair,Pair> getBounds(List> aList) { - Pair first = aList.get(0); - double minx= first.getFirst(); - double maxx = minx; - double miny = first.getSecond(); - double maxy = miny; - - for (int i = 0; i < aList.size(); i++) { - Pair value = aList.get(i); - minx = Math.min(minx, value.getFirst()); - maxx = Math.max(maxx, value.getFirst()); - miny = Math.min(miny, value.getSecond()); - maxy = Math.max(maxy, value.getSecond()); - } - if ( maxx == minx ) { - maxx += 1.0; // to avoid problems. - } - if ( maxy == miny ) { - maxy += 1.0; // to avoid problems. - } - final double paddingFactor = 0.3; // allow some space around min and max - return new Pair,Pair>( - new Pair( minx - paddingFactor*(maxx-minx), - maxx + paddingFactor*(maxx-minx)), - new Pair( miny - paddingFactor*(maxy-miny), - maxy + paddingFactor*(maxy-miny)) - ); - } -} - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gpx/ZoomableBackgroundXYPlot.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gpx/ZoomableBackgroundXYPlot.java deleted file mode 100644 index 8de07114..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gpx/ZoomableBackgroundXYPlot.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.gpx; - -import java.awt.Graphics2D; -import java.awt.Image; -import java.awt.geom.Rectangle2D; - -import org.jfree.chart.axis.ValueAxis; -import org.jfree.chart.plot.XYPlot; -import org.jfree.chart.renderer.xy.XYItemRenderer; -import org.jfree.data.xy.XYDataset; - -/** - * Extension of XY plot that provides automatic zooming of the background - * image. - */ -public class ZoomableBackgroundXYPlot extends XYPlot { - - /* - * Initial domain axis. - */ - private double _x1 = 1.0; - private double _x2 = -1.0; // _x2 < _x1 initially to make signify uninitialized values. - - /* - * Initial range axis. - */ - private double _y1 = 1.0; - private double _y2 = -1.0; // _y2 < _y1 initially to make signify uninitialized values. - - public ZoomableBackgroundXYPlot(XYDataset aDataset, - ValueAxis aDomainAxis, ValueAxis aRangeAxis, XYItemRenderer aRenderer) { - super(aDataset, aDomainAxis, aRangeAxis, aRenderer); - } - - /* (non-Javadoc) - * @see org.jfree.chart.plot.Plot#drawBackgroundImage(java.awt.Graphics2D, java.awt.geom.Rectangle2D) - */ - @Override - protected void drawBackgroundImage(Graphics2D g2, Rectangle2D area) { - //System.out.println("--------"); - //System.out.println("Area: " + area); - //System.out.println("Graphics clip: " + g2.getClipBounds()); - //System.out.println("Domain axis: " + getDomainAxis().getLowerBound() + " " + - // getDomainAxis().getUpperBound()); - - // Get the current domain axis bounds - double y1 = getDomainAxis().getLowerBound(); - double y2 = getDomainAxis().getUpperBound(); - double x1 = getRangeAxis().getLowerBound(); - double x2 = getRangeAxis().getUpperBound(); - - if ( _x2 < _x1 ) { - // initial domain axis bounds - _y1 = y1; - _y2 = y2; - _x1 = x1; - _x2 = x2; - } - - Image background = getBackgroundImage(); - int width = background.getWidth(null); - int height = background.getHeight(null); - - // Determine the part of the image to be drawn on the screen based on the scaling - // of the domain axes. - int imageX1 = (int)Math.round(1 + (x1 - _x1)*(width-1)/(_x2 - _x1)); - int imageX2 = (int)Math.round(1 + (x2 - _x1)*(width-1)/(_x2 - _x1)); - // Note: y-axis of image goes from bottom to top. - int imageY2 = (int)Math.round(height + (y1 - _y1)*(1-height)/(_y2 - _y1)); - int imageY1 = (int)Math.round(height + (y2 - _y1)*(1-height)/(_y2 - _y1)); - - // Draw the correct part of the image on the screen. - g2.drawImage(background, (int)area.getMinX(), (int)area.getMinY(), (int)area.getMaxX(), (int)area.getMaxY(), - imageX1, imageY1, imageX2, imageY2, null); - - // System.out.println("========"); - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gpx/gpx.xsd b/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gpx/gpx.xsd deleted file mode 100644 index 0ce1605c..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/gpx/gpx.xsd +++ /dev/null @@ -1,788 +0,0 @@ - - - - - - GPX schema version 1.1 - For more information on GPX and this schema, visit http://www.topografix.com/gpx.asp - - GPX uses the following conventions: all coordinates are relative to the WGS84 datum. All measurements are in metric units. - - - - - - - GPX is the root element in the XML file. - - - - - - - - GPX documents contain a metadata header, followed by waypoints, routes, and tracks. You can add your own elements - to the extensions section of the GPX document. - - - - - - - Metadata about the file. - - - - - - - A list of waypoints. - - - - - - - A list of routes. - - - - - - - A list of tracks. - - - - - - - You can add extend GPX by adding your own elements from another schema here. - - - - - - - - - You must include the version number in your GPX document. - - - - - - - You must include the name or URL of the software that created your GPX document. This allows others to - inform the creator of a GPX instance document that fails to validate. - - - - - - - - - Information about the GPX file, author, and copyright restrictions goes in the metadata section. Providing rich, - meaningful information about your GPX files allows others to search for and use your GPS data. - - - - - - - The name of the GPX file. - - - - - - - A description of the contents of the GPX file. - - - - - - - The person or organization who created the GPX file. - - - - - - - Copyright and license information governing use of the file. - - - - - - - URLs associated with the location described in the file. - - - - - - - The creation date of the file. - - - - - - - Keywords associated with the file. Search engines or databases can use this information to classify the data. - - - - - - - Minimum and maximum coordinates which describe the extent of the coordinates in the file. - - - - - - - - You can add extend GPX by adding your own elements from another schema here. - - - - - - - - - - wpt represents a waypoint, point of interest, or named feature on a map. - - - - - - - - Elevation (in meters) of the point. - - - - - - - Creation/modification timestamp for element. Date and time in are in Univeral Coordinated Time (UTC), not local time! Conforms to ISO 8601 specification for date/time representation. Fractional seconds are allowed for millisecond timing in tracklogs. - - - - - - - Magnetic variation (in degrees) at the point - - - - - - - Height (in meters) of geoid (mean sea level) above WGS84 earth ellipsoid. As defined in NMEA GGA message. - - - - - - - - - The GPS name of the waypoint. This field will be transferred to and from the GPS. GPX does not place restrictions on the length of this field or the characters contained in it. It is up to the receiving application to validate the field before sending it to the GPS. - - - - - - - GPS waypoint comment. Sent to GPS as comment. - - - - - - - A text description of the element. Holds additional information about the element intended for the user, not the GPS. - - - - - - - Source of data. Included to give user some idea of reliability and accuracy of data. "Garmin eTrex", "USGS quad Boston North", e.g. - - - - - - - Link to additional information about the waypoint. - - - - - - - Text of GPS symbol name. For interchange with other programs, use the exact spelling of the symbol as displayed on the GPS. If the GPS abbreviates words, spell them out. - - - - - - - Type (classification) of the waypoint. - - - - - - - - - Type of GPX fix. - - - - - - - Number of satellites used to calculate the GPX fix. - - - - - - - Horizontal dilution of precision. - - - - - - - Vertical dilution of precision. - - - - - - - Position dilution of precision. - - - - - - - Number of seconds since last DGPS update. - - - - - - - ID of DGPS station used in differential correction. - - - - - - - - You can add extend GPX by adding your own elements from another schema here. - - - - - - - - - The latitude of the point. Decimal degrees, WGS84 datum. - - - - - - - The latitude of the point. Decimal degrees, WGS84 datum. - - - - - - - - - rte represents route - an ordered list of waypoints representing a series of turn points leading to a destination. - - - - - - - GPS name of route. - - - - - - - GPS comment for route. - - - - - - - Text description of route for user. Not sent to GPS. - - - - - - - Source of data. Included to give user some idea of reliability and accuracy of data. - - - - - - - Links to external information about the route. - - - - - - - GPS route number. - - - - - - - Type (classification) of route. - - - - - - - - You can add extend GPX by adding your own elements from another schema here. - - - - - - - - A list of route points. - - - - - - - - - - trk represents a track - an ordered list of points describing a path. - - - - - - - GPS name of track. - - - - - - - GPS comment for track. - - - - - - - User description of track. - - - - - - - Source of data. Included to give user some idea of reliability and accuracy of data. - - - - - - - Links to external information about track. - - - - - - - GPS track number. - - - - - - - Type (classification) of track. - - - - - - - - You can add extend GPX by adding your own elements from another schema here. - - - - - - - - A Track Segment holds a list of Track Points which are logically connected in order. To represent a single GPS track where GPS reception was lost, or the GPS receiver was turned off, start a new Track Segment for each continuous span of track data. - - - - - - - - - - You can add extend GPX by adding your own elements from another schema here. - - - - - - - You can add extend GPX by adding your own elements from another schema here. - - - - - - - - - - A Track Segment holds a list of Track Points which are logically connected in order. To represent a single GPS track where GPS reception was lost, or the GPS receiver was turned off, start a new Track Segment for each continuous span of track data. - - - - - - - A Track Point holds the coordinates, elevation, timestamp, and metadata for a single point in a track. - - - - - - - - You can add extend GPX by adding your own elements from another schema here. - - - - - - - - - - Information about the copyright holder and any license governing use of this file. By linking to an appropriate license, - you may place your data into the public domain or grant additional usage rights. - - - - - - - Year of copyright. - - - - - - - Link to external file containing license text. - - - - - - - - Copyright holder (TopoSoft, Inc.) - - - - - - - - - A link to an external resource (Web page, digital photo, video clip, etc) with additional information. - - - - - - - Text of hyperlink. - - - - - - - Mime type of content (image/jpeg) - - - - - - - - URL of hyperlink. - - - - - - - - - An email address. Broken into two parts (id and domain) to help prevent email harvesting. - - - - - - id half of email address (billgates2004) - - - - - - - domain half of email address (hotmail.com) - - - - - - - - - A person or organization. - - - - - - - Name of person or organization. - - - - - - - Email address. - - - - - - - Link to Web site or other external information about person. - - - - - - - - - - A geographic point with optional elevation and time. Available for use by other schemas. - - - - - - - The elevation (in meters) of the point. - - - - - - - The time that the point was recorded. - - - - - - - - The latitude of the point. Decimal degrees, WGS84 datum. - - - - - - - The latitude of the point. Decimal degrees, WGS84 datum. - - - - - - - - - An ordered sequence of points. (for polygons or polylines, e.g.) - - - - - - - Ordered list of geographic points. - - - - - - - - - - Two lat/lon pairs defining the extent of an element. - - - - - - The minimum latitude. - - - - - - - The minimum longitude. - - - - - - - The maximum latitude. - - - - - - - The maximum longitude. - - - - - - - - - - The latitude of the point. Decimal degrees, WGS84 datum. - - - - - - - - - - - - The longitude of the point. Decimal degrees, WGS84 datum. - - - - - - - - - - - - Used for bearing, heading, course. Units are decimal degrees, true (not magnetic). - - - - - - - - - - - - Type of GPS fix. none means GPS had no fix. To signify "the fix info is unknown, leave out fixType entirely. pps = military signal used - - - - - - - - - - - - - - - Represents a differential GPS station. - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/utils/JpegUtils.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/utils/JpegUtils.java deleted file mode 100644 index b64c76f3..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/gps/src/main/java/org/wamblee/utils/JpegUtils.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.utils; - -import java.awt.Container; -import java.awt.Graphics2D; -import java.awt.Image; -import java.awt.MediaTracker; -import java.awt.RenderingHints; -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -import com.sun.image.codec.jpeg.JPEGCodec; -import com.sun.image.codec.jpeg.JPEGEncodeParam; -import com.sun.image.codec.jpeg.JPEGImageDecoder; -import com.sun.image.codec.jpeg.JPEGImageEncoder; - -/** - * Utility functions for processing JPEG images. - */ -public class JpegUtils { - /** - * Scales an image preserving the aspect ratio. - * - * @param aMaxWidth Maximum width. - * @param aMaxHeight Maximum height. - * @param aImage Image to scale. - * @return Scaled image. - */ - public static BufferedImage scaleImage(int aMaxWidth, int aMaxHeight, Image aImage) { - double thumbRatio = (double) aMaxWidth / (double) aMaxHeight; - int imageWidth = aImage.getWidth(null); - int imageHeight = aImage.getHeight(null); - double imageRatio = (double) imageWidth / (double) imageHeight; - if (thumbRatio < imageRatio) { - aMaxHeight = (int) (aMaxWidth / imageRatio); - } else { - aMaxWidth = (int) (aMaxHeight * imageRatio); - } - BufferedImage thumbImage = new BufferedImage(aMaxWidth, aMaxHeight, - BufferedImage.TYPE_INT_RGB); - Graphics2D graphics2D = thumbImage.createGraphics(); - graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, - RenderingHints.VALUE_INTERPOLATION_BILINEAR); - graphics2D.drawImage(aImage, 0, 0, aMaxWidth, aMaxHeight, null); - return thumbImage; - } - - /** - * Loads a jpeg image from an input stream. - * - * @param aInput Input stream. - * @return JPEG image. - * @throws IOException In case of IO problems. - * @throws InterruptedException When execution is interrupted. - */ - public static BufferedImage loadJpegImage(InputStream aInput) throws IOException, InterruptedException { - JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(aInput); - BufferedImage image = decoder.decodeAsBufferedImage(); - MediaTracker mediaTracker = new MediaTracker(new Container()); - mediaTracker.addImage(image, 0); - mediaTracker.waitForID(0); - return image; - } - - /** - * Writes a JPEG image. - * - * @param aOutput Output stream to write to. - * @param aQuality Quality of the JPEG image in the range 0..100 - * @param aThumbImage - * @throws IOException - */ - public static void writeJpegImage(OutputStream aOutput, int aQuality, BufferedImage aThumbImage) throws IOException { - // save thumbnail image to OUTFILE - - if ( aQuality < 0 || aQuality > 100 ) { - throw new IllegalArgumentException("Argument quality must be in range 0.100: " + aQuality); - } - - JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(aOutput); - JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(aThumbImage); - aQuality = Math.max(0, Math.min(aQuality, 100)); - param.setQuality((float) aQuality / 100.0f, false); - encoder.setJPEGEncodeParam(param); - encoder.encode(aThumbImage); - } - -} - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/ear/pom.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/ear/pom.xml deleted file mode 100644 index a1e1aa80..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/ear/pom.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - org.wamblee - wamblee-mythtv - 0.2-SNAPSHOT - - - 4.0.0 - org.wamblee - wamblee-mythtv-ear - ear - wamblee.org mythtv directory monitor EAR - http://wamblee.org - - - - org.wamblee - wamblee-mythtv-war - ${project.version} - war - - - org.wamblee - wamblee-mythtv-monitor - ${project.version} - - - org.wamblee - wamblee-mythtv-timer - ${project.version} - ejb - - - org.hibernate - hibernate-entitymanager - - - - - - - maven-ear-plugin - - lib/ - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/pom.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/pom.xml deleted file mode 100644 index 03fa2edd..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - org.wamblee - wamblee-mythtv - 0.2-SNAPSHOT - - - 4.0.0 - org.wamblee - wamblee-mythtv-monitor - jar - wamblee.org mythtv directory monitor MONITOR - http://wamblee.org - - - - org.wamblee - wamblee-support - - - javax.servlet - servlet-api - - - javax.persistence - persistence-api - - - org.springframework - spring-jpa - - - concurrent - concurrent - - - log4j - log4j - provided - - - javaee - javaee-api - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/Application.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/Application.java deleted file mode 100644 index bdf1cb03..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/Application.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.mythtv; - -import javax.annotation.Resource; -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.MessageProducer; -import javax.jms.ObjectMessage; -import javax.jms.Queue; -import javax.jms.Session; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wamblee.general.BeanKernel; - -/** - * - */ -public class Application implements ServletContextListener { - private static final Log LOG = LogFactory.getLog(Application.class); - - @Resource(name = "MythtvConnectionFactory") - private ConnectionFactory connectionFactory; - - @Resource(name = "MythtvTimer") - private Queue timerQueue; - - /* - * (non-Javadoc) - * - * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent) - */ - public void contextInitialized(ServletContextEvent arg0) { - LOG.info("initializing"); - - // Get application configuration. - ScheduleConfig config = BeanKernel.getBeanFactory().find( - ScheduleConfig.class); - - // Send object message to the timer with the timer interval. - try { - Connection connection = connectionFactory.createConnection(); - Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - ObjectMessage msg = session.createObjectMessage(); - msg.setObject(config.getIntervalSeconds()); - MessageProducer producer = session.createProducer(timerQueue); - producer.send(msg); - } catch (Exception e) { - LOG.fatal("Error sending message", e); - } - - } - - /* - * (non-Javadoc) - * - * @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent) - */ - public void contextDestroyed(ServletContextEvent arg0) { - LOG.info("terminating"); - - // TODO check if timer will be automatically stopped. - // Empty. - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/Channel.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/Channel.java deleted file mode 100644 index d519c9ad..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/Channel.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.mythtv; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; - -/** - * - */ -@Entity -@Table(name="channel") -public class Channel { - - private int _id; - - private String _name; - - protected Channel() { - // Empty - } - - /** - * @return the id - */ - @Id - @Column(name="chanid") - public int getId() { - return _id; - } - - /** - * @param aId the id to set - */ - public void setId(int aId) { - _id = aId; - } - - /** - * @return the name - */ - @Column(name="name") - public String getName() { - return _name; - } - - /** - * @param aName the name to set - */ - public void setName(String aName) { - _name = aName; - } - - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "Channel(" + _id + "," + _name + ")"; - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object aObj) { - if ( !(aObj instanceof Channel)) { - return false; - } - Channel recording = (Channel)aObj; - return _id == recording._id; - } - - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - return _id; - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/FileType.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/FileType.java deleted file mode 100644 index c27e2906..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/FileType.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.mythtv; - -/** - * - */ -public enum FileType { - - MPG, AVI; -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/LinkStructure.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/LinkStructure.java deleted file mode 100644 index ced5ae11..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/LinkStructure.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.mythtv; - -import java.io.File; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.HashMap; -import java.util.Map; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wamblee.io.SimpleProcess; -import org.wamblee.io.DirectoryMonitor.Listener; - -/** - * Link structure. - */ -public class LinkStructure implements Listener { - - private static final Log LOG = LogFactory.getLog(LinkStructure.class); - - private String _monitorDir; - - private File _linkDir; - - private RecordingDatabase _database; - - private SimpleDateFormat _format; - - private Map _recordings; - - public LinkStructure(String aMonitorDir, File aLinkDir, - RecordingDatabase aDatabase) { - _monitorDir = aMonitorDir + "/"; - deleteDir(aLinkDir); - _linkDir = aLinkDir; - _database = aDatabase; - _format = new SimpleDateFormat("yyyy-MM-dd-HH:mm"); - _recordings = new HashMap(); - } - - private void deleteDir(File aFile) { - for (File file: aFile.listFiles()) { - if ( file.isDirectory()) { - deleteDir(file); - } - LOG.info("File deleted " + file + ": " + file.delete()); - } - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.io.DirectoryMonitor.Listener#fileChanged(java.io.File) - */ - public void fileChanged(File aFile) { - LOG.debug("file changed " + aFile); - - // Re-assess file type - Recording recording = _recordings.get(aFile); - LOG.debug("Recording changed " + recording); - recording.setFilesize(aFile.length()); - _database.update(recording); - String dir = getDirectory(recording); - FileType type = getFileType(aFile); - String path = dir + "/" + getFilename(recording, type); - - if (exists(dir + "/" + getFilename(recording, type))) { - // Nothing to do. - } else { - mkdir(dir); - for (FileType t : FileType.values()) { - rmlink(dir + "/" + getFilename(recording, t)); - } - createSymLink(_monitorDir + aFile.getName(), dir + "/" - + getFilename(recording, type)); - } - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.io.DirectoryMonitor.Listener#fileCreated(java.io.File) - */ - public void fileCreated(File aFile) { - LOG.debug("file created " + aFile); - Recording recording = _database.findRecording(aFile.getName()); - if ( recording == null ) { - LOG.warn("Spurious recording which should not exist according to mythtv: " + aFile); - return; - } - _recordings.put(aFile, recording); - LOG.info("New recording detected " + aFile + " " - + recording); - - recording.setFilesize(aFile.length()); - _database.update(recording); - String dir = getDirectory(recording); - mkdir(dir); - createSymLink(_monitorDir + aFile.getName(), dir + "/" - + getFilename(recording, getFileType(aFile))); - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.io.DirectoryMonitor.Listener#fileDeleted(java.io.File) - */ - public void fileDeleted(File aFile) { - LOG.debug("file deleted " + aFile); - Recording recording = _recordings.get(aFile); - _recordings.remove(recording); - // mythtv will remove the recording from its database itself. - LOG.info("recording deleted " + recording); - String dir = getDirectory(recording); - for (FileType t: FileType.values()) { - rmlink(dir + "/" + getFilename(recording, t)); - } - rmdir(dir); - } - - private String getDirectory(Recording aRecording) { - return aRecording.getTitle().replaceAll("/", "-"); - } - - private FileType getFileType(File aFile) { - SimpleProcess process = new SimpleProcess(new File(_monitorDir), new String[] { - "file", aFile.getName() }); - try { - process.run(); - if (process.getStdout().contains("RIFF")) { - return FileType.AVI; - } else { - return FileType.MPG; - } - } catch (IOException e) { - LOG.error("Determining filetype for " + aFile + " failed", e); - return FileType.MPG; - } - } - - private String getFilename(Recording aRecording, FileType aType) { - return (_format.format(aRecording.getProgstart()) + "-" - + aRecording.getSubtitle() + "-" - + aRecording.getChannel().getName() + "." - + aType.toString().toLowerCase()).replaceAll("/", "-"); - } - - private boolean exists(String aPath) { - LOG.debug("exists " + aPath); - return new File(_linkDir, aPath).exists(); - } - - private void rmlink(String aPath) { - LOG.debug("rmlink " + aPath); - File link = new File(_linkDir, aPath); - //if ( !link.exists()) { - // return; - // } - if (!link.delete()) { - LOG.warn("Delete failed: " + aPath); - } else { - LOG.info("Removed link " + link); - } - } - - private void mkdir(String aDir) { - LOG.debug("mkdir " + aDir); - File dir = new File(_linkDir, aDir); - if ( dir.isDirectory()) { - return; - } - if (!dir.mkdirs()) { - LOG.warn("Could not create directory path: " + aDir); - } else { - LOG.info("Created directory " + dir); - } - } - - private void rmdir(String aDir) { - LOG.debug("rmdir " + aDir); - File dir = new File(_linkDir, aDir); - if (!dir.delete()) { - LOG.warn("Directory not deleted (still recordings left): " + aDir); - } else { - LOG.info("Directory " + dir + " deleted."); - } - } - - private void createSymLink(String aTarget, String aSource) { - try { - SimpleProcess process = new SimpleProcess(_linkDir, new String[] { - "ln", "-s", aTarget, aSource }); - process.run(); - LOG.info("Created symlink " + aSource + " -> " + aTarget); - } catch (IOException e) { - LOG.error( - "Could not create symlink: " + aTarget + " <- " + aSource, - e); - } - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/MythtvBeanFactory.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/MythtvBeanFactory.java deleted file mode 100644 index f29911d7..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/MythtvBeanFactory.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.mythtv; -import org.wamblee.general.SpringBeanFactory; - - -/** - * Bean factory for the crawler application. - */ -public class MythtvBeanFactory extends SpringBeanFactory { - private static final String SELECTOR_NAME = "beanRefContext.xml"; - private static final String FACTORY_NAME = "mythtv"; - - /** - * Constructs the bean factory. - * - */ - public MythtvBeanFactory() { - super(SELECTOR_NAME, FACTORY_NAME); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/MythtvHibernateMappings.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/MythtvHibernateMappings.java deleted file mode 100644 index 481afe62..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/MythtvHibernateMappings.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.mythtv; - -import org.wamblee.persistence.hibernate.HibernateMappingFiles; - -/** - * - */ -public class MythtvHibernateMappings extends HibernateMappingFiles { - - public MythtvHibernateMappings() { - super(new String[] { "Channel.hbm.xml", "Recording.hbm.xml" }); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/Recording.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/Recording.java deleted file mode 100644 index a1e7844e..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/Recording.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.mythtv; - -import java.io.Serializable; -import java.util.Date; - -import javax.persistence.Column; -import javax.persistence.EmbeddedId; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.IdClass; -import javax.persistence.JoinColumn; -import javax.persistence.JoinColumns; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -import javax.persistence.Transient; - -/** - * - */ -@Entity -@Table(name="recorded") -public class Recording implements Serializable { - - private RecordingPk _id; - - private String _basename; - - private Date _progstart; - - private String _title; - - private String _subtitle; - - private long _filesize; - - protected Recording() { - // Empty - } - - /** - * @return the id - */ - @EmbeddedId - public RecordingPk getId() { - return _id; - } - - /** - * @param aId the id to set - */ - public void setId(RecordingPk aId) { - _id = aId; - } - - /** - * @return the basename - */ - @Column(name="basename") - public String getBasename() { - return _basename; - } - - /** - * @param aBasename the basename to set - */ - public void setBasename(String aBasename) { - _basename = aBasename; - } - - /** - * @return the progstart - */ - @Column(name="progstart") - @Temporal(TemporalType.TIMESTAMP) - public Date getProgstart() { - return _progstart; - } - - /** - * @param aProgstart the progstart to set - */ - public void setProgstart(Date aProgstart) { - _progstart = aProgstart; - } - - @Transient - public Channel getChannel() { - return _id.getChannel(); - } - - @Transient - public Date getStarttime() { - return _id.getStartTime(); - } - - /** - * @return the title - */ - @Column(name="title") - public String getTitle() { - return _title; - } - - /** - * @param aTitle the title to set - */ - public void setTitle(String aTitle) { - _title = aTitle; - } - - /** - * @return the subtitle - */ - @Column(name="subtitle") - public String getSubtitle() { - return _subtitle; - } - - /** - * @param aSubtitle the subtitle to set - */ - public void setSubtitle(String aSubtitle) { - _subtitle = aSubtitle; - } - - /** - * @return the filesize - */ - @Column(name="filesize") - public long getFilesize() { - return _filesize; - } - - public void setFilesize(long aFilesize) { - _filesize = aFilesize; - } - - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "Recording(" + _id + "," + _basename + "," + _progstart + "," + _title + "," + _subtitle + ")"; - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object aObj) { - if ( !(aObj instanceof Recording)) { - return false; - } - Recording recording = (Recording)aObj; - return _id.equals(recording._id); - } - - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - return _id.hashCode(); - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/RecordingDatabase.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/RecordingDatabase.java deleted file mode 100644 index cf7bc5f5..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/RecordingDatabase.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.mythtv; - -import java.sql.SQLException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.persistence.EntityManager; -import javax.persistence.Query; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.hibernate.HibernateException; -import org.hibernate.Session; -import org.hibernate.criterion.Expression; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.orm.jpa.JpaTemplate; -import org.springframework.orm.jpa.support.JpaDaoSupport; - -/** - * - */ -public class RecordingDatabase extends JpaDaoSupport { - - private static final Log LOG = LogFactory.getLog(RecordingDatabase.class); - - public RecordingDatabase() { - // Empty - } - - public void init() { - /* - for (Recording recording: (List)getHibernateTemplate().loadAll(Recording.class) ) { - LOG.info("Found recording " + recording); - } - LOG.info("After listing recordings"); - */ - } - - public Recording findRecording(final String aName) { - JpaTemplate jpaTemplate = getJpaTemplate(); - EntityManager entityManager = jpaTemplate.getEntityManager(); - Query query = entityManager.createQuery( - "select r from Recording r where r.basename = ?1"); - query.setParameter(1, aName); - List result = query.getResultList(); - if ( result.size() > 1 ) { - throw new RuntimeException("More than two recordings returned"); - } - if ( result.size() == 0 ) { - return null; - } - return result.get(0); - } - - public void update(Recording aRecording) { - // Update is not required since the whole task of updating the - // directory structure occurs within a single transaction. - // Therefore, modifications to recordings are automatically persisted. - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/RecordingPk.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/RecordingPk.java deleted file mode 100644 index da06d3d0..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/RecordingPk.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.mythtv; - -import java.io.Serializable; -import java.util.Date; - -import javax.persistence.Column; -import javax.persistence.Embeddable; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; - -/** - * - */ -@Embeddable -public class RecordingPk implements Serializable { - public Channel _channel; - public Date _starttime; - - public RecordingPk() { - // Empty - } - - /** - * @return the channel - */ - @ManyToOne - @JoinColumn(name="chanid") - public Channel getChannel() { - return _channel; - } - - /** - * @param aChannel the channel to set - */ - public void setChannel(Channel aChannel) { - _channel = aChannel; - } - - /** - * @return the starttime - */ - @Column(name="starttime") - @Temporal(TemporalType.TIMESTAMP) - public Date getStartTime() { - return _starttime; - } - - /** - * @param aStarttime the starttime to set - */ - public void setStartTime(Date aStarttime) { - _starttime = aStarttime; - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object aObj) { - if ( aObj == null ) { - return false; - } - if ( !(aObj instanceof RecordingPk)) { - return false; - } - RecordingPk pk = (RecordingPk) aObj; - return _channel.equals(pk._channel) && _starttime.equals(pk._starttime); - } - - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - return _channel.hashCode() + _starttime.hashCode(); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/ScheduleConfig.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/ScheduleConfig.java deleted file mode 100644 index 3478ff41..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/java/org/wamblee/mythtv/ScheduleConfig.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.mythtv; - -/** - * - */ -public class ScheduleConfig { - - private int _intervalSeconds; - - public ScheduleConfig(int aIntervalSeconds) { - _intervalSeconds = aIntervalSeconds; - } - - /** - * @return the intervalSeconds - */ - public int getIntervalSeconds() { - return _intervalSeconds; - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/resources/META-INF/persistence.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/resources/META-INF/persistence.xml deleted file mode 100644 index fc87ef01..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/main/resources/META-INF/persistence.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - org.hibernate.ejb.HibernatePersistence - jdbc/mythtv - org.wamblee.mythtv.Channel - org.wamblee.mythtv.Recording - true - - - \ No newline at end of file diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/test/resources/org.wamblee.mythtv.datasource.standalone.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/test/resources/org.wamblee.mythtv.datasource.standalone.xml deleted file mode 100644 index 1d6e8563..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/monitor/src/test/resources/org.wamblee.mythtv.datasource.standalone.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - com.mysql.jdbc.Driver - jdbc:mysql://10.0.0.140/mythconverg - mythtv - mythtv - - - \ No newline at end of file diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/pom.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/pom.xml deleted file mode 100644 index fd3ed9a1..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - org.wamblee - wamblee-utils - 0.2-SNAPSHOT - - - 4.0.0 - org.wamblee - wamblee-mythtv - pom - wamblee.org mythtv directory monitor - http://wamblee.org - - - monitor - war - timer - ear - - - - - - - - - org.apache.maven.plugins - maven-war-plugin - - ${basedir}/src/webapp/WEB-INF/web.xml - wamblee-mythtv - src/webapp - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/timer/pom.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/timer/pom.xml deleted file mode 100644 index bcd1ef88..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/timer/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - org.wamblee - wamblee-mythtv - 0.2-SNAPSHOT - - - 4.0.0 - org.wamblee - wamblee-mythtv-timer - jar - wamblee.org mythtv directory monitor TIMER - http://wamblee.org - - - - org.wamblee - wamblee-mythtv-monitor - ${project.version} - - - javaee - javaee-api - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/timer/src/main/java/org/wamblee/timer/TimerBean.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/timer/src/main/java/org/wamblee/timer/TimerBean.java deleted file mode 100644 index ca910301..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/timer/src/main/java/org/wamblee/timer/TimerBean.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.timer; - -import javax.annotation.Resource; -import javax.ejb.MessageDriven; -import javax.ejb.Timeout; -import javax.ejb.Timer; -import javax.ejb.TimerService; -import javax.ejb.TransactionAttribute; -import javax.ejb.TransactionAttributeType; -import javax.ejb.TransactionManagement; -import javax.ejb.TransactionManagementType; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageListener; -import javax.jms.ObjectMessage; -import javax.jms.StreamMessage; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wamblee.general.BeanKernel; -import org.wamblee.io.DirectoryMonitor; - -/** - * - */ -@MessageDriven(name = "MythtvTimer") -// Spring's JTA transaction manager does not work with container managed transactions -// because it uses the UserTransaction object which glassfish forbids. -@TransactionManagement(TransactionManagementType.BEAN) -public class TimerBean implements MessageListener { - - private static final Log LOG = LogFactory.getLog(TimerBean.class); - - @Resource - private TimerService _timerService; - - /** - * Initialization of the time interval. The initialization is done through a - * StreamMessage with a single integer containing the time interval to use. - */ - public void onMessage(Message aInitMessage) { - ObjectMessage msg = (ObjectMessage) aInitMessage; - try { - int interval = (Integer)msg.getObject(); - LOG.info("Initializing timer with interval " + interval + " seconds"); - _timerService.createTimer(interval*1000, interval*1000, null); - } catch (JMSException e) { - throw new RuntimeException(e.getMessage()); - } - } - - @Timeout - private void timeout(Timer aTimer) { - LOG.debug("Timer expired!!!"); - try { - DirectoryMonitor monitor = BeanKernel.getBeanFactory().find( - DirectoryMonitor.class); - monitor.poll(); - } catch (Throwable t) { - LOG - .error( - "something terrible happend, ignoring it and hoping for the best", - t); - } - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/timer/src/main/resources/META-INF/ejb-jar.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/timer/src/main/resources/META-INF/ejb-jar.xml deleted file mode 100644 index 84e66f9f..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/timer/src/main/resources/META-INF/ejb-jar.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/timer/src/main/resources/META-INF/sun-ejb-jar.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/timer/src/main/resources/META-INF/sun-ejb-jar.xml deleted file mode 100644 index b08fa26f..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/timer/src/main/resources/META-INF/sun-ejb-jar.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - MythtvTimer - jms/MythtvTimer - - - - \ No newline at end of file diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/pom.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/pom.xml deleted file mode 100644 index d34be658..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - org.wamblee - wamblee-mythtv - 0.2-SNAPSHOT - - - 4.0.0 - org.wamblee - wamblee-mythtv-war - war - wamblee.org mythtv directory monitor WAR - http://wamblee.org - - - - org.wamblee - wamblee-mythtv-monitor - ${project.version} - - - javaee - javaee-api - - - - - - - org.apache.maven.plugins - maven-war-plugin - - ${basedir}/src/webapp/WEB-INF/web.xml - wamblee-mythtv - src/webapp - WEB-INF/lib/*.jar - - - true - lib - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/Recording.hbm.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/Recording.hbm.xml deleted file mode 100644 index 6e52a541..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/Recording.hbm.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/beanRefContext.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/beanRefContext.xml deleted file mode 100644 index 1bd48a62..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/beanRefContext.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - org.wamblee.mythtv.properties.xml - org.wamblee.mythtv.datasource.xml - org.wamblee.mythtv.hibernate.xml - org.wamblee.mythtv.application.xml - - - - - \ No newline at end of file diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.beanfactory.properties b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.beanfactory.properties deleted file mode 100644 index 4ffb2ece..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.beanfactory.properties +++ /dev/null @@ -1,7 +0,0 @@ - -############################################################################## -# Class name of the beanfactory used by the crawler application -############################################################################## - -org.wamblee.beanfactory.class=org.wamblee.mythtv.MythtvBeanFactory - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.mythtv.application.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.mythtv.application.xml deleted file mode 100644 index dafa987d..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.mythtv.application.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - ${org.wamblee.mythtv.linkdir} - - - - - - ${org.wamblee.mythtv.monitordir} - - - - - - ^[a-zA-Z0-9-_]*.mpg$ - - - - - - - - - - - - - - - ${org.wamblee.mythtv.monitordir} - - - - - - - - - - - - - - - - - - - - - - - - - - ${org.wamblee.mythtv.pollinterval} - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.mythtv.datasource.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.mythtv.datasource.xml deleted file mode 100644 index 4f40b6d8..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.mythtv.datasource.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.mythtv.hibernate.properties b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.mythtv.hibernate.properties deleted file mode 100644 index 42491b2c..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.mythtv.hibernate.properties +++ /dev/null @@ -1,20 +0,0 @@ - -################################################################################### -# dialect -################################################################################### -hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect - -################################################################################### -# debugging settings: Log4j configuration can provide more detail. -################################################################################### -hibernate.show_sql=false - -################################################################################### -# hibernate cache provider -################################################################################### -hibernate.cache.provider=org.hibernate.cache.EhCacheProvider - -################################################################################### -# query cache -################################################################################### -hibernate.cache.use_query_cache=true \ No newline at end of file diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.mythtv.hibernate.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.mythtv.hibernate.xml deleted file mode 100644 index fb66e86b..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.mythtv.hibernate.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - java:comp/env/persistence/mythtv - - - - - - - - - - - - PROPAGATION_REQUIRED - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.mythtv.properties b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.mythtv.properties deleted file mode 100644 index c7bf5062..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.mythtv.properties +++ /dev/null @@ -1,8 +0,0 @@ - -org.wamblee.mythtv.datasource=jdbc/mythtv -org.wamblee.mythtv.pollinterval=2 -#org.wamblee.mythtv.monitordir=/data/vcr -#org.wamblee.mythtv.linkdir=/data/vcr/links - -org.wamblee.mythtv.monitordir=/ext/home/erik/java/workspace/utils/mythtv/testdata/input -org.wamblee.mythtv.linkdir=/ext/home/erik/java/workspace/utils/mythtv/testdata/links diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.mythtv.properties.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.mythtv.properties.xml deleted file mode 100644 index 32fa83cd..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/main/resources/org.wamblee.mythtv.properties.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - org.wamblee.mythtv.hibernate.properties - org.wamblee.mythtv.properties - - - - \ No newline at end of file diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/webapp/META-INF/MANIFEST.MF b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/webapp/META-INF/MANIFEST.MF deleted file mode 100644 index 5e949512..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/webapp/META-INF/MANIFEST.MF +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -Class-Path: - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/webapp/WEB-INF/sun-web.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/webapp/WEB-INF/sun-web.xml deleted file mode 100644 index 606cf61e..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/webapp/WEB-INF/sun-web.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - MythtvConnectionFactory - jms/MythtvConnectionFactory - - - - - MythtvTimer - jms/MythtvTimer - - - \ No newline at end of file diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/webapp/WEB-INF/web.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/webapp/WEB-INF/web.xml deleted file mode 100644 index 8d08eb7c..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/mythtv/war/src/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - org.wamblee.mythtv.Application - - - - persistence/mythtv - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/pom.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/pom.xml deleted file mode 100644 index 57c52598..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/pom.xml +++ /dev/null @@ -1,411 +0,0 @@ - - 4.0.0 - org.wamblee - wamblee-utils - pom - 0.2-SNAPSHOT - wamblee.org utility libraries - http://wamblee.org - - support - socketproxy - crawler - gps - mythtv - - - - junit - junit - 3.8.1 - test - - - dbunit - dbunit - 2.1 - test - - - jmock - jmock-cglib - 1.1.0 - test - - - cglib - cglib-full - - - - - - - - - org.wamblee - wamblee-support - ${project.version} - - - org.wamblee - wamblee-support - test-jar - ${project.version} - - - org.wamblee - wamblee-socketproxy - ${project.version} - - - org.wamblee - wamblee-socketproxy - test-jar - ${project.version} - - - org.wamblee - wamblee-crawler - ${project.version} - - - org.wamblee - wamblee-crawler - test-jar - ${project.version} - - - org.wamblee - wamblee-crawler-basic - ${project.version} - - - org.wamblee - wamblee-crawler-basic - test-jar - ${project.version} - - - - javax.servlet - servlet-api - 2.3 - jar - provided - - - quartz - quartz - 1.5.1 - - - jtidy - jtidy - 4aug2000r7-dev - - - - concurrent - concurrent - 1.3.4 - - - - oro - oro - 2.0.6 - - - commons-logging - commons-logging - 1.0.2 - - - commons-httpclient - commons-httpclient - 3.0 - - - commons-beanutils - commons-beanutils - 1.7.0 - - - org.springframework - spring-beans - ${springversion} - - - org.springframework - spring-web - ${springversion} - - - org.springframework - spring-jms - ${springversion} - - - org.springframework - spring-context - ${springversion} - - - org.springframework - spring-hibernate3 - ${springversion} - - - org.springframework - spring-jpa - ${springversion} - - - org.springframework - spring-aop - ${springversion} - - - - - log4j - log4j - 1.2.8 - - - dom4j - dom4j - 1.6 - - - xml-apis - xml-apis - - - - - net.sf.ehcache - ehcache - 1.2.3 - - - xerces - xercesImpl - 2.8.1 - - - org.hibernate - hibernate - 3.2.5.ga - - - org.hibernate - hibernate-entitymanager - 3.3.1.ga - - - javax.persistence - persistence-api - 1.0 - provided - - - commons-email - commons-email - 1.0 - - - javax.mail - mail - 1.3.3_01 - - - jaxen - jaxen - 1.1-beta-9 - - - xom - xom - - - xerces - xmlParserAPIs - - - - - jstl - jstl - 1.1.2 - - - taglibs - standard - 1.1.2 - - - jfree - jfreechart - 1.0.1 - - - jfree - jcommon - 1.0.2 - - - - javaee - javaee-api - 5 - provided - - - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*Test.java - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - test-jar - - - - - - - org.codehaus.mojo - cobertura-maven-plugin - - - - clean - - - - - - - - - - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - - - - checkstyle - javadoc - dependencies - project-team - mailing-list - issue-tracking - license - scm - - - - - - org.codehaus.mojo - changes-maven-plugin - 2.0-beta-1 - - - - changes-report - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - org.codehaus.mojo - surefire-report-maven-plugin - - - - org.codehaus.mojo - cobertura-maven-plugin - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - config/sun_checks.xml - - - - - - org.codehaus.mojo - taglist-maven-plugin - - - TODO - @todo - FIXME - - - - - - - - - - javaee - Java EE repo at SUN - http://download.java.net/maven/1 - legacy - - - - - 2.0.8 - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/socketproxy/pom.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/socketproxy/pom.xml deleted file mode 100644 index c8b534f0..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/socketproxy/pom.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - org.wamblee - wamblee-utils - 0.2-SNAPSHOT - - - 4.0.0 - org.wamblee - wamblee-socketproxy - jar - - wamblee.org socket proxy - http://wamblee.org - - - org.wamblee - wamblee-support - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/socketproxy/src/main/java/org/wamblee/socketproxy/Barrier.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/socketproxy/src/main/java/org/wamblee/socketproxy/Barrier.java deleted file mode 100644 index b703f48e..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/socketproxy/src/main/java/org/wamblee/socketproxy/Barrier.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.socketproxy; - -public class Barrier { - - private int _countLeft; - - public Barrier( int aCount ) { - _countLeft = aCount; - } - - public synchronized void block( ) { - _countLeft--; - if ( _countLeft < 0 ) { - throw new IllegalStateException( - "Barrier count became negative, programming error" ); - } - notifyAll( ); - while ( _countLeft > 0 ) { - waitUninterruptable( ); - } - } - - private void waitUninterruptable( ) { - try { - wait( ); - } catch ( InterruptedException e ) { - // ignore. - } - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/socketproxy/src/main/java/org/wamblee/socketproxy/ForwarderThread.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/socketproxy/src/main/java/org/wamblee/socketproxy/ForwarderThread.java deleted file mode 100644 index 53988b1f..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/socketproxy/src/main/java/org/wamblee/socketproxy/ForwarderThread.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.wamblee.socketproxy; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -/** - * Forwarder thread which handles forwarding of an input stream to - * an output stream. - */ - -public class ForwarderThread extends Thread { - - private String _prefix; - - private Barrier _barrier; - - private InputStream _is; - - private OutputStream _os; - - /** - * Constructs the forwarder thread. - * @param aPrefix Prefix to use in the output. - * @param aBarrier Barrier to block on before actually closing the stream. - * This is done to make sure that connections are only closed in th e - * proxy when the forwarders in both directions are ready to close. - * @param aIs Input stream to read from. - * @param aOs Output stream to forward to. - */ - public ForwarderThread( String aPrefix, Barrier aBarrier, - InputStream aIs, OutputStream aOs ) { - _prefix = aPrefix; - _is = aIs; - _os = aOs; - _barrier = aBarrier; - } - - public void run( ) { - boolean firstChar = true; - try { - int c = _is.read( ); - while ( c > 0 ) { - try { - _os.write( c ); - _os.flush( ); - if ( firstChar ) { - System.out.print( _prefix ); - firstChar = false; - } - System.out.print( (char) c ); - if ( c == '\n' ) { - firstChar = true; - } - } catch ( IOException e ) { - } - - c = _is.read( ); - } - } catch ( IOException e ) { - } - closeStreams(); - } - - /** - * @param is - * @param os - */ - private void closeStreams( ) { - _barrier.block( ); // wait until the other forwarder for the other direction - // is also closed. - try { - _is.close( ); - } catch ( IOException e1 ) { - // Empty. - } - try { - _os.flush( ); - _os.close( ); - } catch ( IOException e1 ) { - // Empty - } - System.out.println(_prefix + " closed"); - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/socketproxy/src/main/java/org/wamblee/socketproxy/SocketProxy.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/socketproxy/src/main/java/org/wamblee/socketproxy/SocketProxy.java deleted file mode 100644 index 25d350fd..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/socketproxy/src/main/java/org/wamblee/socketproxy/SocketProxy.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.wamblee.socketproxy; - -/* - * Created on Apr 5, 2005 - */ - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.ServerSocket; -import java.net.Socket; - -/** - * @author erik - * - * TODO To change the template for this generated type comment go to Window - - * Preferences - Java - Code Style - Code Templates - */ -public class SocketProxy { - - public static void main( final String[] args ) throws IOException { - for ( int i = 0; i < args.length; i++ ) { - // System.out.println(i + " " + args[i]); - String[] fields = args[i].split( ":" ); - final int localPort = Integer.parseInt( fields[0] ); - final String host = fields[1]; - final int remotePort = Integer.parseInt( fields[2] ); - runSocketProxy( localPort, host, remotePort ); - } - } - - /** - * @param localPort - * @param host - * @param remotePort - */ - private static void runSocketProxy( final int localPort, - final String host, final int remotePort ) { - new Thread( new Runnable( ) { - public void run( ) { - try { - new SocketProxy( localPort, host, remotePort ); - } catch ( IOException e ) { - System.out.println( "Problem with socket " + localPort - + ":" + host + ":" + remotePort ); - e.printStackTrace( ); - } - } - } ).start( ); - } - - public SocketProxy( int localPort, String remoteHost, int remotePort ) - throws IOException { - System.out.println( "Listening on port " + localPort ); - ServerSocket server = new ServerSocket( localPort ); - for ( ;; ) { - Socket socket = server.accept( ); - System.out.println( "Got local connection on port " - + localPort ); - InputStream localIs = socket.getInputStream( ); - OutputStream localOs = socket.getOutputStream( ); - Socket clientSocket = new Socket( remoteHost, remotePort ); - final String description = "Port forwarding: " + localPort - + " -> " + remoteHost + ":" + remotePort; - System.out.println( description + " established." ); - InputStream serverIs = clientSocket.getInputStream( ); - OutputStream serverOs = clientSocket.getOutputStream( ); - Barrier barrier = new Barrier(2); - final Thread t1 = runForwarder( barrier, "> ", localIs, serverOs ); - final Thread t2 = runForwarder( barrier, "< ", serverIs, localOs ); - waitForConnectionClose( description, t1, t2 ); - } - } - - /** - * @param description - * @param t1 - * @param t2 - */ - private void waitForConnectionClose( final String description, - final Thread t1, final Thread t2 ) { - new Thread( new Runnable( ) { - public void run( ) { - try { - t1.join( ); - t2.join( ); - } catch ( InterruptedException e ) { - e.printStackTrace( ); - } - System.out.println( description + " closed" ); - } - } ).start( ); - } - - private Thread runForwarder( final Barrier barrier, final String prefix, - final InputStream is, final OutputStream os ) { - Thread t = new ForwarderThread(prefix, barrier, is, os); - t.start( ); - return t; - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/pom.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/pom.xml deleted file mode 100644 index 83977a67..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/pom.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - org.wamblee - wamblee-utils - 0.2-SNAPSHOT - - - 4.0.0 - org.wamblee - wamblee-support - jar - wamblee.org support library - http://wamblee.org - - - commons-logging - commons-logging - - - commons-beanutils - commons-beanutils - - - org.springframework - spring-beans - - - org.springframework - spring-hibernate3 - - - org.springframework - spring-aop - - - - log4j - log4j - - - dom4j - dom4j - - - net.sf.ehcache - ehcache - - - xerces - xercesImpl - - - org.hibernate - hibernate - - - jaxen - jaxen - - - oro - oro - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/cache/Cache.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/cache/Cache.java deleted file mode 100644 index 15f2c508..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/cache/Cache.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.cache; - -import java.io.Serializable; - -/** - * The Cache interface represents... a cache. - * In some circumstances it is more optimal to implement caching directly in - * the code instead of relying on Hibernate caching methods. This interface abstracts - * from the used cache implementation. - * Cache implementations must be thread-safe. - */ -public interface Cache { - - /** - * Adds a key-value pair to the cache. - * @param aKey Key. - * @param aValue Value. - */ - void put(KeyType aKey, ValueType aValue); - - /** - * Retrieves a value from the cache. - * @param aKey Key to retrieve. - * @return Key. - */ - ValueType get(KeyType aKey); - - /** - * Removes an entry from the cache. - * @param aKey Key to remove the entry for. - */ - void remove(KeyType aKey); - - /** - * Removes all entries from the cache. - * - */ - void clear(); -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/cache/CachedObject.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/cache/CachedObject.java deleted file mode 100644 index 787bc870..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/cache/CachedObject.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.cache; - -import java.io.Serializable; - -import org.apache.log4j.Logger; - -/** - * Represents a cached object. The object is either retrieved from the cache if - * the cache has it, or a call back is invoked to get the object (and put it in - * the cache). - */ -public class CachedObject { - - private static final Logger LOGGER = Logger.getLogger(CachedObject.class); - - /** - * Callback invoked to compute an object if it was not found in the cache. - * - * @param - * Type of the object - */ - public static interface Computation { - /** - * Gets the object. Called when the object is not in the cache. - * - * @param aObjectKey - * Id of the object in the cache. - * @return Object, must be non-null. - */ - Value getObject(Key aObjectKey); - } - - /** - * Cache to use. - */ - private Cache _cache; - - /** - * Key of the object in the cache. - */ - private KeyType _objectKey; - - /** - * Computation used to obtain the object if it is not found in the cache. - */ - private Computation _computation; - - /** - * Constructs the cached object. - * - * @param aCache - * Cache to use. - * @param aObjectKey - * Key of the object in the cache. - * @param aComputation - * Computation to get the object in case the object is not in the - * cache. - */ - public CachedObject(Cache aCache, KeyType aObjectKey, - Computation aComputation) { - _cache = aCache; - _objectKey = aObjectKey; - _computation = aComputation; - } - - /** - * Gets the object. Since the object is cached, different calls to this - * method may return different objects. - * - * @return Object. - */ - public ValueType get() { - ValueType object = (ValueType) _cache.get(_objectKey); // the used - // cache is - // thread safe. - if (object == null) { - // synchronize the computation to make sure that the object is only - // computed - // once when multiple concurrent threads detect that the entry must - // be - // recomputed. - synchronized (this) { - object = (ValueType) _cache.get(_objectKey); - if (object == null) { - // No other thread did a recomputation so we must do this - // now. - LOGGER.debug("Refreshing cache for '" + _objectKey + "'"); - object = _computation.getObject(_objectKey); - _cache.put(_objectKey, object); - } - } - } - return object; - } - - /** - * Invalidates the cache for the object so that it is recomputed the next - * time it is requested. - * - */ - public void invalidate() { - _cache.remove(_objectKey); - } - - /** - * Gets the cache. - * - * @return Cache. - */ - public Cache getCache() { - return _cache; - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/cache/EhCache.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/cache/EhCache.java deleted file mode 100644 index 0dcb2b7a..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/cache/EhCache.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.cache; - -import java.io.IOException; -import java.io.InputStream; -import java.io.Serializable; - -import net.sf.ehcache.Cache; -import net.sf.ehcache.CacheException; -import net.sf.ehcache.CacheManager; -import net.sf.ehcache.Element; - -import org.apache.log4j.Logger; -import org.wamblee.io.InputResource; - -/** - * Cache implemented on top of EhCache. - */ -public class EhCache - implements org.wamblee.cache.Cache { - - private static final Logger LOGGER = Logger.getLogger(EhCache.class); - - /** - * EH Cache manager. - */ - private CacheManager _manager; - - /** - * EH cache. - */ - private Cache _cache; - - /** - * Constructs a cache based on EHCache. - * - * @param aResource - * Resource containing the configuration file for EHCache. - * @param aCacheName - * Name of the cache to use. If a cache with this name does not - * exist, one is created based on default settings. - * @throws IOException - * @throws CacheException - */ - public EhCache(InputResource aResource, String aCacheName) - throws IOException, CacheException { - InputStream is = aResource.getInputStream(); - try { - _manager = CacheManager.create(is); - _cache = _manager.getCache(aCacheName); - if (_cache == null) { - LOGGER.warn("Creating cache '" + aCacheName - + "' because it is not configured"); - _manager.addCache(aCacheName); - _cache = _manager.getCache(aCacheName); - } - assert _cache != null; - } finally { - is.close(); - } - - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.cache.Cache#put(KeyType, ValueType) - */ - public void put(KeyType aKey, ValueType aValue) { - _cache.put(new Element(aKey, aValue)); - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.cache.Cache#get(KeyType) - */ - public ValueType get(KeyType aKey) { - try { - Element element = _cache.get(aKey); - if (element == null) { - return null; - } - return (ValueType) element.getValue(); - } catch (CacheException e) { - throw new RuntimeException("Cache problem key = '" + aKey + "'", e); - } - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.cache.Cache#remove(KeyType) - */ - public void remove(KeyType aKey) { - _cache.remove(aKey); - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.cache.Cache#clear() - */ - public void clear() { - _cache.removeAll(); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/cache/ForeverCache.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/cache/ForeverCache.java deleted file mode 100644 index fe607aac..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/cache/ForeverCache.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.cache; - -import java.io.Serializable; -import java.util.HashMap; - -/** - * A very simple cache based on a HashMap, It never expires any entries, and has - * no bounds on its size. - */ -public class ForeverCache - implements Cache { - - /** - * Cached entries. - */ - private HashMap _map; - - /** - * Constructs the cache. - * - */ - public ForeverCache() { - _map = new HashMap(); - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.cache.Cache#put(KeyType, ValueType) - */ - public synchronized void put(KeyType aKey, ValueType aValue) { - _map.put(aKey, aValue); - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.cache.Cache#get(KeyType) - */ - public synchronized ValueType get(KeyType aKey) { - return _map.get(aKey); - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.cache.Cache#remove(KeyType) - */ - public synchronized void remove(KeyType aKey) { - _map.remove(aKey); - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.cache.Cache#clear() - */ - public synchronized void clear() { - _map.clear(); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/cache/ZeroCache.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/cache/ZeroCache.java deleted file mode 100644 index 4c5e1b1a..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/cache/ZeroCache.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.cache; - -import java.io.Serializable; - -/** - * A cache that does not cache. This implementation is useful for disabling caching. - * Because of this implementation, application code does not need to distinguish - * between the situation where it a cache is used and where it isn't. - */ -public class ZeroCache - implements Cache { - - public ZeroCache() { - // Empty. - } - - /* (non-Javadoc) - * @see org.wamblee.cache.Cache#put(KeyType, ValueType) - */ - public void put(KeyType aKey, ValueType aValue) { - // Empty. - } - - /* (non-Javadoc) - * @see org.wamblee.cache.Cache#get(KeyType) - */ - public ValueType get(KeyType aKey) { - return null; - } - - /* (non-Javadoc) - * @see org.wamblee.cache.Cache#remove(KeyType) - */ - public void remove(KeyType aKey) { - // Empty - } - - /* (non-Javadoc) - * @see org.wamblee.cache.Cache#clear() - */ - public void clear() { - // Empty - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/cache/package.html b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/cache/package.html deleted file mode 100644 index 17bde142..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/cache/package.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - wamblee.org - - - -This package provides an interface for a cache together with several -implementations. - - - -@since - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/concurrency/JvmLock.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/concurrency/JvmLock.java deleted file mode 100644 index 6de043d2..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/concurrency/JvmLock.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.concurrency; - -import java.util.concurrent.locks.ReentrantLock; - -/** - * In memory JVM lock. - */ -public class JvmLock implements Lock { - - /** - * Reentrant lock to use. - */ - private ReentrantLock _lock; - - /** - * In-memory lock. - */ - public JvmLock() { - _lock = new ReentrantLock(true); - } - - /* (non-Javadoc) - * @see org.wamblee.concurrency.Lock#acquire() - */ - public void acquire() { - _lock.lock(); - } - - /* (non-Javadoc) - * @see org.wamblee.concurrency.Lock#release() - */ - public void release() { - _lock.unlock(); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/concurrency/Lock.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/concurrency/Lock.java deleted file mode 100644 index 6c6cb126..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/concurrency/Lock.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.concurrency; - -/** - * Represents a re-entrant lock. - * Implementations can provide inmemory JVM locking or full cluster safe locking - * mechanisms. - */ -public interface Lock { - - /** - * Acquires the lock. - */ - void acquire(); - - /** - * Releases the lock. - */ - void release(); -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/concurrency/LockAdvice.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/concurrency/LockAdvice.java deleted file mode 100644 index 7137b52d..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/concurrency/LockAdvice.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.concurrency; - -import org.aopalliance.intercept.MethodInterceptor; -import org.aopalliance.intercept.MethodInvocation; - -/** - * Locking advice. This automatically synchronized an object using a given lock. - */ -public class LockAdvice implements MethodInterceptor { - - /** - * Lock to use. - */ - private Lock _lock; - - /** - * Constructs lock advice. - * @param aLock Lock to use. - */ - public LockAdvice(Lock aLock) { - _lock = aLock; - } - - /* (non-Javadoc) - * @see org.aopalliance.intercept.MethodInterceptor#invoke(org.aopalliance.intercept.MethodInvocation) - */ - public Object invoke(MethodInvocation aInvocation) throws Throwable { - _lock.acquire(); - try { - return aInvocation.proceed(); - } finally { - _lock.release(); - } - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/concurrency/ReadWriteLock.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/concurrency/ReadWriteLock.java deleted file mode 100644 index e7658161..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/concurrency/ReadWriteLock.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.concurrency; - -import java.util.HashSet; - - -/** - * Read-write lock for allowing multiple concurrent readers or at most one - * writer. This implementation does not aim for high performance but for - * robustness and simplicity. Users of this class should not synchronize on - * objects of this class. - */ -public class ReadWriteLock { - /** - * Sets containing the references to the threads that are currently - * reading. This administration is useful to check that the lock has - * already been acquired before it is release. This check adds robustness - * to the application. - */ - private HashSet _readers; - - /** - * The thread that has acquired the lock for writing or null if no such - * thread exists currently. - */ - private Thread _writer; - - /** - * Constructs read-write lock. - */ - public ReadWriteLock() { - _readers = new HashSet(); - _writer = null; - } - - /** - * Acquires the lock for reading. This call will block until the lock can - * be acquired. - * - * @throws IllegalStateException Thrown if the read or write lock is - * already acquired. - */ - public synchronized void acquireRead() { - if (_readers.contains(Thread.currentThread())) { - throw new IllegalStateException( - "Read lock already acquired by current thread: " - + Thread.currentThread()); - } - - if (_writer == Thread.currentThread()) { - throw new IllegalStateException( - "Trying to acquire the read lock while already holding a write lock: " - + Thread.currentThread()); - } - - while (_writer != null) { - try { - wait(); - } catch (InterruptedException e) { - notifyAll(); - } - } - - _readers.add(Thread.currentThread()); - } - - /** - * Releases the lock for reading. Note: This implementation assumes that - * the lock has already been acquired for reading previously. - * - * @throws IllegalStateException Thrown when the lock was not acquired by - * this thread. - */ - public synchronized void releaseRead() { - if (!_readers.remove(Thread.currentThread())) { - throw new IllegalStateException( - "Cannot release read lock because current thread has not acquired it."); - } - - if (_readers.size() == 0) { - notifyAll(); - } - } - - /** - * Acquires the lock for writing. This call will block until the lock has - * been acquired. - * - * @throws IllegalStateException Thrown if the read or write lock is - * already acquired. - */ - public synchronized void acquireWrite() { - if (_writer == Thread.currentThread()) { - throw new IllegalStateException( - "Trying to acquire a write lock while already holding the write lock: " - + Thread.currentThread()); - } - - if (_readers.contains(Thread.currentThread())) { - throw new IllegalStateException( - "Trying to acquire a write lock while already holding the read lock: " - + Thread.currentThread()); - } - - // wait until there are no more writers and no more - // readers - while ((_writer != null) || (_readers.size() > 0)) { - try { - wait(); - } catch (InterruptedException e) { - notifyAll(); - } - } - - _writer = Thread.currentThread(); - - // notification not necessary since all writers and - // readers are now blocked by this thread. - } - - /** - * Releases the lock for writing. - * - * @throws IllegalStateException Thrown when the lock was not acquired. - */ - public synchronized void releaseWrite() { - if (_writer != Thread.currentThread()) { - throw new IllegalStateException( - "Cannot release write lock because it was not acquired. "); - } - - _writer = null; - notifyAll(); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/concurrency/package.html b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/concurrency/package.html deleted file mode 100644 index 405a12a1..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/concurrency/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - wamblee.org - - - -This package provides utilities for dealing with concurrency. - - - -@since - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/conditions/AndCondition.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/conditions/AndCondition.java deleted file mode 100644 index fb77c80a..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/conditions/AndCondition.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.conditions; - -import java.util.ArrayList; -import java.util.List; - -/** - * Represents a logical and of different boolean conditions. - */ -public class AndCondition implements Condition { - - private List> _conditions; - - /** - * Constructs the condition. - * - * @param aCondition1 - * First condition. - * @param aCondition2 - * Second condition. - */ - public AndCondition(Condition aCondition1, Condition aCondition2) { - _conditions = new ArrayList>(); - _conditions.add(aCondition1); - _conditions.add(aCondition2); - } - - /** - * Constructs the and condition. - * - * @param aConditions - * List of conditions to use in the logical and. - */ - public AndCondition(List> aConditions) { - _conditions = aConditions; - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.crawler.kiss.ProgramMatcher#matches(org.wamblee.crawler.kiss.Program) - */ - public boolean matches(T aObject) { - for (Condition condition : _conditions) { - if (!condition.matches(aObject)) { - return false; - } - } - return true; - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/conditions/Condition.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/conditions/Condition.java deleted file mode 100644 index b9f8d77c..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/conditions/Condition.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.conditions; - - -/** - * Determines if an object matches a certain condition. - */ -public interface Condition { - - /** - * Determines if an object matches a condition. - * @param aObject object to match. - * @return True iff the object matches. - */ - boolean matches(T aObject); -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/conditions/FixedCondition.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/conditions/FixedCondition.java deleted file mode 100644 index 0626731c..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/conditions/FixedCondition.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.conditions; - -/** - * Condition which always returns a fixed value. - */ -public class FixedCondition implements Condition { - - private boolean _value; - - /** - * Constructs the condition. - * @param aValue Fixed value of the condition. - */ - public FixedCondition(boolean aValue) { - _value = aValue; - } - - /* (non-Javadoc) - * @see org.wamblee.conditions.Condition#matches(T) - */ - public boolean matches(T aObject) { - return _value; - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/conditions/OrCondition.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/conditions/OrCondition.java deleted file mode 100644 index 2997a4a6..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/conditions/OrCondition.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.conditions; - -import java.util.ArrayList; -import java.util.List; - -/** - * Represents a logical or of different boolean conditions. - */ -public class OrCondition implements Condition { - - private List> _conditions; - - /** - * Constructs the condition. - * - * @param aCondition1 - * First condition. - * @param aCondition2 - * Second condition. - */ - public OrCondition(Condition aCondition1, Condition aCondition2) { - _conditions = new ArrayList>(); - _conditions.add(aCondition1); - _conditions.add(aCondition2); - } - - /** - * Constructs the or condition. - * - * @param aConditions - * List of conditions to use in the logical or. - */ - public OrCondition(List> aConditions) { - _conditions = aConditions; - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.crawler.kiss.ProgramMatcher#matches(org.wamblee.crawler.kiss.Program) - */ - public boolean matches(T aObject) { - for (Condition condition : _conditions) { - if (condition.matches(aObject)) { - return true; - } - } - return false; - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/conditions/PropertyRegexCondition.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/conditions/PropertyRegexCondition.java deleted file mode 100644 index 60726dcc..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/conditions/PropertyRegexCondition.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.conditions; - -import java.lang.reflect.InvocationTargetException; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.apache.commons.beanutils.PropertyUtils; - -/** - * Condition to check whether a given property value matches a certain - * regular expression. - */ -public class PropertyRegexCondition implements Condition { - - /** - * Property name. - */ - private String _property; - - /** - * Regular expression. - */ - private Pattern _regex; - - /** - * Whether or not to convert the value to lowercase before matching. - */ - private boolean _tolower; - - /** - * Constructs the condition. - * @param aProperty Name of the property to examine. - * @param aRegex Regular expression to use. - * @param aTolower Whether or not to convert the value to lowercase before matching. - */ - public PropertyRegexCondition(String aProperty, String aRegex, boolean aTolower) { - _property = aProperty; - _regex = Pattern.compile(aRegex); - _tolower = aTolower; - } - - /* (non-Javadoc) - * @see org.wamblee.conditions.Condition#matches(T) - */ - public boolean matches(T aObject) { - try { - String value = PropertyUtils.getProperty(aObject, _property) + ""; - if ( _tolower ) { - value = value.toLowerCase(); - } - Matcher matcher = _regex.matcher(value); - return matcher.matches(); - } catch (IllegalAccessException e) { - throw new RuntimeException(e.getMessage(), e); - } catch (InvocationTargetException e) { - throw new RuntimeException(e.getMessage(), e); - } catch (NoSuchMethodException e) { - throw new RuntimeException(e.getMessage(), e); - } - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/conditions/package.html b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/conditions/package.html deleted file mode 100644 index 3d489d60..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/conditions/package.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - wamblee.org - - - -This package provides some basic support classes for checking boolean conditions -on objects. - - - -@since - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/general/BeanFactory.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/general/BeanFactory.java deleted file mode 100644 index f93e1fef..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/general/BeanFactory.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.general; - -/** - * Bean factory used to obtain objects in a transparent way. - */ -public interface BeanFactory { - - /** - * Finds a bean based on id. - * @param aId Id of the bean. - * @return Object (always non-null). - * @throws BeanFactoryException In case the object could not be found. - */ - Object find(String aId); - - /** - * Finds a bean of the given class and which can be cast to the - * specified class. This is typically used by specifying the interface - * class for retrieving an implementation of that class. This - * means that the bean implementing the class is configured in the bean factory - * with id equal to the class name of the interface. - * @param aClass Class of the object to find. - * @return Object (always non-null). - * @throws BeanFactoryException In case the object could not be found. - */ - T find(Class aClass); - - /** - * Finds a bean with the given id which can be cast to the specified - * class. - * @param Type of the object to get. - * @param aId Id of the object to lookup. - * @param aClass Class that the object must extends. - * @return Object, always non-null. - * @throws BeanFactoryException In case the object could not be found. - */ - T find(String aId, Class aClass); -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/general/BeanFactoryException.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/general/BeanFactoryException.java deleted file mode 100644 index 9f60d21b..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/general/BeanFactoryException.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.general; - -/** - * Exception thrown by the BeanFactory if an object could not be found. - */ -public class BeanFactoryException extends RuntimeException { - static final long serialVersionUID = -1215992188624874902L; - - /** - * Constructs the exception. - * @param aMsg Message. - */ - public BeanFactoryException(String aMsg) { - super(aMsg); - } - - /** - * Constructs the exception. - * @param aMsg Message. - * @param aThrowable Cause of the exception. - */ - public BeanFactoryException(String aMsg, Throwable aThrowable) { - super(aMsg, aThrowable); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/general/BeanKernel.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/general/BeanKernel.java deleted file mode 100644 index d05eef3d..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/general/BeanKernel.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.general; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wamblee.io.ClassPathResource; -import org.wamblee.io.InputResource; - -/** - * The standard means to obtain the bean factory. This works by reading a - * property {@value #BEAN_FACTORY_CLASS} from a property file named - * {@value #BEAN_KERNEL_PROP_FILE} from the class path. This property identifies - * the bean factory implementation to use. The configured bean factory must have - * a no-arg constructor. - */ -public final class BeanKernel { - - private static final Log LOG = LogFactory.getLog(BeanKernel.class); - - /** - * Bean factory kernel properties file. - */ - private static final String BEAN_KERNEL_PROP_FILE = "org.wamblee.beanfactory.properties"; - - /** - * Name of the property to define the name of the bean factory class to use. - * THis class must have a public default constructor. - */ - private static final String BEAN_FACTORY_CLASS = "org.wamblee.beanfactory.class"; - - /** - * Cached bean factory. - */ - private static BeanFactory BEAN_FACTORY; - - /** - * Disabled constructor. - * - */ - private BeanKernel() { - // Empty - } - - /** - * Overrides the default mechanism for looking up the bean factory by - * specifying it yourself. - * - * @param aOverride - * Override bean factory. - */ - public static void overrideBeanFactory(BeanFactory aOverride) { - BEAN_FACTORY = aOverride; - } - - /** - * Gets the bean factory. - * - * @return Bean factory. - */ - public static BeanFactory getBeanFactory() { - synchronized (BeanFactory.class) { - if (BEAN_FACTORY == null) { - BEAN_FACTORY = lookupBeanFactory(BEAN_KERNEL_PROP_FILE); - } - } - return BEAN_FACTORY; - } - - /** - * Lookup the bean factory based on the properties file. - * - * @return Bean factory. - */ - static BeanFactory lookupBeanFactory(String aPropertyFilename) { - InputResource resource = new ClassPathResource(aPropertyFilename); - InputStream is; - try { - is = resource.getInputStream(); - } catch (IOException e) { - throw new BeanFactoryException("Cannot open resource " + resource, - e); - } - try { - Properties props = new Properties(); - props.load(is); - String className = props.getProperty(BEAN_FACTORY_CLASS); - Class beanFactory = Class.forName(className); - return (BeanFactory) beanFactory.newInstance(); - } catch (Exception e) { - throw new BeanFactoryException("Cannot read from resource " - + resource, e); - } finally { - try { - is.close(); - } catch (IOException e) { - // last resort cannot do much now. - LOG.error("Error closing resource " + resource); - } - } - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/general/Pair.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/general/Pair.java deleted file mode 100644 index a6bc544d..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/general/Pair.java +++ /dev/null @@ -1,78 +0,0 @@ - - - -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.general; - -/** - * Represents a pair of objects. This is inspired on the C++ Standard Template - * Library pair template. - * - * @param - * Type of the first object. - * @param - * Type of the second object. - */ -public class Pair { - - private T _t; - - private U _u; - - /** - * Constructs the pair. - * - * @param aT - * First object. - * @param aU - * Second object. - */ - public Pair(T aT, U aU) { - _t = aT; - _u = aU; - } - - /** - * Copies a pair. - * - * @param aPair - * Pair to copy. - */ - public Pair(Pair aPair) { - _t = aPair._t; - _u = aPair._u; - } - - /** - * Gets the first object of the pair. - * - * @return First object. - */ - public T getFirst() { - return _t; - } - - /** - * Gets the second object of the pair. - * - * @return Second object. - */ - public U getSecond() { - return _u; - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/general/SpringBeanFactory.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/general/SpringBeanFactory.java deleted file mode 100644 index a373eb5c..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/general/SpringBeanFactory.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.general; - -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.access.BeanFactoryLocator; -import org.springframework.beans.factory.access.BeanFactoryReference; -import org.springframework.context.access.ContextSingletonBeanFactoryLocator; - -/** - * Bean factory which uses Spring. This bean factory cannot be configured - * directly in the {@link org.wamblee.general.BeanKernel} because it does not - * provide a default no-arg constructor. Therefore, it must be delegated to or - * it must tbe subclassed to provide a default constructor. - */ -public class SpringBeanFactory implements BeanFactory { - - private BeanFactoryReference _factoryReference; - - /** - * Constructs the bean factory. - * - * @param aSelector - * Selector to find the appropriate bean ref context. - * @param aFactoryName - * Spring bean factory to use. - */ - public SpringBeanFactory(String aSelector, String aFactoryName) { - try { - BeanFactoryLocator locator = ContextSingletonBeanFactoryLocator - .getInstance(aSelector); - _factoryReference = locator.useBeanFactory(aFactoryName); - } catch (BeansException e) { - throw new BeanFactoryException( - "Could not load bean factory: selector = '" + aSelector - + "', factory = '" + aFactoryName + "'", e); - } - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.general.BeanFactory#find(java.lang.String) - */ - public Object find(String aId) { - return find(aId, Object.class); - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.general.BeanFactory#find(java.lang.Class) - */ - public T find(Class aClass) { - return find(aClass.getName(), aClass); - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.general.BeanFactory#find(java.lang.String, - * java.lang.Class) - */ - public T find(String aId, Class aClass) { - try { - Object obj = _factoryReference.getFactory().getBean(aId, aClass); - assert obj != null; - return aClass.cast(obj); - } catch (BeansException e) { - throw new BeanFactoryException(e.getMessage(), e); - } - } - - /** - * Gets the spring bean factory. - * @return Spring bean factory. - */ - public org.springframework.beans.factory.BeanFactory getSpringBeanFactory() { - return _factoryReference.getFactory(); - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/general/package.html b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/general/package.html deleted file mode 100644 index 042270f2..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/general/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - wamblee.org - - - -This package provides several general purpose support classes. - - - -@since - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/ClassPathResource.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/ClassPathResource.java deleted file mode 100644 index 32014a10..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/ClassPathResource.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.io; - -import java.io.IOException; -import java.io.InputStream; - -/** - * Represents an input resource in the classpath. - */ -public class ClassPathResource implements InputResource { - /** - * Resource name. - */ - private String _resource; - - /** - * Construct the class path resource. - * - * @param aResource - * Resource - */ - public ClassPathResource(String aResource) { - _resource = aResource; - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.io.InputResource#getInputStream() - */ - public InputStream getInputStream() throws IOException { - InputStream stream = Thread.currentThread().getContextClassLoader() - .getResourceAsStream(_resource); - if (stream == null) { - throw new IOException("Class path resource '" + _resource - + "' not found."); - } - return stream; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - public String toString() { - return "ClassPathResource(" + _resource + ")"; - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/DirectoryMonitor.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/DirectoryMonitor.java deleted file mode 100644 index f84d0378..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/DirectoryMonitor.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.io; - -import java.io.File; -import java.io.FileFilter; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * Monitors a directory for changes. - */ -public class DirectoryMonitor { - - private static final Log LOG = LogFactory.getLog(DirectoryMonitor.class); - - public static interface Listener { - void fileChanged(File aFile); - void fileCreated(File aFile); - void fileDeleted(File aFile); - }; - - private File _directory; - private FileFilter _filter; - private Listener _listener; - private Map _contents; - - public DirectoryMonitor(File aDirectory, FileFilter aFilefilter, Listener aListener) { - _directory = aDirectory; - if ( !_directory.isDirectory()) { - throw new IllegalArgumentException("Directory '" + _directory + "' does not exist"); - } - _filter = aFilefilter; - _listener = aListener; - _contents = new HashMap(); - } - - public void poll() { - LOG.debug("Polling " + _directory); - Map newContents = new HashMap(); - File[] files = _directory.listFiles(_filter); - for (File file: files) { - if ( _contents.containsKey(file)) { - Date oldDate = _contents.get(file); - if (file.lastModified() != oldDate.getTime()) { - _listener.fileChanged(file); - } else { - // No change. - } - _contents.remove(file); - newContents.put(file, new Date(file.lastModified())); - } else { - _listener.fileCreated(file); - newContents.put(file, new Date(file.lastModified())); - } - } - for (File file: _contents.keySet()) { - _listener.fileDeleted(file); - } - _contents = newContents; - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/FileResource.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/FileResource.java deleted file mode 100644 index ee43f72f..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/FileResource.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.io; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; - -/** - * Resource implemention for reading from a file. - */ -public class FileResource implements InputResource { - /** - * File to read. - */ - private File _file; - - /** - * Constructs the resource. - * - * @param aFile - * File to read. - */ - public FileResource(File aFile) { - _file = aFile; - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.io.InputResource#getInputStream() - */ - public InputStream getInputStream() throws IOException { - return new BufferedInputStream(new FileInputStream(_file)); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/InputResource.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/InputResource.java deleted file mode 100644 index f5e84965..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/InputResource.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.io; - -import java.io.IOException; -import java.io.InputStream; - -/** - * Represents a resource from which information can be read. - */ -public interface InputResource { - /** - * Gets the input stream to the resource. The obtained input stream must be - * closed once reading has finished. - * - * @return Input stream to the resource, never null. - * @throws IOException - * in case the resource cannot be found. - */ - InputStream getInputStream() throws IOException; -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/SimpleProcess.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/SimpleProcess.java deleted file mode 100644 index 6b922b93..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/SimpleProcess.java +++ /dev/null @@ -1,153 +0,0 @@ -package org.wamblee.io; - -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.PrintStream; -import java.io.StringWriter; -import java.io.Writer; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -public class SimpleProcess { - - private static final Log LOG = LogFactory.getLog(SimpleProcess.class); - - private File _directory; - - private String[] _cmd; - - private String _stdout; - private String _stderr; - - public SimpleProcess(File aDirectory, String[] aCmd) { - _directory = aDirectory; - _cmd = aCmd; - } - - /** - * @return the stdout - */ - public String getStdout() { - return _stdout; - } - - /** - * @return the stderr - */ - public String getStderr() { - return _stderr; - } - - /** - * Runs the process and blocks until it is done. - * - * @return Exit status of the process. - * @throws IOException - * In case of problems. - */ - public int run() throws IOException { - return runImpl(); - } - - private int runImpl() throws IOException { - try { - String fullcmd = ""; - for (String part: _cmd) { - fullcmd += " " + part; - } - LOG.debug("Executing '" + fullcmd + "' in directory '" + _directory - + "'"); - java.lang.Process proc = Runtime.getRuntime().exec(_cmd, null, _directory); - - // Read standard output and error in separate threads to avoid - // deadlock. - - StringWriter stdout = new StringWriter(); - StringWriter stderr = new StringWriter(); - Thread stdoutReader = readAndLogStream("STDOUT> ", proc - .getInputStream(), stdout); - Thread stderrReader = readAndLogStream("STDERR> ", proc - .getErrorStream(), stderr); - - try { - proc.waitFor(); - } catch (InterruptedException e) { - IOException exception = new IOException( - "Process was terminated: " + this); - exception.initCause(e); - throw exception; - } - waitForReader(stdoutReader); - waitForReader(stderrReader); - - _stdout = stdout.toString(); - _stderr = stderr.toString(); - - if (proc.exitValue() != 0) { - LOG.warn("Exit value was non-zero: " + this); - } else { - LOG.debug("Process finished"); - } - return proc.exitValue(); - } catch (IOException e) { - IOException exception = new IOException("Error executing process: " - + this); - exception.initCause(e); - throw exception; - } - } - - private void waitForReader(Thread aReaderThread) { - try { - aReaderThread.join(); - } catch (InterruptedException e) { - LOG - .warn(this - + ": error waiting for output stream reader of process to finish"); - } - } - - private Thread readAndLogStream(final String aPrefix, - final InputStream aStream, final Writer aOutput) { - Thread inputReader = new Thread() { - @Override - public void run() { - BufferedReader br = null; - try { - br = new BufferedReader(new InputStreamReader(aStream)); - String str; - while ((str = br.readLine()) != null) { - LOG.debug(aPrefix + str); - aOutput.write(str); - } - } catch (IOException e) { - LOG.warn(SimpleProcess.this + ": error reading input stream", e); - } finally { - if (br != null) { - try { - br.close(); - } catch (IOException e) { - LOG.warn("Error closing stream " + aPrefix); - } - } - } - } - }; - inputReader.start(); - return inputReader; - } - - @Override - public String toString() { - String fullcmd = ""; - for (String part: _cmd) { - fullcmd += part + " "; - } - return "process(dir = '" + _directory + "', cmd = '" + fullcmd + "')"; - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/StreamResource.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/StreamResource.java deleted file mode 100644 index 11f815c4..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/StreamResource.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.io; - -import java.io.IOException; -import java.io.InputStream; - -/** - * Input resource based on an input stream. - */ -public class StreamResource implements InputResource { - /** - * Input stream to read. - */ - private InputStream _stream; - - /** - * Constructs a resource. - * - * @param aStream - * Input stream to read. - */ - public StreamResource(InputStream aStream) { - _stream = aStream; - } - - /* - * (non-Javadoc) - * - * @see InputResource#getInputStream() - */ - public InputStream getInputStream() throws IOException { - return _stream; - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/package.html b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/package.html deleted file mode 100644 index 2023c07b..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/io/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - wamblee.org - - - -This package provides several support utilities for IO related functionality. - - - -@since - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/observer/DefaultObserverNotifier.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/observer/DefaultObserverNotifier.java deleted file mode 100644 index 2e028ea7..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/observer/DefaultObserverNotifier.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.observer; - -/** - * Default observer notifier which calls - * {@link org.wamblee.observer.Observer#send(ObservableType, Event)} - * immediately. - */ -public class DefaultObserverNotifier implements - ObserverNotifier { - - /** - * Constructs the notifier. - * - */ - public DefaultObserverNotifier() { - // Empty - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.observer.ObserverNotifier#update(org.wamblee.observer.Observer, - * ObservableType, Event) - */ - public void update(Observer aObserver, - ObservableType aObservable, Event aEvent) { - aObserver.send(aObservable, aEvent); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/observer/Observable.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/observer/Observable.java deleted file mode 100644 index 2980afaf..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/observer/Observable.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.observer; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.TreeMap; - -import org.apache.log4j.Logger; - -/** - * Implements subscription and notification logic for an observer pattern. This - * class is thread safe. - */ -public class Observable { - - private static final Logger LOGGER = Logger.getLogger(Observable.class); - - /** - * Observable. - */ - private ObservableType _observable; - - /** - * Used to notify observers. - */ - private ObserverNotifier _notifier; - - /** - * Map of subscription to observer. - */ - private Map> _observers; - - /** - * Counter for subscriptions. Holds the next subscription. - */ - private long _counter; - - /** - * Constructs the observable. - * - * @param aObservable - * Observable this instance is used for. - * @param aNotifier - * Object used for implementing notification of listeners. - */ - public Observable(ObservableType aObservable, - ObserverNotifier aNotifier) { - _observable = aObservable; - _notifier = aNotifier; - _observers = new TreeMap>(); - _counter = 0; - } - - /** - * Subscribe an obvers. - * - * @param aObserver - * Observer to subscribe. - * @return Event Event to send. - */ - public synchronized long subscribe(Observer aObserver) { - long subscription = _counter++; // integer rage is so large it will - // never roll over. - _observers.put(subscription, aObserver); - return subscription; - } - - /** - * Unsubscribe an observer. - * - * @param aSubscription - * Subscription which is used - * @throws IllegalArgumentException - * In case the subscription is not known. - */ - public synchronized void unsubscribe(long aSubscription) { - Object obj = _observers.remove(aSubscription); - if (obj == null) { - throw new IllegalArgumentException("Subscription '" + aSubscription - + "'"); - } - } - - /** - * Gets the number of subscribed observers. - * - * @return Number of subscribed observers. - */ - public int getObserverCount() { - return _observers.size(); - } - - /** - * Notifies all subscribed observers. - * - * @param aEvent - * Event to send. - */ - public void send(Event aEvent) { - // Make sure we do the notification while not holding the lock to avoid - // potential deadlock - // situations. - List> observers = new ArrayList>(); - synchronized (this) { - observers.addAll(_observers.values()); - } - for (Observer observer : observers) { - _notifier.update(observer, _observable, aEvent); - } - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#finalize() - */ - @Override - protected void finalize() throws Throwable { - if (_observers.size() > 0) { - LOGGER - .error("Still observers registered at finalization of observer!"); - for (Observer observer : _observers.values()) { - LOGGER.error(" observer: " + observer); - } - } - - super.finalize(); - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/observer/Observer.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/observer/Observer.java deleted file mode 100644 index 3f74773c..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/observer/Observer.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.observer; - -/** - * This is a type-safe version of {@link java.util.Observable}. - */ -public interface Observer { - - /** - * Called when an event has occurred on the observable. - * @param aObservable Observable. - * @param aEvent Event. - */ - void send(ObservableType aObservable, Event aEvent); -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/observer/ObserverNotifier.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/observer/ObserverNotifier.java deleted file mode 100644 index 26cbd581..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/observer/ObserverNotifier.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.observer; - -/** - * Implementation of notification of subscribers. - */ -public interface ObserverNotifier { - - /** - * Notifies an observer. - * - * @param aObserver Observer to notify - * @param aObservable Observable at which the event occured. - * @param aEvent Event that occured. - */ - void update(Observer aObserver, ObservableType aObservable, Event aEvent); - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/observer/package.html b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/observer/package.html deleted file mode 100644 index 35b6c3b0..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/observer/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - wamblee.org - - - -This package provides support for the observer pattern. - - - -@since - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/persistence/AbstractPersistent.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/persistence/AbstractPersistent.java deleted file mode 100644 index 65142564..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/persistence/AbstractPersistent.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.persistence; - -import java.io.Serializable; - -/** - * Default implementation of Persistent. - */ -public abstract class AbstractPersistent implements Persistent { - - /** - * Primary key. - */ - private Serializable _primaryKey; - - /** - * Version. - */ - private int _version; - - /** - * Constructs the object. - * - */ - protected AbstractPersistent() { - _primaryKey = null; - _version = -1; - } - - /** - * Copy constructor. - * @param aPersistent Object to copy. - */ - protected AbstractPersistent(AbstractPersistent aPersistent) { - _primaryKey = aPersistent._primaryKey; - _version = aPersistent._version; - } - - /* (non-Javadoc) - * @see org.wamblee.persistence.Persistent#getPrimaryKey() - */ - public Serializable getPrimaryKey() { - return _primaryKey; - } - - /* (non-Javadoc) - * @see org.wamblee.persistence.Persistent#setPrimaryKey(java.io.Serializable) - */ - public void setPrimaryKey(Serializable aKey) { - _primaryKey = aKey; - } - - /* (non-Javadoc) - * @see org.wamblee.persistence.Persistent#getPersistedVersion() - */ - public int getPersistedVersion() { - return _version; - } - - /* (non-Javadoc) - * @see org.wamblee.persistence.Persistent#setPersistedVersion(int) - */ - public void setPersistedVersion(int aVersion) { - _version = aVersion; - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/persistence/Persistent.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/persistence/Persistent.java deleted file mode 100644 index 57faf95e..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/persistence/Persistent.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.persistence; - -import java.io.Serializable; - -/** - * Interface for persistent objects. This defines required functionality for all objects - * that are persisted. - * - * Objects that implement this interface and which implement - * {@link java.lang.Object#equals(java.lang.Object)} - * should exclude the primary key and version from determining equality. - */ -public interface Persistent { - - /** - * Gets the primary key. - * @return Primary key. - * @see #setPrimaryKey(Serializable) - */ - Serializable getPrimaryKey(); - - /** - * Sets the primary key. - * @param aKey Primary key. - * @see #getPrimaryKey() - */ - void setPrimaryKey(Serializable aKey); - - /** - * Gets the version. - * @return Version. - * @see #setPersistedVersion(int) - */ - int getPersistedVersion(); - - /** - * Sets the version. - * @param aVersion Version. - * @see #getPersistedVersion() - */ - void setPersistedVersion(int aVersion); -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/persistence/hibernate/HibernateMappingFiles.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/persistence/hibernate/HibernateMappingFiles.java deleted file mode 100644 index b051455b..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/persistence/hibernate/HibernateMappingFiles.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.persistence.hibernate; - -import java.util.ArrayList; -import java.util.Arrays; - -/** - * Hibernate mapping files to use. - */ -public class HibernateMappingFiles extends ArrayList { - - /** - * Constructs an empty list of hibernate mapping files. - * - */ - public HibernateMappingFiles() { - super(); - } - - /** - * Constructs the list of Spring config files. - * @param aFiles Files. - */ - public HibernateMappingFiles(String[] aFiles) { - super(); - addAll(Arrays.asList(aFiles)); - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/persistence/hibernate/HibernateSupport.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/persistence/hibernate/HibernateSupport.java deleted file mode 100644 index 65160dd1..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/persistence/hibernate/HibernateSupport.java +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.persistence.hibernate; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.orm.hibernate3.HibernateTemplate; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.wamblee.persistence.Persistent; - -/** - * Extension of - * {@link org.springframework.orm.hibernate.support.HibernateDaoSupport}. - */ -public class HibernateSupport extends HibernateDaoSupport { - - private static final Log LOG = LogFactory.getLog(HibernateSupport.class); - - /** - * This class provided an equality operation based on the object reference - * of the wrapped object. This is required because we cannto assume that the - * equals operation has any meaning for different types of persistent - * objects. This allows us to use the standard collection classes for - * detecting cyclic dependences and avoiding recursion. - * - */ - private static final class ObjectElem { - private Object _object; - - public ObjectElem(Object aObject) { - _object = aObject; - } - - public boolean equals(Object aObj) { - return ((ObjectElem) aObj)._object == _object; - } - - public int hashCode() { - return _object.hashCode(); - } - } - - /** - * Constructs the object. - * - */ - public HibernateSupport() { - // Empty - } - - /** - * Performes a hibernate Session.merge() and updates the - * object with the correct primary key and version. This is an extension to - * the hibernate merge operation because hibernate itself leaves the object - * passed to merge untouched. - * - * Use this method with extreme caution since it will recursively load all - * objects that the current object has relations with and for which - * cascade="merge" was specified in the Hibernate mapping file. - * - * @param aPersistent - * Object to merge. - */ - public void merge(Persistent aPersistent) { - merge(getHibernateTemplate(), aPersistent); - } - - /** - * As {@link #merge(Persistent)} but with a given template. This method can - * be accessed in a static way. - * - * @param aTemplate - * Hibernate template - * @param aPersistent - * Object to merge. - */ - public static void merge(HibernateTemplate aTemplate, Persistent aPersistent) { - Persistent merged = (Persistent) aTemplate.merge(aPersistent); - processPersistent(aPersistent, merged, new ArrayList()); - } - - /** - * Copies primary keys and version from the result of the merged to the - * object that was passed to the merge operation. It does this by traversing - * the properties of the object. It copies the primary key and version for - * objects that implement {@link Persistent} and applies the same rules to - * objects in maps and sets as well (i.e. recursively). - * - * @param aPersistent - * Object whose primary key and version are to be set. - * @param aMerged - * Object that was the result of the merge. - * @param aProcessed - * List of already processed Persistent objects of the persistent - * part. - */ - public static void processPersistent(Persistent aPersistent, - Persistent aMerged, List aProcessed) { - if (aPersistent == null && aMerged == null) { - return; - } - if (aPersistent == null || aMerged == null) { - throw new RuntimeException("persistent or merged object is null '" - + aPersistent + "'" + " '" + aMerged + "'"); - } - ObjectElem elem = new ObjectElem(aPersistent); - if (aProcessed.contains(elem)) { - return; // already processed. - } - aProcessed.add(elem); - - LOG.info("Setting pk/version on " + aPersistent + " from " + aMerged); - - if (aPersistent.getPrimaryKey() != null - && !aMerged.getPrimaryKey().equals(aPersistent.getPrimaryKey())) { - LOG.error("Mismatch between primary key values: " + aPersistent - + " " + aMerged); - } else { - aPersistent.setPersistedVersion(aMerged.getPersistedVersion()); - aPersistent.setPrimaryKey(aMerged.getPrimaryKey()); - } - - Method[] methods = aPersistent.getClass().getMethods(); - for (Method getter : methods) { - if (getter.getName().startsWith("get")) { - Class returnType = getter.getReturnType(); - - try { - if (Set.class.isAssignableFrom(returnType)) { - Set merged = (Set) getter.invoke(aMerged); - Set persistent = (Set) getter.invoke(aPersistent); - processSet(persistent, merged, aProcessed); - } else if (List.class.isAssignableFrom(returnType)) { - List merged = (List) getter.invoke(aMerged); - List persistent = (List) getter.invoke(aPersistent); - processList(persistent, merged, aProcessed); - } else if (Map.class.isAssignableFrom(returnType)) { - Map merged = (Map) getter.invoke(aMerged); - Map persistent = (Map) getter.invoke(aPersistent); - processMap(persistent, merged, aProcessed); - } else if (Persistent.class.isAssignableFrom(returnType)) { - Persistent merged = (Persistent) getter.invoke(aMerged); - Persistent persistent = (Persistent) getter - .invoke(aPersistent); - processPersistent(persistent, merged, aProcessed); - } else if (returnType.isArray() - && Persistent.class.isAssignableFrom(returnType - .getComponentType())) { - Persistent[] merged = (Persistent[]) getter - .invoke(aMerged); - Persistent[] persistent = (Persistent[]) getter - .invoke(aPersistent); - for (int i = 0; i < persistent.length; i++) { - processPersistent(persistent[i], merged[i], - aProcessed); - } - } - } catch (InvocationTargetException e) { - throw new RuntimeException(e.getMessage(), e); - } catch (IllegalAccessException e) { - throw new RuntimeException(e.getMessage(), e); - } - } - } - - } - - /** - * Process the persistent objects in the collections. - * - * @param aPersistent - * Collection in the original object. - * @param aMerged - * Collection as a result of the merge. - * @param aProcessed - * List of processed persistent objects. - */ - public static void processList(List aPersistent, List aMerged, - List aProcessed) { - Object[] merged = aMerged.toArray(); - Object[] persistent = aPersistent.toArray(); - if (merged.length != persistent.length) { - throw new RuntimeException("Array sizes differ " + merged.length - + " " + persistent.length); - } - for (int i = 0; i < merged.length; i++) { - assert merged[i].equals(persistent[i]); - if (merged[i] instanceof Persistent) { - processPersistent((Persistent) persistent[i], - (Persistent) merged[i], aProcessed); - } - } - } - - /** - * Process the persistent objects in sets. - * - * @param aPersistent - * Collection in the original object. - * @param aMerged - * Collection as a result of the merge. - * @param aProcessed - * List of processed persistent objects. - */ - public static void processSet(Set aPersistent, Set aMerged, - List aProcessed) { - if (aMerged.size() != aPersistent.size()) { - throw new RuntimeException("Array sizes differ " + aMerged.size() - + " " + aPersistent.size()); - } - for (Object merged : aMerged) { - // Find the object that equals the merged[i] - for (Object persistent : aPersistent) { - if (persistent.equals(merged)) { - processPersistent((Persistent) persistent, - (Persistent) merged, aProcessed); - break; - } - } - } - } - - /** - * Process the Map objects in the collections. - * - * @param aPersistent - * Collection in the original object. - * @param aMerged - * Collection as a result of the merge. - * @param aProcessed - * List of processed persistent objects. - */ - public static void processMap(Map aPersistent, Map aMerged, - List aProcessed) { - if (aMerged.size() != aPersistent.size()) { - throw new RuntimeException("Sizes differ " + aMerged.size() + " " - + aPersistent.size()); - } - Set keys = aMerged.keySet(); - for (Object key : keys) { - if (!aPersistent.containsKey(key)) { - throw new RuntimeException("Key '" + key + "' not found"); - } - Object mergedValue = aMerged.get(key); - Object persistentValue = aPersistent.get(key); - if (mergedValue instanceof Persistent) { - if (persistentValue instanceof Persistent) { - processPersistent((Persistent) persistentValue, - (Persistent) mergedValue, aProcessed); - } else { - throw new RuntimeException( - "Value in original object is null, whereas merged object contains a value"); - } - } - } - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/persistence/hibernate/package.html b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/persistence/hibernate/package.html deleted file mode 100644 index 6f14b9f2..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/persistence/hibernate/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - wamblee.org - - - -This package provides support utilities for persistence with hibernate. - - - -@since - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/persistence/package.html b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/persistence/package.html deleted file mode 100644 index cdca295e..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/persistence/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - wamblee.org - - - -This package provides support for persistence. - - - -@since - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/xml/ClasspathUriResolver.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/xml/ClasspathUriResolver.java deleted file mode 100644 index ba2d875c..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/xml/ClasspathUriResolver.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.xml; - -import java.io.IOException; - -import javax.xml.transform.Source; -import javax.xml.transform.TransformerException; -import javax.xml.transform.URIResolver; -import javax.xml.transform.stream.StreamSource; - -import org.wamblee.io.ClassPathResource; -import org.wamblee.io.InputResource; - -/** - * URI resolver that resolves stylesheets through the classpath. - */ -public class ClasspathUriResolver implements URIResolver { - - /** - * Constructs the resolver. - * - */ - public ClasspathUriResolver() { - // Empty. - } - - /* - * (non-Javadoc) - * - * @see javax.xml.transform.URIResolver#resolve(java.lang.String, - * java.lang.String) - */ - public Source resolve(String aHref, String aBase) - throws TransformerException { - InputResource xslt = new ClassPathResource(aHref); - try { - return new StreamSource(xslt.getInputStream()); - } catch (IOException e) { - throw new TransformerException( - "Could not get XSLT style sheet in classpath '" + aHref - + "'", e); - } - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/xml/DomUtils.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/xml/DomUtils.java deleted file mode 100644 index e0148692..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/xml/DomUtils.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.xml; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; - -import javax.xml.XMLConstants; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.stream.StreamSource; -import javax.xml.validation.Schema; -import javax.xml.validation.SchemaFactory; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.xml.serialize.OutputFormat; -import org.apache.xml.serialize.XMLSerializer; -import org.dom4j.DocumentException; -import org.dom4j.io.DOMReader; -import org.dom4j.io.DOMWriter; -import org.w3c.dom.Attr; -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.SAXException; - -/** - * Some basic XML utilities for common reoccuring tasks for DOM documents. - */ -public final class DomUtils { - - private static final Log LOG = LogFactory.getLog(DomUtils.class); - - /** - * Disabled default constructor. - * - */ - private DomUtils() { - // Empty. - } - - /** - * Parses an XML document from a string. - * - * @param aDocument - * document. - * @return - */ - public static Document read(String aDocument) throws XMLException { - ByteArrayInputStream is = new ByteArrayInputStream(aDocument.getBytes()); - return read(is); - } - - /** - * Parses an XML document from a stream. - * - * @param aIs - * Input stream. - * @return - */ - public static Document read(InputStream aIs) throws XMLException { - try { - DocumentBuilder builder = DocumentBuilderFactory.newInstance() - .newDocumentBuilder(); - return builder.parse(aIs); - } catch (SAXException e) { - throw new XMLException(e.getMessage(), e); - } catch (IOException e) { - throw new XMLException(e.getMessage(), e); - } catch (ParserConfigurationException e) { - throw new XMLException(e.getMessage(), e); - } finally { - try { - aIs.close(); - } catch (Exception e) { - LOG.warn("Error closing XML file", e); - } - } - } - - /** - * Reads and validates a document against a schema. - * - * @param aIs - * Input stream. - * @param aSchema - * Schema. - * @return Parsed and validated document. - */ - public static Document readAndValidate(InputStream aIs, InputStream aSchema) - throws XMLException { - - try { - final Schema schema = SchemaFactory.newInstance( - XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema( - new StreamSource(aSchema)); - - final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setValidating(true); - factory.setNamespaceAware(true); - factory.setSchema(schema); - - return factory.newDocumentBuilder().parse(aIs); - } catch (SAXException e) { - throw new XMLException(e.getMessage(), e); - } catch (IOException e) { - throw new XMLException(e.getMessage(), e); - } catch (ParserConfigurationException e) { - throw new XMLException(e.getMessage(), e); - } finally { - try { - aSchema.close(); - } catch (Exception e) { - LOG.warn("Error closing schema", e); - } - try { - aIs.close(); - } catch (Exception e) { - LOG.warn("Error closing XML file", e); - } - } - - } - - /** - * Serializes an XML document to a stream. - * - * @param aDocument - * Document to serialize. - * @param aOs - * Output stream. - */ - public static void serialize(Document aDocument, OutputStream aOs) - throws IOException { - XMLSerializer serializer = new XMLSerializer(aOs, new OutputFormat()); - serializer.serialize(aDocument); - } - - /** - * Serializes an XML document. - * - * @param aDocument - * Document to serialize. - * @return Serialized document. - */ - public static String serialize(Document aDocument) throws IOException { - ByteArrayOutputStream os = new ByteArrayOutputStream(); - serialize(aDocument, os); - return os.toString(); - } - - /** - * Converts a dom4j document into a w3c DOM document. - * - * @param aDocument - * Document to convert. - * @return W3C DOM document. - */ - public static Document convert(org.dom4j.Document aDocument) - throws DocumentException { - return new DOMWriter().write(aDocument); - } - - /** - * Converts a W3C DOM document into a dom4j document. - * - * @param aDocument - * Document to convert. - * @return Dom4j document. - */ - public static org.dom4j.Document convert(Document aDocument) { - return new DOMReader().read(aDocument); - } - - /** - * Removes duplicate attributes from a DOM tree.This is useful for - * postprocessing the output of JTidy as a workaround for a bug in JTidy. - * - * @param aNode - * Node to remove duplicate attributes from (recursively). - * Attributes of the node itself are not dealt with. Only the - * child nodes are dealt with. - */ - public static void removeDuplicateAttributes(Node aNode) { - NodeList list = aNode.getChildNodes(); - for (int i = 0; i < list.getLength(); i++) { - Node node = list.item(i); - if (node instanceof Element) { - removeDuplicateAttributes((Element) node); - removeDuplicateAttributes(node); - } - } - } - - /** - * Removes duplicate attributes from an element. - * - * @param aElement - * Element. - */ - private static void removeDuplicateAttributes(Element aElement) { - NamedNodeMap attributes = aElement.getAttributes(); - Map uniqueAttributes = new TreeMap(); - List attlist = new ArrayList(); - for (int i = 0; i < attributes.getLength(); i++) { - Attr attribute = (Attr) attributes.item(i); - if (uniqueAttributes.containsKey(attribute.getNodeName())) { - LOG.info("Detected duplicate attribute (will be removed)'" - + attribute.getNodeName() + "'"); - } - uniqueAttributes.put(attribute.getNodeName(), attribute); - attlist.add(attribute); - } - // Remove all attributes from the element. - for (Attr att : attlist) { - aElement.removeAttributeNode(att); - } - // Add the unique attributes back to the element. - for (Attr att : uniqueAttributes.values()) { - aElement.setAttributeNode(att); - } - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/xml/XMLException.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/xml/XMLException.java deleted file mode 100644 index 53f1d5e2..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/xml/XMLException.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.xml; - -/** - * Exception thrown in case of XML parsing problems. - */ -public class XMLException extends Exception { - - public XMLException(String aMsg) { - super(aMsg); - } - - public XMLException(String aMsg, Throwable aCause) { - super(aMsg, aCause); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/xml/XslTransformer.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/xml/XslTransformer.java deleted file mode 100644 index 59a00fd0..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/xml/XslTransformer.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.xml; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; - -import javax.xml.transform.Result; -import javax.xml.transform.Source; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.URIResolver; -import javax.xml.transform.dom.DOMResult; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; -import javax.xml.transform.stream.StreamSource; - -import org.w3c.dom.Document; -import org.wamblee.io.FileResource; - -/** - * XSL transformer for simplified usage of XSL transformations. - */ -public class XslTransformer { - - private TransformerFactory _factory; - - /** - * Constructs the URL resolver. - * - * @param aResolver - * URI resolver to use. - */ - public XslTransformer(URIResolver aResolver) { - _factory = TransformerFactory.newInstance(); - _factory.setURIResolver(aResolver); - } - - /** - * Constructs the XSLT processor. - * - */ - public XslTransformer() { - _factory = TransformerFactory.newInstance(); - } - - /** - * Resolves an XSLT based on URI. - * @param aXslt XSLT to resolve, - * @return Source for the XSLT - * @throws TransformerException In case the XSLT cannot be found. - */ - public Source resolve(String aXslt) throws TransformerException { - URIResolver resolver = _factory.getURIResolver(); - if (resolver == null) { - if (new File(aXslt).canRead()) { - try { - return new StreamSource(new FileResource(new File(aXslt)) - .getInputStream()); - } catch (IOException e) { - throw new TransformerException(e.getMessage(), e); - } - } else { - throw new TransformerException("Cannot read '" + aXslt + "'"); - } - } - return resolver.resolve(aXslt, ""); - } - - /** - * Transforms a DOM document into another DOM document using a given XSLT - * transformation. - * - * @param aDocument - * Document to transform. - * @param aXslt - * XSLT to use. - * @return Transformed document. - * @throws IOException - * In case of problems reading resources. - * @throws TransformerException - * In case transformation fails. - */ - public Document transform(Document aDocument, Source aXslt) - throws IOException, TransformerException { - Source source = new DOMSource(aDocument); - DOMResult result = new DOMResult(); - transform(source, result, aXslt); - return (Document) result.getNode(); - } - - /** - * Transforms a document using XSLT. - * - * @param aDocument - * Document to transform. - * @param aXslt - * XSLT to use. - * @return Transformed document. - * @throws IOException - * In case of problems reading resources. - * @throws TransformerException - * In case transformation fails. - */ - public Document transform(byte[] aDocument, Source aXslt) - throws IOException, TransformerException { - Source source = new StreamSource(new ByteArrayInputStream(aDocument)); - DOMResult result = new DOMResult(); - transform(source, result, aXslt); - return (Document) result.getNode(); - } - - /** - * Transforms a document to a text output. This supports XSLT - * transformations that result in text documents. - * - * @param aDocument - * Document to transform. - * @param aXslt - * XSL transformation. - * @return Transformed document. - */ - public String textTransform(byte[] aDocument, Source aXslt) - throws IOException, TransformerException { - Source source = new StreamSource(new ByteArrayInputStream(aDocument)); - ByteArrayOutputStream os = new ByteArrayOutputStream(); - StreamResult result = new StreamResult(os); - transform(source, result, aXslt); - return new String(os.toByteArray()); - } - - /** - * Transforms a document using XSLT. - * - * @param aSource - * Document to transform. - * @param aResult - * Result of the transformation. - * @param aXslt - * XSLT to use. - * @throws IOException - * In case of problems reading resources. - * @throws TransformerException - * In case transformation fails. - */ - public void transform(Source aSource, Result aResult, Source aXslt) - throws IOException, TransformerException { - try { - Transformer transformer = _factory.newTransformer(aXslt); - transformer.transform(aSource, aResult); - } catch (TransformerConfigurationException e) { - throw new TransformerException( - "Configuration problem of XSLT transformation", e); - } - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/xml/package.html b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/xml/package.html deleted file mode 100644 index 5d1c9e81..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/main/java/org/wamblee/xml/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - wamblee.org - - - -This package provides support utilities for XML processing. - - - -@since - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/cache/CachedObjectTest.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/cache/CachedObjectTest.java deleted file mode 100644 index 07ea337f..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/cache/CachedObjectTest.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.cache; - -import java.io.IOException; - -import junit.framework.TestCase; -import net.sf.ehcache.CacheException; - -import org.wamblee.io.TestResource; -import org.wamblee.test.TimingUtils; - -/** - * Cached object test. - */ -public class CachedObjectTest extends TestCase { - - /** - * - */ - private static final String EHCACHE_CONFIG = "ehcache.xml"; - - private static final int OBJECT_KEY = 10; - - private CachedObject.Computation _computation; - private int _ncomputations; - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - _computation = new CachedObject.Computation() { - public Integer getObject(Integer aObjectKey) { - _ncomputations++; - return compute(aObjectKey); - }; - }; - _ncomputations = 0; - } - - private int compute(int aValue) { - return aValue + 10; - } - - private CachedObject createCached(Cache aCache) { - return new CachedObject(aCache, OBJECT_KEY, _computation); - } - - /** - * Verifies that upon first use, the cached object uses the computation to - * retrieve the object. - * - */ - public void testComputation() { - CachedObject cached = createCached(new ZeroCache()); - int value = cached.get(); - assertEquals(compute(OBJECT_KEY), value); - assertEquals(1, _ncomputations); - } - - public void testInvalidateCache() { - CachedObject cached = createCached(new ForeverCache()); - int value = cached.get(); - assertEquals(compute(OBJECT_KEY), value); - assertEquals(1, _ncomputations); - cached.invalidate(); - value = cached.get(); - assertEquals(compute(OBJECT_KEY), value); - assertEquals(2, _ncomputations); - } - - public void testBehaviorEhCache() throws CacheException, IOException { - Cache cache = new EhCache(new TestResource(CachedObjectTest.class, EHCACHE_CONFIG), "test"); - CachedObject cached = createCached(cache); - - assertTrue( cache == cached.getCache()); - int value = cached.get(); - assertEquals(compute(OBJECT_KEY), value); - assertEquals(1, _ncomputations); - // The value must still be cached. - value = cached.get(); - assertEquals(compute(OBJECT_KEY), value); - assertEquals(1, _ncomputations); - - // Cache expiry. - TimingUtils.sleep(6000); - value = cached.get(); - assertEquals(compute(OBJECT_KEY), value); - assertEquals(2, _ncomputations); - - // Should still be cached now. - value = cached.get(); - assertEquals(compute(OBJECT_KEY), value); - assertEquals(2, _ncomputations); - - // explicit invalidation. - cached.invalidate(); - value = cached.get(); - assertEquals(compute(OBJECT_KEY), value); - assertEquals(3, _ncomputations); - - } - - public void testBehaviorEhCacheDefault() throws CacheException, IOException { - Cache cache = new EhCache(new TestResource(CachedObjectTest.class, EHCACHE_CONFIG), "undefined"); - CachedObject cached = createCached(cache); - - assertTrue( cache == cached.getCache()); - int value = cached.get(); - assertEquals(compute(OBJECT_KEY), value); - assertEquals(1, _ncomputations); - // The value must still be cached. - value = cached.get(); - assertEquals(compute(OBJECT_KEY), value); - assertEquals(1, _ncomputations); - - // Cache expiry. - TimingUtils.sleep(6000); - value = cached.get(); - assertEquals(compute(OBJECT_KEY), value); - assertEquals(2, _ncomputations); - - // Should still be cached now. - value = cached.get(); - assertEquals(compute(OBJECT_KEY), value); - assertEquals(2, _ncomputations); - - } - - - public void testBehaviorForeverCache() { - CachedObject cached = createCached(new ForeverCache()); - int value = cached.get(); - assertEquals(compute(OBJECT_KEY), value); - assertEquals(1, _ncomputations); - for (int ncomp = 2; ncomp <= 100; ncomp++) { - value = cached.get(); - assertEquals(compute(OBJECT_KEY), value); - assertEquals(1, _ncomputations); - } - } - - public void testBehaviorZeroCache() { - CachedObject cached = createCached(new ZeroCache()); - int value = cached.get(); - assertEquals(compute(OBJECT_KEY), value); - assertEquals(1, _ncomputations); - for (int ncomp = 2; ncomp <= 100; ncomp++) { - value = cached.get(); - assertEquals(compute(OBJECT_KEY), value); - assertEquals(ncomp, _ncomputations); - } - cached.invalidate(); - value = cached.get(); - assertEquals(compute(OBJECT_KEY), value); - assertEquals(101, _ncomputations); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/concurrency/AbstractLockTestCase.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/concurrency/AbstractLockTestCase.java deleted file mode 100644 index 1c1769d3..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/concurrency/AbstractLockTestCase.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.concurrency; - -import org.wamblee.test.EventTracker; -import org.wamblee.test.TimingUtils; - -import junit.framework.TestCase; - -/** - * Tests for the JVMLock. - */ -public abstract class AbstractLockTestCase extends TestCase { - - protected static final int SLEEP_TIME = 1000; - - protected static final String STARTED = "started"; - - protected static final String ACQUIRED = "acquired"; - - protected static final String RELEASED = "released"; - - private EventTracker _tracker; - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - _tracker = new EventTracker(); - } - - protected EventTracker getTracker() { - return _tracker; - } - - /** - * Must be implemented to generate the events - * {@link #STARTED}, {@link #ACQUIRED}, and {@link #RELEASED} in - * that order. The lock should be acquired for - * the time specified by {@link #SLEEP_TIME}. - * @return Thread which does the work. - */ - protected abstract Thread runThread(); - - /** - * Tests the operation of the lock. - */ - public void testLock() throws InterruptedException { - Thread t1 = runThread(); - Thread t2 = runThread(); - TimingUtils.sleep(SLEEP_TIME / 10); // give threads a chance to start - // up. - assertEquals(2, _tracker.getEventCount(STARTED)); // both threads - // should have - // started. - assertEquals(1, _tracker.getEventCount(ACQUIRED)); // one thread has - // acquired the - // lock. - TimingUtils.sleep(SLEEP_TIME); - assertEquals(2, _tracker.getEventCount(ACQUIRED)); // now the other - // thread could also - // acquire the lock - assertEquals(1, _tracker.getEventCount(RELEASED)); // and the first - // thread has - // released it. - TimingUtils.sleep(SLEEP_TIME); - assertEquals(2, _tracker.getEventCount(RELEASED)); // both threads - // should be - // finished. - t1.join(); - t2.join(); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/concurrency/JvmLockTest.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/concurrency/JvmLockTest.java deleted file mode 100644 index 9b08f04a..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/concurrency/JvmLockTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.concurrency; - -import org.wamblee.test.TimingUtils; - -/** - * Tests for the JVMLock. - */ -public class JvmLockTest extends AbstractLockTestCase { - - private JvmLock _lock; - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - _lock = new JvmLock(); - } - - protected Thread runThread() { - Thread t = new Thread(new Runnable() { - public void run() { - getTracker().eventOccurred(STARTED); - _lock.acquire(); - getTracker().eventOccurred(ACQUIRED); - TimingUtils.sleep(SLEEP_TIME); - _lock.release(); - getTracker().eventOccurred(RELEASED); - }; - }); - t.start(); - return t; - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/concurrency/LockAdviceTest.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/concurrency/LockAdviceTest.java deleted file mode 100644 index 61b9f7d4..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/concurrency/LockAdviceTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.concurrency; - -import org.springframework.aop.framework.ProxyFactoryBean; -import org.wamblee.test.TimingUtils; - -/** - * - */ -public class LockAdviceTest extends AbstractLockTestCase { - - private class Runner implements Runnable { - public void run() { - LockAdviceTest.this.getTracker().eventOccurred(ACQUIRED); - TimingUtils.sleep(SLEEP_TIME); - } - } - - private Runnable _target; - - /* - * (non-Javadoc) - * - * @see org.wamblee.concurrency.AbstractLockTestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - - Runner runner = new Runner(); - LockAdvice advice = new LockAdvice(new JvmLock()); - - ProxyFactoryBean support = new ProxyFactoryBean(); - support.setInterfaces(new Class[]{ Runnable.class }); - support.setTarget(runner); - support.addAdvice(advice); - _target = (Runnable)support.getObject(); - - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.concurrency.AbstractLockTestCase#runThread() - */ - @Override - protected Thread runThread() { - Thread t = new Thread(new Runnable() { - public void run() { - try { - getTracker().eventOccurred(STARTED); - _target.run(); - getTracker().eventOccurred(RELEASED); - } catch (Throwable e) { - throw new RuntimeException(e); - } - }; - }); - t.start(); - return t; - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/concurrency/ReadWriteLockTest.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/concurrency/ReadWriteLockTest.java deleted file mode 100644 index 2c159e94..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/concurrency/ReadWriteLockTest.java +++ /dev/null @@ -1,507 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.concurrency; - -import junit.framework.Assert; -import junit.framework.TestCase; - - -/** - * Testing the read-write lock class. Note: in case of problems, test cases - * could hang. - * - * @see ReadWriteLock - */ -public class ReadWriteLockTest extends TestCase { - /** - * - */ - private static final int HALF_SECOND = 500; - /** - * - */ - private static final int ONE_SECOND = 1000; - /** - * - */ - private static final int TWO_SECONDS = 2000; - private ReadWriteLock _lock; - private int _nReaders; - private int _nWriters; - - /** - * Constructor for ReadWriteLockTest. - * - * @param aName - */ - public ReadWriteLockTest(String aName) { - super(aName); - } - - private synchronized int getReaderCount() { - return _nReaders; - } - - private synchronized int getWriterCount() { - return _nWriters; - } - - synchronized void incrementReaderCount() { - _nReaders++; - } - - synchronized void incrementWriterCount() { - _nWriters++; - } - - synchronized void decrementReaderCount() { - _nReaders--; - } - - synchronized void decrementWriterCount() { - _nWriters--; - } - - /* - * @see TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - _lock = new ReadWriteLock(); - } - - /* - * @see TestCase#tearDown() - */ - protected void tearDown() throws Exception { - _lock = null; - super.tearDown(); - } - - /** - * Acquire and release a read lock. - */ - public void testRead() { - _lock.acquireRead(); - _lock.releaseRead(); - } - - /** - * Acquire and release a write lock. - */ - public void testWrite() { - _lock.acquireWrite(); - _lock.releaseWrite(); - } - - /** - * Verify concurrent access by multiple readers is possible. - * - * @throws InterruptedException May not occur. - */ - public void testMultipleReaders() throws InterruptedException { - Runnable runnable = new ReadLocker(_lock, this, TWO_SECONDS); - - Thread t1 = new Thread(runnable); - t1.start(); - - Thread t2 = new Thread(runnable); - t2.start(); - Thread.sleep(ONE_SECOND); - assertTrue("Not enough readers!", getReaderCount() == 2); - t1.join(); - t2.join(); - } - - /** - * Verify that only one writer at a time can acquire the write lock. - * - * @throws InterruptedException May not occur. - */ - public void testSingleWriter() throws InterruptedException { - WriteLocker writer = new WriteLocker(_lock, this, ONE_SECOND); - Thread t1 = new Thread(writer); - Thread t2 = new Thread(writer); - - t1.start(); - t2.start(); - Thread.sleep(HALF_SECOND); - assertTrue("Wrong writer count: " + getWriterCount(), - getWriterCount() == 1); - t1.join(); - t2.join(); - } - - /** - * Verify that multiple writers cannot acquire the write lock concurrently. - * - * @throws InterruptedException May not occur. - */ - public void testMultipleWriters() throws InterruptedException { - WriteLocker writer1 = new WriteLocker(_lock, this, HALF_SECOND + ONE_SECOND); - WriteLocker writer2 = new WriteLocker(_lock, this, ONE_SECOND); - Thread t1 = new Thread(writer1); - Thread t2 = new Thread(writer2); - - t1.start(); - Thread.sleep(HALF_SECOND); - assertTrue(getWriterCount() == 1); - t2.start(); - Thread.sleep(HALF_SECOND); - assertTrue(getWriterCount() == 1); // first writer still - - // has the lock. - Thread.sleep(ONE_SECOND); - - // at t = 2, the second writer still must have - // a lock. - assertTrue(getWriterCount() == 1); - t1.join(); - t2.join(); - } - - /** - * Verify that after the first reader acquires a lock, a subsequent writer - * can only acquire the lock after the reader has released it. - * - * @throws InterruptedException May not occur. - */ - public void testReadWrite1() throws InterruptedException { - ReadLocker readLocker = new ReadLocker(_lock, this, TWO_SECONDS); - Thread t1 = new Thread(readLocker); - WriteLocker writeLocker = new WriteLocker(_lock, this, TWO_SECONDS); - Thread t2 = new Thread(writeLocker); - - t1.start(); // acquire read lock - Thread.sleep(HALF_SECOND); - assertTrue(getReaderCount() == 1); - t2.start(); - Thread.sleep(HALF_SECOND); - - // 1 second underway, reader still holding the - // lock so write lock cannot be acquired. - assertTrue(getReaderCount() == 1); - assertTrue(getWriterCount() == 0); - Thread.sleep(ONE_SECOND + HALF_SECOND); - - // 2.5 seconds underway, read lock released and - // write lock must be acquired. - assertTrue("Wrong no. of readers: " + getReaderCount(), - getReaderCount() == 0); - assertTrue(getWriterCount() == 1); - t1.join(); - t2.join(); - } - - /** - * Verify that when multiple readers have acquired a read lock, the writer - * can only acquire the lock after all readers have released it. - * - * @throws InterruptedException May not occur. - */ - public void testReadWrite2() throws InterruptedException { - ReadLocker readLocker1 = new ReadLocker(_lock, this, TWO_SECONDS + HALF_SECOND); - ReadLocker readLocker2 = new ReadLocker(_lock, this, TWO_SECONDS + HALF_SECOND); - Thread t1 = new Thread(readLocker1); - Thread t2 = new Thread(readLocker2); - WriteLocker writeLocker = new WriteLocker(_lock, this, TWO_SECONDS); - Thread t3 = new Thread(writeLocker); - - t1.start(); // acquire read lock - Thread.sleep(ONE_SECOND); - assertTrue(getReaderCount() == 1); - t2.start(); - Thread.sleep(HALF_SECOND); - assertTrue(getReaderCount() == 2); - t3.start(); - Thread.sleep(HALF_SECOND); - - // 2 seconds, - assertTrue(getReaderCount() == 2); - assertTrue(getWriterCount() == 0); - Thread.sleep(ONE_SECOND); - - // 3 seconds underway, first read lock must - // have been released. - assertTrue(getReaderCount() == 1); - assertTrue(getWriterCount() == 0); - Thread.sleep(HALF_SECOND); - - // 4 seconds underway, write lock must have - // been acquired. - assertTrue(getReaderCount() == 0); - assertTrue(getWriterCount() == 1); - - t1.join(); - t2.join(); - t3.join(); - } - - /** - * Verify that after a writer acquires a lock, a subsequent reader can - * only acquire the lock after the writer has released it. - * - * @throws InterruptedException May not occur. - */ - public void testReadWrite3() throws InterruptedException { - ReadLocker readLocker = new ReadLocker(_lock, this, TWO_SECONDS); - Thread t1 = new Thread(readLocker); - WriteLocker writeLocker = new WriteLocker(_lock, this, TWO_SECONDS); - Thread t2 = new Thread(writeLocker); - - t2.start(); // acquire write lock - Thread.sleep(HALF_SECOND); - assertTrue(getWriterCount() == 1); - t1.start(); - Thread.sleep(HALF_SECOND); - - // 1 second underway, writer still holding the - // lock so read lock cannot be acquired. - assertTrue(getWriterCount() == 1); - assertTrue(getReaderCount() == 0); - Thread.sleep(ONE_SECOND + HALF_SECOND); - - // 2.5 seconds underway, write lock released and - // read lock must be acquired. - assertTrue("Wrong no. of writers: " + getReaderCount(), - getWriterCount() == 0); - assertTrue(getReaderCount() == 1); - t1.join(); - t2.join(); - } - - /* - * The following test cases are for testing whether or not - * the read write lock checks the locking correctly. - * Strictly speaking, these checks wouldn't be necessary - * because it involves the contract of the ReadWriteLock which - * must be obeyed by users of the ReadWriteLock. Nevertheless, - * this is tested anyway to be absolutely sure. - */ - - /** - * Acquire a read lock from one thread, release it from another. Verify - * that a RuntimeException is thrown. - * - * @throws InterruptedException May not occur. - */ - public void testReleaseReadFromWrongThread() throws InterruptedException { - Thread t1 = null; - - try { - t1 = new Thread(new Runnable() { - public void run() { - ReadWriteLockTest.this._lock.acquireRead(); - } - }); - t1.start(); - Thread.sleep(ONE_SECOND); // wait until thread is started - _lock.releaseRead(); // release lock from wrong thread. - } catch (RuntimeException e) { - return; // ok - } finally { - t1.join(); - } - - fail(); - } - - /** - * Acquire a write lock from one thread, release it from another. Verify - * that a RuntimeException is thrown. - * - * @throws InterruptedException May not occur. - */ - public void testReleaseWriteFromWrongThread() throws InterruptedException { - Thread t1 = null; - - try { - t1 = new Thread(new Runnable() { - public void run() { - ReadWriteLockTest.this._lock.acquireWrite(); - } - }); - t1.start(); - Thread.sleep(ONE_SECOND); // wait until thread is started - _lock.releaseWrite(); // release lock from wrong thread. - } catch (RuntimeException e) { - return; // ok - } finally { - t1.join(); - } - - fail(); - } - - /** - * Try to acquire a read lock multiple times. Verify that a - * RuntimeException is thrown. - */ - public void testAcquireReadTwice() { - try { - _lock.acquireRead(); - _lock.acquireRead(); - } catch (RuntimeException e) { - // ok - return; - } - - fail(); - } - - /** - * Try to acquire a write lock multiple times. Verify that a - * RuntimeException is thrown. - */ - public void testAcquireWriteTwice() { - try { - _lock.acquireWrite(); - _lock.acquireWrite(); - } catch (RuntimeException e) { - return; // ok - } - - fail(); - } - - /** - * Acquire the lock for reading and directly afterwards acquire it for - * writing. Verify that a RuntimeException is thrown. - */ - public void testAcquireReadFollowedByWrite() { - try { - _lock.acquireRead(); - _lock.acquireWrite(); - } catch (RuntimeException e) { - return; // ok - } - - fail(); - } - - /** - * Acquire the lock for writing and directly afterwards acquire it for - * reading. Verify that a RuntimeException is thrown. - */ - public void testAcquireWriteFollowedByRead() { - try { - _lock.acquireWrite(); - _lock.acquireRead(); - } catch (RuntimeException e) { - return; // ok - } - - fail(); - } - - /** - * Acquire a read lock and release it as a write lock. Verify that a - * RuntimeException is thrown. - */ - public void testAcquireReadFollowedByReleaseaWrite() { - try { - _lock.acquireRead(); - _lock.releaseWrite(); - } catch (RuntimeException e) { - return; // ok - } - - fail(); - } - - /** - * Acquire a write lock and release it as a read lock. Verify that a - * RuntimeException is thrown. - */ - public void testAcquireWriteFollowedByReleaseRead() { - try { - _lock.acquireWrite(); - _lock.releaseRead(); - } catch (RuntimeException e) { - return; // ok - } - - fail(); - } -} - - -/** - * ReadLocker acquires a read lock and performs a callback when the lock as - * been acquired, sleeps for a designated amount of time, releases the read - * lock, and performs a callback after the lock has been released. - */ -class ReadLocker implements Runnable { - private ReadWriteLock _lock; - private ReadWriteLockTest _lockTest; - private int _sleepTime; - - public ReadLocker(ReadWriteLock aLock, ReadWriteLockTest aLockTest, - int aSleepTime) { - _lock = aLock; - _lockTest = aLockTest; - _sleepTime = aSleepTime; - } - - public void run() { - _lock.acquireRead(); - _lockTest.incrementReaderCount(); - - try { - Thread.sleep(_sleepTime); - } catch (InterruptedException e) { - Assert.fail("ReadLocker thread was interrupted." - + Thread.currentThread()); - } - - _lock.releaseRead(); - _lockTest.decrementReaderCount(); - } -} - - -/** - * WriteLocker acquires a write lock and performs a callback when the lock as - * been acquired, sleeps for a designated amount of time, releases the write - * lock, and performs a callback after the lock has been released. - */ -class WriteLocker implements Runnable { - private ReadWriteLock _lock; - private ReadWriteLockTest _lockTest; - private int _sleepTime; - - public WriteLocker(ReadWriteLock aLock, ReadWriteLockTest aLockTest, - int aSleepTime) { - _lock = aLock; - _lockTest = aLockTest; - _sleepTime = aSleepTime; - } - - public void run() { - _lock.acquireWrite(); - _lockTest.incrementWriterCount(); - - try { - Thread.sleep(_sleepTime); - } catch (InterruptedException e) { - Assert.fail("WriteLocker thread was interrupted: " - + Thread.currentThread()); - } - - _lock.releaseWrite(); - _lockTest.decrementWriterCount(); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/conditions/AndConditionTest.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/conditions/AndConditionTest.java deleted file mode 100644 index 3ada4b4a..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/conditions/AndConditionTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.conditions; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.TestCase; - -/** - * Tests the Or Condition. - */ -public class AndConditionTest extends TestCase { - - public void checkResult(boolean aFirst, boolean aSecond, boolean aResult) { - AndCondition and = new AndCondition(new FixedCondition(aFirst), - new FixedCondition(aSecond)); - assertEquals(aResult, and.matches(0)); - } - - public void checkResult(boolean[] aValues, boolean aResult) { - List> conditions = new ArrayList>(); - for (boolean value: aValues) { - conditions.add(new FixedCondition(value)); - } - AndCondition and = new AndCondition(conditions); - assertEquals(aResult, and.matches(new Integer(0))); - } - - /** - * Checks all combinations of two conditions. - * - */ - public void testTwoConditions() { - checkResult(false, false, false); - checkResult(true, false, false); - checkResult(false, true, false); - checkResult(true, true, true); - } - - public void testMultipleConditions() { - checkResult(new boolean[]{ false, false, false} , false); - checkResult(new boolean[]{ true, false, false }, false); - checkResult(new boolean[]{ false, true, false }, false); - checkResult(new boolean[]{ false, false, true }, false); - checkResult(new boolean[]{ true, true, true }, true); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/conditions/GreaterThanCondition.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/conditions/GreaterThanCondition.java deleted file mode 100644 index ca64abe3..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/conditions/GreaterThanCondition.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.conditions; - -/** - * Test condition object. - */ -public class GreaterThanCondition implements Condition { - - private int _value; - - public GreaterThanCondition(int aValue) { - _value = aValue; - } - - /* (non-Javadoc) - * @see org.wamblee.conditions.Condition#matches(T) - */ - public boolean matches(Integer aObject) { - return aObject > _value; - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/conditions/LessThanCondition.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/conditions/LessThanCondition.java deleted file mode 100644 index f2f5fb23..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/conditions/LessThanCondition.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.conditions; - -/** - * Test condition object. - */ -public class LessThanCondition implements Condition { - - private int _value; - - public LessThanCondition(int aValue) { - _value = aValue; - } - - /* (non-Javadoc) - * @see org.wamblee.conditions.Condition#matches(T) - */ - public boolean matches(Integer aObject) { - return aObject < _value; - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/conditions/OrConditionTest.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/conditions/OrConditionTest.java deleted file mode 100644 index 2fad3110..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/conditions/OrConditionTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.conditions; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.TestCase; - -/** - * Tests the Or Condition. - */ -public class OrConditionTest extends TestCase { - - public void checkResult(boolean aFirst, boolean aSecond, boolean aResult) { - OrCondition or = new OrCondition(new FixedCondition(aFirst), - new FixedCondition(aSecond)); - assertEquals(aResult, or.matches(0)); - } - - public void checkResult(boolean[] aValues, boolean aResult) { - List> conditions = new ArrayList>(); - for (boolean value: aValues) { - conditions.add(new FixedCondition(value)); - } - OrCondition or = new OrCondition(conditions); - assertEquals(aResult, or.matches(new Integer(0))); - } - - /** - * Checks all combinations of two conditions. - * - */ - public void testTwoConditions() { - checkResult(false, false, false); - checkResult(true, false, true); - checkResult(false, true, true); - checkResult(true, true, true); - } - - public void testMultipleConditions() { - checkResult(new boolean[]{ false, false, false} , false); - checkResult(new boolean[]{ true, false, false }, true); - checkResult(new boolean[]{ false, true, false }, true); - checkResult(new boolean[]{ false, false, true }, true); - checkResult(new boolean[]{ true, true, true }, true); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/conditions/PropertyRegexConditionTest.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/conditions/PropertyRegexConditionTest.java deleted file mode 100644 index 5830666c..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/conditions/PropertyRegexConditionTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.conditions; - -import junit.framework.TestCase; - -/** - * Tests {@link org.wamblee.conditions.PropertyRegexCondition}. - */ -public class PropertyRegexConditionTest extends TestCase { - - private boolean match(String aProperty, String aRegex, boolean aToLower, TestBean aBean) { - PropertyRegexCondition condition = new PropertyRegexCondition(aProperty, aRegex, aToLower ); - return condition.matches(aBean); - } - - private void checkMatch(String aProperty, String aRegex, boolean aToLower, TestBean aBean, boolean aResult) { - assertEquals( aResult, match(aProperty, aRegex, aToLower, aBean)); - } - - /** - * Verifies correct matching behavior for several cases. - * - */ - public void testMatchProperty() { - TestBean bean = new TestBean("Hallo"); - checkMatch("value", "Hallo", false, bean, true); - checkMatch("value", "all", false, bean, false); - checkMatch("value", ".a.*o", false, bean, true); - checkMatch("value", "hallo", false, bean, false); // no match when not converting to lower case. - checkMatch("value", "hallo", true, bean, true); // match! - } - - /** - * Uses property regex condition for non-existing property. - * Verifies that a runtime exception is thrown. - * - */ - public void testWrongProperty() { - TestBean bean = new TestBean("Hallo"); - try { - match("bla", ".*", false, bean); - } catch (RuntimeException e) { - return; // ok - } - fail(); - } - - /** - * Applies condition to a private property. Verifies that a runtime - * exception is thrown. - * - */ - public void testPrivateProperty() { - TestBean bean = new TestBean("Hallo"); - try { - match("privateValue", ".*", false, bean); - } catch (RuntimeException e) { - return; // ok - } - fail(); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/conditions/TestBean.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/conditions/TestBean.java deleted file mode 100644 index 14162139..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/conditions/TestBean.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.conditions; - -/** - * - */ -public class TestBean { - - private String _value; - - public TestBean(String aValue) { - _value = aValue; - } - - public String getValue() { - return _value; - } - - private String getPrivateValue() { - return _value; - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/general/BeanKernelTest.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/general/BeanKernelTest.java deleted file mode 100644 index 32c0d176..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/general/BeanKernelTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.general; - -import junit.framework.TestCase; - -/** - * Tests the bean kernel. The lookup of the bean factory itself can be tested - * only partially. Using a global property file for all test cases would tie all - * test cases together therefore no global property file is used. - */ -public class BeanKernelTest extends TestCase { - - /** - * Loads the bean factory based on a property file configuration. Verifies - * the correct bean factory is loaded. - * - */ - public void testLoadBeanFactoryFromProperties() { - BeanFactory factory = BeanKernel - .lookupBeanFactory("org/wamblee/general/beankernel.properties"); - assertTrue(factory instanceof TestBeanFactory); - } - - /** - * Loads the bean factory based on a non-existing property file. - * Verifies that BeanFactoryException is thrown. - * - */ - public void testNonExistentPropertyFile() { - try { - BeanKernel - .lookupBeanFactory("org/wamblee/general/beankernel-nonexistent.properties"); - } catch (BeanFactoryException e) { - return; // ok - } - fail(); - } - - /** - * Loads the bean factory based on a property file with a non-existing - * bean factory defined in it. - * Verifies that BeanFactoryException is thrown. - * - */ - public void testNonExistentBeanFactory() { - try { - BeanKernel - .lookupBeanFactory("org/wamblee/general/beankernel-wrong.properties"); - } catch (BeanFactoryException e) { - return; // ok - } - fail(); - } - - - /** - * Retrieves a bean factory throug the bean kernel. Verifies that beans can - * be retrieved. - * - */ - public void testRetrieveFactory() { - BeanKernel.overrideBeanFactory(new TestBeanFactory()); // bypass - // default - // property - // lookup - BeanFactory factory = BeanKernel.getBeanFactory(); - assertNotNull(factory); - assertEquals("hello", factory.find(String.class)); - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/general/PairTest.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/general/PairTest.java deleted file mode 100644 index 0d171a75..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/general/PairTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.general; - -import junit.framework.TestCase; - -/** - * Tests the pair class. - */ -public class PairTest extends TestCase { - - public void testPair() { - Pair pair = new Pair(10, "hello"); - assertEquals(new Integer(10), pair.getFirst()); - assertEquals("hello", pair.getSecond()); - - Pair pair2 = new Pair(pair); - assertEquals(new Integer(10), pair2.getFirst()); - assertEquals("hello", pair2.getSecond()); - - - } -} \ No newline at end of file diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/general/SpringBeanFactoryTest.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/general/SpringBeanFactoryTest.java deleted file mode 100644 index bccb41a8..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/general/SpringBeanFactoryTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.general; - -import junit.framework.TestCase; - -/** - * Tests the spring bean factory. - */ -public class SpringBeanFactoryTest extends TestCase { - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - - } - - public void testExistingBeanRefContext() { - SpringBeanFactory factory = new SpringBeanFactory( - "org/wamblee/general/beanRefContext.xml", "test"); - - String value1 = factory.find(String.class); - assertEquals("hello", value1); - String value2 = (String) factory.find("java.lang.String"); - assertEquals("hello", value2); - String value3 = factory.find("java.lang.String", String.class); - assertEquals("hello", value3); - - try { - factory.find("unknown"); - } catch (BeanFactoryException e) { - return; // ok - } - fail(); - } - - public void testUnknownBeanFactory() { - try { - new SpringBeanFactory( - "org/wamblee/general/beanRefContext.xml", "unknown"); - } catch (BeanFactoryException e) { - return; // ok - } - fail(); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/general/TestBeanFactory.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/general/TestBeanFactory.java deleted file mode 100644 index dbb73309..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/general/TestBeanFactory.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.general; - -/** - * Test bean factory. - */ -public class TestBeanFactory extends SpringBeanFactory { - - - public TestBeanFactory() { - super("org/wamblee/general/beanRefContext.xml", "test"); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/io/ClassPathResourceTest.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/io/ClassPathResourceTest.java deleted file mode 100644 index 70b05ab5..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/io/ClassPathResourceTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.io; - -import java.io.IOException; -import java.io.InputStream; - - -import junit.framework.TestCase; - -/** - * Tests for the classpath resource. - */ -public class ClassPathResourceTest extends TestCase { - - /** - * Loads an existing resource from the class path. Verifies it is found. - * - */ - public void testResourceFound() throws IOException { - ClassPathResource resource = new ClassPathResource( - "org/wamblee/io/myresource.txt"); - InputStream is = resource.getInputStream(); - String data = FileSystemUtils.read(is); - assertEquals("This is my resource", data); - } - - /** - * Loads a non-existing resource from the class path. Verifies that an IO - * exception is thrown. - * - */ - public void testResourceNotFound() { - try { - ClassPathResource resource = new ClassPathResource( - "org/wamblee/io/myresource-nonexistent.txt"); - InputStream is = resource.getInputStream(); - } catch (IOException e) { - return; // ok - } - fail(); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/io/DirectoryMonitorTestProgram.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/io/DirectoryMonitorTestProgram.java deleted file mode 100644 index 1c87e833..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/io/DirectoryMonitorTestProgram.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.io; - -import java.io.File; - -import junit.framework.TestCase; - -import org.apache.oro.io.AwkFilenameFilter; -import org.apache.oro.io.RegexFilenameFilter; - -/** - * - */ -public class DirectoryMonitorTestProgram { - - public static void main(String[] aArgs) throws Exception { - - DirectoryMonitor monitor = new DirectoryMonitor(new File("."), - new AwkFilenameFilter(".*\\.txt"), new DirectoryMonitor.Listener() { - public void fileChanged(File aFile) { - System.out.println("changed " + aFile); - } - public void fileCreated(File aFile) { - System.out.println("created " + aFile); - } - public void fileDeleted(File aFile) { - System.out.println("deleted " + aFile); - } - }); - - for (;;) { - monitor.poll(); - Thread.sleep(1000); - } - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/io/FileResourceTest.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/io/FileResourceTest.java deleted file mode 100644 index cc085e77..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/io/FileResourceTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.io; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; - - -import junit.framework.TestCase; - -/** - * Tests the file resource. - */ -public class FileResourceTest extends TestCase { - - /** - * Loads an existing resource. Verifies it is found. - * - */ - public void testResourceFound() throws IOException { - FileResource resource = new FileResource( new File( - FileSystemUtils.getTestInputDir(FileResourceTest.class), - "myresource.txt")); - InputStream is = resource.getInputStream(); - String data = FileSystemUtils.read(is); - assertEquals("This is my resource", data); - } - - /** - * Loads a non-existing resource. Verifies that an IO - * exception is thrown. - * - */ - public void testResourceNotFound() { - try { - FileResource resource = new FileResource( new File( - FileSystemUtils.getTestInputDir(FileResourceTest.class), - "myresource-nonexistent.txt")); - InputStream is = resource.getInputStream(); - } catch (IOException e) { - return; // ok - } - fail(); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/io/FileSystemUtils.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/io/FileSystemUtils.java deleted file mode 100644 index 99a8d2e7..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/io/FileSystemUtils.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.io; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.net.URL; -import java.net.URLDecoder; -import java.security.CodeSource; - -import junit.framework.TestCase; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * File system utilities. - */ -public final class FileSystemUtils { - - private static final Log LOG = LogFactory.getLog(FileSystemUtils.class); - - /** - * Test output directory relative to the sub project. - */ - private static final String TEST_OUTPUT_DIR = "../target/testoutput"; - - /** - * Test input directory relative to the sub project. - */ - private static final String TEST_INPUT_DIR = "../src/test/resources"; - - /* - * Disabled. - * - */ - private FileSystemUtils() { - // Empty - } - - /** - * Deletes a directory recursively. The test case will fail if the directory - * does not exist or if deletion fails. - * - * @param aDir - * Directory to delete. - */ - public static void deleteDirRecursively(String aDir) { - deleteDirRecursively(new File(aDir)); - } - - /** - * Deletes a directory recursively. See {@link #deleteDirRecursively}. - * - * @param aDir - * Directory. - */ - public static void deleteDirRecursively(File aDir) { - TestCase.assertTrue(aDir.isDirectory()); - - for (File file : aDir.listFiles()) { - if (file.isDirectory()) { - deleteDirRecursively(file); - } else { - delete(file); - } - } - - delete(aDir); - } - - /** - * Deletes a file or directory. The test case will fail if the file or - * directory does not exist or if deletion fails. Deletion of a non-empty - * directory will always fail. - * - * @param aFile - * File or directory to delete. - */ - public static void delete(File aFile) { - TestCase.assertTrue(aFile.delete()); - } - - /** - * Gets a path relative to a sub project. This utility should be used to - * easily access file paths within a subproject without requiring any - * specific Eclipse configuration. - * - * @param aRelativePath - * Relative path. - * @param aTestClass - * Test class. - */ - public static File getPath(String aRelativePath, Class aTestClass) { - CodeSource source = aTestClass.getProtectionDomain().getCodeSource(); - if (source == null) { - LOG.warn("Could not obtain path for '" + aRelativePath - + "' for class " + aTestClass - + ", using relative path as is"); - return new File(aRelativePath); - } - URL location = source.getLocation(); - String protocol = location.getProtocol(); - if (!protocol.equals("file")) { - LOG.warn("protocol is not 'file': " + location); - return new File(aRelativePath); - } - - String path = location.getPath(); - try { - path = URLDecoder.decode(location.getPath(), "UTF-8"); - } catch (UnsupportedEncodingException e) { - // ignore it.. just don't decode - LOG.warn("Decoding path failed: '" + location.getPath() + "'", e ); - } - - return new File(new File(path).getParentFile(), aRelativePath); - } - - /** - * Ensures that a directory hierarchy exists (recursively if needed). If it - * is not possible to create the directory, then the test case will fail. - * - * @param aDir - * Directory to create. - */ - public static void createDir(File aDir) { - if (aDir.exists() && !aDir.isDirectory()) { - TestCase.fail("'" + aDir - + "' already exists and is not a directory"); - } - if (aDir.exists()) { - return; - } - createDir(aDir.getParentFile()); - TestCase.assertTrue("Could not create '" + aDir + "'", aDir.mkdir()); - } - - /** - * Gets the test output directory for a specific test class. - * - * @param aTestClass - * Test class. - * @return Test output directory. - */ - public static File getTestOutputDir(Class aTestClass) { - File file = getPath(TEST_OUTPUT_DIR, aTestClass); - String packageName = aTestClass.getPackage().getName(); - String packagePath = packageName.replaceAll("\\.", "/"); - return new File(file, packagePath); - } - - /** - * Gets the test input directory for a specific test class. - * - * @param aTestClass - * Test class. - * @return Test input directory. - */ - public static File getTestInputDir(Class aTestClass) { - File file = getPath(TEST_INPUT_DIR, aTestClass); - String packageName = aTestClass.getPackage().getName(); - String packagePath = packageName.replaceAll("\\.", "/"); - return new File(file, packagePath); - } - - /** - * Creates a directory hierarchy for the output directory of a test class if - * needed. - * - * @param aTestClass - * Test class - * @return Test directory. - */ - public static File createTestOutputDir(Class aTestClass) { - File file = getTestOutputDir(aTestClass); - createDir(file); - return file; - } - - /** - * Gets a test output file name. This returns a File object representing the - * output file and ensures that the directory where the file will be created - * already exists. - * - * @param aName - * Name of the file. - * @param aTestClass - * Test class. - * @return File. - */ - public static File getTestOutputFile(String aName, Class aTestClass) { - File file = new File(getTestOutputDir(aTestClass), aName); - createDir(file.getParentFile()); - return file; - } - - public static String read(InputStream aIs) throws IOException { - try { - StringBuffer buffer = new StringBuffer(); - int c; - while ((c = aIs.read()) != -1) { - buffer.append((char)c); - } - return buffer.toString(); - } finally { - aIs.close(); - } - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/io/StreamResourceTest.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/io/StreamResourceTest.java deleted file mode 100644 index 11a9bfed..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/io/StreamResourceTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.io; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; - - -import junit.framework.TestCase; - -/** - * Tests the stream resource. - */ -public class StreamResourceTest extends TestCase { - - /** - * Loads an existing resource. Verifies it is found. - * - */ - public void testResourceFound() throws IOException { - File file = new File( - FileSystemUtils.getTestInputDir(StreamResourceTest.class), - "myresource.txt"); - assertTrue(file.canRead()); - InputStream fileIs = new FileInputStream(file); - InputResource resource = new StreamResource(fileIs); - InputStream is = resource.getInputStream(); - String data = FileSystemUtils.read(is); - assertEquals("This is my resource", data); - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/io/TestResource.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/io/TestResource.java deleted file mode 100644 index ec28290f..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/io/TestResource.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.io; - -import java.io.File; - - -/** - * Test resource for locating resources in the classpath. - */ -public class TestResource extends FileResource { - - /** - * Test class name. - * @param aTestClass Test class. - * @param aName Name of the file to look for. - */ - public TestResource(Class aTestClass, String aName) { - super(getFile(aTestClass, aName)); - } - - /** - * Computes the file path of the file to look for. - * @param aClass Test class name. - * @param aName Name of the file. - * @return File. - */ - private static File getFile(Class aClass, String aName) { - File dir = FileSystemUtils.getTestInputDir(aClass); - return new File(dir, aName); - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/observer/ObservableTest.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/observer/ObservableTest.java deleted file mode 100644 index 08e5a2aa..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/observer/ObservableTest.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.observer; - -import java.util.ArrayList; -import java.util.List; - -import org.jmock.Mock; -import org.jmock.cglib.MockObjectTestCase; - -/** - * Test of the observer pattern implementation. - */ -public class ObservableTest extends MockObjectTestCase { - - private static final int SUBSCRIBER_COUNT = 100; - - private static final String UPDATE = "send"; - - private Observable _observable; - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - - _observable = new Observable(this, - new DefaultObserverNotifier()); - } - - /** - * Tests subscription and notification of one subscriber. - */ - public void testOneObserver() { - Mock mockObserver = mock(Observer.class); - Observer observer = (Observer) mockObserver - .proxy(); - long subscription = _observable.subscribe(observer); - - assertEquals(1, _observable.getObserverCount()); - - String message = "hallo"; - mockObserver.expects(once()).method(UPDATE).with(same(this), - eq(message)); - - _observable.send(message); - _observable.unsubscribe(subscription); - assertEquals(0, _observable.getObserverCount()); - - _observable.send(message); - - } - - /** - * Subscribes many susbcribers and sends notifications to subscribers. - * Verifies that unique subscription number are returned. Also verifies that - * the correct subscribers are notfied. - */ - public void testManySubscribers() { - int nsubscribers = SUBSCRIBER_COUNT; - Mock[] mocks = new Mock[nsubscribers]; - - List subscriptions = new ArrayList(); - for (int i = 0; i < nsubscribers; i++) { - Mock mockObserver = mock(Observer.class); - Observer observer = (Observer) mockObserver - .proxy(); - long subscription = _observable.subscribe(observer); - - mocks[i] = mockObserver; - assertTrue(subscriptions.add(subscription)); - } - - assertEquals(nsubscribers, _observable.getObserverCount()); - - String message = "hallo"; - for (int i = 0; i < nsubscribers; i++) { - mocks[i].expects(once()).method(UPDATE).with(same(this), - eq(message)); - } - - _observable.send(message); - - for (int i = nsubscribers / 2; i < nsubscribers; i++) { - _observable.unsubscribe(subscriptions.get(i)); - } - assertEquals(nsubscribers - (nsubscribers - nsubscribers / 2), - _observable.getObserverCount()); - - message = "blabla"; - for (int i = 0; i < nsubscribers / 2; i++) { - mocks[i].expects(once()).method(UPDATE).with(same(this), - eq(message)); - } - _observable.send(message); - } - - /** - * Subscribes and then unsubscribes with a wrong id. Verifies that - * IllegalArgumentException is thrown. - * - */ - public void testUnsubscribeWithWrongSubscription() { - Mock mockObserver = mock(Observer.class); - Observer observer = (Observer) mockObserver - .proxy(); - long subscription = _observable.subscribe(observer); - - assertEquals(1, _observable.getObserverCount()); - - try { - _observable.unsubscribe(subscription + 1); - } catch (IllegalArgumentException e) { - return; // ok - } - fail(); - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/AssertionUtils.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/AssertionUtils.java deleted file mode 100644 index b7300d7d..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/AssertionUtils.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.test; - -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import junit.framework.TestCase; - -/** - * Useful assertions for use in test cases. - */ -public final class AssertionUtils { - - /** - * Disabled constructor. - * - */ - private AssertionUtils() { - // Empty - } - - /** - * Asserts that two object arrays are equal. - * - * @param aExpected - * Expected object array. - * @param aActual - * Actual object array. - */ - public static void assertEquals(Object[] aExpected, Object[] aActual) { - assertEquals("", aExpected, aActual); - } - - /** - * Asserts that two object arrays are equal. - * - * @param aMsg - * Message. - * @param aExpected - * Expected array. - * @param aActual - * Actual array. - */ - public static void assertEquals(String aMsg, Object[] aExpected, - Object[] aActual) { - TestCase.assertEquals(aMsg + ": Array lengths ", aExpected.length, - aActual.length); - - for (int i = 0; i < aExpected.length; i++) { - TestCase.assertEquals(aMsg + ": Element " + i, aExpected[i], - aActual[i]); - } - } - - /** - * Asserts that two objects are equal, and in case the object is an Object[] - * delegates to {@link #assertEquals(String, Object[], Object[]). - * - * @param aMsg - * Message. - * @param aExpected - * Expected result. - * @param aActual - * Actual result. - */ - public static void assertEquals(String aMsg, Object aExpected, - Object aActual) { - if (aExpected instanceof Object[]) { - AssertionUtils.assertEquals(aMsg, (Object[]) aExpected, - (Object[]) aActual); - - return; - } - - TestCase.assertEquals(aMsg, aExpected, aActual); - } - - /** - * Asserts that two maps are equal by comparing all keys and by checking - * that the values for the same keys are the same. - * - * @param aMsg - * Message. - * @param aExpectedMap - * Expected result. - * @param aActual - * Actual result. - */ - public static void assertEquals(String aMsg, Map aExpectedMap, Map aActual) { - TestCase.assertEquals("Map sizes differ", aExpectedMap.size(), aActual - .size()); - - Set keys = aExpectedMap.keySet(); - - for (Iterator i = keys.iterator(); i.hasNext();) { - String key = (String) i.next(); - TestCase.assertTrue("Map does not containg entry for key:" + key, - aActual.containsKey(key)); - AssertionUtils.assertEquals("Value of key " + key + " of map", - aExpectedMap.get(key), aActual.get(key)); - } - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/EventTracker.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/EventTracker.java deleted file mode 100644 index c35ce45b..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/EventTracker.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.test; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * Tracks the occurence of certain events in a test environment. Threads in a - * test environment tell the event tracker of the occurrence of certain events - * using {@link #eventOccurred(Event)}. Test code inspects the events sent by a - * thread using {@link #isEventSent(Thread, Event)}. - * - * A record is kept of every event which is sent. Therefore, the occurrence of a - * new event does not erase a previously sent event. - * - * @param - * Type of event sent from test code. Usually String will be - * sufficient. The event type must provide a sensible implementation - * of {@link java.lang.Object#equals(java.lang.Object)}. - */ -public class EventTracker { - - private static final Log LOG = LogFactory.getLog(EventTracker.class); - - /** - * Map of Thread object to a list of events. - */ - private Map> _events; - - /** - * Constructs the event tracker. - * - */ - public EventTracker() { - _events = new HashMap>(); - } - - /** - * Called by a thread to inform that an event has occurred. - * - * @param aEvent - * Event that was sent. - */ - public synchronized void eventOccurred(Event aEvent) { - LOG.info("Event '" + aEvent + "' sent."); - Thread current = Thread.currentThread(); - List events = _events.get(current); - if (events == null) { - events = new ArrayList(); - _events.put(current, events); - } - events.add(aEvent); - } - - /** - * Checks if a specific event has happened in a specific thread. - * - * @param aThread - * Thread to check. - * @param aEvent - * Event to check for. - * @return Whether or not the event was sent. - */ - public synchronized boolean isEventSent(Thread aThread, Event aEvent) { - List events = _events.get(aThread); - if (events == null) { - return false; - } - return events.contains(aEvent); - } - - /** - * Gets the events for a thread in the order they were sent - * - * @param aThread - * Thread to get events for. - * @return Events that were sent. A zero-sized array is returned if no - * events were sent. - */ - public synchronized List getEvents(Thread aThread) { - List events = _events.get(aThread); - if (events == null) { - events = Collections.emptyList(); - } - return Collections.unmodifiableList(events); - } - - /** - * Gets the number of times an event was sent summed up - * over all threads. - * - * @param aEvent - * Event to check. - * @return Number of times it was reached. - */ - public synchronized int getEventCount(Event aEvent) { - int count = 0; - for (Thread thread : _events.keySet()) { - List events = _events.get(thread); - for (Event event : events) { - if (event.equals(aEvent)) { - count++; - } - } - } - return count; - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/HibernateExporter.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/HibernateExporter.java deleted file mode 100644 index 7b0bafa9..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/HibernateExporter.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.test; - -import java.io.File; -import java.io.IOException; - -import org.hibernate.cfg.Configuration; -import org.hibernate.tool.hbm2ddl.SchemaExport; - -/** - * Exporting the hibernate mapping. - */ -public final class HibernateExporter { - - /** - * Disabled constructor. - * - */ - private HibernateExporter() { - // Empty - } - - public static void main(String[] aArgs) throws IOException { - String file = aArgs[0]; - File dir = new File(aArgs[1]); - - Configuration conf = HibernateUtils.getConfiguration(dir); - - SchemaExport export = new SchemaExport(conf); - export.setDelimiter(";"); - export.setOutputFile(file); - export.create(true, false); - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/HibernateUpdater.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/HibernateUpdater.java deleted file mode 100644 index 576c1819..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/HibernateUpdater.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.test; - -import java.io.File; -import java.io.IOException; - -import org.hibernate.cfg.Configuration; -import org.hibernate.tool.hbm2ddl.SchemaUpdate; - -/** - * Exporting the hibernate mapping. - */ -public final class HibernateUpdater { - - /** - * Disabled constructor. - * - */ - private HibernateUpdater() { - // Empty - } - - public static void main(String[] aArgs) throws IOException { - String file = aArgs[0]; - File dir = new File(file); - - Configuration conf = HibernateUtils.getConfiguration(dir); - - SchemaUpdate lSchemaUpdate = new SchemaUpdate(conf); - lSchemaUpdate.execute(true, true); - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/HibernateUtils.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/HibernateUtils.java deleted file mode 100644 index 41895b08..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/HibernateUtils.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.test; - -import java.io.File; -import java.io.FileFilter; -import java.io.IOException; -import java.util.Map; -import java.util.Properties; -import java.util.TreeMap; - -import org.apache.oro.io.AwkFilenameFilter; -import org.hibernate.cfg.Configuration; -import org.wamblee.io.ClassPathResource; -import org.wamblee.io.InputResource; - -/** - * Hibernate utilities. - */ -public final class HibernateUtils { - - private static final String DATABASE_PROPS = "test.database.properties"; - - /** - * Disabled. - * - */ - private HibernateUtils() { - // Empty - } - - /** - * @param aDir - * @return - */ - public static Configuration getConfiguration(File aDir) throws IOException { - Configuration conf = new Configuration(); - File[] files = aDir.listFiles((FileFilter) (new AwkFilenameFilter( - ".*\\.hbm\\.xml"))); - for (File f : files) { - System.out.println("Mapping file: " + f); - conf.addFile(f); - } - - Map dbProps = getHibernateProperties(); - - for (Map.Entry entry : dbProps.entrySet()) { - System.out.println("Property: " + entry.getKey() + "=" - + entry.getValue()); - conf.setProperty(entry.getKey(), entry.getValue()); - } - - return conf; - } - - private static Map getHibernateProperties() - throws IOException { - - System.out.println("Reading properties file: " + DATABASE_PROPS); - InputResource lPropFile = new ClassPathResource(DATABASE_PROPS); - Properties props = new Properties(); - props.load(lPropFile.getInputStream()); - - Map result = new TreeMap(); - result.put("hibernate.connection.driver_class", props - .getProperty("database.driver")); - result.put("hibernate.connection.url", props - .getProperty("database.url")); - result.put("hibernate.connection.username", props - .getProperty("database.username")); - result.put("hibernate.connection.password", props - .getProperty("database.password")); - - return result; - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/SpringConfigFiles.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/SpringConfigFiles.java deleted file mode 100644 index 5d43a31a..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/SpringConfigFiles.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.test; - -import java.util.ArrayList; -import java.util.Arrays; - -/** - * Spring configuration files to use. - */ -public class SpringConfigFiles extends ArrayList { - - /** - * Constructs an empty list of Spring config files. - * - */ - public SpringConfigFiles() { - super(); - } - - /** - * Constructs the list of Spring config files. - * @param aFiles Files. - */ - public SpringConfigFiles(String[] aFiles) { - super(); - addAll(Arrays.asList(aFiles)); - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/SpringTestCase.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/SpringTestCase.java deleted file mode 100644 index 8b66e0e2..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/SpringTestCase.java +++ /dev/null @@ -1,600 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.test; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; - -import javax.sql.DataSource; - -import junit.framework.TestCase; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.dbunit.DatabaseUnitException; -import org.dbunit.database.DatabaseConnection; -import org.dbunit.database.DatabaseSequenceFilter; -import org.dbunit.database.IDatabaseConnection; -import org.dbunit.dataset.FilteredDataSet; -import org.dbunit.dataset.IDataSet; -import org.dbunit.dataset.filter.ITableFilter; -import org.dbunit.operation.DatabaseOperation; -import org.hibernate.SessionFactory; -import org.jmock.cglib.MockObjectTestCase; -import org.springframework.beans.factory.NoSuchBeanDefinitionException; -import org.springframework.beans.factory.config.BeanDefinition; -import org.springframework.beans.factory.support.RootBeanDefinition; -import org.springframework.context.ApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.context.support.GenericApplicationContext; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.datasource.DataSourceUtils; -import org.springframework.jdbc.datasource.DriverManagerDataSource; -import org.springframework.orm.hibernate3.HibernateTemplate; -import org.springframework.transaction.PlatformTransactionManager; -import org.springframework.transaction.TransactionDefinition; -import org.springframework.transaction.TransactionStatus; -import org.springframework.transaction.support.DefaultTransactionDefinition; -import org.springframework.transaction.support.TransactionCallback; -import org.springframework.transaction.support.TransactionCallbackWithoutResult; -import org.springframework.transaction.support.TransactionTemplate; -import org.wamblee.general.BeanKernel; -import org.wamblee.persistence.hibernate.HibernateMappingFiles; - -/** - * Test case support class for spring tests. - */ -public class SpringTestCase extends MockObjectTestCase { - - private static final Log LOG = LogFactory.getLog(SpringTestCase.class); - - /** - * Session factory bean name. - */ - private static final String SESSION_FACTORY = "sessionFactory"; - - /** - * Data source bean name. - */ - private static final String DATA_SOURCE = "dataSource"; - - /** - * Transaction manager bean name. - */ - private static final String TRANSACTION_MANAGER = "transactionManager"; - - /** - * Name of the ConfigFileList bean that describes the Hibernate mapping - * files to use. - */ - private static final String HIBERNATE_CONFIG_FILES = "hibernateMappingFiles"; - - /** - * Schema pattern. - */ - private static final String SCHEMA_PATTERN = "%"; - - /** - * List of (String) configuration file locations for spring. - */ - private String[] _configLocations; - - /** - * Application context for storing bean definitions that vary on a test by - * test basis and cannot be hardcoded in the spring configuration files. - */ - private GenericApplicationContext _parentContext; - - /** - * Cached spring application context. - */ - private ApplicationContext _context; - - public SpringTestCase(Class aSpringFiles, - Class aMappingFiles) { - try { - SpringConfigFiles springFiles = aSpringFiles.newInstance(); - _configLocations = springFiles.toArray(new String[0]); - } catch (Exception e) { - fail("Could not construct spring config files class '" - + aSpringFiles.getName() + "'"); - } - - // Register the Hibernate mapping files as a bean. - _parentContext = new GenericApplicationContext(); - BeanDefinition lDefinition = new RootBeanDefinition(aMappingFiles); - _parentContext.registerBeanDefinition(HIBERNATE_CONFIG_FILES, - lDefinition); - _parentContext.refresh(); - - } - - /** - * Gets the spring context. - * - * @return Spring context. - */ - protected synchronized ApplicationContext getSpringContext() { - if (_context == null) { - _context = new ClassPathXmlApplicationContext( - (String[]) _configLocations, _parentContext); - assertNotNull(_context); - } - return _context; - } - - /** - * @return Hibernate session factory. - */ - protected SessionFactory getSessionFactory() { - SessionFactory factory = (SessionFactory) getSpringContext().getBean( - SESSION_FACTORY); - assertNotNull(factory); - return factory; - } - - protected void setUp() throws Exception { - LOG.info("Performing setUp()"); - - super.setUp(); - - _context = null; // make sure we get a new application context for - // every - // new test. - - BeanKernel.overrideBeanFactory(new TestSpringBeanFactory( - getSpringContext())); - - cleanDatabase(); - } - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#tearDown() - */ - @Override - protected void tearDown() throws Exception { - try { - super.tearDown(); - } finally { - LOG.info("tearDown() complete"); - } - } - - /** - * @return Transaction manager - */ - protected PlatformTransactionManager getTransactionManager() { - PlatformTransactionManager manager = (PlatformTransactionManager) getSpringContext() - .getBean(TRANSACTION_MANAGER); - assertNotNull(manager); - return manager; - } - - /** - * @return Starts a new transaction. - */ - protected TransactionStatus getTransaction() { - DefaultTransactionDefinition def = new DefaultTransactionDefinition(); - def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); - - return getTransactionManager().getTransaction(def); - } - - /** - * Returns the hibernate template for executing hibernate-specific - * functionality. - * - * @return Hibernate template. - */ - protected HibernateTemplate getTemplate() { - HibernateTemplate template = (HibernateTemplate) getSpringContext() - .getBean(HibernateTemplate.class.getName()); - assertNotNull(template); - return template; - } - - /** - * Flushes the session. Should be called after some Hibernate work and - * before JDBC is used to check results. - * - */ - protected void flush() { - getTemplate().flush(); - } - - /** - * Flushes the session first and then removes all objects from the Session - * cache. Should be called after some Hibernate work and before JDBC is used - * to check results. - * - */ - protected void clear() { - flush(); - getTemplate().clear(); - } - - /** - * Evicts the object from the session. This is essential for the - * implementation of unit tests where first an object is saved and is - * retrieved later. By removing the object from the session, Hibernate must - * retrieve the object again from the database. - * - * @param aObject - */ - protected void evict(Object aObject) { - getTemplate().evict(aObject); - } - - /** - * Gets the connection. - * - * @return Connection. - */ - public Connection getConnection() { - return DataSourceUtils.getConnection(getDataSource()); - } - - public void cleanDatabase() throws SQLException { - - if (!isDatabaseConfigured()) { - return; - } - - String[] tables = getTableNames(); - - try { - IDatabaseConnection connection = new DatabaseConnection( - getConnection()); - ITableFilter filter = new DatabaseSequenceFilter(connection, tables); - IDataSet dataset = new FilteredDataSet(filter, connection - .createDataSet(tables)); - - DatabaseOperation.DELETE_ALL.execute(connection, dataset); - } catch (DatabaseUnitException e) { - SQLException exc = new SQLException(e.getMessage()); - exc.initCause(e); - throw exc; - } - } - - /** - * @throws SQLException - */ - public String[] getTableNames() throws SQLException { - - List result = new ArrayList(); - LOG.debug("Getting database table names to clean (schema: '" - + SCHEMA_PATTERN + "'"); - - ResultSet tables = getConnection().getMetaData().getTables(null, - SCHEMA_PATTERN, "%", new String[] { "TABLE" }); - while (tables.next()) { - String table = tables.getString("TABLE_NAME"); - // Make sure we do not touch hibernate's specific - // infrastructure tables. - if (!table.toLowerCase().startsWith("hibernate")) { - result.add(table); - LOG.debug("Adding " + table - + " to list of tables to be cleaned."); - } - } - return (String[]) result.toArray(new String[0]); - } - - /** - * @return - * @throws SQLException - */ - public void emptyTables(List aTableList) throws SQLException { - Iterator liTable = aTableList.iterator(); - while (liTable.hasNext()) { - emptyTable((String) liTable.next()); - } - } - - /** - * @return - * @throws SQLException - */ - public void emptyTable(String aTable) throws SQLException { - executeSql("delete from " + aTable); - } - - /** - * @return - * @throws SQLException - */ - public void dropTable(String aTable) throws SQLException { - executeQuery("drop table " + aTable); - } - - /** - * Executes an SQL statement within a transaction. - * - * @param aSql - * SQL statement. - * @return Return code of the corresponding JDBC call. - */ - public int executeSql(final String aSql) { - return executeSql(aSql, new Object[0]); - } - - /** - * Executes an SQL statement within a transaction. See - * {@link #setPreparedParam(int, PreparedStatement, Object)}for details on - * supported argument types. - * - * @param aSql - * SQL statement. - * @param aArg - * Argument of the sql statement. - * @return Return code of the corresponding JDBC call. - */ - public int executeSql(final String aSql, final Object aArg) { - return executeSql(aSql, new Object[] { aArg }); - } - - /** - * Executes an sql statement. See - * {@link #setPreparedParam(int, PreparedStatement, Object)}for details on - * supported argument types. - * - * @param aSql - * SQL query to execute. - * @param aArgs - * Arguments. - * @return Number of rows updated. - */ - public int executeSql(final String aSql, final Object[] aArgs) { - Map results = executeTransaction(new TestTransactionCallback() { - public Map execute() throws Exception { - JdbcTemplate template = new JdbcTemplate(getDataSource()); - int result = template.update(aSql, aArgs); - - Map map = new TreeMap(); - map.put("result", new Integer(result)); - - return map; - } - }); - - return ((Integer) results.get("result")).intValue(); - } - - /** - * Executes a transaction with a result. - * - * @param aCallback - * Callback to do your transactional work. - * @return Result. - */ - public Object executeTransaction(TransactionCallback aCallback) { - TransactionTemplate lTemplate = new TransactionTemplate( - getTransactionManager()); - return lTemplate.execute(aCallback); - } - - /** - * Executes a transaction without a result. - * - * @param aCallback - * Callback to do your transactional work. . - */ - protected void executeTransaction(TransactionCallbackWithoutResult aCallback) { - TransactionTemplate template = new TransactionTemplate( - getTransactionManager()); - template.execute(aCallback); - } - - /** - * Executes a transaction with a result, causing the testcase to fail if any - * type of exception is thrown. - * - * @param aCallback - * Code to be executed within the transaction. - * @return Result. - */ - public Map executeTransaction(final TestTransactionCallback aCallback) { - return (Map) executeTransaction(new TransactionCallback() { - public Object doInTransaction(TransactionStatus aArg) { - try { - return aCallback.execute(); - } catch (Exception e) { - // test case must fail. - e.printStackTrace(); - throw new RuntimeException(e); - } - } - }); - } - - /** - * Executes a transaction with a result, causing the testcase to fail if any - * type of exception is thrown. - * - * @param aCallback - * Code to be executed within the transaction. - */ - public void executeTransaction( - final TestTransactionCallbackWithoutResult aCallback) { - executeTransaction(new TransactionCallbackWithoutResult() { - public void doInTransactionWithoutResult(TransactionStatus aArg) { - try { - aCallback.execute(); - } catch (Exception e) { - // test case must fail. - throw new RuntimeException(e.getMessage(), e); - } - } - }); - } - - /** - * Executes an SQL query within a transaction. - * - * @param aSql - * Query to execute. - * @return Result set. - */ - public ResultSet executeQuery(String aSql) { - return executeQuery(aSql, new Object[0]); - } - - /** - * Executes a query with a single argument. See - * {@link #setPreparedParam(int, PreparedStatement, Object)}for details on - * supported argument types. - * - * @param aSql - * Query. - * @param aArg - * Argument. - * @return Result set. - */ - public ResultSet executeQuery(String aSql, Object aArg) { - return executeQuery(aSql, new Object[] { aArg }); - } - - /** - * Executes a query within a transaction. See - * {@link #setPreparedParam(int, PreparedStatement, Object)}for details on - * supported argument types. - * - * @param aSql - * Sql query. - * @param aArgs - * Arguments to the query. - * @return Result set. - */ - public ResultSet executeQuery(final String aSql, final Object[] aArgs) { - Map results = executeTransaction(new TestTransactionCallback() { - public Map execute() throws Exception { - Connection connection = getConnection(); - - PreparedStatement statement = connection.prepareStatement(aSql); - setPreparedParams(aArgs, statement); - - ResultSet resultSet = statement.executeQuery(); - TreeMap results = new TreeMap(); - results.put("resultSet", resultSet); - - return results; - } - }); - - return (ResultSet) results.get("resultSet"); - } - - /** - * Sets the values of a prepared statement. See - * {@link #setPreparedParam(int, PreparedStatement, Object)}for details on - * supported argument types. - * - * @param aArgs - * Arguments to the prepared statement. - * @param aStatement - * Prepared statement - * @throws SQLException - */ - private void setPreparedParams(final Object[] aArgs, - PreparedStatement aStatement) throws SQLException { - for (int i = 1; i <= aArgs.length; i++) { - setPreparedParam(i, aStatement, aArgs[i - 1]); - } - } - - /** - * Sets a prepared statement parameter. - * - * @param aIndex - * Index of the parameter. - * @param aStatement - * Prepared statement. - * @param aObject - * Value Must be of type Integer, Long, or String. TODO extend - * with more types of values. - * @throws SQLException - */ - private void setPreparedParam(int aIndex, PreparedStatement aStatement, - Object aObject) throws SQLException { - if (aObject instanceof Integer) { - aStatement.setInt(aIndex, ((Integer) aObject).intValue()); - } else if (aObject instanceof Long) { - aStatement.setLong(aIndex, ((Integer) aObject).longValue()); - } else if (aObject instanceof String) { - aStatement.setString(aIndex, (String) aObject); - } else { - TestCase.fail("Unsupported object type for prepared statement: " - + aObject.getClass() + " value: " + aObject - + " statement: " + aStatement); - } - } - - private boolean isDatabaseConfigured() { - try { - getDataSource(); - } catch (NoSuchBeanDefinitionException e) { - return false; - } - return true; - } - - /** - * @return Returns the dataSource. - */ - public DataSource getDataSource() { - DataSource ds = (DriverManagerDataSource) getSpringContext().getBean( - DATA_SOURCE); - assertNotNull(ds); - return ds; - } - - /** - * @return - * @throws SQLException - */ - protected int getTableSize(String aTable) throws SQLException { - ResultSet resultSet = executeQuery("select * from " + aTable); - int count = 0; - - while (resultSet.next()) { - count++; - } - - return count; - } - - protected int countResultSet(ResultSet aResultSet) throws SQLException { - int count = 0; - - while (aResultSet.next()) { - count++; - } - - return count; - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/TestSpringBeanFactory.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/TestSpringBeanFactory.java deleted file mode 100644 index 24f90a89..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/TestSpringBeanFactory.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.test; - -import org.springframework.beans.BeansException; -import org.springframework.context.ApplicationContext; -import org.wamblee.general.BeanFactory; -import org.wamblee.general.BeanFactoryException; - -/** - * Bean factory which uses Spring. - */ -public class TestSpringBeanFactory implements BeanFactory { - - private ApplicationContext _context; - - public TestSpringBeanFactory(ApplicationContext aContext) { - _context = aContext; - } - - /* (non-Javadoc) - * @see org.wamblee.general.BeanFactory#find(java.lang.String) - */ - public Object find(String aId) { - return find(aId, Object.class); - } - - /* (non-Javadoc) - * @see org.wamblee.general.BeanFactory#find(java.lang.Class) - */ - public T find(Class aClass) { - return find(aClass.getName(), aClass); - } - - /* (non-Javadoc) - * @see org.wamblee.general.BeanFactory#find(java.lang.String, java.lang.Class) - */ - public T find(String aId, Class aClass) { - try { - Object obj = _context.getBean(aId, aClass); - assert obj != null; - return aClass.cast(obj); - } catch (BeansException e) { - throw new BeanFactoryException(e.getMessage(), e); - } - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/TestSupport.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/TestSupport.java deleted file mode 100644 index c10c24b3..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/TestSupport.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.test; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.nio.MappedByteBuffer; -import java.nio.channels.FileChannel; - -import junit.framework.Assert; - -/** - * @author Erik Test support utility. - */ -public final class TestSupport { - - /** - * Disabled constructor. - * - */ - private TestSupport() { - // Empty - } - - /** - * Obtain root directory of JUnit tests. - * - * @return Directory name. - */ - public static File getTestRootDir() { - return new File("testdata"); - } - - /** - * Returns a temporary directory. - * - * @return Temporary directory. - */ - public static File getTmpDir() { - return new File(getTestRootDir(), "tmpdir"); - } - - /** - * Recursively remove a directory. - * - * @param aSrc - * Directoryto remove. - */ - public static void removeDir(File aSrc) { - if (!aSrc.exists()) { - return; - } - Assert.assertTrue(aSrc.getPath(), aSrc.isDirectory()); - File[] files = aSrc.listFiles(); - for (int i = 0; i < files.length; i++) { - File file = files[i]; - if (file.isDirectory()) { - removeDir(file); - } else { - Assert.assertTrue(file.getPath(), file.delete()); - } - } - Assert.assertTrue(aSrc.getPath(), aSrc.delete()); - } - - /** - * Recursively copy a directory. - * - * @param aSrc - * Source directory - * @param aTarget - * Target directory. - */ - public static void copyDir(File aSrc, File aTarget) { - Assert.assertTrue(aSrc.isDirectory()); - Assert.assertTrue(!aTarget.exists()); - - aTarget.mkdirs(); - - File[] files = aSrc.listFiles(); - for (int i = 0; i < files.length; i++) { - File file = files[i]; - if (file.isDirectory()) { - if (!file.getName().equals(".svn")) { - copyDir(new File(aSrc, file.getName()), new File(aTarget, - file.getName())); - } - } else { - copyFile(file, new File(aTarget, file.getName())); - } - } - } - - /** - * Copy a file. If copying fails then the testcase will fail. - * - * @param aSrc - * Source file. - * @param aTarget - * Target file. - */ - public static void copyFile(File aSrc, File aTarget) { - - try { - FileInputStream fis = new FileInputStream(aSrc); - FileOutputStream fos = new FileOutputStream(aTarget); - FileChannel fcin = fis.getChannel(); - FileChannel fcout = fos.getChannel(); - - // map input file - - MappedByteBuffer mbb = fcin.map(FileChannel.MapMode.READ_ONLY, 0, - fcin.size()); - - // do the file copy - fcout.write(mbb); - - // finish up - - fcin.close(); - fcout.close(); - fis.close(); - fos.close(); - } catch (IOException e) { - Assert.assertTrue("Copying file " + aSrc.getPath() + " to " - + aTarget.getPath() + " failed.", false); - } - } - - /** - * Remove a file or directory. The test case will fail if this does not - * succeed. - * - * @param aFile - * entry to remove. - */ - public static void delete(File aFile) { - Assert - .assertTrue("Could not delete " + aFile.getPath(), aFile - .delete()); - } - - /** - * Remove all files within a given directory including the directory itself. - * This only attempts to remove regular files and not directories within the - * directory. If the directory contains a nested directory, the deletion - * will fail. The test case will fail if this fails. - * - * @param aDir - * Directory to remove. - */ - public static void deleteDir(File aDir) { - cleanDir(aDir); - delete(aDir); - } - - /** - * Remove all regular files within a given directory. - * - * @param outputDirName - */ - public static void cleanDir(File aDir) { - if (!aDir.exists()) { - return; // nothing to do. - } - File[] entries = aDir.listFiles(); - for (int i = 0; i < entries.length; i++) { - File file = entries[i]; - if (file.isFile()) { - Assert.assertTrue("Could not delete " + entries[i].getPath(), - entries[i].delete()); - } - } - } - - /** - * Creates directory if it does not already exist. The test case will fail - * if the directory cannot be created. - * - * @param aDir - * Directory to create. - */ - public static void createDir(File aDir) { - if (aDir.isDirectory()) { - return; // nothing to do. - } - Assert.assertTrue("Could not create directory " + aDir.getPath(), aDir - .mkdirs()); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/TestTransactionCallback.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/TestTransactionCallback.java deleted file mode 100644 index ff46779b..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/TestTransactionCallback.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.wamblee.test; - -import java.util.Map; - -/** - * Transaction callback for testing. The test will fail if any type of exception - * is thrown. - */ -public interface TestTransactionCallback { - /** - * Executes code within a transaction, causing the testcase to fail if any - * type of exception is thrown. - * - * @return A map containg the resuls of the execution. This is a convenient - * method of returning multiple results from a call. - */ - Map execute() throws Exception; -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/TestTransactionCallbackWithoutResult.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/TestTransactionCallbackWithoutResult.java deleted file mode 100644 index 84e213f5..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/TestTransactionCallbackWithoutResult.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.wamblee.test; - -/** - * Transaction callback for testing. The test will fail if any type of exception - * is thrown. - */ -public interface TestTransactionCallbackWithoutResult { - /** - * Executes code within a transaction, causing the testcase to fail if any - * type of exception is thrown. - * - */ - void execute() throws Exception; -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/TimingUtils.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/TimingUtils.java deleted file mode 100644 index 98e89514..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/test/TimingUtils.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.test; - -import junit.framework.TestCase; - -/** - * Timing utilities. - */ -public final class TimingUtils { - - /** - * Disabled constructor. - * - */ - private TimingUtils() { - // Empty - } - - /** - * Sleeps for a time. - * @param aMillis Number of milliseconds to sleep. - */ - public static void sleep(int aMillis) { - try { - Thread.sleep(aMillis); - } catch (InterruptedException e) { - TestCase.fail("Who interrupted my sleep?"); - } - } - -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/xml/ClasspathUriResolverTest.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/xml/ClasspathUriResolverTest.java deleted file mode 100644 index 2d98a399..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/xml/ClasspathUriResolverTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.xml; - -import java.io.IOException; - -import javax.xml.transform.Source; -import javax.xml.transform.TransformerException; -import javax.xml.transform.URIResolver; -import javax.xml.transform.stream.StreamSource; - -import junit.framework.TestCase; - -import org.springframework.core.io.ClassPathResource; -import org.wamblee.io.FileSystemUtils; - -/** - * Tests for {@link org.wamblee.xml.ClasspathUriResolver}. - */ -public class ClasspathUriResolverTest extends TestCase { - - private URIResolver _resolver; - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - _resolver = new ClasspathUriResolver(); - } - - /** - * Resolves an existing file. Verifies the file is resolved correctly. - * @throws TransformerException - * @throws IOException - */ - public void testResolveExistingFile() throws TransformerException, IOException { - Source source = _resolver.resolve("org/wamblee/xml/reportToHtml.xsl", ""); - assertTrue(source instanceof StreamSource); - String resolved = FileSystemUtils.read(((StreamSource)source).getInputStream()); - - ClassPathResource resource = new ClassPathResource("org/wamblee/xml/reportToHtml.xsl"); - String expected = FileSystemUtils.read(resource.getInputStream()); - assertEquals(expected, resolved); - } - - /** - * Resolves a non-existing file. Verifies that a TransformerException is thrown. - * - */ - public void testResolveNonExistingFile() { - try { - Source source = _resolver.resolve("org/wamblee/xml/reportToHtml-nonexisting.xsl", ""); - } catch (TransformerException e) { - return; // ok - } - fail(); - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/xml/XmlUtils.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/xml/XmlUtils.java deleted file mode 100644 index 638d64e4..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/xml/XmlUtils.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.xml; - -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; - -import junit.framework.TestCase; - -import org.dom4j.Attribute; -import org.dom4j.Document; -import org.dom4j.Element; - -/** - * XML test support utilities. - */ -public final class XmlUtils { - - /** - * Disabled constructor. - * - */ - private XmlUtils() { - // Empty - } - - /** - * Checks equality of two XML documents excluding comment and processing - * nodes and trimming the text of the elements. In case of problems, it - * provides an xpath-like expression describing where the problem is. - * - * @param aMsg - * @param aExpected - * @param aActual - */ - public static void assertEquals(String aMsg, - org.w3c.dom.Document aExpected, org.w3c.dom.Document aActual) { - assertEquals(aMsg, DomUtils.convert(aExpected), DomUtils - .convert(aActual)); - } - - /** - * Checks equality of two XML documents excluding comment and processing - * nodes and trimming the text of the elements. In case of problems, it - * provides an xpath-like expression describing where the problem is. - * - * @param aMsg - * @param aExpected - * @param aActual - */ - public static void assertEquals(String aMsg, Document aExpected, - Document aActual) { - assertEquals(aMsg + "/" + aExpected.getRootElement().getName(), aExpected.getRootElement(), aActual.getRootElement()); - } - - /** - * Checks equality of two XML elements excluding comment and processing - * nodes and trimming the text of the elements. In case of problems, it - * provides an xpath-like expression describing where the problem is. - * - * @param aMsg - * @param aExpected - * @param aActual - */ - public static void assertEquals(String aMsg, Element aExpected, - Element aActual) { - - // Name. - TestCase.assertEquals(aMsg + "/name()", aExpected.getName(), aActual - .getName()); - - // Text - TestCase.assertEquals(aMsg + "/text()", aExpected.getTextTrim(), - aActual.getTextTrim()); - - // Attributes - List expectedAttrs = aExpected.attributes(); - Collections.sort(expectedAttrs, new AttributeComparator()); - List actualAttrs = aActual.attributes(); - Collections.sort(actualAttrs, new AttributeComparator()); - - TestCase.assertEquals("count(" + aMsg + "/@*)", expectedAttrs.size(), - actualAttrs.size()); - for (int i = 0; i < expectedAttrs.size(); i++) { - String msg = aMsg + "/@" + expectedAttrs.get(i).getName(); - assertEquals(msg, expectedAttrs.get(i), actualAttrs.get(i)); - } - - // Nested elements. - List expectedElems = aExpected.elements(); - List actualElems = aActual.elements(); - TestCase.assertEquals("count(" + aMsg + "/*)", expectedElems.size(), - actualElems.size()); - // determine the how-manyth element of the given name we are at. - // Maps element name to the last used index (or null if not yet used) - Map elementIndex = new TreeMap(); - for (int i = 0; i < expectedElems.size(); i++) { - String elemName = expectedElems.get(i).getName(); - Integer index = elementIndex.get(elemName); - if (index == null) { - index = 1; - } else { - index++; - } - elementIndex.put(elemName, index); - String msg = aMsg + "/" + expectedElems.get(i).getName() + "[" - + index + "]"; - - assertEquals(msg, expectedElems.get(i), actualElems.get(i)); - } - } - - /** - * Checks equality of two attributes. In case of problems, it - * provides an xpath-like expression describing where the problem is. - * - * @param aMsg - * @param aExpected - * @param aActual - */ - public static void assertEquals(String aMsg, Attribute aExpected, - Attribute aActual) { - TestCase.assertEquals(aMsg + ":name", aExpected.getName(), aActual - .getName()); - TestCase.assertEquals(aMsg + ":value", aExpected.getValue(), aActual - .getValue()); - } - - /** - * Comparator which compares attributes by name. - */ - private static final class AttributeComparator implements - Comparator { - /* - * (non-Javadoc) - * - * @see java.util.Comparator#compare(T, T) - */ - public int compare(Attribute aAttribute1, Attribute aAttribute2) { - return aAttribute1.getName().compareTo(aAttribute2.getName()); - } - } -} diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/xml/XslTransformerTest.java b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/xml/XslTransformerTest.java deleted file mode 100644 index b9effeec..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/java/org/wamblee/xml/XslTransformerTest.java +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.xml; - -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.transform.Result; -import javax.xml.transform.Source; -import javax.xml.transform.TransformerException; -import javax.xml.transform.stream.StreamResult; -import javax.xml.transform.stream.StreamSource; - -import junit.framework.TestCase; -import org.wamblee.io.ClassPathResource; -import org.wamblee.io.FileSystemUtils; -import org.wamblee.io.InputResource; - -import org.w3c.dom.Document; - -/** - * Tests the XSL transformer. - */ -public class XslTransformerTest extends TestCase { - - private static final String INCLUDED_XSL_FILE = "utilities.xsl"; - - private static final String REPORT_XML = "report.xml"; - - private static final String REPORT_TO_HTML_XSLT = "reportToHtml.xsl"; - - private static final String REPORT_TO_HTML2_XSLT = "reportToHtml2.xsl"; - - private static final String REPORT_TO_HTML_INVALID_XSLT = "reportToHtml-invalid.xsl"; - - private static final String REPORT_TO_HTML_NONWELLFORMED_XSLT = "reportToHtml-nonwellformed.xsl"; - - private static final String REPORT_TO_TEXT_XSLT = "reportToText.xsl"; - - private String getResourcePath(String aResource) { - return getClass().getPackage().getName().replaceAll("\\.", "/") + "/" + aResource; - } - - /** - * Transforms a file while using the default resolver, where the included - * file can be found. Verifies the transformation is done correctly. - * - */ - public void testTransformUsingDefaultResolver() throws Exception { - XslTransformer transformer = new XslTransformer(); - - InputResource xmlResource = new ClassPathResource(getResourcePath(REPORT_XML)); - - Source xslt = new StreamSource(new ClassPathResource(getResourcePath( - REPORT_TO_HTML_XSLT)).getInputStream()); - - byte[] documentData = FileSystemUtils - .read(xmlResource.getInputStream()).getBytes(); - DocumentBuilder builder = DocumentBuilderFactory.newInstance() - .newDocumentBuilder(); - Document document = builder.parse(xmlResource.getInputStream()); - Source documentSource = new StreamSource(xmlResource.getInputStream()); - - Document expected = DomUtils.read(new ClassPathResource(getResourcePath( - "output-reportToHtml-report.xml")).getInputStream()); - - Document output1 = transformer.transform(documentData, xslt); - XmlUtils.assertEquals("byte[] transform", expected, output1); - - xslt = new StreamSource(new ClassPathResource(getResourcePath( - REPORT_TO_HTML_XSLT)).getInputStream()); - Document output2 = transformer.transform(document, xslt); - XmlUtils.assertEquals("document transform", expected, output2); - - ByteArrayOutputStream os = new ByteArrayOutputStream(); - Result output = new StreamResult(os); - - xslt = new StreamSource(new ClassPathResource(getResourcePath( - REPORT_TO_HTML_XSLT)).getInputStream()); - transformer.transform(documentSource, output, xslt); - XmlUtils.assertEquals("document source transform", expected, DomUtils - .read(os.toString())); - - xslt = new StreamSource(new ClassPathResource(getResourcePath( - REPORT_TO_HTML_XSLT)).getInputStream()); - String result = transformer.textTransform(documentData, xslt); - XmlUtils - .assertEquals("text transform", expected, DomUtils.read(result)); - } - - /** - * Transforms a file using the default resolver where the included file - * cannot be found. Verifies that a TransformerException is thrown. - * - */ - public void testTransformUsingDefaultResolverFails() throws IOException { - XslTransformer transformer = new XslTransformer(); - - InputResource xmlResource = - new ClassPathResource(getResourcePath(REPORT_XML)); - Source xslt = new StreamSource( - new ClassPathResource(getResourcePath( - REPORT_TO_HTML2_XSLT)).getInputStream()); - - byte[] documentData = FileSystemUtils - .read(xmlResource.getInputStream()).getBytes(); - try { - Document output1 = transformer.transform(documentData, xslt); - } catch (TransformerException e) { - return; // ok - } - fail(); - } - - /** - * Transforms a file using an invalid Xslt. Verifies that a - * TransformerException is thrown. - * - */ - public void testTransformInvalidXslt() throws IOException { - XslTransformer transformer = new XslTransformer(); - - InputResource xmlResource = new ClassPathResource( - getResourcePath(REPORT_XML)); - Source xslt = new StreamSource( - new ClassPathResource(getResourcePath(REPORT_TO_HTML_INVALID_XSLT)).getInputStream()); - - byte[] documentData = FileSystemUtils - .read(xmlResource.getInputStream()).getBytes(); - try { - Document output1 = transformer.transform(documentData, xslt); - } catch (TransformerException e) { - return; // ok - } - fail(); - } - - /** - * Transforms a file using a non-well formed xslt. Verifies that a - * TransformerException is thrown. - * - */ - public void testTransformNonWellformedXslt() throws IOException { - XslTransformer transformer = new XslTransformer(); - - InputResource xmlResource = new ClassPathResource( - getResourcePath(REPORT_XML)); - Source xslt = new StreamSource( - new ClassPathResource(getResourcePath( - REPORT_TO_HTML_NONWELLFORMED_XSLT)).getInputStream()); - - byte[] documentData = FileSystemUtils - .read(xmlResource.getInputStream()).getBytes(); - try { - Document output1 = transformer.transform(documentData, xslt); - } catch (TransformerException e) { - return; // ok - } - fail(); - } - - /** - * Transforms a file using a class path resolver. - * - */ - public void testTransformUsingClassPathResolver() throws Exception { - XslTransformer transformer = new XslTransformer(new ClasspathUriResolver()); - - InputResource xmlResource = new ClassPathResource(getResourcePath( - REPORT_XML)); - Source xslt = new StreamSource(new ClassPathResource( - getResourcePath(REPORT_TO_HTML2_XSLT)).getInputStream()); - - byte[] documentData = FileSystemUtils - .read(xmlResource.getInputStream()).getBytes(); - - Document output1 = transformer.transform(documentData, xslt); - Document expected = DomUtils.read(new ClassPathResource( - getResourcePath("output-reportToHtml-report.xml")) - .getInputStream()); - XmlUtils.assertEquals("doc", expected, output1); - } - - /** - * Transforms a file to text output. Verifies the file is transformed - * correctly. - * - */ - public void testTransformToTextOutput() throws Exception { - XslTransformer transformer = new XslTransformer(new ClasspathUriResolver()); - - InputResource xmlResource = new ClassPathResource( - getResourcePath(REPORT_XML)); - Source xslt = new StreamSource( - new ClassPathResource(getResourcePath(REPORT_TO_TEXT_XSLT)).getInputStream()); - - byte[] documentData = FileSystemUtils - .read(xmlResource.getInputStream()).getBytes(); - - String result = transformer.textTransform(documentData, xslt); - String expected = "Hello world!"; - assertEquals("text transform", expected, result); - } - - /** - * Tests resolving a file using {@link XslTransformer#resolve(String)} with the - * default resolver where the file does not exist. - * - */ - public void testResolveWithDefaultResolverFileNotFound() { - XslTransformer transformer = new XslTransformer(); - try { - Source source = transformer.resolve("org/wamblee/xml/utilities-nonexistent.xsl"); - } catch (TransformerException e) { - return; // ok - } - fail(); - } - - - /** - * Tests resolving a file using {@link XslTransformer#resolve(String)} with the - * default resolver. - * - */ - public void testResolveWithClasspathResolver() throws Exception { - XslTransformer transformer = new XslTransformer(new ClasspathUriResolver()); - Source source = transformer.resolve(getResourcePath(INCLUDED_XSL_FILE)); - assert(source instanceof StreamSource); - StreamSource ssource = (StreamSource)source; - String data = FileSystemUtils.read(ssource.getInputStream()); - String expected = FileSystemUtils.read(new ClassPathResource(getResourcePath(INCLUDED_XSL_FILE)).getInputStream()); - assertEquals(expected, data); - } - -} - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/cache/ehcache.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/cache/ehcache.xml deleted file mode 100644 index 694184ed..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/cache/ehcache.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/general/beanRefContext.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/general/beanRefContext.xml deleted file mode 100644 index a453f3de..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/general/beanRefContext.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - org/wamblee/general/spring1.xml - - - - - \ No newline at end of file diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/general/beankernel-wrong.properties b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/general/beankernel-wrong.properties deleted file mode 100644 index e54de19d..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/general/beankernel-wrong.properties +++ /dev/null @@ -1,2 +0,0 @@ - -org.wamblee.beanfactory.class=org.wamblee.general.TestBeanFactoryBla diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/general/beankernel.properties b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/general/beankernel.properties deleted file mode 100644 index e08cf398..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/general/beankernel.properties +++ /dev/null @@ -1,2 +0,0 @@ - -org.wamblee.beanfactory.class=org.wamblee.general.TestBeanFactory diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/general/spring1.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/general/spring1.xml deleted file mode 100644 index 52ec0bec..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/general/spring1.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - hello - - - \ No newline at end of file diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/io/myresource.txt b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/io/myresource.txt deleted file mode 100644 index c72f1105..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/io/myresource.txt +++ /dev/null @@ -1 +0,0 @@ -This is my resource \ No newline at end of file diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/output-reportToHtml-report.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/output-reportToHtml-report.xml deleted file mode 100644 index 40f29fd3..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/output-reportToHtml-report.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - KiSS crawler report - - -

KiSS crawler report

-

Successfully recorded programs

- - - - - - - -
23:25 - 00:10: Wintertijd (Nederland - 1/Documentaire)
-
- Some description MINSK - De presidentsverkiezingen - in Wit-Rusland zijn zondag met ruime cijfers gewonnen door - zittend president Aleksandr Loekasjenko. Dat bleek zondag uit - exitpolls uitgevoerd in opdracht van het totalitaire regime. Het - staatshoofd zou kunnen rekenen op ruim 82 procent van de - stemmen. Volgens de eerste gedeeltelijke uitslagen zou - Loekasjenko zelfs kunnen rekenen op bijna 89 procent. -
-
-
-

-

Possibly interesting programs

-

- - - - - - - -
23:30 - 00:15: Brainiac (Discovery Channel/science)
-
- Humor -
-
-
-

-

Category: horror

-

- - - - - - - -
23:30 - 00:15: Andere tijden (Nederland 1/docu)
-
- Documentaire -
-
-
-

- - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/report.xml b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/report.xml deleted file mode 100644 index 391aea94..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/report.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - Wintertijd - Some description MINSK - De presidentsverkiezingen in Wit-Rusland zijn zondag met ruime cijfers gewonnen door zittend president Aleksandr Loekasjenko. Dat bleek zondag uit exitpolls uitgevoerd in opdracht van het totalitaire regime. Het staatshoofd zou kunnen rekenen op ruim 82 procent van de stemmen. Volgens de eerste gedeeltelijke uitslagen zou Loekasjenko zelfs kunnen rekenen op bijna 89 procent. - Documentaire - Nederland 1 - - 23:25 - 00:10 - - - - - - - Brainiac - Humor - science - Discovery Channel - - 23:30 - 00:15 - - - - - Andere tijden - Documentaire - docu - Nederland 1 - - 23:30 - 00:15 - - - - - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/reportToHtml-invalid.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/reportToHtml-invalid.xsl deleted file mode 100644 index 104234e1..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/reportToHtml-invalid.xsl +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - KiSS crawler report - - -

KiSS crawler report

- - -

Possibly interesting programs

- -
- - No suitable programs found - - - - -
- - -

- - - -
-
-

-
- - -

- - - Successfully recorded programs - - - - Already recorded programs - - - - Conflicts with other recorded programs - - - - Programs that could not be recorded for - technical reasons. - - - -

-
- - - - - : - - (/) - - - - -
- - - -
- - - - -
- - - - - - - - - - - -

Category:

- -
-
- diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/reportToHtml-nonwellformed.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/reportToHtml-nonwellformed.xsl deleted file mode 100644 index 03d19083..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/reportToHtml-nonwellformed.xsl +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - KiSS crawler report - - -

KiSS crawler report

- - -

Possibly interesting programs

- - - - No suitable programs found - - - - -
- - -

- - - -
-
-

-
- - -

- - - Successfully recorded programs - - - - Already recorded programs - - - - Conflicts with other recorded programs - - - - Programs that could not be recorded for - technical reasons. - - - -

-
- - - - - : - - (/) - - - - -
- - - -
- - - - -
- - - - - - - - - - - -

Category:

- -
-
- diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/reportToHtml.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/reportToHtml.xsl deleted file mode 100644 index ce113d5a..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/reportToHtml.xsl +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - KiSS crawler report - - -

KiSS crawler report

- - -

Possibly interesting programs

- -
- - No suitable programs found - - - - -
- - -

- - - -
-
-

-
- - -

- - - Successfully recorded programs - - - - Already recorded programs - - - - Conflicts with other recorded programs - - - - Programs that could not be recorded for - technical reasons. - - - -

-
- - - - - : - - (/) - - - - -
- - - -
- - - - -
- - - - - - - - - - - -

Category:

- -
-
- diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/reportToHtml2.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/reportToHtml2.xsl deleted file mode 100644 index 2cec21fe..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/reportToHtml2.xsl +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - KiSS crawler report - - -

KiSS crawler report

- - -

Possibly interesting programs

- -
- - No suitable programs found - - - - -
- - -

- - - -
-
-

-
- - -

- - - Successfully recorded programs - - - - Already recorded programs - - - - Conflicts with other recorded programs - - - - Programs that could not be recorded for - technical reasons. - - - -

-
- - - - - : - - (/) - - - - -
- - - -
- - - - -
- - - - - - - - - - - -

Category:

- -
-
- diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/reportToText.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/reportToText.xsl deleted file mode 100644 index c1f7023c..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/reportToText.xsl +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - Hello world! - - - diff --git a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/utilities.xsl b/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/utilities.xsl deleted file mode 100644 index 0dd7e62b..00000000 --- a/tags/MYTHTV_EAR_NO_MSG_LINKING/support/src/test/resources/org/wamblee/xml/utilities.xsl +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/trunk/test/eclipselink/pom.xml b/test/eclipselink/pom.xml similarity index 100% rename from trunk/test/eclipselink/pom.xml rename to test/eclipselink/pom.xml diff --git a/trunk/test/eclipselink/src/main/java/org/wamblee/support/persistence/eclipselink/EclipselinkJpaCustomizer.java b/test/eclipselink/src/main/java/org/wamblee/support/persistence/eclipselink/EclipselinkJpaCustomizer.java similarity index 100% rename from trunk/test/eclipselink/src/main/java/org/wamblee/support/persistence/eclipselink/EclipselinkJpaCustomizer.java rename to test/eclipselink/src/main/java/org/wamblee/support/persistence/eclipselink/EclipselinkJpaCustomizer.java diff --git a/trunk/test/eclipselink/src/main/java/org/wamblee/support/persistence/eclipselink/EclipselinkTables.java b/test/eclipselink/src/main/java/org/wamblee/support/persistence/eclipselink/EclipselinkTables.java similarity index 100% rename from trunk/test/eclipselink/src/main/java/org/wamblee/support/persistence/eclipselink/EclipselinkTables.java rename to test/eclipselink/src/main/java/org/wamblee/support/persistence/eclipselink/EclipselinkTables.java diff --git a/trunk/test/eclipselink/src/main/java/org/wamblee/support/persistence/eclipselink/JndiSessionCustomizer.java b/test/eclipselink/src/main/java/org/wamblee/support/persistence/eclipselink/JndiSessionCustomizer.java similarity index 100% rename from trunk/test/eclipselink/src/main/java/org/wamblee/support/persistence/eclipselink/JndiSessionCustomizer.java rename to test/eclipselink/src/main/java/org/wamblee/support/persistence/eclipselink/JndiSessionCustomizer.java diff --git a/trunk/test/eclipselink/src/main/resources/META-INF/services/org.wamblee.support.persistence.JpaCustomizer b/test/eclipselink/src/main/resources/META-INF/services/org.wamblee.support.persistence.JpaCustomizer similarity index 100% rename from trunk/test/eclipselink/src/main/resources/META-INF/services/org.wamblee.support.persistence.JpaCustomizer rename to test/eclipselink/src/main/resources/META-INF/services/org.wamblee.support.persistence.JpaCustomizer diff --git a/trunk/test/eclipselink/src/test/java/org/wamblee/support/persistence/eclipselink/DatabaseUtilsTest.java b/test/eclipselink/src/test/java/org/wamblee/support/persistence/eclipselink/DatabaseUtilsTest.java similarity index 100% rename from trunk/test/eclipselink/src/test/java/org/wamblee/support/persistence/eclipselink/DatabaseUtilsTest.java rename to test/eclipselink/src/test/java/org/wamblee/support/persistence/eclipselink/DatabaseUtilsTest.java diff --git a/trunk/test/eclipselink/src/test/java/org/wamblee/support/persistence/eclipselink/MyEntityExampleTest.java b/test/eclipselink/src/test/java/org/wamblee/support/persistence/eclipselink/MyEntityExampleTest.java similarity index 100% rename from trunk/test/eclipselink/src/test/java/org/wamblee/support/persistence/eclipselink/MyEntityExampleTest.java rename to test/eclipselink/src/test/java/org/wamblee/support/persistence/eclipselink/MyEntityExampleTest.java diff --git a/trunk/test/enterprise/pom.xml b/test/enterprise/pom.xml similarity index 100% rename from trunk/test/enterprise/pom.xml rename to test/enterprise/pom.xml diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/jndi/StubInitialContext.java b/test/enterprise/src/main/java/org/wamblee/support/jndi/StubInitialContext.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/jndi/StubInitialContext.java rename to test/enterprise/src/main/java/org/wamblee/support/jndi/StubInitialContext.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/jndi/StubInitialContextFactory.java b/test/enterprise/src/main/java/org/wamblee/support/jndi/StubInitialContextFactory.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/jndi/StubInitialContextFactory.java rename to test/enterprise/src/main/java/org/wamblee/support/jndi/StubInitialContextFactory.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/AbstractDatabase.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/AbstractDatabase.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/AbstractDatabase.java rename to test/enterprise/src/main/java/org/wamblee/support/persistence/AbstractDatabase.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/AbstractDatabaseProvider.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/AbstractDatabaseProvider.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/AbstractDatabaseProvider.java rename to test/enterprise/src/main/java/org/wamblee/support/persistence/AbstractDatabaseProvider.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/CompositeJpaCustomizer.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/CompositeJpaCustomizer.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/CompositeJpaCustomizer.java rename to test/enterprise/src/main/java/org/wamblee/support/persistence/CompositeJpaCustomizer.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/CompositeJpaTables.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/CompositeJpaTables.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/CompositeJpaTables.java rename to test/enterprise/src/main/java/org/wamblee/support/persistence/CompositeJpaTables.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/Database.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/Database.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/Database.java rename to test/enterprise/src/main/java/org/wamblee/support/persistence/Database.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseBuilder.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseBuilder.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseBuilder.java rename to test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseBuilder.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseDescription.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseDescription.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseDescription.java rename to test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseDescription.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseProvider.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseProvider.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseProvider.java rename to test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseProvider.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseStarter.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseStarter.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseStarter.java rename to test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseStarter.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseUtils.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseUtils.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseUtils.java rename to test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseUtils.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/DerbyDatabase.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/DerbyDatabase.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/DerbyDatabase.java rename to test/enterprise/src/main/java/org/wamblee/support/persistence/DerbyDatabase.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/DerbyDatabaseProvider.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/DerbyDatabaseProvider.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/DerbyDatabaseProvider.java rename to test/enterprise/src/main/java/org/wamblee/support/persistence/DerbyDatabaseProvider.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/ExternalDatabase.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/ExternalDatabase.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/ExternalDatabase.java rename to test/enterprise/src/main/java/org/wamblee/support/persistence/ExternalDatabase.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/ExternalDatabaseProvider.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/ExternalDatabaseProvider.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/ExternalDatabaseProvider.java rename to test/enterprise/src/main/java/org/wamblee/support/persistence/ExternalDatabaseProvider.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/JpaBuilder.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/JpaBuilder.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/JpaBuilder.java rename to test/enterprise/src/main/java/org/wamblee/support/persistence/JpaBuilder.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/JpaCustomizer.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/JpaCustomizer.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/JpaCustomizer.java rename to test/enterprise/src/main/java/org/wamblee/support/persistence/JpaCustomizer.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/JpaCustomizerBuilder.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/JpaCustomizerBuilder.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/JpaCustomizerBuilder.java rename to test/enterprise/src/main/java/org/wamblee/support/persistence/JpaCustomizerBuilder.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/JpaTester.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/JpaTester.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/JpaTester.java rename to test/enterprise/src/main/java/org/wamblee/support/persistence/JpaTester.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/PersistenceUnitDescription.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/PersistenceUnitDescription.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/PersistenceUnitDescription.java rename to test/enterprise/src/main/java/org/wamblee/support/persistence/PersistenceUnitDescription.java diff --git a/trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/package-info.java b/test/enterprise/src/main/java/org/wamblee/support/persistence/package-info.java similarity index 100% rename from trunk/test/enterprise/src/main/java/org/wamblee/support/persistence/package-info.java rename to test/enterprise/src/main/java/org/wamblee/support/persistence/package-info.java diff --git a/trunk/test/enterprise/src/main/resources/META-INF/services/org.wamblee.support.persistence.DatabaseProvider b/test/enterprise/src/main/resources/META-INF/services/org.wamblee.support.persistence.DatabaseProvider similarity index 100% rename from trunk/test/enterprise/src/main/resources/META-INF/services/org.wamblee.support.persistence.DatabaseProvider rename to test/enterprise/src/main/resources/META-INF/services/org.wamblee.support.persistence.DatabaseProvider diff --git a/trunk/test/enterprise/src/test/java/org/wamblee/support/jndi/StubInitiaContextFactoryTest.java b/test/enterprise/src/test/java/org/wamblee/support/jndi/StubInitiaContextFactoryTest.java similarity index 100% rename from trunk/test/enterprise/src/test/java/org/wamblee/support/jndi/StubInitiaContextFactoryTest.java rename to test/enterprise/src/test/java/org/wamblee/support/jndi/StubInitiaContextFactoryTest.java diff --git a/trunk/test/enterprise/src/test/java/org/wamblee/support/persistence/DatabaseBuilderTest.java b/test/enterprise/src/test/java/org/wamblee/support/persistence/DatabaseBuilderTest.java similarity index 100% rename from trunk/test/enterprise/src/test/java/org/wamblee/support/persistence/DatabaseBuilderTest.java rename to test/enterprise/src/test/java/org/wamblee/support/persistence/DatabaseBuilderTest.java diff --git a/trunk/test/enterprise/src/test/java/org/wamblee/support/persistence/DatabaseUtilsTestBase.java b/test/enterprise/src/test/java/org/wamblee/support/persistence/DatabaseUtilsTestBase.java similarity index 100% rename from trunk/test/enterprise/src/test/java/org/wamblee/support/persistence/DatabaseUtilsTestBase.java rename to test/enterprise/src/test/java/org/wamblee/support/persistence/DatabaseUtilsTestBase.java diff --git a/trunk/test/enterprise/src/test/java/org/wamblee/support/persistence/DerbyDatabaseTest.java b/test/enterprise/src/test/java/org/wamblee/support/persistence/DerbyDatabaseTest.java similarity index 100% rename from trunk/test/enterprise/src/test/java/org/wamblee/support/persistence/DerbyDatabaseTest.java rename to test/enterprise/src/test/java/org/wamblee/support/persistence/DerbyDatabaseTest.java diff --git a/trunk/test/enterprise/src/test/java/org/wamblee/support/persistence/ExternalDatabaseTest.java b/test/enterprise/src/test/java/org/wamblee/support/persistence/ExternalDatabaseTest.java similarity index 100% rename from trunk/test/enterprise/src/test/java/org/wamblee/support/persistence/ExternalDatabaseTest.java rename to test/enterprise/src/test/java/org/wamblee/support/persistence/ExternalDatabaseTest.java diff --git a/trunk/test/enterprise/src/test/java/org/wamblee/support/persistence/MyEntity.java b/test/enterprise/src/test/java/org/wamblee/support/persistence/MyEntity.java similarity index 100% rename from trunk/test/enterprise/src/test/java/org/wamblee/support/persistence/MyEntity.java rename to test/enterprise/src/test/java/org/wamblee/support/persistence/MyEntity.java diff --git a/trunk/test/enterprise/src/test/java/org/wamblee/support/persistence/MyEntityExampleTestBase.java b/test/enterprise/src/test/java/org/wamblee/support/persistence/MyEntityExampleTestBase.java similarity index 100% rename from trunk/test/enterprise/src/test/java/org/wamblee/support/persistence/MyEntityExampleTestBase.java rename to test/enterprise/src/test/java/org/wamblee/support/persistence/MyEntityExampleTestBase.java diff --git a/trunk/test/enterprise/src/test/java/org/wamblee/support/persistence/MyPersistenceUnit.java b/test/enterprise/src/test/java/org/wamblee/support/persistence/MyPersistenceUnit.java similarity index 100% rename from trunk/test/enterprise/src/test/java/org/wamblee/support/persistence/MyPersistenceUnit.java rename to test/enterprise/src/test/java/org/wamblee/support/persistence/MyPersistenceUnit.java diff --git a/trunk/test/enterprise/src/test/java/org/wamblee/support/persistence/MyTables.java b/test/enterprise/src/test/java/org/wamblee/support/persistence/MyTables.java similarity index 100% rename from trunk/test/enterprise/src/test/java/org/wamblee/support/persistence/MyTables.java rename to test/enterprise/src/test/java/org/wamblee/support/persistence/MyTables.java diff --git a/trunk/test/enterprise/src/test/resources/META-INF/persistence.xml b/test/enterprise/src/test/resources/META-INF/persistence.xml similarity index 100% rename from trunk/test/enterprise/src/test/resources/META-INF/persistence.xml rename to test/enterprise/src/test/resources/META-INF/persistence.xml diff --git a/trunk/test/hibernate/pom.xml b/test/hibernate/pom.xml similarity index 100% rename from trunk/test/hibernate/pom.xml rename to test/hibernate/pom.xml diff --git a/trunk/test/hibernate/src/main/java/org/wamblee/support/persistence/hibernate/HibernateJpaCustomizer.java b/test/hibernate/src/main/java/org/wamblee/support/persistence/hibernate/HibernateJpaCustomizer.java similarity index 100% rename from trunk/test/hibernate/src/main/java/org/wamblee/support/persistence/hibernate/HibernateJpaCustomizer.java rename to test/hibernate/src/main/java/org/wamblee/support/persistence/hibernate/HibernateJpaCustomizer.java diff --git a/trunk/test/hibernate/src/main/java/org/wamblee/support/persistence/hibernate/HibernateTables.java b/test/hibernate/src/main/java/org/wamblee/support/persistence/hibernate/HibernateTables.java similarity index 100% rename from trunk/test/hibernate/src/main/java/org/wamblee/support/persistence/hibernate/HibernateTables.java rename to test/hibernate/src/main/java/org/wamblee/support/persistence/hibernate/HibernateTables.java diff --git a/trunk/test/hibernate/src/main/resources/META-INF/services/org.wamblee.support.persistence.JpaCustomizer b/test/hibernate/src/main/resources/META-INF/services/org.wamblee.support.persistence.JpaCustomizer similarity index 100% rename from trunk/test/hibernate/src/main/resources/META-INF/services/org.wamblee.support.persistence.JpaCustomizer rename to test/hibernate/src/main/resources/META-INF/services/org.wamblee.support.persistence.JpaCustomizer diff --git a/trunk/test/hibernate/src/test/java/org/wamblee/support/persistence/hibernate/DatabaseUtilsTest.java b/test/hibernate/src/test/java/org/wamblee/support/persistence/hibernate/DatabaseUtilsTest.java similarity index 100% rename from trunk/test/hibernate/src/test/java/org/wamblee/support/persistence/hibernate/DatabaseUtilsTest.java rename to test/hibernate/src/test/java/org/wamblee/support/persistence/hibernate/DatabaseUtilsTest.java diff --git a/trunk/test/hibernate/src/test/java/org/wamblee/support/persistence/hibernate/MyEntityExampleTest.java b/test/hibernate/src/test/java/org/wamblee/support/persistence/hibernate/MyEntityExampleTest.java similarity index 100% rename from trunk/test/hibernate/src/test/java/org/wamblee/support/persistence/hibernate/MyEntityExampleTest.java rename to test/hibernate/src/test/java/org/wamblee/support/persistence/hibernate/MyEntityExampleTest.java diff --git a/trunk/test/pom.xml b/test/pom.xml similarity index 100% rename from trunk/test/pom.xml rename to test/pom.xml diff --git a/trunk/test/toplink-essentials/pom.xml b/test/toplink-essentials/pom.xml similarity index 100% rename from trunk/test/toplink-essentials/pom.xml rename to test/toplink-essentials/pom.xml diff --git a/trunk/test/toplink-essentials/src/main/java/org/wamblee/support/persistence/toplink/JndiSessionCustomizer.java b/test/toplink-essentials/src/main/java/org/wamblee/support/persistence/toplink/JndiSessionCustomizer.java similarity index 100% rename from trunk/test/toplink-essentials/src/main/java/org/wamblee/support/persistence/toplink/JndiSessionCustomizer.java rename to test/toplink-essentials/src/main/java/org/wamblee/support/persistence/toplink/JndiSessionCustomizer.java diff --git a/trunk/test/toplink-essentials/src/main/java/org/wamblee/support/persistence/toplink/ToplinkJpaCustomizer.java b/test/toplink-essentials/src/main/java/org/wamblee/support/persistence/toplink/ToplinkJpaCustomizer.java similarity index 100% rename from trunk/test/toplink-essentials/src/main/java/org/wamblee/support/persistence/toplink/ToplinkJpaCustomizer.java rename to test/toplink-essentials/src/main/java/org/wamblee/support/persistence/toplink/ToplinkJpaCustomizer.java diff --git a/trunk/test/toplink-essentials/src/main/java/org/wamblee/support/persistence/toplink/ToplinkTables.java b/test/toplink-essentials/src/main/java/org/wamblee/support/persistence/toplink/ToplinkTables.java similarity index 100% rename from trunk/test/toplink-essentials/src/main/java/org/wamblee/support/persistence/toplink/ToplinkTables.java rename to test/toplink-essentials/src/main/java/org/wamblee/support/persistence/toplink/ToplinkTables.java diff --git a/trunk/test/toplink-essentials/src/main/resources/META-INF/services/org.wamblee.support.persistence.JpaCustomizer b/test/toplink-essentials/src/main/resources/META-INF/services/org.wamblee.support.persistence.JpaCustomizer similarity index 100% rename from trunk/test/toplink-essentials/src/main/resources/META-INF/services/org.wamblee.support.persistence.JpaCustomizer rename to test/toplink-essentials/src/main/resources/META-INF/services/org.wamblee.support.persistence.JpaCustomizer diff --git a/trunk/test/toplink-essentials/src/test/java/org/wamblee/support/persistence/toplink/DatabaseUtilsTest.java b/test/toplink-essentials/src/test/java/org/wamblee/support/persistence/toplink/DatabaseUtilsTest.java similarity index 100% rename from trunk/test/toplink-essentials/src/test/java/org/wamblee/support/persistence/toplink/DatabaseUtilsTest.java rename to test/toplink-essentials/src/test/java/org/wamblee/support/persistence/toplink/DatabaseUtilsTest.java diff --git a/trunk/test/toplink-essentials/src/test/java/org/wamblee/support/persistence/toplink/MyEntityExampleTest.java b/test/toplink-essentials/src/test/java/org/wamblee/support/persistence/toplink/MyEntityExampleTest.java similarity index 100% rename from trunk/test/toplink-essentials/src/test/java/org/wamblee/support/persistence/toplink/MyEntityExampleTest.java rename to test/toplink-essentials/src/test/java/org/wamblee/support/persistence/toplink/MyEntityExampleTest.java diff --git a/trunk/ABOUT.txt b/trunk/ABOUT.txt deleted file mode 100644 index 8d0afc91..00000000 --- a/trunk/ABOUT.txt +++ /dev/null @@ -1,4 +0,0 @@ -This is the utilities project of wamblee.org. It contains various utilities -and useful programs for various purposes. The most important part is the -support library. - diff --git a/trunk/LICENSE b/trunk/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/trunk/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - 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. diff --git a/trunk/build/checkstyle-noframes.xsl b/trunk/build/checkstyle-noframes.xsl deleted file mode 100644 index 5f18134b..00000000 --- a/trunk/build/checkstyle-noframes.xsl +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -

CheckStyle Audit

Designed for use with CheckStyle and Ant.
-
- - - -
- - - -
- - - - - -

-

- -


- - - - -
- - - - -

Files

- - - - - - - - - - - - - - -
NameErrors
-
- - - - -

File

- - - - - - - - - - - - - -
Error DescriptionLine
- Back to top -
- - - -

Summary

- - - - - - - - - - - - -
FilesErrors
-
- - - - a - b - - -
- - diff --git a/trunk/build/checkstyle-simple.xsl b/trunk/build/checkstyle-simple.xsl deleted file mode 100644 index d98cbcbe..00000000 --- a/trunk/build/checkstyle-simple.xsl +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - Sun Coding Style Violations - - -

Coding Style Check Results

- - - - - - - - - - - - - - - - - - - - -
Summary
Total files checked
Files with errors
Total errors
Errors per file
-
-

The following are violations of the Sun Coding-Style Standards:

-

- - - - - - - - - - - -
File: - -
- - - - - - -
Line Number Error Message
-

- - - - - - - - - - - - - - diff --git a/trunk/build/style.xml b/trunk/build/style.xml deleted file mode 100644 index 58b854ea..00000000 --- a/trunk/build/style.xml +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/trunk/support/general/src/main/java/org/wamblee/cache/Cache.java b/trunk/support/general/src/main/java/org/wamblee/cache/Cache.java deleted file mode 100644 index 15f2c508..00000000 --- a/trunk/support/general/src/main/java/org/wamblee/cache/Cache.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.cache; - -import java.io.Serializable; - -/** - * The Cache interface represents... a cache. - * In some circumstances it is more optimal to implement caching directly in - * the code instead of relying on Hibernate caching methods. This interface abstracts - * from the used cache implementation. - * Cache implementations must be thread-safe. - */ -public interface Cache { - - /** - * Adds a key-value pair to the cache. - * @param aKey Key. - * @param aValue Value. - */ - void put(KeyType aKey, ValueType aValue); - - /** - * Retrieves a value from the cache. - * @param aKey Key to retrieve. - * @return Key. - */ - ValueType get(KeyType aKey); - - /** - * Removes an entry from the cache. - * @param aKey Key to remove the entry for. - */ - void remove(KeyType aKey); - - /** - * Removes all entries from the cache. - * - */ - void clear(); -} diff --git a/trunk/support/general/src/main/java/org/wamblee/cache/package.html b/trunk/support/general/src/main/java/org/wamblee/cache/package.html deleted file mode 100644 index 17bde142..00000000 --- a/trunk/support/general/src/main/java/org/wamblee/cache/package.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - wamblee.org - - - -This package provides an interface for a cache together with several -implementations. - - - -@since - - - - diff --git a/trunk/support/general/src/main/java/org/wamblee/concurrency/ReadWriteLock.java b/trunk/support/general/src/main/java/org/wamblee/concurrency/ReadWriteLock.java deleted file mode 100644 index e7658161..00000000 --- a/trunk/support/general/src/main/java/org/wamblee/concurrency/ReadWriteLock.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.concurrency; - -import java.util.HashSet; - - -/** - * Read-write lock for allowing multiple concurrent readers or at most one - * writer. This implementation does not aim for high performance but for - * robustness and simplicity. Users of this class should not synchronize on - * objects of this class. - */ -public class ReadWriteLock { - /** - * Sets containing the references to the threads that are currently - * reading. This administration is useful to check that the lock has - * already been acquired before it is release. This check adds robustness - * to the application. - */ - private HashSet _readers; - - /** - * The thread that has acquired the lock for writing or null if no such - * thread exists currently. - */ - private Thread _writer; - - /** - * Constructs read-write lock. - */ - public ReadWriteLock() { - _readers = new HashSet(); - _writer = null; - } - - /** - * Acquires the lock for reading. This call will block until the lock can - * be acquired. - * - * @throws IllegalStateException Thrown if the read or write lock is - * already acquired. - */ - public synchronized void acquireRead() { - if (_readers.contains(Thread.currentThread())) { - throw new IllegalStateException( - "Read lock already acquired by current thread: " - + Thread.currentThread()); - } - - if (_writer == Thread.currentThread()) { - throw new IllegalStateException( - "Trying to acquire the read lock while already holding a write lock: " - + Thread.currentThread()); - } - - while (_writer != null) { - try { - wait(); - } catch (InterruptedException e) { - notifyAll(); - } - } - - _readers.add(Thread.currentThread()); - } - - /** - * Releases the lock for reading. Note: This implementation assumes that - * the lock has already been acquired for reading previously. - * - * @throws IllegalStateException Thrown when the lock was not acquired by - * this thread. - */ - public synchronized void releaseRead() { - if (!_readers.remove(Thread.currentThread())) { - throw new IllegalStateException( - "Cannot release read lock because current thread has not acquired it."); - } - - if (_readers.size() == 0) { - notifyAll(); - } - } - - /** - * Acquires the lock for writing. This call will block until the lock has - * been acquired. - * - * @throws IllegalStateException Thrown if the read or write lock is - * already acquired. - */ - public synchronized void acquireWrite() { - if (_writer == Thread.currentThread()) { - throw new IllegalStateException( - "Trying to acquire a write lock while already holding the write lock: " - + Thread.currentThread()); - } - - if (_readers.contains(Thread.currentThread())) { - throw new IllegalStateException( - "Trying to acquire a write lock while already holding the read lock: " - + Thread.currentThread()); - } - - // wait until there are no more writers and no more - // readers - while ((_writer != null) || (_readers.size() > 0)) { - try { - wait(); - } catch (InterruptedException e) { - notifyAll(); - } - } - - _writer = Thread.currentThread(); - - // notification not necessary since all writers and - // readers are now blocked by this thread. - } - - /** - * Releases the lock for writing. - * - * @throws IllegalStateException Thrown when the lock was not acquired. - */ - public synchronized void releaseWrite() { - if (_writer != Thread.currentThread()) { - throw new IllegalStateException( - "Cannot release write lock because it was not acquired. "); - } - - _writer = null; - notifyAll(); - } -} diff --git a/trunk/support/general/src/main/java/org/wamblee/concurrency/package.html b/trunk/support/general/src/main/java/org/wamblee/concurrency/package.html deleted file mode 100644 index 405a12a1..00000000 --- a/trunk/support/general/src/main/java/org/wamblee/concurrency/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - wamblee.org - - - -This package provides utilities for dealing with concurrency. - - - -@since - - - - diff --git a/trunk/support/general/src/main/java/org/wamblee/conditions/package.html b/trunk/support/general/src/main/java/org/wamblee/conditions/package.html deleted file mode 100644 index 3d489d60..00000000 --- a/trunk/support/general/src/main/java/org/wamblee/conditions/package.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - wamblee.org - - - -This package provides some basic support classes for checking boolean conditions -on objects. - - - -@since - - - - diff --git a/trunk/support/general/src/main/java/org/wamblee/general/BeanKernel.java b/trunk/support/general/src/main/java/org/wamblee/general/BeanKernel.java deleted file mode 100644 index d05eef3d..00000000 --- a/trunk/support/general/src/main/java/org/wamblee/general/BeanKernel.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.general; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wamblee.io.ClassPathResource; -import org.wamblee.io.InputResource; - -/** - * The standard means to obtain the bean factory. This works by reading a - * property {@value #BEAN_FACTORY_CLASS} from a property file named - * {@value #BEAN_KERNEL_PROP_FILE} from the class path. This property identifies - * the bean factory implementation to use. The configured bean factory must have - * a no-arg constructor. - */ -public final class BeanKernel { - - private static final Log LOG = LogFactory.getLog(BeanKernel.class); - - /** - * Bean factory kernel properties file. - */ - private static final String BEAN_KERNEL_PROP_FILE = "org.wamblee.beanfactory.properties"; - - /** - * Name of the property to define the name of the bean factory class to use. - * THis class must have a public default constructor. - */ - private static final String BEAN_FACTORY_CLASS = "org.wamblee.beanfactory.class"; - - /** - * Cached bean factory. - */ - private static BeanFactory BEAN_FACTORY; - - /** - * Disabled constructor. - * - */ - private BeanKernel() { - // Empty - } - - /** - * Overrides the default mechanism for looking up the bean factory by - * specifying it yourself. - * - * @param aOverride - * Override bean factory. - */ - public static void overrideBeanFactory(BeanFactory aOverride) { - BEAN_FACTORY = aOverride; - } - - /** - * Gets the bean factory. - * - * @return Bean factory. - */ - public static BeanFactory getBeanFactory() { - synchronized (BeanFactory.class) { - if (BEAN_FACTORY == null) { - BEAN_FACTORY = lookupBeanFactory(BEAN_KERNEL_PROP_FILE); - } - } - return BEAN_FACTORY; - } - - /** - * Lookup the bean factory based on the properties file. - * - * @return Bean factory. - */ - static BeanFactory lookupBeanFactory(String aPropertyFilename) { - InputResource resource = new ClassPathResource(aPropertyFilename); - InputStream is; - try { - is = resource.getInputStream(); - } catch (IOException e) { - throw new BeanFactoryException("Cannot open resource " + resource, - e); - } - try { - Properties props = new Properties(); - props.load(is); - String className = props.getProperty(BEAN_FACTORY_CLASS); - Class beanFactory = Class.forName(className); - return (BeanFactory) beanFactory.newInstance(); - } catch (Exception e) { - throw new BeanFactoryException("Cannot read from resource " - + resource, e); - } finally { - try { - is.close(); - } catch (IOException e) { - // last resort cannot do much now. - LOG.error("Error closing resource " + resource); - } - } - } -} diff --git a/trunk/support/general/src/main/java/org/wamblee/general/ClassLoaderUtils.java b/trunk/support/general/src/main/java/org/wamblee/general/ClassLoaderUtils.java deleted file mode 100644 index 5275e159..00000000 --- a/trunk/support/general/src/main/java/org/wamblee/general/ClassLoaderUtils.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2006 the original author or authors. - * - * 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.wamblee.general; - -import java.io.IOException; -import java.io.File; -import java.net.URLClassLoader; -import java.net.URL; -import java.lang.reflect.Method; - -/** - * Utility for working with the class loader. Based on the ClassPathHacker - * example found on the internet. - */ -public class ClassLoaderUtils { - - // No logging in this class to keep the required class libraries - // limited to the standard java classes. This allows use of the - // utilities in an environment with a very limited classpath. - - private static final String JAR_SUFFIX = ".jar"; - - /** - * Adds all jars in the given directory to the class path. - * @param aDirectory Directory. - * @throws IOException - */ - public static void addJarsInDirectory(File aDirectory) throws IOException { - System.out.println("directory '" + aDirectory + "'"); - - for (File aFile : aDirectory.listFiles()) { - System.out - .println("Considering '" + aFile.getCanonicalPath() + "'"); - if (aFile.getName().toLowerCase().endsWith(JAR_SUFFIX)) { - System.out.println("Adding '" + aFile.getCanonicalPath() - + "' to classpath."); - addFile(aFile); - } - } - } - - /** - * Adds a file to the classpath. - * @param aFilename Filename to add. - * @throws IOException - */ - public static void addFile(String aFilename) throws IOException { - File f = new File(aFilename); - addFile(f); - } - - /** - * Adds a file to the classpath. - * @param aFile File to add. - * @throws IOException - */ - public static void addFile(File aFile) throws IOException { - addURL(aFile.toURL()); - } - - /** - * Adds a url to the classpath. - * @param aUrl Url to add. - * @throws IOException - */ - public static void addURL(URL aUrl) throws IOException { - - URLClassLoader sysloader = (URLClassLoader) ClassLoader - .getSystemClassLoader(); - Class sysclass = URLClassLoader.class; - - try { - Method method = sysclass.getDeclaredMethod("addURL", new Class[]{ URL.class } ); - method.setAccessible(true); - method.invoke(sysloader, new Object[] { aUrl }); - } catch (Throwable t) { - t.printStackTrace(); - throw new IOException( - "Error, could not add URL to system classloader"); - } - - } - -} diff --git a/trunk/support/general/src/main/java/org/wamblee/general/package.html b/trunk/support/general/src/main/java/org/wamblee/general/package.html deleted file mode 100644 index 042270f2..00000000 --- a/trunk/support/general/src/main/java/org/wamblee/general/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - wamblee.org - - - -This package provides several general purpose support classes. - - - -@since - - - - diff --git a/trunk/support/general/src/main/java/org/wamblee/io/ClassPathResource.java b/trunk/support/general/src/main/java/org/wamblee/io/ClassPathResource.java deleted file mode 100644 index 32014a10..00000000 --- a/trunk/support/general/src/main/java/org/wamblee/io/ClassPathResource.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.io; - -import java.io.IOException; -import java.io.InputStream; - -/** - * Represents an input resource in the classpath. - */ -public class ClassPathResource implements InputResource { - /** - * Resource name. - */ - private String _resource; - - /** - * Construct the class path resource. - * - * @param aResource - * Resource - */ - public ClassPathResource(String aResource) { - _resource = aResource; - } - - /* - * (non-Javadoc) - * - * @see org.wamblee.io.InputResource#getInputStream() - */ - public InputStream getInputStream() throws IOException { - InputStream stream = Thread.currentThread().getContextClassLoader() - .getResourceAsStream(_resource); - if (stream == null) { - throw new IOException("Class path resource '" + _resource - + "' not found."); - } - return stream; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - public String toString() { - return "ClassPathResource(" + _resource + ")"; - } -} diff --git a/trunk/support/general/src/main/java/org/wamblee/io/package.html b/trunk/support/general/src/main/java/org/wamblee/io/package.html deleted file mode 100644 index 2023c07b..00000000 --- a/trunk/support/general/src/main/java/org/wamblee/io/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - wamblee.org - - - -This package provides several support utilities for IO related functionality. - - - -@since - - - - diff --git a/trunk/support/general/src/main/java/org/wamblee/observer/Observable.java b/trunk/support/general/src/main/java/org/wamblee/observer/Observable.java deleted file mode 100644 index 2980afaf..00000000 --- a/trunk/support/general/src/main/java/org/wamblee/observer/Observable.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.observer; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.TreeMap; - -import org.apache.log4j.Logger; - -/** - * Implements subscription and notification logic for an observer pattern. This - * class is thread safe. - */ -public class Observable { - - private static final Logger LOGGER = Logger.getLogger(Observable.class); - - /** - * Observable. - */ - private ObservableType _observable; - - /** - * Used to notify observers. - */ - private ObserverNotifier _notifier; - - /** - * Map of subscription to observer. - */ - private Map> _observers; - - /** - * Counter for subscriptions. Holds the next subscription. - */ - private long _counter; - - /** - * Constructs the observable. - * - * @param aObservable - * Observable this instance is used for. - * @param aNotifier - * Object used for implementing notification of listeners. - */ - public Observable(ObservableType aObservable, - ObserverNotifier aNotifier) { - _observable = aObservable; - _notifier = aNotifier; - _observers = new TreeMap>(); - _counter = 0; - } - - /** - * Subscribe an obvers. - * - * @param aObserver - * Observer to subscribe. - * @return Event Event to send. - */ - public synchronized long subscribe(Observer aObserver) { - long subscription = _counter++; // integer rage is so large it will - // never roll over. - _observers.put(subscription, aObserver); - return subscription; - } - - /** - * Unsubscribe an observer. - * - * @param aSubscription - * Subscription which is used - * @throws IllegalArgumentException - * In case the subscription is not known. - */ - public synchronized void unsubscribe(long aSubscription) { - Object obj = _observers.remove(aSubscription); - if (obj == null) { - throw new IllegalArgumentException("Subscription '" + aSubscription - + "'"); - } - } - - /** - * Gets the number of subscribed observers. - * - * @return Number of subscribed observers. - */ - public int getObserverCount() { - return _observers.size(); - } - - /** - * Notifies all subscribed observers. - * - * @param aEvent - * Event to send. - */ - public void send(Event aEvent) { - // Make sure we do the notification while not holding the lock to avoid - // potential deadlock - // situations. - List> observers = new ArrayList>(); - synchronized (this) { - observers.addAll(_observers.values()); - } - for (Observer observer : observers) { - _notifier.update(observer, _observable, aEvent); - } - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#finalize() - */ - @Override - protected void finalize() throws Throwable { - if (_observers.size() > 0) { - LOGGER - .error("Still observers registered at finalization of observer!"); - for (Observer observer : _observers.values()) { - LOGGER.error(" observer: " + observer); - } - } - - super.finalize(); - } - -} diff --git a/trunk/support/general/src/main/java/org/wamblee/observer/package.html b/trunk/support/general/src/main/java/org/wamblee/observer/package.html deleted file mode 100644 index 35b6c3b0..00000000 --- a/trunk/support/general/src/main/java/org/wamblee/observer/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - wamblee.org - - - -This package provides support for the observer pattern. - - - -@since - - - - diff --git a/trunk/support/general/src/main/java/org/wamblee/persistence/Persistent.java b/trunk/support/general/src/main/java/org/wamblee/persistence/Persistent.java deleted file mode 100644 index 57faf95e..00000000 --- a/trunk/support/general/src/main/java/org/wamblee/persistence/Persistent.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.persistence; - -import java.io.Serializable; - -/** - * Interface for persistent objects. This defines required functionality for all objects - * that are persisted. - * - * Objects that implement this interface and which implement - * {@link java.lang.Object#equals(java.lang.Object)} - * should exclude the primary key and version from determining equality. - */ -public interface Persistent { - - /** - * Gets the primary key. - * @return Primary key. - * @see #setPrimaryKey(Serializable) - */ - Serializable getPrimaryKey(); - - /** - * Sets the primary key. - * @param aKey Primary key. - * @see #getPrimaryKey() - */ - void setPrimaryKey(Serializable aKey); - - /** - * Gets the version. - * @return Version. - * @see #setPersistedVersion(int) - */ - int getPersistedVersion(); - - /** - * Sets the version. - * @param aVersion Version. - * @see #getPersistedVersion() - */ - void setPersistedVersion(int aVersion); -} diff --git a/trunk/support/general/src/main/java/org/wamblee/persistence/package.html b/trunk/support/general/src/main/java/org/wamblee/persistence/package.html deleted file mode 100644 index cdca295e..00000000 --- a/trunk/support/general/src/main/java/org/wamblee/persistence/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - wamblee.org - - - -This package provides support for persistence. - - - -@since - - - - diff --git a/trunk/support/general/src/main/java/org/wamblee/xml/ClasspathUriResolver.java b/trunk/support/general/src/main/java/org/wamblee/xml/ClasspathUriResolver.java deleted file mode 100644 index ba2d875c..00000000 --- a/trunk/support/general/src/main/java/org/wamblee/xml/ClasspathUriResolver.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.xml; - -import java.io.IOException; - -import javax.xml.transform.Source; -import javax.xml.transform.TransformerException; -import javax.xml.transform.URIResolver; -import javax.xml.transform.stream.StreamSource; - -import org.wamblee.io.ClassPathResource; -import org.wamblee.io.InputResource; - -/** - * URI resolver that resolves stylesheets through the classpath. - */ -public class ClasspathUriResolver implements URIResolver { - - /** - * Constructs the resolver. - * - */ - public ClasspathUriResolver() { - // Empty. - } - - /* - * (non-Javadoc) - * - * @see javax.xml.transform.URIResolver#resolve(java.lang.String, - * java.lang.String) - */ - public Source resolve(String aHref, String aBase) - throws TransformerException { - InputResource xslt = new ClassPathResource(aHref); - try { - return new StreamSource(xslt.getInputStream()); - } catch (IOException e) { - throw new TransformerException( - "Could not get XSLT style sheet in classpath '" + aHref - + "'", e); - } - } - -} diff --git a/trunk/support/general/src/main/java/org/wamblee/xml/package.html b/trunk/support/general/src/main/java/org/wamblee/xml/package.html deleted file mode 100644 index 5d1c9e81..00000000 --- a/trunk/support/general/src/main/java/org/wamblee/xml/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - wamblee.org - - - -This package provides support utilities for XML processing. - - - -@since - - - - diff --git a/trunk/support/general/src/main/resources/log4j.properties b/trunk/support/general/src/main/resources/log4j.properties deleted file mode 100644 index b953f9b3..00000000 --- a/trunk/support/general/src/main/resources/log4j.properties +++ /dev/null @@ -1,56 +0,0 @@ - -############################################################################################ -# Default configuration file for log4j. -# -# This properties file is used if no other configuration if log4j is done explicitly. -############################################################################################ - - -# Root logger reports everything and uses the console appender -log4j.rootLogger=ERROR, console - -# Log level for wamblee.org -log4j.logger.org.wamblee=INFO -log4j.logger.org.wamblee.usermgt.UserAdministrationImplTest=INFO -log4j.logger.org.wamblee.security.authorization=ERROR -log4j.logger.org.wamblee.cache=INFO -log4j.logger.org.wamblee.crawler=DEBUG - -log4j.logger.org.springframework=ERROR -log4j.logger.net.sf.ehcache=WARN - -# Default log level for hibernate -log4j.logger.org.hibernate=ERROR -log4j.logger.org.hibernate3=ERROR - -log4j.appender.console=org.apache.log4j.ConsoleAppender -log4j.appender.console.layout=org.apache.log4j.PatternLayout -log4j.appender.console.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n - -###################################################################################### -# Hibernate SQL logging, switch the log level to DEBUG to see the output. -###################################################################################### - -log4j.logger.org.wamblee.test.SpringTestCase=ERROR, console -log4j.additivity.org.wamblee.test.SpringTestCase=false - -# Logging for queries. -log4j.logger.org.hibernate.SQL=ERROR, sql -log4j.additivity.org.hibernate.SQL=false - -# Logging for query parameters and return values. -log4j.logger.org.hibernate.type=ERROR, sqltype -log4j.additivity.org.hibernate.type=false - -# Appender for the queries -log4j.appender.sql=org.apache.log4j.ConsoleAppender -log4j.appender.sql.layout=org.apache.log4j.PatternLayout -log4j.appender.sql.layout.ConversionPattern=%n%-4r [%t] SQL: %x - %m%n - -# Appender to show the actual parameters and return values of the queries. -log4j.appender.sqltype=org.apache.log4j.ConsoleAppender -log4j.appender.sqltype.layout=org.apache.log4j.PatternLayout -log4j.appender.sqltype.layout.ConversionPattern=%-4r [%t] SQL: %x - %m%n - - - diff --git a/trunk/support/general/src/test/java/org/wamblee/io/ClassPathResourceTest.java b/trunk/support/general/src/test/java/org/wamblee/io/ClassPathResourceTest.java deleted file mode 100644 index 70b05ab5..00000000 --- a/trunk/support/general/src/test/java/org/wamblee/io/ClassPathResourceTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.io; - -import java.io.IOException; -import java.io.InputStream; - - -import junit.framework.TestCase; - -/** - * Tests for the classpath resource. - */ -public class ClassPathResourceTest extends TestCase { - - /** - * Loads an existing resource from the class path. Verifies it is found. - * - */ - public void testResourceFound() throws IOException { - ClassPathResource resource = new ClassPathResource( - "org/wamblee/io/myresource.txt"); - InputStream is = resource.getInputStream(); - String data = FileSystemUtils.read(is); - assertEquals("This is my resource", data); - } - - /** - * Loads a non-existing resource from the class path. Verifies that an IO - * exception is thrown. - * - */ - public void testResourceNotFound() { - try { - ClassPathResource resource = new ClassPathResource( - "org/wamblee/io/myresource-nonexistent.txt"); - InputStream is = resource.getInputStream(); - } catch (IOException e) { - return; // ok - } - fail(); - } -} diff --git a/trunk/support/general/src/test/java/org/wamblee/io/TestResource.java b/trunk/support/general/src/test/java/org/wamblee/io/TestResource.java deleted file mode 100644 index ec28290f..00000000 --- a/trunk/support/general/src/test/java/org/wamblee/io/TestResource.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2005 the original author or authors. - * - * 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.wamblee.io; - -import java.io.File; - - -/** - * Test resource for locating resources in the classpath. - */ -public class TestResource extends FileResource { - - /** - * Test class name. - * @param aTestClass Test class. - * @param aName Name of the file to look for. - */ - public TestResource(Class aTestClass, String aName) { - super(getFile(aTestClass, aName)); - } - - /** - * Computes the file path of the file to look for. - * @param aClass Test class name. - * @param aName Name of the file. - * @return File. - */ - private static File getFile(Class aClass, String aName) { - File dir = FileSystemUtils.getTestInputDir(aClass); - return new File(dir, aName); - } - -} diff --git a/trunk/support/general/src/test/resources/org/wamblee/cache/ehcache.xml b/trunk/support/general/src/test/resources/org/wamblee/cache/ehcache.xml deleted file mode 100644 index 694184ed..00000000 --- a/trunk/support/general/src/test/resources/org/wamblee/cache/ehcache.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - diff --git a/trunk/support/general/src/test/resources/org/wamblee/general/beanRefContext.xml b/trunk/support/general/src/test/resources/org/wamblee/general/beanRefContext.xml deleted file mode 100644 index a453f3de..00000000 --- a/trunk/support/general/src/test/resources/org/wamblee/general/beanRefContext.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - org/wamblee/general/spring1.xml - - - - - \ No newline at end of file diff --git a/trunk/support/general/src/test/resources/org/wamblee/general/beankernel-wrong.properties b/trunk/support/general/src/test/resources/org/wamblee/general/beankernel-wrong.properties deleted file mode 100644 index e54de19d..00000000 --- a/trunk/support/general/src/test/resources/org/wamblee/general/beankernel-wrong.properties +++ /dev/null @@ -1,2 +0,0 @@ - -org.wamblee.beanfactory.class=org.wamblee.general.TestBeanFactoryBla diff --git a/trunk/support/general/src/test/resources/org/wamblee/general/beankernel.properties b/trunk/support/general/src/test/resources/org/wamblee/general/beankernel.properties deleted file mode 100644 index e08cf398..00000000 --- a/trunk/support/general/src/test/resources/org/wamblee/general/beankernel.properties +++ /dev/null @@ -1,2 +0,0 @@ - -org.wamblee.beanfactory.class=org.wamblee.general.TestBeanFactory diff --git a/trunk/support/general/src/test/resources/org/wamblee/general/spring1.xml b/trunk/support/general/src/test/resources/org/wamblee/general/spring1.xml deleted file mode 100644 index 52ec0bec..00000000 --- a/trunk/support/general/src/test/resources/org/wamblee/general/spring1.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - hello - - - \ No newline at end of file diff --git a/trunk/support/general/src/test/resources/org/wamblee/io/myresource.txt b/trunk/support/general/src/test/resources/org/wamblee/io/myresource.txt deleted file mode 100644 index c72f1105..00000000 --- a/trunk/support/general/src/test/resources/org/wamblee/io/myresource.txt +++ /dev/null @@ -1 +0,0 @@ -This is my resource \ No newline at end of file diff --git a/trunk/support/general/src/test/resources/org/wamblee/xml/output-reportToHtml-report.xml b/trunk/support/general/src/test/resources/org/wamblee/xml/output-reportToHtml-report.xml deleted file mode 100644 index 40f29fd3..00000000 --- a/trunk/support/general/src/test/resources/org/wamblee/xml/output-reportToHtml-report.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - KiSS crawler report - - -

KiSS crawler report

-

Successfully recorded programs

- - - - - - - -
23:25 - 00:10: Wintertijd (Nederland - 1/Documentaire)
-
- Some description MINSK - De presidentsverkiezingen - in Wit-Rusland zijn zondag met ruime cijfers gewonnen door - zittend president Aleksandr Loekasjenko. Dat bleek zondag uit - exitpolls uitgevoerd in opdracht van het totalitaire regime. Het - staatshoofd zou kunnen rekenen op ruim 82 procent van de - stemmen. Volgens de eerste gedeeltelijke uitslagen zou - Loekasjenko zelfs kunnen rekenen op bijna 89 procent. -
-
-
-

-

Possibly interesting programs

-

- - - - - - - -
23:30 - 00:15: Brainiac (Discovery Channel/science)
-
- Humor -
-
-
-

-

Category: horror

-

- - - - - - - -
23:30 - 00:15: Andere tijden (Nederland 1/docu)
-
- Documentaire -
-
-
-

- - diff --git a/trunk/support/general/src/test/resources/org/wamblee/xml/report.xml b/trunk/support/general/src/test/resources/org/wamblee/xml/report.xml deleted file mode 100644 index 391aea94..00000000 --- a/trunk/support/general/src/test/resources/org/wamblee/xml/report.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - Wintertijd - Some description MINSK - De presidentsverkiezingen in Wit-Rusland zijn zondag met ruime cijfers gewonnen door zittend president Aleksandr Loekasjenko. Dat bleek zondag uit exitpolls uitgevoerd in opdracht van het totalitaire regime. Het staatshoofd zou kunnen rekenen op ruim 82 procent van de stemmen. Volgens de eerste gedeeltelijke uitslagen zou Loekasjenko zelfs kunnen rekenen op bijna 89 procent. - Documentaire - Nederland 1 - - 23:25 - 00:10 - - - - - - - Brainiac - Humor - science - Discovery Channel - - 23:30 - 00:15 - - - - - Andere tijden - Documentaire - docu - Nederland 1 - - 23:30 - 00:15 - - - - - - - diff --git a/trunk/support/general/src/test/resources/org/wamblee/xml/reportToHtml-invalid.xsl b/trunk/support/general/src/test/resources/org/wamblee/xml/reportToHtml-invalid.xsl deleted file mode 100644 index 104234e1..00000000 --- a/trunk/support/general/src/test/resources/org/wamblee/xml/reportToHtml-invalid.xsl +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - KiSS crawler report - - -

KiSS crawler report

- - -

Possibly interesting programs

- -
- - No suitable programs found - - - - -
- - -

- - - -
-
-

-
- - -

- - - Successfully recorded programs - - - - Already recorded programs - - - - Conflicts with other recorded programs - - - - Programs that could not be recorded for - technical reasons. - - - -

-
- - - - - : - - (/) - - - - -
- - - -
- - - - -
- - - - - - - - - - - -

Category:

- -
-
- diff --git a/trunk/support/general/src/test/resources/org/wamblee/xml/reportToHtml-nonwellformed.xsl b/trunk/support/general/src/test/resources/org/wamblee/xml/reportToHtml-nonwellformed.xsl deleted file mode 100644 index 03d19083..00000000 --- a/trunk/support/general/src/test/resources/org/wamblee/xml/reportToHtml-nonwellformed.xsl +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - KiSS crawler report - - -

KiSS crawler report

- - -

Possibly interesting programs

- - - - No suitable programs found - - - - -
- - -

- - - -
-
-

-
- - -

- - - Successfully recorded programs - - - - Already recorded programs - - - - Conflicts with other recorded programs - - - - Programs that could not be recorded for - technical reasons. - - - -

-
- - - - - : - - (/) - - - - -
- - - -
- - - - -
- - - - - - - - - - - -

Category:

- -
-
- diff --git a/trunk/support/general/src/test/resources/org/wamblee/xml/reportToHtml.xsl b/trunk/support/general/src/test/resources/org/wamblee/xml/reportToHtml.xsl deleted file mode 100644 index ce113d5a..00000000 --- a/trunk/support/general/src/test/resources/org/wamblee/xml/reportToHtml.xsl +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - KiSS crawler report - - -

KiSS crawler report

- - -

Possibly interesting programs

- -
- - No suitable programs found - - - - -
- - -

- - - -
-
-

-
- - -

- - - Successfully recorded programs - - - - Already recorded programs - - - - Conflicts with other recorded programs - - - - Programs that could not be recorded for - technical reasons. - - - -

-
- - - - - : - - (/) - - - - -
- - - -
- - - - -
- - - - - - - - - - - -

Category:

- -
-
- diff --git a/trunk/support/general/src/test/resources/org/wamblee/xml/reportToHtml2.xsl b/trunk/support/general/src/test/resources/org/wamblee/xml/reportToHtml2.xsl deleted file mode 100644 index 2cec21fe..00000000 --- a/trunk/support/general/src/test/resources/org/wamblee/xml/reportToHtml2.xsl +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - KiSS crawler report - - -

KiSS crawler report

- - -

Possibly interesting programs

- -
- - No suitable programs found - - - - -
- - -

- - - -
-
-

-
- - -

- - - Successfully recorded programs - - - - Already recorded programs - - - - Conflicts with other recorded programs - - - - Programs that could not be recorded for - technical reasons. - - - -

-
- - - - - : - - (/) - - - - -
- - - -
- - - - -
- - - - - - - - - - - -

Category:

- -
-
- diff --git a/trunk/support/general/src/test/resources/org/wamblee/xml/reportToText.xsl b/trunk/support/general/src/test/resources/org/wamblee/xml/reportToText.xsl deleted file mode 100644 index c1f7023c..00000000 --- a/trunk/support/general/src/test/resources/org/wamblee/xml/reportToText.xsl +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - Hello world! - - - diff --git a/trunk/support/general/src/test/resources/org/wamblee/xml/utilities.xsl b/trunk/support/general/src/test/resources/org/wamblee/xml/utilities.xsl deleted file mode 100644 index 0dd7e62b..00000000 --- a/trunk/support/general/src/test/resources/org/wamblee/xml/utilities.xsl +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/trunk/support/spring/src/main/java/org/wamblee/persistence/hibernate/package.html b/trunk/support/spring/src/main/java/org/wamblee/persistence/hibernate/package.html deleted file mode 100644 index 6f14b9f2..00000000 --- a/trunk/support/spring/src/main/java/org/wamblee/persistence/hibernate/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - wamblee.org - - - -This package provides support utilities for persistence with hibernate. - - - -@since - - - -