n. Slang a rough lawless young Kuali developer.
[perhaps variant of Houlihan, Irish surname]
kualiganism n

# Kualigan

Blog of an rSmart Java Developer. Full of code examples, solutions, best practices, et al.

## Thursday, September 27, 2012

### This is Now a Personal Blog

This had been a professional blog connected to rSmart. It is not any longer. The feed from this blog no longer appears on rSmart's blog.

This is quoting my About Page
I'll start with the blog description, "Blog of an rSmart Java Developer. Full of code examples, solutions, best practices, et al." This is a professional blog about software development with Kuali Software. It is composed of examples from real-world scenarios and encounters while developing on the Kuali platform.

The goal of this blog is to help spread information through the Kuali community and share development experiences. There is a rift in implementation of kuali software vs. development of kuali software. I want to share ideas between. While the mailing lists also do this, there is no such thing as too much communication.

Any critiques I make on this blog are intended to be honest and truthful. Critiques are, of course, opinions; therefore, consider them with your own discretion. The opinions and critiques made on this blog are my own and do not reflect the opinions and criticisms of rSmart or the Kuali Foundation.

## Beamer over S5 or Reveal JS

I usually use S5 or Reveal JS generated from LaTeX and hyperlatex. This Kuali Days, I'm going to use Beamer.

## Motivation

The reason for it is mostly Speakerdeck. I am expecting to push my presentations up there immediately after doing them. I suppose I could do that with S5 or Reveal JS. I really like the Speakerdeck product though.

## Custom Theme

Unfortunately, the themes available for beamer don't work with Kuali Days presentations. I had to build my own theme to do it.

All of my presentations (including those from previous Kuali Days) can be found on GitHub. Likewise, you can find the templates in that same GitHub project.

### Using it

Just clone the project and copy the theme to your \$TEXMFHOME

Then, just create your TeX file and use the beamer theme.

## Overview

The rice team has put together their own archetype compliments of Travis Schneeberger of Dechen Consulting Group. It's intended to replace the aging createproject.groovy script. I for one am excited and very eager to look at the code.

## Details

You can checkout the Jira comment about his checkin. Looks like it's slated for 2.2, but it's on the 2.1 branch right now. At some point, there's going to be a code review on this. I'd like to point out some features I already see just from the checkin comment.

### Overlay

Right off, you can tell it's pretty skeletal! That's because it's an overlay. Unlike the previous createproject.groovy that built a full project with rice as a resource, this creates an overlay project.

### Sample Unit Tests

A config\archetype\quickstart\src\main\resources\archetype-resources\src\test\java
A config\archetype\quickstart\src\main\resources\archetype-resources\src\test\java\MultiplicationProductServiceImplTest.java
A config\archetype\quickstart\src\main\resources\archetype-resources\src\test\java\AbstractProductServiceImplTest.java

looks like there are some sample unit tests there. Since there's no package, I take it that it's been filtered and whatever package you use to create your project will be used. Very happy about that.

### Sample Services

Of course the tests mentioned earlier are for code that isn't in Rice. Here's the actual code it's testing:

A config\archetype\quickstart\src\main\resources\archetype-resources\src\main\java\AdditionProductServiceImpl.java
A config\archetype\quickstart\src\main\resources\archetype-resources\src\main\java\MultiplicationProductServiceImpl.java
A config\archetype\quickstart\src\main\resources\archetype-resources\src\main\java\ProductService.java

### Sample Spring Bootstrap Config!

It's better not to mess with the base rice config. You usually want to bootstrap the spring config. createproject.groovy didn't really give you good examples on that. Enter quickstart-archetype!

A config\archetype\quickstart\src\main\resources\archetype-resources\src\main\resources\BootStrapConfig.xml
A config\archetype\quickstart\src\main\resources\archetype-resources\src\main\resources\BootStrapSpringBeans.xml

### Sample Integration Tests

Travis put together some pretty cool integration tests.

A config\archetype\quickstart\src\main\resources\archetype-resources\src\it
A config\archetype\quickstart\src\main\resources\archetype-resources\src\it\java
A config\archetype\quickstart\src\main\resources\archetype-resources\src\it\java\BasicApplicationIT.java
A config\archetype\quickstart\src\main\resources\archetype-resources\src\it\resources

### Sample Project Configurations

Before there was only one config (rice-config.xml) you could use. Now you can instrument various areas of your configuration before it hits the shelves.
D config\templates\createproject.SampleAppBeans.template.xml
D config\templates\createproject.SpringBeans.template.xml
C config\templates\createproject.pom.template.xml
D config\templates\createproject.standalone.meta-inf.config.template.xml
D config\templates\createproject.standalone.config.template.xml
D config\templates\createproject.standalone.RiceDataSourceSpringBeans.template.xml
D config\templates\createproject.config.template.xml
D config\templates\createproject.standalone.RiceSpringBeans.template.xml

