Thursday, July 7, 2011

Azzyzt JEE Tools 1.2.4 are available

Some more customization: 

  • Now you can not only cut back on features that would normally be generated, you can also add features that would normally not be generated. Currently the only option to add is an Apache CXF REST client project. Interfaces for the CXF proxy-based API are generated. The tutorial now contains an example for in-server unit tests implemented via CXF REST. 
  • Customization of the REST error response via HTTP request headers.
See section 6 Customization of the generated code for all the details.

Sunday, June 26, 2011

Azzyzt JEE Tools 1.2.3 are available

Everybody makes an Indigo release these days, why shouldn't I :-?

The only visible changes are in the vanity department: The installed feature is now displayed in the list of installed features (this was a harmless bug) and in Eclipse's "Help / About" dialog there's now an Azzyzt icon.

Azzyzt JEE Tools are now built on Indigo and against a GlassFish 3.1 runtime. Up to now I have used Helios SR1 and GlassFish 3.01 for building.

I have tested the cookbook tutorial in the following configurations:
  • Glassfish Tools Bundle for Eclipse (Galileo SR1 + GlassFish 3.0)
  • Helios SR1 + GlassFish 3.01
  • Helios SR2 + GlassFish 3.1
  • Indigo + GlassFish 3.1
I guess I should try to automate these tests :)

Monday, June 20, 2011

Azzyzt JEE Tools 1.2.2 are available

Well, actually they've been available since Friday afternoon, but you just don't announce new software on Fridays. So, what's new?

  • Support for JSON added. Query spec parameter for list operations is intentionally still XML though. The operations in the generated ModifyMulti bean could theoretically be accessed via JSON, but in practice this fails due to lacking deserialization support for polymorphic lists. In XML this is solved via @XmlSeeAlso annotations on parent classes, Jackson, the JSON base technology in GlassFish, has evolved something analogous in 1.5 and as GlassFish 3.1 ships with 1.5.5, it would be possible to support it. The necessary annotations are in the package org.codehaus.jackson.annotate, and I expect them to surface somewhere under javax.ws.rs in JEE 7. If you really need it now, you can always change the code or the generator :)
  • Two new cutbacks can be defined in Azzyztant: NoRestServicesXml and NoRestServicesJson. If both are used, no REST code is generated at all, not even the servlet.
  • A good one and a bad one: we now clean all generated folders before generating code. This has become a necessity with cutbacks. The drawback is, that we now have Apache Commons IO as an additional bundled library.

Thursday, June 9, 2011

Documentation updated

Originally I had got the semantics of the "Visit" class in the tutorial stupidly wrong. The language used by the guide is no extra attribute, it clearly has to be a part of the embedded ID.

How do I know? Well, in the original you couldn't insert two visits from the same ZIP area to the same city, but with different languages used by the guide. You always got an update of the same record, because the ID, combining only city and ZIP, was the same.

Now we have an association between three entities, City, Zip and Language, all three contributing their respective IDs to the embedded ID, and the "numberOfVisitors" has become a "totalNumberOfVisitors". Whenever new data about a visit comes in, we look if an instance of Visit already exists. If so, we increment its total number of visitors, otherwise we create a new object. Maybe I should even call the class not Visit but VisitStats or something like that.

I have not made a new release, but I have already updated the documentation, the tutorial as well as doc.zip, the archive that also contains sample sources. You would have got it with the next release, but I figure it is bad style keeping nonsense on the web as soon as you recognize it's nonsense :)

Tuesday, June 7, 2011

Azzyzt JEE Tools 1.2.1 are available

This is really a bugfix release. Release 1.2.0 had a problem with azzyzted projects created by earlier versions. It tried to upgrade gracefully and failed miserably :)

1.2.1 has been tested with the cookbook application as generated by 1.1.1 and 1.2.0. In both cases the upgrade works.

Two user-visible changes are, that Azzyzt now generates a new project called "azzyzt_tools" and that there is a new file "EarContent/META-INF/azzyzt.xml" in the EAR project. You can ignore them by now, later on they may become useful. "azzyzt_tools" is not packaged into the EAR artifact, it is only used by the Azzyzt JEE Tools plugins during code generation.

