Spring in Workbrain - Part 1 - Introduction

Well, I've been away for a while. I got busy figuring out how to integrate custom Spring modules into Workbrain. I'll share this knowledge with you in a new Spring in Workbrain series I'm starting today. I'll get you through basics of implementing a Spring module in Workbrain, so keep up with the next several posts if this interests you. And do note this series will be purely technical!



Not familiar with Spring? Check it out at www.springsource.org. There are many great tutorials and documentation there as well. I assume you have a basic knowledge of Spring, so some pre-reading would be a good idea. Workbrain is using version 2.0.2, so it helps in debugging if you download the exact source code, which you can do on the Spring Source website.

First off, Workbrain will automatically load your data and service level beans if you place them in data-config.xml and service-config.xml files. But first you'll need to tell it where to look. Follow these steps:
  1. Create a customer.properties file and add it to the package com.workbrain2.customer.
  2. The simple customer.properties text file should contain the 'name' property and the customer package name as the value like so:
    name=myclient
  3. Create a new package for your module at com.myclient.app.modules.moduleName
  4. Create an empty data-config.xml and add it to the package com.myclient.app.modules.moduleName.db.
  5. Create an empty service-config.xml file and add it to the package com.myclient.app.modules.moduleName.svc.
When the JEE server starts up, Workbrain will find the customer.properties file and then automatically search for your data-config.xml and service-config.xml files in com.myclient.** substructure, which it will now find since we've placed them there.

As there are no defined beans yet in those XML files, there won't be any beans created. On my next post, I'll walk you through creating the Workbrain data access objects and adding those to the associated data-config.xml file.

0 comments:

Post a Comment