### Full Application Test

Before you even finish building the application from the archetype, it will test it out for you. That's a really good feature that createproject.groovy never had.

A it\config\src\test\groovy\org\kuali\rice\config\at\QuickStartTest.groovy
A it\config\src\test\resources
A it\config\src\test\resources\META-INF
A it\config\src\test\resources\META-INF\config-test-config.xml

## Want to know more?

Check out The Confluence Page on it if you want to know more. They have tons of other features planned and great IDE integration! It's all planned to hit you before Kuali Days!

## Other Archetypes

I'd like to also point out that I have a fair a mount of archetypes I'm working on at my github project. Some time pre-or-post-code review I will go over the actual differences between the archetypes and why you would want to use one over the other.

## Overview

While there's now an Ant implementation and a Maven plugin devoted to copying databases across RDBMS platforms, the plan has always been to be supportive of the liquibase core and to use liquibase custom refactorings for as much as possible. Right now, the Rice project is working on a fork of liquibase. Much of what Kuali needs is outside the scope of liquibase and contrary to the direction they want to go.

Maintenance effort can be reduced by developing necessary functionality as extensions which is why I chose this approach. I am developing everything as an extension of liquibase and posting it on the web and in forums. If others find it useful, a liquibase Jira issue can be created for implementing the extensions in the core. Then, "Why the reimplementation of Ant and maven plugins?" My answer is plainly that liquibase as it is now does not support the use cases that I want.

• Database Migration and copy
• Clover and Pentaho change management/integration
• Ruby-on-rails-ish migration
• Simple developer change testing

It's not that liquibase does any of those things differently, but that they simply don't exist. The direction of the product is not leaning toward any of those features. It is database change management on the simplest level. However, they have created an awesome and useful extension system that allows me to add in the pieces I need.

That all being said, I am creating liquibase extensions that will get me the functionality I am looking for simply by using liquibase, ant, or maven. Some of it I have already shared with the Rice Liquibase Extensions.

## MigrateData Custom Change

I have now made another one for migrating data across RDBMS platforms.

### Using it

This is not so bad. You basically want to:
2. Create a change
3. Run it with liquibase

Likewise, I need to add my credentials for the target database into src/main/resources/liquibase/

### 2 Create a change

This is pretty easy. It's just a normal liquibase change.

It may not make sense at first that there's only a source specified. The reason for this is that the target is always where liquibase is applying the change. It does not need to be specified because liquibase already knows about it.

### 3 Run it with liquibase

Personally, I prefer the maven tooling, so I'm going to use that:

Enjoy

## Overview

Thanks for reading my 100th post!
It seems like I've already blogged about this subject. I have. The difference is this time I'm going to use the lb-maven-plugin to do the copy. In previous runs I've used an ant project which you have to copy and then modify via editing. This time, I'm going to copy an entire oracle database straight from a maven plugin. I don't even have a maven project. Keep in mind that in normal cases, you usually export the database and then import it. That's just if you're doing it with the same RDBMS (ie., oracle or mysql but not both). Here we go:

## Screencast

I am working on an even easier way to do this without a maven plugin or ant tool, but just straight through liquibase. I also want to provide a way to encapsulate data with an embedded RDBMS (H2). This is better than flat files because it's not a flat file and it's entirely browsable via SQL utility. That makes it much easier to analyze when you need to.

## Overview

Recently my page on the Kuali Wiki regarding Updating Default Java via Ubuntu Alternatives was deleted. For my own edification, I'm adding it here. This is how the Ubuntu distribution natively maintains multiple versions of the same software (ie., different versions/flavors of java). I think it's worth noting since it's not entirely straightforward.

## Details

### Overview

Commands for maintaining the path of commands managed by the ubuntu system. This is important because Jenkins doesn't allow setting a default tool version. Instead, it will use whatever singular version exists. If more than one version exists, then it will default to whatever is set in the path which is managed by ubuntu alternatives. Therefore, if you have more than one JDK that you are using in Jenkins, the default will be managed this way.

Note This is a system-wide change. If every it is required to have a different JDK between different CI jobs, Jenkins facilitates handling this internally with a drop down.

### Commands

All of these commands will alter the state of a running ubuntu distribution, so they need to be executed as root (probably using sudo).

### Install a New Alternative

This will add a new alternative for java at the /usr/bin/java path using the java located in /var/lib/jenkins/tools/JDK_6/bin/java with a priority of 99. An alternative must be installed and registered before it can be set.

### Setting an Alternative

Sets the java alternative manually to /var/lib/jenkins/tools/JDK_6/bin/java

## Enjoy!

I hope this helps others as much as it helped me.