Any news on Wicket 1.4 support ??

classic Classic list List threaded Threaded
21 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Any news on Wicket 1.4 support ??

Daniel Toffetti
Hi Nathan,

    I'm keeping an eye on Databinder for Wicket 1.4, because Wicket Web Beans has a Databinder integration subproject still on Wicket 1.3 that depends on Databinder itself being migrated.
    Any estimation of a possible release date ?

Cheers,

Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Any news on Wicket 1.4 support ??

n8han
Administrator
Hey, I was waiting for this question! :) I thought everything was good to go for Databinder 1.3 until I tested all the examples and found that some of them didn't work, either because of a problem in Databinder itself or the examples. And I'm thoroughly swamped.

What would be extremely helpful is for someone to clone the examples repository and fix some examples, or at least figure out what works and what needs fixing. Once all the examples are working a release will not be far behind.

Nathan
Reply | Threaded
Open this post in threaded view
|

Re: Any news on Wicket 1.4 support ??

Daniel Toffetti
    Glad to hear that, I'll take a look at those problems and hopefully will be able to provide some patches if needed, as time permits.

Cheers,

Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Any news on Wicket 1.4 support ??

Daniel Toffetti
In reply to this post by n8han
Nathan:

    I was unable to build the examples until I found this was commented out in your examples' parent pom:

   
    <repository>
      <id>databinder-snapshots</id>
      <name>Databinder snapshot repository</name>
      <url>http://databinder.net/snapshot/</url>
    </repository>

    When I uncommented this, all the dependencies seem to be found and the build runs fine. But running the examples doesn't yet work, I'm getting this runtime error:

WARNING: Could not obtain connection metadata
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: NO)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)

    Does this build depends on actual databases in your local system ??

Cheers,

Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Any news on Wicket 1.4 support ??

n8han
Administrator
That is the default, but you can change it in hibernate.properties to  
an embedded database.

Nathan
Reply | Threaded
Open this post in threaded view
|

Re: Any news on Wicket 1.4 support ??

Daniel Toffetti
Hi Nathan,

    It's taking me more that I expected, but I'm starting to see some problems. Baseball example shows empty page because it lacks a file "Master.csv" with which the database is populated at startup.
    I tried using an embedded Derby database but is seems to have some problems in Windows environments, otherwise I would've suggested changing all the examples to use it. I'll explore this possibility a bit more, and meanwhile I'll check the other examples.

Cheers,

Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Any news on Wicket 1.4 support ??

Daniel Toffetti
Hi Nathan:

    In net.databinder.models.ao.EntityModel(44):

        @Override
        protected Object load() {
                if (isBound())
                        return Databinder.getEntityManager(managerKey).get(entityType, id);
                return getPropertyStore();
        }

    You are expected to return T extends RawEntity<K> as declared in superclass LoadableWritebleModel(75):

        protected abstract T load();

    But method getPropertyStore() returns Map<String, Object>, which results in a:

java.lang.ClassCastException: java.util.HashMap cannot be cast to net.java.ao.RawEntity

    when trying to run Bookmarks example. Beware also that this project seems to be configured for jar packaging instead of war ??

    Not sure how to patch this as I don't quite understand what you mean to do in getPropertyStore(), but I would point out that removing warnings may actually hide some useful information about incorrect castings.

Cheers,

Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Any news on Wicket 1.4 support ??

Daniel Toffetti
In reply to this post by n8han
Hi Nathan,

    This should fix the Phone Directory example, sorry I'm not sending a diff patch file:

ListAndEdit.java:
line 69:
                // dropdown filter to limit the listing to selected categories
                add(categoryFilter = new DropDownChoice("categoryFilter",
                                new HibernateObjectModel(), categoryListModel));

