čtvrtek 14. října 2010

Fixing Line Terminators for Cygwin CVS

I have to use a Windows operating system (unfortunately :-)) and CVS in my current job. Thanks to the Cygwin, I can work with Windows almost as effectively as in Linux. The CVS (CVSNT) installation in Windows and other CVS tools installed in on my Windows box (TortoiseCVS, Eclipse) stores the CVS files with CRLF line terminators (EOLs). The Cygwin CVS client requires the classic UNIX LT terminator. Fortunatelly, the Windows CVS clients can read the UNIX-way text files, too. So, I have creates a simple bash script to forx this problem:
#!/bin/sh
find . -type f -path '*/CVS/*' -print0 | xargs -0 dos2unix 
Hope, someone may find it useful.

úterý 31. srpna 2010

JasperReports PDF Font Mapping

Are your font bold and italic font properties lost when you export your JasperReports report into the PDF? Do you wander, why PDF preview in the iReport has all fonts right? Check this link out, mate: http://sites.google.com/site/xmedeko/code/misc/jasperreports-pdf-font-mapping

čtvrtek 5. srpna 2010

JBoss and HSQLDB 2.0.0

HSQLBD 2.0 GA has been released on 7 June 2010 with a lot of new cool features. I have needed some of them for my JBoss 5.1.0GA, so I have just replaced the library common/lib/hsqldb.jar and voilà, it runs almost without any problem (Hibernate/JPA usage) as before. I have made just one small change, see bellow. Even the HSQLDB Database Manager starts from JMX console. My personal feeling is that the version 2.0 is a little bit faster than 1.8.0, but I have not made any benchmarks.

The HSQLDB 2.0 upgrade notes:
  1. In my import.sql I had to change all timestamp formats from '2010-08-06 8:00:00' to '2010-08-06 08:00:00', i.e. I had to zero pad the hours into two decimal places.

středa 21. července 2010

ZK 3.6 CSRF Protection

Unfortunately, ZK Web Framework version 3.6 and earlier lack any CSRF protection. i have created a very basic event filter to tackle this issue. Hope, someone else may find it useful, see http://sites.google.com/site/xmedeko/code/zk-web-framework/zk-3-6-csrf-protection. It is just a very first version, leave me a comment, if you have some suggestion.

Update 15th Sep 2010: Improved protection and logging.

středa 14. července 2010

ZK - Converting Null Values

A common problem in database programming is to display some meaningful labels instead of NULL values in the list of database rows. Fortunately, ZK Web Framework, offers a comfortable TypeConverter class to address this issue. I have created a general type converter NullToLabelConverter to convert NULL values into any localised text. Hope, someone else may find it useful, see http://sites.google.com/site/xmedeko/code/zk-web-framework/nulltolabelconverter.

středa 19. května 2010

ZK Logging in ZUL zscript Code

I have created a very simple class to simplify getting Java logger for the ZUL file (see ZK Web Framework). It is targeted especially for the JBoss logging org.jboss.logging.Logger, but can be easily changed for java.util.logging or any other logging library. Hope, someone else may find it useful, see http://sites.google.com/site/xmedeko/code/zk-web-framework/zul-logging.

středa 7. dubna 2010

ZK and Very Long Strings

When I was working with ZK Web Framework, I have needed to display just a beginning of a very long String in a listbox. I have created a new type converter StringTrimConverter, which trims a string to the specified length. Hope, someone else may find it useful, see http://sites.google.com/site/xmedeko/code/zk-web-framework/stringtrimconverter.