Thursday, October 1, 2009

XINS 3.0 fork at Github

Just recently, I've made our internal XINS fork available via:
The version is currently set at 3.0-alpha1-dev. This may become the official XINS 3.0 release at some point, or (some or all) changes may go into an official XINS release.

The most important changes in compared to mainstream XINS are:
  • Java 5-features, such as generics and foreach-loops (hence Java 5+ is required)
  • lots of utility functions are added, to simplify programming with XINS
  • various libraries are updated, such as Saxon (from 8 to 9) , JUnit (from 3 to 4), Xerces, etc.
  • a couple of previously deprecated members and classes are removed, most notably FastStringBuffer and FastStringWriter
  • deprecated various classes and members, such as the ElementBuilder class
  • upgraded from XSLT 1.0 to 2.0
  • the Element class now supports mixed content (PCDATA and child elements), an add(String) method has been added
This branch of XINS has been used in production for almost 3 years now, but you are not advised to use this code in production, as it has not gone through all the testing that is typically done for an official XINS release, across various platforms and Java versions.
Also note that not all of the changes in XINS 2.2/2.3 have been incorporated (yet).

The following things are still on my list of things to be done:
  1. clean the code up further
  2. get rid of all deprecation warnings by either resolving or suppressing them (whatever is more appropriate)
  3. further changing the code to use type-safe collections where possible, using generics
  4. possibly adding Commons Lang as a dependency, so that various utility methods, like TextUtils.isEmpty(String) can be deprecated (and later removed)
  5. change HttpClient (which is deprecated) based code with HttpComponents HttpClient based code
  6. get rid of Jakarta ORO, just use the J2SE regular expression-support that is available since J2SE 1.4
If you have any changes you would like to incorporate into (this branch of) XINS, fork the project at github. Using git, it is quite easy to merge different forks.

To be continued.

Tuesday, September 22, 2009

Weird error while executing LessCSS

This is really odd: I got the following output while running lessc on some .less files from an Apache Ant task:
-lesscss:
[003:221] MagicCam 0: Current process: java, Flash is loaded: no
[003:221] Error(magiccammac.cc:276): MagicCam 0: MagicCamOpen: Not an allowed process!
[000:002] MagicCam 0: Current process: java, Flash is loaded: no
[000:002] Error(magiccammac.cc:276): MagicCam 0: MagicCamOpen: Not an allowed process!
[000:001] MagicCam 1: Current process: java, Flash is loaded: no
[000:001] Error(magiccammac.cc:276): MagicCam 1: MagicCamOpen: Not an allowed process!
[000:002] MagicCam 1: Current process: java, Flash is loaded: no
[000:002] Error(magiccammac.cc:276): MagicCam 1: MagicCamOpen: Not an allowed process!
[lesscss] 0 file(s) transformed in 4 ms; 7 unmodified file(s) skipped.
Now I had it at a different point in the build process:
do-generate-headings:
Warning: Reference saxon.classpath has not been set at runtime, but was found during
build file parsing, attempting to resolve. Future versions of Ant may support
referencing ids defined in non-executed targets.
[xslt] Processing /Users/ernst/albizia/build/contentdb/pfizer/content/PreprocessedSite.xml to /Users/ernst/albizia/build/contentdb/pfizer/content/PageHeadings.ErigeronStrings.xml
[xslt] Loading stylesheet /Users/ernst/albizia/src/build-xslt/GeneratePageHeadings.xslt
[xmlvalidate2] 1 file(s) have been successfully validated.
[000:224] MagicCam 0: Current process: java, Flash is loaded: no
[000:224] Error(magiccammac.cc:276): MagicCam 0: MagicCamOpen: Not an allowed process!
[000:003] MagicCam 0: Current process: java, Flash is loaded: no
[000:003] Error(magiccammac.cc:276): MagicCam 0: MagicCamOpen: Not an allowed process!
[000:000] MagicCam 1: Current process: java, Flash is loaded: no
[000:001] Error(magiccammac.cc:276): MagicCam 1: MagicCamOpen: Not an allowed process!
[000:002] MagicCam 1: Current process: java, Flash is loaded: no
[000:002] Error(magiccammac.cc:276): MagicCam 1: MagicCamOpen: Not an allowed process!
There is a tiny bit of information here:

Tuesday, September 8, 2009

OptiPNG Ant task

OptiPNG is a tool for optimizing PNG images. And now, there's an Ant task for executing it from an Ant build file:
Mini-HOWTO for Linux/UNIX/Mac OS X systems, assuming you already have Apache Ant installed:
  1. download OptiPNG source code from SourceForge (TAR GZ file)
  2. execute: ./configure
  3. execute: make
  4. execute: sudo make install
    (enter your password if required); the command optipng is now installed in /usr/local/bin/
  5. download the optipng-ant-task source code from http://github.com/znerd/optipng-ant-task/downloads - take the latest version available (you can choose between a ZIP and a TAR GZ file)
  6. unpack the download file, this will create a new directory with an odd name like: znerd-optipng-ant-task-604de975b4cc4a1a2766e385c91b749318af038e (you may want to rename it to optipng-ant-task or so)
  7. in that directory, execute: ant
    this will compile the classes, run the available unit test and build the JAR file
Then you can use the Ant task from your own build file, for example as follows:
<taskdef name="optipng" classname="com.pensioenpage.jynx.optipng.OptiPNGTask" classpath="lib/optipng-ant-task.jar" />
<optipng dir="src/htdocs" todir="build/htdocs" />