Skip to main content

Posts

Showing posts from 2009

Hacking Apache POI

In the near future, presumably, I'll have to read and process complex xlsx documents containing a lots of formulas. Jexcelapi can't even open those kinds documents, so I turned to Apache POI . Unfortunately, POI also have problems with some formulas becase support of this field is not fully laboured. [ Update 2010.03.10: After some experimentations I found that Apache POI can read and process new Excel ( xlsx ) documents including calculating very complex formulas: Basically, cell.getStringCellValue() gives the evaluated outcome. This way, I didn't have to hack POI. That's great!] I choosed to start two methods: Knowing exact static structure of the Excel template document, I do problematic calculations in the reader program itself, eliminating POI's formula support. I study Apache POI's internal structure and try to make up the missing functionality. Unfortunately, POI isn't amendable in a non-invasive way with registering components at certain extensi

Json-lib vs Hibernate

Subtitle: java.util.Date vs java.sql.Timestamp One of my projects has a data path where Hibernate entities are converted to Json objects by using json-lib . I have some special formatters, e.g. for Date objects for having an easy readable format instead of this: {"date":1,"day":4,"hours":1, "minutes":0,"month":0,"nanos":0, "seconds":0,"time":0,"timezoneOffset":-60,"year":70} A JsonConfig object can be suited by special formatters which later will be given to the fromObject method: JsonConfig cfg = new JsonConfig(); cfg.registerJsonValueProcessor( java.util.Date.class, new JsonValueProcessor() { private static final SimpleDateFormat SDF = new SimpleDateFormat("yyyy-MM-dd"); public Object processArrayValue(Object value, JsonConfig c) { return format((Date)value); } public Object processObjectValue( String key, Object v, JsonConfig c) { return format(

jxl.log

In an intranet production environment we have running a Glassfish v2 appserver with several J2EE applications which all use JexcelApi , a.k.a JXL, which is an open source library for accessing, generating or manipulating Microsoft Excel documents. We use version 2.6.3 of JXL because it's the recent one in the Maven repository which we use, however, at the official JXL site there are newer versions. Additionally we have log4j and Java Commons Logging (JCL), ignoring Glassfish's JSR-47 Java Util Logging (JUL) facility. Application #1 uses purely log4j and gets its log4j.xml config from a custom location. Application #2 runs Java Commons Logging with no explicite configuration file given, so JCL uses the default JUL facility of the appserver. Application #1 had been running for a long time without problems but when we installed #2 we realized that a jxl.log file had been created in the glassfish/domain/domain1/config directory and it's rapidly growing. As it happens, we

JUM VIII. - IX. - X.

In the recent months there were a few Java-related microconferences organized at Budapest. At the eighth occassion of the Java User Meeting (JUM) in January we had a presentation about OSGi by local guys and about Flex by Cornel Creanga from the Romanian Adobe office. I've read his blog and I must say life of an evangelist can be very cool (if there's no wife or girlfriend:)). Visiting Java and Adobe user groups all around in Europe, it's great. At the ninth occasion in March we had three presentations: introduction to the Maven build system, SOAP testing with SOAPui and various other components, and OLAP architectures. The latter was driven by the magnificant prezi presentation engine, which is a very young Hungarian startup project and which will be introduced soon at the Silicon Walley and I'm sure it will have a great success. Otherwise, I guess this time we beat down the highest participant number with about 40 attendees. At the tenth occassion we had a pr

Budapest Newtech Meetup

The originally planned programme of the January Budapest Newtech Meetup contained some interesting presentations like the smart 3D visualizer solution ( 3dForAll ) from a young Hungarian inventor or the Google App Engine which is an alternative server-side solution for those who don't have own server facilities. It can be used mainly for OpenSocial applications which is actual nowadays because of leader social network of Hungary (Wiw: Who is Who) had been announced to support opensocial applications in the near future. Further live demo would had been the Surface which is a Microsoft hardware but it had been also cancelled. The event had been organized this time in a small art movie near the Buda-side of the Margareth bridge. About 130 people were present, some of them couldn't fit into the room. The first demo was about the Zoomery application which is built on Microsoft Silverlight technology and used for deep-zooming a set of pictures or documents. Several kinds of docume