Xzajo's Weblog

All | Java | nbxdoclet | NetBeans | Personal | Project Extensions | Sun | Testing
Main | Next month (Mar 2006) »
20060331 Friday March 31, 2006

Xdoclet 1.2.3 and JDK 1.5 features - hot fix

XDoclet 1.2.3 building fails when are used in java sources with jdk 1.5 language enhancements (Enum, annotations,...). How to solve it? I found solution at XJD-41:

Replace the xjavadoc-1.x.jar library with javadoc-1.1-j5-v4.jar

If somebody want to use jdk 1.5 features in nbxdoclet hibernate plugin he will have to replace the xjavadoc-1.x.jar jar file of xjavadoc-1.x.jar library with javadoc-1.1-j5-v4.jar jar file in Tools|Library Manager.

Posted by xzajo ( Mar 31 2006, 12:09:57 PM CEST ) Permalink Comments [12]

20060330 Thursday March 30, 2006

LaTeX Editor for NetBeans 5.0 is comming...

Jan Lahoda, my colleague, shown me this week new version of LaTeX Editor for NetBeans 5.0. I am really impressed. I've never seen such good LaTeX support. When I was on university I was using a poor emacs plugin for LaTeX. But with the new Jan's everything is much easier and faster.

LaTeX is a document preparation system for high-quality typesetting. It is most often used for medium-to-large technical or scientific documents, but it can be used for almost any form of publishing.

The main features of the LaTex for NetBeans 5.0 plugin:

Look at the screenshot:

Are you also impressed? I'll let know when the release is available.

Posted by xzajo ( Mar 30 2006, 01:53:32 PM CEST ) Permalink Comments [14]

20060329 Wednesday March 29, 2006

AndroMDA - generation code from UML (Powered by MDR)

In short, AndroMDA is an open source MDA framework - it takes any number of models (usually UML models stored in XMI produced from case-tools) combined with any number of andromda plugins (cartridge and translation-libraries) and produces any number of custom components. You can generate components for any language you want, Java, .Net, HTML, PHP, anything really, you just write (or customize existing) plugins to support it and you're good to go. The core of AndroMDA uses NetBeans MDR storage.

For example from UML class diagram shown bellow can be generated code for different technologies (Spring, Hibernate, EJB, Webservices, XML).

And for Activity UML diagram allows to generate code for Struts, JSP, Servlets.

Posted by xzajo ( Mar 29 2006, 12:00:00 PM CEST ) Permalink Comments [11]

20060328 Tuesday March 28, 2006

Select J2SE library from Maven repository and install it in NetBeans 5.0 feature

Project extensions plugin of NBXdoclet allows to select library from Maven repository and install it to Library Manager.

For example you want to add Postgresql jdbc driver to my project. Dialog with available libraries is shown by using Tools|Download Library menu item from main menu. There are these components:

To filter contentes of all librarires type pos int Filter field. After selection of postgresgl Category all libraries from postgress category are shown in libraries folder. Select the postgresql-7.2.jar and click to >> button. The Library is added to Added libraries list. To start downloading and installing the library click to Ok button. Waiting dialog with progress bar is shown during installing of library.

When is the library downloaded we can add the library to our project.

Posted by xzajo ( Mar 28 2006, 11:57:35 AM CEST ) Permalink Comments [15]

20060325 Saturday March 25, 2006

Hibernate Query Wizard for Netbeans 5.0

Hibernate is equipped with an extremely powerful query language that (quite intentionally) looks very much like SQL. But don't be fooled by the syntax; HQL is fully object-oriented, understanding notions like inheritance, polymorphism and association.

HQL Wizard for NetBeans 5.0 helps to create selects in HQL. The wizard is part of hibernate plugin based on xdoclet. The project pages are on nbxdoclet website. The HQL wizard can be open be using code completion of hibernate bean's (POJO) facade class.

The wizard is shown bellow:

Detailed steps how to create the query in the example:

  1. To create first join select USER -> N-1: Address address property in entities view and click to Add button. The address is added to Entities list.
  2. To add first Left Parameter select address -> town item and click to Add button.
  3. Type ? to First right parameter.
  4. To create second join select User -? N-1: Car car item and click to Add button.
  5. Add two user -> age rows. It is similiar like adding car -> type row.
  6. To add first parentheses select car.typ="fiat" and user.age > 20 rows and click to Set Or button.
  7. To add second parentheses select user.age < 50 and user.age > 20 rows and click to Set And button.
  8. Change generated method name to getFiatForTown.

After click to Ok button code, shown bellow, is generated to facade class:

 public java.util.List getFiatForTown(java.lang.String addressTown) {
        Session session = store.HibernateUtil.currentSession();
        org.hibernate.Query query = session.createQuery(
                " select user " +
                " from  " +
                " User as user " +
                " join user.address as address " +
                " join user.car as car " +
                "  where  " +
                " address.town = ? " +
                "  and  (car.type = \"fiat\" " +
                "  OR  (user.age < 50 " +
                "  AND user.age > 20) " +
                " ) ");
        query.setParameter(0,addressTown);
        
        return query.list();
    }

The wizard read the information about entities (POJO) from xdoclet tags. It it not so difficult to implement reading of EJB30 annotations. I'm not sure if someone wants to use it with annotations. Is this wizard handy? Please give me feedback and report bugs to nbxdoclet's bug tracing system.

Posted by xzajo ( Mar 25 2006, 09:25:57 PM CET ) Permalink Comments [30]

20060324 Friday March 24, 2006

Emma Code Coverage for NetBeans 5.0 plugins

EMMA is an open-source toolkit for measuring and reporting Java code coverage. Netbeans Project Extensions Project allows to create pluggable extensions for NetBeans projects. One of first extensions is support for code coverage of test's run in NetBeans 5.0.

Installation

  1. Download sf-netbeans-nbxdoclet-update-05.nbm NetBeans plugin. Install it. The plugin contains url to nbxdoclet update center.
  2. Open update center and install Experimental Teplates plugin with its dependencies.

How to use Emma code coverage

  1. Show project extension window from Window|Project Extension main menu.
  2. Select your developed module.
  3. Select Project Extensions Window.
  4. Perform Add Project Extension from popup of Project Extensions Window. Dialog with available project extensions is shown.
  5. Select Emma Code Coverage item from list and click to Ok button. The Emma Code Coverage Project Extension is added to selected project. It is visible in Project Extensions Window
  6. Select Emma Code Coverage node in Project Extensions Window and perform Run Code Coverage action from popup dialog. The tests are run and the emma code coverage report is generated.
  7. if some tests were run you can show code coverage results by clicking to Show Results from popup of Emma Code Coverage node.


Posted by xzajo ( Mar 24 2006, 11:58:49 AM CET ) Permalink Comments [61]

Calendar

RSS Feeds

Search

Links

Navigation

Referers