+++ categoryFilter.setDefaultModelObject(new HibernateObjectModel(Category.class, new Integer(1)).getObject());
+++
                categoryFilter.add(new AjaxFormComponentUpdatingBehavior("onChange" ) {
                        protected void onUpdate(AjaxRequestTarget target) {
                                target.addComponent(contactsWrap);


line 90:
                final IModel contactList = new HibernateListModel(getString("query"),  
                                new QueryBinder() {
                        /** Uses default search binder and custom category filter */
                        public void bind(Query query) {
+++ Integer catid = null;
+++ if (categoryFilter.getModelObject() != null)
+++ catid = ((Category) categoryFilter.getModelObject()).getId();
                                query
                                        .setString("search", search.getSearch())
--- .setParameter("category", categoryFilter.getModelObject());
+++ .setParameter("category", catid, new IntegerType());
                        }

    After this, the example seems to work fine.

Cheers,

Daniel

Reply | Threaded
Open this post in threaded view
|

Re: Any news on Wicket 1.4 support ??

n8han
Administrator
In reply to this post by Daniel Toffetti
Daniel Toffetti wrote
    You are expected to return T extends RawEntity<K> as declared in superclass LoadableWritebleModel(75):

        protected abstract T load();

    But method getPropertyStore() returns Map<String, Object>, which results in a:

java.lang.ClassCastException: java.util.HashMap cannot be cast to net.java.ao.RawEntity
I may have to drop the ActiveObjects support for 1.3, because of this and similar problems. ActiveObjects works only with a Map for the initial insert, which is reasonable in itself, but it doesn't mesh well with Wicket models which are generally expecting to interact with the same object for their lifecycle. Before Wicket generics I was able to get by here using a Map and swapping it out for the actual object once it existed, but that was always a bit of a hack and generic models break it entirely.

So I guess this is where I say, unless anyone can think of a better way around it, I'll drop the ActiveObjects modules so we can forge ahead with this belated release. I spent a lot of time on them so it's kind of sad, but that's the way it goes!

Nathan
Reply | Threaded
Open this post in threaded view
|

Re: Any news on Wicket 1.4 support ??

Daniel Toffetti
    There is always room for a 1.3.1 release with AO support back in, right ?  I might help after WWB release if I have some time for it.

Cheers,

Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Any news on Wicket 1.4 support ??

n8han
Administrator
True, although I'm not sure if the ActiveObjects project itself will be moving forward. There are a number of other interesting ORM/non-ORM things that might be fun to integrate as a module tho, if people are interested.

Thanks a lot for the testing and patch, Daniel. I've checked the updates into master.

There are some short instructions for getting the baseball example data as comments in the SQL file in that directory, but it looks fine in my cursory inspection.

I'm going to go ahead and roll out the 1.3.0 artifacts in the next few minutes. If no one finds any serious, overlooked problems I'll update the site for the new release. Yay!

Nathan
Reply | Threaded
Open this post in threaded view
|

Re: Any news on Wicket 1.4 support ??

Daniel Toffetti
    Hey please check Recipe example, I've found a problem with a CLOB column but didn't had time to try fixing it yet, and I've not even tested Graffiti example... are you sure those work fine ?  If not, allow me for some days and I'll see what I can do.

Cheers,

Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Any news on Wicket 1.4 support ??

n8han
Administrator
Oh, sorry I thought you had checked them all. Graffiti is fine but Recipe reveals that most of the authorization panels are broken. I guess Wicket changed its API at some point so that wicket:message will not work if the property doesn't exist, so I'll need to change all uses of it there to labels with a default property. Actually this starting to seem familiar, I may have fixed it once already but if so I don't know where the changes are.

Nathan
Reply | Threaded
Open this post in threaded view
|

Re: Any news on Wicket 1.4 support ??

Peter Vlugter
To have warnings instead of exceptions for missing resources:

getResourceSettings().setThrowExceptionOnMissingResource(false);

Peter
Reply | Threaded
Open this post in threaded view
|

Re: Any news on Wicket 1.4 support ??

n8han
Administrator
Ah. I thought there might be something like that. But I've already changed most of them now; I'll finish it so people can leave that option on if they want.

Nathan
Reply | Threaded
Open this post in threaded view
|

Re: Any news on Wicket 1.4 support ??

n8han
Administrator
I've changed all these to Label components, so the Recipe example and anything else using the auth module should work now.

Nathan
Reply | Threaded
Open this post in threaded view
|

Re: Any news on Wicket 1.4 support ??

Daniel Toffetti
    Great, is there anything else I can do to help ?

Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Any news on Wicket 1.4 support ??

n8han
Administrator
If you don't see any other problems, then I'll do the release.

Nathan
Reply | Threaded
Open this post in threaded view
|

Re: Any news on Wicket 1.4 support ??

Daniel Toffetti
    I've found just two small things in Recipe example:

-"SELECT DISTINCT" in RecipeBook.properties, line 3, is not supported by Derby when one of the columns is of CLOB datatype.
-SearchPanel("search") (RecipeBook,java line 142) gives an error probably due to the null model, I avoided it with SearchPanel("search", new Model("")), but this is also probably Derby related.

    I've checked ActiveObjects project page, last release is from 18 months ago and there is little movement in the source repo so you're probably right about it.

    I don't think there's anything else to add.

Regards,

Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Any news on Wicket 1.4 support ??

n8han
Administrator
Okay, I changed the distinct to a group by on the id, still works okay on mysql. Also made the other change with the blank model.

Nathan
12