Css Design Contest

On the wicket mailing list they annouced a design contest. Read the email for more details:

Hi

Someone mentioned that we could have a better look & feel for wicket, since there are no designers in the core team. I proposed a contest, to make the coolest slickest css for wicket. So please feel free to apply.

Requirements:

your css should be compatible with the basic browsers, Firefox , IE , Safari etc. And retain heavy use of embedded js. And it should be a drop on, using existing id’s & hierachy for design.

Practical info:

The contest ends in 2 months April 2nd.

Get the wicket examples here:
http://svn.apache.org/repos/asf/wicket/trunk/wicket-examples/

If you need it you can put your css in svn at wicketstuff, write to this
list for details on howto get commit rights, you should add your css to
sandbox and sf user name (https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/sandbox/ ).

Yes as with all contest there is a prize, you can win the wicket t-shirt along with the honor if your css are the winner. This
http://www.cafepress.com/apachewicket.317298148
or this
http://www.cafepress.com/apachewicket.317298083 depending on your age :)

Just reply to this thread to enter the contest.

Regards Nino on behalf of the Wicket People

To join the thread in the mailing list send a mail to

users-subscribe@wicket.apache.org

Kenai.com Will be Closed

I read on the German heise portal that Kenai is the ‘loser’ of Oracle’s Sun-acquisition. On the project’s blog you can read this in English:

Part of this process is the phasing out of the public-facing domain used for the Project Kenai Beta site.

It is a pitty, because of the effort for the great NetBeans integration etc. Hopefully Oracle will provide such a solution for java.net!

Shame on Sourceforge?

Sourceforge restricts access from some more ‘evil’ countries. Read more here. This violates Open Source Initiative:

“5. No Discrimination Against Persons or Groups
The license must not discriminate against any person or group of persons.”

