Apache Ant Recipes for Web Developers
by James Fuller
ISBN Number: 978-1-60-746047-3
| Publisher: self published with Fastpencil
Free Download Book |
Download Source Code |
Preface |
Table of Contents |
Recipe Index |
About the Author
Download Book
download the following versions of the book for free.
If you found this book valuable consider donating.
Download Book Source Code
All source was developed and tested on linux and mac osx
all chapters code[~40mb]
| chp1
| chp2
| chp3
| chp4
| chp5
Book Preface
This book is a collection of Apache Ant recipes that I have gathered up over the years whilst doing Web development. The book is not intended to be an introduction to using Apache Ant, nor does it pretend to be a complete treatment on using Ant with the various technologies that I have presented. You will still need to refer to Ant's rather good manual or any of the other proper Ant books to learn 'how to use ant'.
This experimental book was a side project to investigate how to 'self publish' a small book. Doing a book by oneself is a powerful reminder of how difficult it is to create something of quality when you do not have a team of talented people behind you doing the copy editing, reviewing, graphics and all the inevitable checking that ends up making one look professional. Hence, the most difficult decision with self publishing was acknowledging that I had to be satisfied with much less then I am normally comfortable with.
I hope that readers will look past my foibles as a 'newbie' book publisher and get some value out of the Ant Recipes contained within.
-- James Fuller
Table of Contents
- Preface
- Text Recipes
- Find and Replace
- Managing Encoding and Whitespace
- Handling Unicode
- Facilitating Localisation
- Advanced Text Processing
- Conclusion
- Database Recipes
- Mysql Import
- Accessing SQL
- The SQL Task
- A note about XML Database
- Conclusion
- XML Recipes
- The Basics
- Working with XSLT
- Validating XML
- Open Office XML Documents
- Source Code Bonus: Advanced XML Databases
- Conclusion
- Web Recipes
- Working with HTTP
- Consistent and Clean HTML
- Optimizing the Web
- Other Web Techniques
- Source Code Bonus: Web Services
- Conclusion
- Case Study: Working with Multilingual Websites
- Critical Concepts
- Overview of Example Multilingual Site
- Requirements
- Running the Code
- Looking at the Code
- Conclusion
- Appendix
- License, Disclaimers and Copyrights
- 3rd party Licenses
- Installing Ant
- Ant Commandline Options
- Recipes Index
Recipe Index
- Page 9 - “Learn how to find and replace text”
- Page 11 - “Substitute tokens found in text using Ant native filter
functionality”
- Page 13 - “Create reusable sets of filters that perform token
replacement”
- Page 14 - “Create sophisticated find and replace pipelines”
- Page 17 - “Find and replace text using property expansion”
- Page 20 - ”Manage translation of end of line, carriage returns,
tabs, and end of file characters between operating systems”
- Page 21 - ”fix line ending encodings”
- Page 22 - ”compress a set of SQL statements”
- Page 22 - ”Output a specific encoding”
- Page 23 - “Preprocess source text files so that they are in the
correct encoding and format for the current operating system”
- Page 23 - “Process a set of text source files so all characters
are encoded using Unicode”
- Page 25 - “Task orientated unicode conversion”
- Page 27 - “Transform a set of source text files into a range of
language variants”
- Page 32 - “Advanced text processing with Jacson Ant Task”
- Page 35 - ”Manage import of csv delimited data into MySQL”
- Page 36 - ”Use the result of a SQL query as properties within your
Ant build”
- Page 37 - ”Execute SQL statements in Ant”
- Page 41 - ”Generate XML directly from your Ant scripts”
- Page 42 - ”Load external XML into Ant Properties”
- Page 45 - ”For loop processing in Ant”
- Page 46 - ”Perform update operations on existing XML
documents”
- Page 46 - ”How to include an XML document into another using
Xinclude”
- Page 52 - ”Use conditions to check what the XML Parser
supports"
- Page 53 - ”Simple XSLT Processing with Ant”
- Page 55 - ”More sophisticated XSLT processing”
- Page 56 - ”Generate documentation for your XSLT using
XSLTDoc”
- Page 59 - ”Generate a DTD for Ant markup”
- Page 60 - ”Validate XML using Ant’s built in facilities”
- Page 62 - ”Validate using schemavalidate Task”
- Page 64 - ”Get additional error information on XML errors using
xmllint”
- Page 64 - ”Get additional error information on XML errors using
rxp”
- Page 64 - ”Speed up the resolving of DTD by using catalogs”
- Page 66 - ”Speed up Xerces Schema validation through grammar
caching”
- Page 66 - ”Validate using Schematron”
- Page 67 - ”Use Jing and Namespace Routing Language to orchestrate
parallel and multiple schema validation”
- Page 69 - ”Use Jing to perform all major schema validation”
- Page 71 - ”Use Namespace Routing Language to control binding of
schema validation to XML Namespace”
- Page 72 - ”Use Namespace Routing Language to achieve concurrent
schema validation”
- Page 74 - ”applying an XSLT transformation to an
OpenDocument”
- Page 78 - ”transforming Docbook to HTML or WordML”
- Page 80 - ”Create sophisticated documentation using Docbook
XML"
- Page 83 - ”Check that a site is live and accessible”
- Page 84 - ”Perform a HTTP Get with Ant”
- Page 84 - ”Perform a HTTP Post”
- Page 85 - ”Perform a HTTP Put”
- Page 88 - ”FTP with Ant”
- Page 88 - ”Telnet with Ant”
- Page 88 - ”Email with Ant”
- Page 89 - ”Securely copy files between remote servers”
- Page 89 - ”Securely log onto a remote machine and execute a
command”
- Page 90 - ”Making Ant work with proxies”
- Page 94 - ”Validate xhtml, html, etc...”
- Page 95 - ”Create HTML pages from components using xinclude”
- Page 98 - ”Use ispell to spellcheck your html”
- Page 98 - ”Check that a distribution of files conforms to a
desired directory and filestructure”
- Page 100 - ”Clean up X/HTML with HTML Tidy”
- Page 102 - ”Clean up X/HTML with JTidy”
- Page 102 - ”Clean up X/HTML with TagSoup”
- Page 103 - ”Compress a set of HTML files”
- Page 105 - ”Optimising css with yui.compressor”
- Page 105 - ”Compacting JS with yui.compressor”
- Page 107 - ”Reduce the number of HTTP requests by concatenating JS
files”
- Page 107 - ”Measuring website performance with Apache
Benchmark”
- Page 110 - "Starting and stoping apache webserver"
- Page 112 - ”Check status of webserver, email and ftp server”
- Page 114 - ”Develop and deploy a Firefox toolbar”
- Page 115 - “Creating a web backup”
About the Author
James Fuller has been a professional developer for many years, working with several blue-chip software companies in both his native USA and in Europe. He has used Apache Ant for the best part of a decade in several software build solutions. He has also co-written a few technology-related books and writes articles focusing on XML technologies. He spends his free time playing with XML databases and XQuery. He is technical director for Webcomposite s.r.o. and Senior Engineer for MarkLogic can be reached at:
twitter: xquery
website: www.webcomposite.com
email: jim.fuller@webcomposite.com
License, Disclaimer, and Copyright
3rd party licenses can be viewed here
James Fuller © 2009, 2010 Copyright for Source Code, Book Text and Layout
Ian Cox © 2009, 2010 Copyright for Design of front and back cover
The source code examples for this book is released under the Creative Commons Attribution 3.0 Unported License. A copy of which can be obtained at http://creativecommons.org/licenses/by/3.0/ .
SOFTWARE CONTAINED IN 'ANT APACHE RECIPE FOR WEB DEVELOPERS' BOOK OR INCLUDED SOURCE CODE EXAMPLES IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Webcomposite s.r.o. |
jim.fuller@webcomposite.com