This page describes how you install Giles. Giles depends on two other web applications: Digilib and Jars. Digilib serves up images and Jars manages their metadata.. You can run Giles without Jars. However, you will have a bunch of non-working links in that case.

System Requirements

Notes on Giles & Digilib

Giles works under the assumption that it is running on the same machine as your Digilib installation. When uploading a file, Giles simply puts that file into a folder accessible by Digilib. If you have different requirements, then Giles won't work for you. However, if you are comfortable programming Java, you could implement your own FileStorageManager (edu.asu.giles.files.impl.FileStorageManager). This class is the one that handle file storage in Giles.

Giles adds authentication and authorization to Digilib. This only works effectively if you add authentication to Digilib as well. The easiest way to that is to let Tomcat close down access to Digilib completely and only allow request from localhost. If you want parts of your Digilib contents to be open to the public or specific groups or users, please consult the Digilib documentation.

Giles and Databases

Giles uses two different databases.The goal is to change that in the future but for now this is the way it is. Information about uploaded files are stored in several Db4o database files. Advantange of this is that they can easily be moved around and backed up.

Information about GitHub user account tokens are stored in a MySQL database. This is the default implementation of the Social Spring module that Giles uses. Before you deploy Giles, make sure to create a database and run the following script to create a table to hold information about what users authorized Giles to use their GitHub profile.

create table UserConnection (userId varchar(255) not null,
	providerId varchar(255) not null,
	providerUserId varchar(255),
	rank int not null,
	displayName varchar(255),
	profileUrl varchar(512),
	imageUrl varchar(512),
	accessToken varchar(512) not null,
	secret varchar(512),
	refreshToken varchar(512),
	expireTime bigint,
	primary key (userId, providerId, providerUserId));

create unique index UserConnectionRank on UserConnection(userId, providerId, rank);

Building Giles

Giles is a Java/Spring web application that uses Maven. The easiest way is therefore to download the latest release and run maven to build a war-file. You can either do that in your favorite IDE or through the terminal. If you are comfortable using Maven, simply run mvn package specifying the following parameters:

Step-by-step guide

You will probably not getting around learning a little bit about Maven in order to build Giles, but this step-by-step guide hopefully makes it as easy as possible. 

  1. Install Maven
  2. In a terminal go into the folder giles-{version}/giles-spring
  3. You need only one command to build Giles: mvn clean package. This will delete all previous built files and generate a war file. However, you need to specify the above listed properties for Giles to work correctly.
  4. To specify a property when running Maven, the easiest way is to append -D{property_name}={property_value}. For example, if your database user is called "giles", then you would append -Ddb.user=giles to the Maven command. The complete command would look like this: mvn clean package -Ddb.user=giles.
  5. Append each property to the command like described in step 4. You complete command string will look something like this:

    mvn clean package -Ddb_files=/path/to/db/files -Dadmin.password=GilesPassword -Dgithub.clientId=githubClientId -Dgithub.secret=githubClientSecret -Ddb.driver=com.mysql.jdbc.Driver -Ddb.database.url=jdbc:mysql://localhost:3306/giles -Ddb.user=giles -Ddb.password=GilesDbPassword -Ddigilib.url=http://myserver.org/digilib/servlet/Scaler -DdigilibBaseDir=/path/to/digilib/images -Djars.url=http://myserver.org/jars -Dgiles.base.url=http://myserver.org/giles

     

  6. Maven will create a new folder in giles-spring called target. If Maven ran successfully you will find a file called giles.war inside this folder.

  7. Simply put giles.war into your Tomcat's webapp directory and you should be good to go!