And if the license must not restrict this, the distributor shouldn’t as well! Its free software and not US software! :-(

So, if they argue with US laws I have the feelings that they shouldn’t or cannot provide free software hosting any longer. Maybe they should create a server outside the US?

Or should users from the affected countries use tor or should all developers migrate to alternative free software hosting projects?

But it is nice that they allow the comments to the link above, that’s good:

“sarcastic-man on January 25th, 2010
[...] Maybe one day Americans will wake up and realize that the world is a big place. [...]

afsharm on January 25th, 2010
I am an Iranian (an innocent one) and I am not responsible for what ever my government is doing. As nawwark mentioned I’ve sometimes have contributions in SF.NET projects, so why you are denying me from my own works?
It’s against freedom and against FOSS.

bones_0 on January 26th, 2010
Just for the book: I want everybody to access my projects. Beeing a Swiss product (I am Swiss citizend and resident) it’s kind of crazy they are falling under US law now… [...]“
But also:
“meonkeys on January 25th, 2010
[...] maybe this will raise awareness of these laws and encourage people to get them changed
lukecrouch on January 26th, 2010
Disclaimer: SourceForge employee.
I speak for all of us here when I say we feel your pain. “Rub us the wrong way” is the nicest possible term for it – very diplomatic on Lee’s part. I host projects here on SourceForge too – ajaxmytop, peardbdeploy, and tangoiconsprite. So blocking these countries not only goes against the free flow of information, but it cuts down my potential audience and collaborators; not to mention that it removes hundreds of thousands of ad impressions from the business!
But at the end of the day, I’m a 20-something web developer with a wife and kid to feed and I have the amazing chance to do that AND try to give my own small contributions to open-source software.  [...]“

Where is UML for NetBeans 6.8?

Recently I wanted the good and fancy UML editor for NetBeans 6.8, but I couldn’t find it in the update center.

The  solution seems is simple. I clicked here and got the zip called netbeans-6.8-200912091457-ml-uml.zip which needs to be extracted into your NetBeans installation. After this I was able to create an UML project from the project menu:

I created a project to reverse-engineer my java project where even maven (jar or war) was possible. Look here:

But at the time of NetBeans 6.5 the packages were filled with content! Now they are empty and no class diagrams can be easily generated from source code :-(

The import of the java files seems to work, because if I right click the project I could create a model report with all my classes and its dependencies.

Do you know my mistake? I just wanted to create a class diagramm from my project.

Update: There seems to be no solution for NetBeans 6.8. See StackOverflow.

Update2: No, wait. Read this.

Hidden Features of Java

This is a nice ‘question’ on StackOverflow: What are hidden features in Java?

I didn’t read about this nice one:


Integer integ1_a = 1;
Integer integ1_b = 1;
Integer integ1_c = new Integer(1);
Integer integ1_d = new Integer(1);

Integer integ128_a = 128;
Integer integ128_b = 128;

assertTrue (integ1_a   == integ1_b);   // again: this is true!
assertFalse(integ128_a == integ128_b); // again: this is false!
assertFalse(integ1_c   == integ1_d);   // again: this is false!

Read more about this issue by searching java’s pool of integer (internal ‘cache’ from -128 to 127 for autoboxing) or look into Integer.valueOf

Of course you can vote for my comment on stack overflow ;-)

Change Subersion Format: From 1.5 to 1.6

The latest changes in ubuntu will force you to update the local subversion repository. Use used the following on a 1.5 repository and it works:

~/change-svn-wc-format.py . 1.6

Make sure that all clients then use 1.6! Downgrading from 1.6 to 1.5 should be possible, too.

CRUD with Wicket + Guice + Db4o / NeoDatis

The journey began with a search for a database for my desktop application TimeFinder. It turned out that there are at least 3 candidates if I would choose a simple and only one tier architecture:

  1. GORM
  2. NeoDatis
  3. Db4o

One tier applications would only make sense for some special uses cases like in my case for high schools with one timetable admin. But it would be a lot better if I could use sth. like remote GORM, remote object persistence or even an ajaxified web application. Yes. Why not? What, if I rewrite the UI from scratch and move from ‘Swing Desktop’ to web? But then again: which web framework and which persistent architecture?

A lot of people would recommend Grails (myself included) if I need a simple CRUD web framework, but for me Grails is a bit heavy weight (~ 20 MB) and I will have to live with at least 6 languages: GSP, JS, HTML, ‘Spring-XML’, Java and Groovy. I will need Java at least for the performance critical part: the timetabling algorithm.

Okay. Then, why not GWT or Eclipse RAP? GWT has Javascript compilation, which I am not a big fan of and Eclipse RAP requires pure Eclipse development, I guess. So what else? There are a lot of Java web frameworks (with Ajax) as I discovered earlier. My choice now was simple: Wicket, which is Swing for the web. But what if you don’t like Swing? Then you will love the ‘Swing for the web’ ;-) !

Wicket Features

From what I learned in the last days and from blog posts; Wicket is outstanding in the following areas:

  • Separation of UI and code. You only have
    • pure HTML no new syntax required ala JSP, JSF, GSP, velocity, … the latter one was the reason for not choosing click. No Javascript hassle … if there are some, then I trust the wicket community to fix them in wicket itself
    • and pure Java. This is very good if you’ll someday refactor your code. And you’ll.
  • You can create your own components easy and fast. You can even create ajax components without xml and js… only Java.
  • A strong community (even a German book)
  • No route file necessary. (This can be a disaster for manually managed JSF apps)

Okay. And the persistent layer? That was the reason for this journey … hmmh, there are already several different persistent ‘technics’ for Wicket available:

Hmmh, but I only need a very simple persistent layer. No complex queries etc. As I mentioned earlier I can even live with xml (for datastorage). I decided to look into db4o again (used it in gstpl which is the antecessor of TimeFinder) and into the more commercial friendly (LGPL) object oriented database NeoDatis. The latter one has an option to export to xml and import the same, this would be great so that I don’t have to think about database migrations (some refactorings will be applied automatically. see 1.10 in the PDF docs). Migration in db4o should be easy too.

While I was thinking about that, I asked on the Apache Wicket mailing list for such simple persistent solution. Jeremy Thomerson pointed out that there are even some maven archetypes at jweekend which generates a simple Wicket app with persistence for me. I chose the Wicket+Guice+JPA template and updated this to use Guice 2.0 and the latest warp-persist according to this post. After that I needed to make db4o or NeoDatis working. For the latter one I needed warp-persist-neodatis and for the first one I only needed some minor changes, but they took a bit longer.

