GettingStarted

This page contains a short guide that should help you getting started if you want to contribute to the development of the TAC Energy server. If you are looking for instructions on how to start developing a Power TAC client please refer to the Power TAC Client documentation, which ships as part of the Power TAC demo client project.

As a first step, you should subscribe to the developers mailing list on nabble.

Prerequisites
You need to install the following software packages and tools on your computer if you want to contribute to the development of the Power TAC project.

Required Software

 * Java 1.6 JDK
 * Groovy development tools (much of the code is in Groovy).
 * SpringSource Grails MVC Framework version 1.3.2 (needed only for work on the frontend web application.

Optional Software

 * An IDE of your choice that provides good support for editing Java and Groovy files, e.g. (in descending order of groovy and grails support)
 * IntelliJ IDEA
 * Netbeans
 * Spring Source Toolsuite, a special distribution of Eclipse with good groovy and grails support
 * Eclipse
 * A Bazaar client in order to be able to check out and manage source code from the TAC Energy version control system

If you are using Grails or the prototype server, then make sure that everything is configured correctly by opening a command line prompt and typing

grails

You should then see something like

cblock-mac:~ cblock$ grails Welcome to Grails 1.3.2 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: /usr/local/Cellar/grails/1.3.2 No script name specified. Use 'grails help' for more info or 'grails interactive' to enter interactive mode Note that you might have to increase Java Heap Space on your local computer in order to avoid PermGenSpace exception and that you have to set up a GRAILS_HOME variable. You can do so by defining the following environment variables on your computer JAVA_OPTS="-Xms512M -Xmx512M" GRAILS_HOME=/grails/installation/directory

Please refer to the grails installation instructions for more information on how to set up the framework on your computer

Downloading the Source Code and Starting the Server
You can either download the latest source code release as zip file from the launchpad project homepage or you can check out the latest development version of the code using Bazaar or from our continuous integration server. as a zip file. To check out the code from the version control system, open a command line window and type

bzr branch lp:tacenergy /some/directory

Afterwards the latest snapshot of the Power TAC server source code is downloaded and unzipped into the given target directory.

You can start the prototype server by simply typing

cd /some/directory grails run-app

This command launches an integrated Apache Tomcat Application server. After some moments you will see something like:

cblock-mac:tacenergy cblock$ cd ~/IdeaProjects/tacenergy cblock-mac:tacenergy cblock$ grails run-app Welcome to Grails 1.3.2 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: /usr/local/Cellar/grails/1.3.2 Base Directory: /Users/cblock/IdeaProjects/tacenergy Resolving dependencies... Dependencies resolved in 4123ms. Running script /usr/local/Cellar/grails/1.3.2/scripts/RunApp.groovy Environment set to development [...] Some more log statements... [...] Server running. Browse to http://localhost:8080/tacenergy You can then point your web browser to http://localhost:8080/tacenergy in order to see the welcome page of the Power TAC server.

Editing the Code
The directory structure of the Power TAC prototype server follows the grails standard, as displayed above. Most importantly you will need the grails-app directory which contains subdirectories for the data model classes (domain), web interface controllers that orchestrate user interaction via the web interface (controller), jsp style pages that serialize Power TAC data into views, and business logic in form of services.

If you wish to work on the prototype server or on the webapp frontend, then perhaps this is the point for you to learn more about grails itself before you continue. Excellent sources to quickly get started with grails are
 * IBM Developer Works series Mastering Grails written by Scott Davis
 * Free InfoQ Ebook Getting started with Grails

After you're familiar with grails, you may want to help us implementing some of the Power TAC code. We use the Bazaar distributed version control system in combination with the launchpad.net code hosting facilities to organize our distributed code development following a gatekeeper model. Please have a look at the Contributor's guide to launchpad and bazaar to learn how to branch and merge code and how to use launchpad in combination with bazaar. It's quick, easy, and fun!

Please also have a look at our Power TAC development policies in order to familiarize yourself with our coding style and our conventions, on checking in and out source code, on when we consider a certain task as being "done" etc.