Nice: A 100% pure Java PDF rendering library

posted 07:16PM Dec 13, 2007 with tags java opensource pdf by Lars Trieloff

Via DZone I found pdf-renderer, a 100% pure Java library for rendering PDF files. Unlike existing libraries like iText or FOP, which concentrate on creating and writing PDF files, this library allows to display PDF files on screen and conversion into images. This - together with the upcoming Java Runtime enhancements would make it possible to create an applet-equivalent of Adobe Flashpaper easily. pdf-renderer is LGPL-licensed, which makes it possible to embed it into proprietary applications, but not Apache projects.

Apple, give us Java 6!

posted 07:24PM Nov 03, 2007 with tags 13949712720901forosx apple java leopard by Lars Trieloff

If you see the string 13949712720901ForOSX in some weblogs in the next days, it means: Apple give us Java 6 for Mac OS X Leopard.

Observerations of the day

posted 05:58PM Oct 22, 2007 with tags farming java javascript jcr softwaredevlopment by Lars Trieloff

  • despite the name, Java is not made for Java Content Repository API, you need something more dynamic
  • Is there something like JSDoc for Rhino, that allows me to generate documentation for my Scriptable implementations automatically?
  • Farm Fetish
There are four times as many Americans living in urban than rural areas. There are four times as many people sucking back coffee in New York city alone than make a living farming. According to the Burea of Labor, there are just as many people employed in Architecture and Engineering as farming, hell, 3 million people working in Computer and Mathematical jobs. But when one of these "What does America think about culture" pieces comes on, do I ever see a mid-30's software engineer onscreen bitching about having to download BitTorrents of "The IT Crowd"?
  • In the web office market, Google docs and Google spreadsheets hold a market share of 92%. The report calls these "online collaborative productivity tools". Interesting segmentation.

DAX presentation from CocoonGT

posted 12:30PM Oct 05, 2007 with tags cocoon cocoongt2007 conference dax java javascript opensource rome xslt by Lars Trieloff

I just had my first presentation at this year's Cocoon GetTogether in the Rome Bioparco about DAX - Declarative API for XML. I've uploaded the slides to slideshare.net and would invite all other presenters to do the same and add their presentations to the newly created Cocoon group at slideshare.net

A Java API for REST

posted 11:58AM Feb 15, 2007 with tags api cocoon java rest softwaredevelopment xml by Lars Trieloff

There is a new JCP aiming to create a Java (TM) API for RESTful Web Services. The proposal was sumitted by Sun and is supported (among others by) Jérôme Louvel, creator of the RESTlet Java framework.

Interesting Commentary:

Pete Layey:
I hope they don’t screw it up (see JAX-WS).
Marc Hadley: provides a code example of what he thinks the API might look like. Looks good from my point of view

Steve Loughran:

It seems to me the people who have a better idea of what to do are the Cocoon folk and Team Netkernel, not the WS projects. Yet I suspect it will be the latter is the most interested, because clearly REST is winning the battle for hearts and minds, at least outside the enterprise. The trouble is, work on WS too long and you get corrupted, you start thinking of methods and operations, not remote state.
Indeed, as we are building REST applications with Cocoon, adhering to or integrating this API is an interesting point to watch. Stefan Tilkov:
First, we asked why he (Marc Hadley) feels a REST-specific JSR is needed, i.e. why Servlets and JSPs are not enough. We also questioned the spec’s wording about low-level APIs, and how one would go about developing RESTful web apps without a deep understanding of HTTP issues and design patterns. Marc replied that while the current APIs provide broad support for HTTP, they leave a lot of work to the developer that could be automated in a higher level API
Contains lots of other good references and quotes.

Top 10 Reasons to upgrade to Eclipse 3.3 M5 right now

posted 02:18PM Feb 11, 2007 with tags eclipse java softwaredevelopment tips by Lars Trieloff

Eclipse's last milestone for the 3.3 release is out for two days, and these are my top-10 reasons to upgrade:
  1. SWT libraries automatically found (since M4) - this eases deployment of SWT applications dramatically. No longer setting java.library.path, just one single dependency, easily expressed as a Maven 2 dependency
  2. System tray support added on Mac OS X (since M1, somehow workable since M4 - your starting class has to be in package org.eclipse.swt) - Now there is real cross-platform support for tray icons, notification area icons or menubar items
  3. Code clean up on save (since M3) - makes it easy to adhere to coding conventions without much manual formatting
  4. Text drag and drop in text editors (since M5) - very useful for manual reording of code
  5. Advanced tooltips (since M4) - tooltips can contain more than text
  6. New DateTime control (since M3) - date and time entry with improved usability
  7. Mozilla Everywhere (since M5) - when you need a controlled web browser control and cannot rely on the operating system's default
  8. Improved completion in annotations (since M2) - good for users of libraries like DAX that use annotations.
  9. Working sets for the Project Explorer (since M2) - working set support for non-Java projects
  10. Apply Patch offers full context patch preview (since M2)