Wednesday, June 1, 2011

Upgrading to 1.2.0

Upgrading Azzyzt JEE Tools themselves is just a matter of upgrading an Eclipse feature from the update site, but if you already have created an azzyzted project with an earlier version, you will encounter a problem after the upgrade.

Azzyzt installs two runtime components into the lib directory of the EAR project, but it runs the code generator from the plugin itself. Unfortunately the code generated by the plugin depends on a particular version of the runtime components, and after the upgrade, code generator and runtime don't match.

If you generate code with 1.2.0 from an azzyzted project created with an earlier version, you will get "Azzyztant" created in the wrong package, and the code will not compile because of two missing interfaces.

This will be fixed in release 1.2.1 due in a few days, but until then, here are two possible temporary solutions:

  1. If the only code supplied by you are the entities and your persistence.xml, you can just save them, delete the four projects, create the azzyzted project anew, copy the saved entities and persistence.xml into the new projects, refresh the projects, clean all projects, and then you can safely generate code.
  2. The other solution is to create a second azzyzted project (call it "dummy" or whatever you like), and then copy the contents of "dummyEAR/lib" over to the lib directory in your EAR project. Refresh your own EAR project, delete the dummy projects, create a sub-package "meta" parallel to "entity" in your EJB project's "ejbModule" source folder, and then you're done.

Sorry for the inconvenience, next time there will be an automatic solution.

Tuesday, May 31, 2011

Azzyzt JEE Tools 1.2.0 are available

We are definitely making progress.

Release 1.2.0 brings some basic validation of entity classes and embeddable classes. Embeddables are used as embedded IDs in those cases where we have to model a many-to-many association with extra attributes on the join table, and where the join table has no explicit ID from a sequence. In such cases we lump all foreign keys together into a class annotated with @Embeddable, and the entity class for the join table gets an instance of such an embeddable class as @EmbeddedId. See section "3.2.2.1 A complicated association" of the Azzyzt tutorial for details.

Embedded IDs are a special case of IDs, thus they have to be passed from client to service in cases like a lookup by ID. They get serialized by JAX-B like any other DTO, and today we had an interesting case:

A developer had defined a mis-matching pair of getter/setter on a property of an embedded ID. The getter was getidPerson() and the setter was setIdPerson(). The problem is, that if we don't explicitly specify serialization rules with annotations, JAX-B just serializes all properties of an object, and it decides that something is a property, if there is a pair of matching getter/setter. Of course the difference between a lower case i and an upper case I is not that big and is easy to miss. The effect was, that only one of the two foreign IDs comprising the embedded ID got serialized.

Although I am quite confident by now, that the basic code in Azzyzt is working and stable, I am still in a phase where I tend to search for the error on my side. When I finally found the problem, I decided to solve it once and for all times. From now on all entity classes and all embeddables get verified. If any of the expected getters/setters for non-internal fields is missing, code generation fails with a precise log message telling you where the problem is.

Other than that, Azzyzt 1.2.0 introduces some configurability. There is a new class Azzyztant. It gets generated into the user source folder of the EJB directory at project creation time, and if it does not exist at code generation time, it gets generated as well. You can modify this class in two ways:

Set properties that get evaluated at runtime, or annotate the class to influence code generation. There is a new chapter "6 Customization of the generated code" in the Azzyzt tutorial that explains the details.

Currently Azzyzt offers one runtime hook (changing of portal-supplied user names) and two code generation options. They allow you to omit "@Remote" on service interfaces (thus I suppose we now support the JEE 6 web profile and therefore JBoss AS 6.0) and/or to omit "@WebService" on service beans. If you use both options, the application is exclusively available via REST.

Tuesday, May 24, 2011

Azzyzt JEE Tools 1.1.1 are available

This is mostly a bug-fix release. Changes in 1.1.0 had broken support for entities with string IDs. Now everything works again.

If you already have seen the tutorial, you might like to have another look at it. The cookbook application has got one more table, this time it's a simple key/value lookup table.

Other than that, the name of the HTTP header used for determining the calling user (expected to be set by a portal in front of the application) is now configurable via JNDI lookup of a string resource in the server. Just define the resource and the generated application will use the header of your choice.

