krimple (141) [Avatar] Offline
Hey everyone…

Now that we're about to release the MEAP with all chapters (pending a final technical review), we're in clean-up mode.

Srini and I put what we originally had for examples in to the github repository, located at

I've been working on the most egregiously wrong ones - for example, chapter 7 had some issues with the ajax components, so I updated it. I originally had a massively confusing version that included jquery as well as dojo samples, but unfortunately I didn't get to contribute a query one. My next cleanup job is the web flow chapter.

So, here are two things we would like to do, and would take volunteers to work on them (if anything, it's practice with getting dojo to work on your forms, and perhaps even finding better ways to do what I've done).

Chapter 7

1. Finish out the other ajax forms for tags and training program, and others - following the pattern established with the course entity / forms.
2. Perhaps building a jQuery version of the same example - I'd commit it as a separate project.

If you'd like to help, feel free to fork the samples repository, make a branch in your own repo, and make your changes. Then you can issue a 'pull request' with your fixes. Remember to let us know that you're working on them, so that we don't do the same thing, and waste your time.

Let us know you're working on them. These changes will just fill out the samples - I am not relying on them to publish the book but they would make for more comprehensive examples.

I will have more of these tasks I'm sure, as I'm rolling through some other chapters making some significant fixes to code. We used the source code just enough to put our examples in text, and now that we have time, we need to go through and clean them up so that they can stand on their own.

I'm also open to putting up a commons - perhaps a place where we can show off some of our readers' contributions. Let me know if you're interesteed.
jbbarquero (84) [Avatar] Offline
Re: Course examples - all online - want to contribute some help?
I'd like to work in this code, however, I haven't read the chapter 7 yet (I'm not currently interested in web flow, but this contribution is a good reason to take a look to it)

Furthermore, there is some work to do in order to migrate the code to the 1.2 version.

I've forked the repository and I've created a branch to work with the chapter 7, however, once compiled, the test doesn't work for some reason related with the database.

I've begun to work with the chapter 3 and 4 in order to remember the business logic and at that moment I've realized the need of updating to version 1.2, and the problems that would can come with it (

The next step is to achieve a successful build and then I'd like to begin with the requested job (after reading the chapter 7, of course)
ken.rimple (246) [Avatar] Offline
Re: Course examples - all online - want to contribute some help?
Ok, I realize I wrote that late at night, but it actually refers to chapter 6. Ugh!

So, I definitely could use help with chapter 7 too but not of the type described by my post. Sigh.
jbbarquero (84) [Avatar] Offline
Re: Course examples - all online - want to contribute some help?
Don't worry, it has been a good way to enter the project.

Besides, in my first reading I was thinking about the chapter 6, but when I decided to try the code, I read "chapter 7", the only one I haven't read, and I felt a little disappointed.

In any case, I imported the code in order to do the first two steps: to compile the code and to pass the tests, using a Roo built from source, version 1.2.0.BUILD-SNAPSHOT [rev 98e5e27]

But it came with the first problem: the entire StudentIntegrationTest failed (error creating the application context due to Foreign key (FKD2311006A8423C66:offering [instructor])) must have same number of columns as the referenced primary key (instructor [id_,id]))

Since I'm not used to working with hsqldb, I imported both the chapters 3 and 4 to review the JPA persistence.

And with that, the second problem arose: the remove test for Offering failed.

It cost me an arm and a leg to realize what the problem was. With the help of the Manning book "Java persistence with Hibernate", I found that ManyToOne Course reference within the Entity Offering can't have cascade options, because Course is the owner of the relationship with the addOffering method and the "cascade all" in the OneToMany relationship with Offering (mapped by course)

Now both the chapters 3 and 4 compile, with Roo 1.2, and they pass the tests.

My next step is to build the chapter 6, in order to contribute as requested.

ken.rimple (246) [Avatar] Offline
Re: Course examples - all online - want to contribute some help?
Fantastic! Are you doing this with a github pull request in mind? I would be glad to receive them.

Great work and huge thanks.
jbbarquero (84) [Avatar] Offline
Re: Course examples - all online - want to contribute some help?
Yes, I forked the repository and created a topic branch.

This afternoon (Madrid, GMT+1) I can push to my fork the chapters 3 and 4, and the 7 if I can fix the error with the database definition (I'm not sure now, because I don't figure out the problem)

Then, I'll send a pull request as you said.

Thanks to you for allowing us to participate.
ken.rimple (246) [Avatar] Offline
Re: Course examples - all online - want to contribute some help?
Awesome. Thank YOU for offering. I think this could be really great.
MikB (202) [Avatar] Offline
Re: Course examples - all online - want to contribute some help?
There is some specific git version I must use there? Or a specific command? I use mercurial mostly, so it's possible I use the wrong command "git clone", which gives me
"error: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing"

"checkout" also doesn't work.
What's the correct command?

BTW, is there any value doing a jdk 1.5 branch?
jbbarquero (84) [Avatar] Offline
Re: Course examples - all online - want to contribute some help?
Roo 1.2.0.BUILD-SNAPSHOT [rev 11acd5e]

The last two commits don't compile. The one that I'm using doesn't complete the import of @RooJpaActiveRecord and I need "to ctrl+shift+o" in the STS.

The chapter 07 already has a problem with a column definition (constrains in tables).

The chapter 04 passed the tests yesterday but not today. I'm wondering if Student needs an addRegistration method as it has Offering: the StudentIntegrationTest obtains a new transient student without registrations, and then set to the registration the obtained student. But the student doesn't have any registration for deleting ·in cascade", so you can't remove the Student because the registration keeps a reference to it.

But... the addRegistration method is not enough, I'm missing some flush in the meantime, because an exception indicates that there is an attempt of removing a null registration.

Or... I've created some dependencies in my MySQL database that I should erase (because yesterday I had no problems with the tests of chapter 4)

Good night.