There are numerous other improvements in these five milestones, but these are the features I like most and that convice me to upgrade to Eclipse 3.3M5 and use SWT 3.3M5 and JFace 3.3M5 for desktop GUI development.

Spring modules for JCR

posted 02:59PM Feb 10, 2007 with tags jackrabbit java jcr softwaredevelopment spring by Lars Trieloff

When you are building applications using Spring and JCR with a repository like Apache Jackrabbit, the newly released JCR Spring module (see org.springmodules: spring-modules-jcr 0.7) might be for you.

It contains Spring FactoryBeans that allow you to access JCR repositories directly, via RMI or JNDI.

Java 6

posted 08:49PM Dec 11, 2006 with tags java linux macosx windows by Lars Trieloff

Java 6 is out and Danny Coward has a list of 10 reasons to upgrade. One reason he is missing is the new System Tray API which works for Windows, Linux and Mac OS X.

What Checkstyle, PMD and Findbugs can do for your code

posted 07:34PM Dec 06, 2006 with tags checkstyle findbugs java maven pmd softwarequality by Lars Trieloff

Frank Kelly's excellent blog article Analyze This - Put your code on the couch! discusses the most important bugs and code smells the three static analyzers Checkstyle, PMD and Findbugs are able to find. Together with unit testing and code coverage for dynamic quality assurance they can help you creating much better Java code.

Luckily there are Maven 2 plugins for all three of them:

Building Scala Applications with Maven 2

posted 04:59PM Aug 30, 2006 with tags java maven opensource plexus scala by Lars Trieloff

Scala is a programming language that implements many interesting concepts and can be compiled into Java bytecode, making it an an ideal match for Java developers who would like to try out new programming language and keep using existing code and third-party libraries.

Unfortunately Scala and Maven 2 have not been working together until now. Scala comes with an standalone compiler, scalac and a collection of Ant tasks. Maven 2 relies on Plexus for compilers and there are up to now Plexus compiler components for the standard javac, for Jikes, for the Eclipse Java Compiler and for C# using Microsofts compiler or Mono.

It wrote until now, because this patch for Plexus brings a Scala compiler component for plexus. The easiest way to use it is to create a new Maven project with some Scala source code in src/main/scala and to use an adaption of following pom.xml:


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.example</groupId>
  <artifactId>scala-maven-example</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>Scala Maven Example</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>scala</groupId>
      <artifactId>scala-library</artifactId>
      <version>2.1.8</version>
    </dependency>
  </dependencies>
  <repositories>
    <repository>
      <id>Goshaky</id>
      <url>http://www.goshaky.com/m2</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <releases>
        <enabled>true</enabled>
      </releases>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>Goshaky Plugins</id>
      <url>http://www.goshaky.com/m2</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <releases>
        <enabled>false</enabled>
      </releases>
    </pluginRepository>
  </pluginRepositories>
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/main/scala</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerId>scalac</compilerId>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-compiler-scalac</artifactId>
            <version>1.6-SNAPSHOT</version>
            <scope>runtime</scope>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>
</project>

This pom uses the Goshaky repository which contains snapshots for Scala and the new compiler component until they are available in the public repository, configures the Maven compiler plugin to use the Scala compiler component and adds the path src/main/scala to the source lookup path, so you don't have to put your *.scala files below src/main/java.

The most interesting part in writing this component was seeing how certain Scala constructs (e.g. functions as arguments) are mapped to Java constructs.

Who else wants to get rid of the default jEdit icons?

posted 09:26PM Aug 01, 2006 with tags gnome java jedit linux macosx tips by Lars Trieloff