Sunday, May 22, 2011

Azzyzt JEE Tools 1.1.0 are available

Actually version 1.0.0 has been available since end of March, but I had not announced it. Thus 1.1.0 is the first version that's really open to the public.

As I've already mentioned in the first post, Azzyzt JEE Tools is a collection of software tools helping software developers to create software using Java Enterprise Edition 6. It is designed to be integrated into popular Java IDEs, and at the moment this means it is an Eclipse plugin.

Azzyzt JEE Tools is a set of Eclipse plugins for creating a so-called azzyzted project, and for creating code from a model. Azzyzt uses Java JPA entities as a model, and from that model it creates an enterprise application, ready to be deployed in a Java EE 6 application server like GlassFish 3.1, ready to be accessed via CORBA, SOAP and REST. Thus the generated application is a set of web services, providing all that you need in a typical CRUD application. 
Generated enterprise applications have separate source folders for generated and developer-supplied content. Add your own functionality to a well-engineered base project.
Azzyzt JEE Tools is not about user interfaces. It is expected that the generated application is accessed by a RIA frontend (Flex/Flash, Silverlight, Java FX, ...) or by a fat client.

If you just want to use Azzyzt JEE Tools (as opposed to modify and build them), the recommended way to install the software is via an Eclipse update site. As of release 1.1.0, there are two update site URLs, one for the edition used by the Municipiality of Vienna, Austria, the other a generic version. The URLs are

http://azzyzt.manessinger.com/azzyzt_generic/

http://azzyzt.manessinger.com/azzyzt_magwien/

If you want to look into the source code, modify Azzyzt JEE Tools for your own use or if you even want to contribute, then you can fork the project from GitHub under the URL

https://github.com/amanessinger/azzyzt_jee_tools

So far the project lacks reference documentation, though a tutorial under

http://azzyzt.manessinger.com/doc/using_azzyzt.html

should give you a fairly good impression of what Azzyzt JEE Tools are about, how to get started and how to go on. The process of building/modifying the tools and of how to contribute to the code base currently lacks documentation.

All announcements of new versions will be published here on

http://www.azzyzt.org

Discussion of the architecture, of interesting details of the implementation, and in general of things I've learned in the process, will happen on my programming blog

http://programming.manessinger.com/

If you want to be kept up-to-date, I suggest that you subscribe to the feeds of both sites, azzyzt.org and programming.manessinger.com, in the feed reader of your choice.

Azzyzt JEE Tools are based on my Eclipse / GlassFish / Java EE 6 Tutorial and on a subsequent internal class that I held in October/November 2010 and that was based on the tutorial as well. The code generated by Azzyzt JEE Tools is basically a refinement of the code presented in the tutorial, with some very interesting features added.

Azzyzt JEE Tools are copyright (c) 2011, Municipiality of Vienna, Austria, licensed under the EUPL, version 1.1 or subsequent versions.

Saturday, March 26, 2011

Welcome to the First Post

This blog is about Azzyzt JEE Tools. JEE means Java Enterprise Edition, and when I say JEE, I imply version 6 and above. If all that is gibberish to you, I suggest you leave for one of the other amazing sites out there.

Azzyzt JEE Tools is a set of software tools, designed to help you (actually me, but you as well) build JEE 6 applications. The focus is currently on web services, SOAP as well as REST. At the moment Azzyzt JEE Tools are implemented as an IDE-independent core and a set of Eclipse plugins. Support for other IDEs like NetBeans or IntelliJ IDEA would be possible.

Azzyzt JEE Tools were designed and implemented by me and, more important, they were financed by my employer, the Municipiality of Vienna, Austria.

As of March 27, 2011 the code is ready to be released, legal work is done, the only thing left is to actually publish it.

I will use GitHub as hosting service for the source repository, and the code will be released under the European Union Public Licence (the "EUPL"), a license that is compatible with several other popular open source licenses, among them the Eclipse Public License and the GPLv2.

All further details will be announced on this blog soon. Until then, I suggest you have a look at my Java EE tutorial. Code generated by Azzyzt JEE Tools largely follows those patterns.