Prerequisites- Java 6 SDK
- Maven 2
- A decent database -or- MySQL (if you're feeling adventurous, we should test on PostgreSQL too)
- IDE (optional; after all, there's nothing wrong with vi or Emacs!)
- Computer (required)
Step by Step(No, not the television show!) Getting started with the ORBlogs/BigBark codebase is straight forward: Step 1: Checkout and Build- Download and unpack Maven 2.0.9
- Verify Maven install by running "mvn -version" from the command line
- Check out SVN code from this project
- From with the checkout, run "mvn install". You'll get an error that 5 dependencies could not be found.
- Go in to the etc directory and run the install-libs script (.sh for unix and .bat for windows)
- Go back to the root checkout and run "mvn install". It should complete successfully.
Step 2: Open in an IDEIf you are using IntelliJ IDEA, it can automatically open pom.xml files, which are the Maven build instruction. If you're on a different IDE, it may or may not support Maven natively. If it doesn't, there may be a Maven plugin that can generate the project settings for you. For example, you can run "mvn eclipse:eclipse" from the command line and it will generate an Eclipse project file for you. Step 3: Running the CodeTo get the code running, you need a local copy of MySQL running. MySQL needs a database named "bigbark" with a username and password of "bigbark" that has full permissions on that database. You do not need to set up any tables ahead of time, as those will be created automatically when the server runs. mysql> create database bigbark;
Query OK, 1 row affected (0.00 sec)
mysql> create user bigbark;
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on bigbark.* to 'bigbark'@'localhost' identified by 'bigbark';
Query OK, 0 rows affected (0.00 sec) Once the database is set up, simply execute the maven "jetty:run" goal. That will create a mini web server available at http://localhost:8080/. That's it! Navigating the CodeThe directory structure uses the standard Maven build structure, which is: - pom.xml - The Maven build file, which declares dependencies and project information.
- src
- main
- java - Java source files for the main program.
- net
- bigbark - General source code location
- stripes - Where Stripes "ActionBeans" are stored. By default any bean extending ActionBean will be accessible at "/foo" if the name is FooActionBean, but this mapping can be overridden.
- resources - Supporting configuration files.
- webapp - The root of the webapp itself. Everything here (except for WEB-INF) can be accessed HTTP.
- WEB-INF
- web.xml - The configuration of the web-app itself, including filters, servlets, etc.
- jsp - Convention where JSP files go. Instead of being accessed directly, they are rendered through a Stripes "ActionBean" which can access the JSPs in a privileged manner.
- tags - Convention where JSP tag files go, such as form tags
- decorators - Convention where the SiteMesh decorators go. Decorators provide things like a common header/footer without actually needed to include them in every page.
- test
- java - Java test classes
- resources - Java test supporting files
- target - Temporary space used for building. This can be nuked at any time.
|