jEdit is a great editor. It is free, runs on every platform, can be extended using plugins, can be scripted using macros, but the default set of icons is a shame. Java swing applications are known to look arkward and jEdit is no exception. But there are some simple steps of getting rid of the default look and feel.
  1. If you are using GNOME, you should download Java 1.6 Mustang beta, as it supports the new GTK Look and Feel which makes jEdit look more like a native GTK application. Windows users have no problems, Mac OS X users should follow the next instruction.
  2. If you are using Mac OS X: Start jEdit, open /Applications/jEdit/jEdit.app/Contents/Info.plist. This is an XML file, but you just need to find the line containing <string>org.gjt.sp.jedit.jEdit</string> and add following content below: <key>Properties</key> <dict> <key>com.apple.macos.useScreenMenuBar</key> <string>true</string> </dict>. Save the file and restart jEdit. Now the Menu bar will not be part of the main window any more, jEdit uses the Mac OS X menu bar like a proper Mac application.
  3. Download the icon set from this forum post and install it to the lib/ext folder of your Java runtime installation. For Mac OS X users, this is probably /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext/, Windows Users should look for C:\Program Files\Java and Linux users should ask their distribution where Java is installed.

The result is a jEdit that looks much more like the cool and powerful application it is.

| Comments[1]

An intelligent build system

posted 04:41PM Jul 13, 2006 with tags ant build java maven by Lars Trieloff

Vincent Massol has collected a number of ideas on building an intelligent build system, i.e. an system that is automatically capable of building a Java project by detecting meta-information about the project without the user having to explicitly state them.

For the dependency-detection part of the build system, Vincent proposes following heuristics:

How do we detect project dependencies? One relatively way is to parse the sources that we have found above and find all external imports. Then query ibiblio to find matching package names (this information is present in Maven POMs on ibiblio).

I would instead use Jarfinder.com to find out what JAR a dependent class file belongs to and then roundtrip to the Ibiblio Maven repository to find that JAR file.

For projects that have their JAR dependencies in a lib folder, it might be possible to match the MD5-sums agains JARs in the ibiblio repository to find out what kind of dependency this particular JAR file is.

This tool would be great for migrating IDE-bound build processes that still can be found in many companies to build-tool-driven processes that allow continuous integration.

XHTML and CSS rendering library for Java

posted 09:54AM May 16, 2006 with tags css java opensource xhtml xml by Lars Trieloff

Is anyone interested in writing an open-source alternative to the XMLmind XML Editor? If so, you should take a look at the xhtmlrenderer-framework, a Java library that allows rendering of XML and CSS.

Subversion for JEE Applications

posted 12:17PM May 05, 2006 with tags development java software subversion tips by Lars Trieloff

Swaminathan Radhakrishnan's article Configuration Management in Java EE Applications Using Subversion suggests to use Subversion and the JavaSVN API to create a versioned storage backend for Java Enterprise applications. One comment further suggests to use XStream in order to serialize Java objects to XML documents which would allow textual differencing. And with support of xmldiff4j, even XML differencing would be possible.

New Scala and Scala Eclipse Plugin

posted 03:35PM May 04, 2006 with tags eclipse java scala by Lars Trieloff

The Scala Team has mad a new release of Scala available and a new release of the Scala Eclipse Plugin. Scala is a programming language for the Java Virtual Machine that implements many very interesting concepts like being object-oriented and functional at the same time, strong statical typing and extensibility.

Sun JARs are finally downloadable

posted 03:31PM May 04, 2006 with tags java maven opensource by Lars Trieloff

Sun had a policy of making important JAR libraries like the Java Mail API not available for public download, you had to agree to a license before you coud proceed with the download, which makes it hard to run build tools that automatically download all dependencies of a software like Apache Maven or Gentoo's portage. No longer. According to Matt Raible:
JavaMail is now open source as part of the GlassFish project.
and Carlos Sanchez:
I uploaded them (the Java Mail API, ed) to the Maven 2 repo at iBiblio, improving the poms: activation and javamail, if you want to use them you can add one of the following dependencies to your pom. You only need one because javamail depends on activation and brings it in.

This is very good news.

XMLmind XML Editor 3.2.0

posted 10:03AM Apr 04, 2006 with tags css dita java wysiwyg xml by Lars Trieloff

A new release of the CSS-based, customizable WYSIWYG-XML-Editor XXE is out. The new release has following highlights:
  • A configuration for DITA can be downloaded and installed using Options|Install Add-ons. More info. in this document.
  • XXE has a more powerful table editor allowing to insert, copy, cut, paste, delete columns and rows, and allowing to increment or decrement the number of columns and the number of rows spanned by a cell.
  • It is now possible to bind a command to the drag action as well as to the drop action. For example, using this new facility, it is possible to drag a DITA topic and drop it in a DITA map in order to create the corresponding topicref.
  • Many enhancements are related to the CSS support in XXE.

A feature I like most about the new version is the support for Java 6 and its new GTK-Look-and-Feel.

http://weblogs.goshaky.com/weblogs/resources/lars/xxe_3_2_0.png