< 

Introduction for Developers

< 

Table of Contents

< 

Documents


Files and Setup

First, clone the WordHoard git repository containing all of the Java source code and a number of auxiliary files for the project to any convenient location on your local machine. This will include the third-party libraries used to build and run WordHoard. Then proceed with downloading and unpacking the files in the following list.

  • Raw data files. This large zip archive contains all of the raw data files for the corpora on the main public WordHoard site. This includes the text and tagging data for all of the works. Expand the archive and place the resulting data directory inside your development directory. These files are used to build the static object model database.
  • Static database files. This very large zip archive contains the MySQL binary database files for the current build of the static object model database (the one used by the WordHoard client with all the text and tagging data). Expand the archive and place the resulting wordhoard directory inside your development directory. You will move this directory into your MySQL data directory later (see Installing the Database). Note that it is possible to build this database from the raw data files, and we will discuss how to do this in the chapter Building the Static Object Model. This takes a long time, however, so to help you get started more quickly, we have included this pre-built copy of the database.
  • HTML source for this manual. Expand this zip archive and place the resulting userman directory inside your development directory. Or simply regenerate your own with b doc after you have built the Java source code.

After you have cloned the source repository and downloaded and unpacked the other files, open the setup file. At the top of the file there are several statements which define important environment variables:

  • MYSQL_ROOT_USERNAME = MySQL root username.
  • MYSQL_ROOT_PASSWORD = MySQL root password.
  • MYSQL_BIN = Path to the directory containing the MySQL client and utility programs.
  • MYSQL_DATA = Path to the MySQL data directory.
  • ANT_HOME = Path to the Ant home directory.
  • CODEBASE = HTTP URL for deployed client directory.
  • HOMEPAGE = HTTP URL for deployed user manual.

Change the values of these variables to the ones you use. The root account is the one you use to manage your MySQL system. It must be granted all privileges on everything. See the MySQL manual for details.

When we want to work on WordHoard, we open a new terminal window, change to our development directory, and execute the following command:

source setup

Our setup file defines the environment variables discussed above, sets up our classpath, and defines a large number of aliases that make our work go faster. Other developers, of course, will want to customize their own environments, and developers on other platforms will almost certainly need to make changes to the setup file.

Some of our more useful and frequently used aliases include the following:

  • mysql-start. Starts MySQL.
  • mysql-stop. Stops MySQL.
  • mysql. Runs the MySQL command line client with the root username and password.
  • b. Runs Ant. Used to build the source code.
  • start. Starts the WordHoard server.
  • stop. Stops the WordHoard server.
  • r. Runs the WordHoard client.

We will use these aliases in the examples in the following chapters. To see their definitions, look in the setup file. You may need to change the definitions on your system to get them to work right.


< 

Introduction for Developers

< 

Table of Contents

< 

Documents