Resources

For those who want to see the results, here are the 2 independent maven projects (Apache License 2.0) within my subversion repository (revision 781):

To try the examples just type ‘mvn install’ and run ‘mvn jetty:run’. The resulting war file is amazing small: under 6 MB!

Now point your firefox or opera to http://localhost:8080/timefinderwicket/

And here is the screenshot:

As you can see the localized warning messages are already provided and shown instead of “Please enter a value into the field ‘location’”.

To work with wicket is a great experience! In another project it took me about 10 minutes to convert a normal submit into an ajax one which updates only selected components. And then, in the NeoDatis project I initiallly developed my EventDataView against a completely different data item and moved the source nearly unchanged to the db4o project with the Event class! That is nice component oriented development. Okay, I did copy and paste rather then creating a maven submodule for the pageable list, but that wouldn’t be that difficult with wicket. Then as a third example I overwrote the navigation panel, which was easy too: Now instead of

<< < 1 2 ... > >>

it will be shown

First Prev 1 2 ... Next Last.

without touching the UI. You can even provide ‘properties’ files to apply easy I18n.

Coming Home

Wicket is like coming home ‘to desktop’ after some years of web development, especially in the UI layer. And guice perfectly meets my dependency injection requirements: pure Java.

To get all things right I had to tweek the initial example of jweekend a lot, but all necessary changes were logically and does not smell like a hack. As a first step I updated the versions of the artifacts and then I added a DataView from the repeater examples. The developed CRUD example is now built with dependency injection instead of the original locator pattern (ala DatabaseLocator.getDb()):

@Inject
Provider<ObjectContainer> oc;

Then the update mechanism and some other exception must be solved, but you only need to check out the sources and see what is possible!

As a side note

please keep in mind that there is a NetBeans Plugin for Wicket 1.4.x and an IntelliJ plugin for the same. For all NetBeans guys which are interested in ‘deploy on save’ feature you only need to enable ‘Compile on Save’ and then you can change code or HTML in Wicket, if you are running the application via jetty:run (jetty configuration is already done in the pom). Currently this works only with db4o as a standalone server. To my knowledge this way of UI prototyping can be even faster than with Grails, where it could take some seconds to be recompiled.

Conclusion

Dive into the world of Wicket right now!

Bahnhof der DB

Da ich gerade einmal dabei bin meine alten Handyphotos zu durchstöbern … hier noch zwei, die ich auf der ungeplanten Zwischenstation Kirchenlaibach Ende Oktober 2009 gemacht habe. Der Franken Sachsen Expresse sollte eigentlich von Dresden direkt nach Bayreuth fahren. Er fuhr jedoch kurzfristig geändert dann doch über Kirchenlaibach um pünktlich in Nürnberg einzutreffen, da wie immer  – die Neigetechniken kaputt war. (Kurzfristig geändert und das obwohl das Problem schon vorher bekannt war.)

So weit so gut für die Bahn. Der einzige Haken an der Sache für mich war: der Anschlusszug der auf keinen anderen Zug hätte warten müssen, hat nicht mal 10 Minuten auf unseren Franken-Sachen-Express aus Dresden gewarten. So dass ich dann mit Kind 50 Minuten in der Kälte (!) warten durfte. Aber zum Glück gab es ja noch die Wartehalle …

… dann entdeckte ich am gleichen Gebäude noch folgendes …

PS: Der Zug aus Kirchenlaibach nach Bayreuth fuhr dann pünktlich ab. Der nächste Zug aus Dresden hatte >10 min Verspätung (und? deja vu?).

Pünktlichkeit ist das oberste Gebot der Bahn.

Wahlurne vs. Papierkorb

Hier ein Photo unseres Meldeamtes. Man beachte die Distanz von Wahlurne und Papierkorb.

Google Will Stop Censorship in China

From google blog:

We have decided we are no longer willing to continue censoring our results on Google.cn, and so over the next few weeks we will be discussing with the Chinese government the basis on which we could operate an unfiltered search engine within the law, if at all. We recognize that this may well mean having to shut down Google.cn, and potentially our offices in China.

Next Page »