How to use Exhibit offline

HowTo Articles Home &raquo;

Preliminaries
Exhibit's code is stored in our Subversion code repository, just like all of our other projects. You need a Subversion client and here is a list of Subversion clients we know of.

Downloading Exhibit
After having installed one of the Subversion client, go to the command prompt and change to the directory where you want to download Exhibit's code and type

svn checkout http://simile-widgets.googlecode.com/svn/exhibit/trunk simile-widgets-read-only

If you're checking out Exhibit's code from within Eclipse, then you probably know what to do with that URL above.

Fixing Dependencies
Exhibit relies on the SimileAjax library, which is included in the SVN checkout. However, by default, Exhibit still tries to load the SimileAjax library at http://static.simile.mit.edu/ajax/api-2.0/simile-ajax-api.js. So, you need to change this dependency.

If you intend to use Exhibit locally on your own machine only, then go to the file exhibit/src/webapp/api/exhibit-api.js, find

var useLocalResources = false;

and change it to

var useLocalResources = true;

If you also intend to serve Exhibit so that other people on other machines can use it, then still do that change, and then in the same file, find all instances of

http://127.0.0.1:8888

and change it to match your machine's address.

But be careful not to commit these changes back into SVN

Running Exhibit using Jetty
In the directory where you checked out exhibit, type (on Windows)

run

or on Mac,

./run

This will launch a small web server (Jetty). You can then browse to http://127.0.0.1:8888/exhibit/. And the API is at http://127.0.0.1:8888/exhibit/api/exhibit-api.js.

Conditionally loading Exhibit from file:* or http:*
Here is a method to load Exhibit from your local file system, when the exhibit you browse was loaded from a  URL, or from Simile, when it was fetched from elsewhere (an   URL, most likely). This is convenient when you do edits locally, but don't want to rewrite the page before uploading it to your web hosting somewhere when you publish it. It requires you to first check out the Exhibit repository and any of the other required resources (Timeline, in this example) to local disk, and then link to the API using code like this. Be sure to update your local copy once in a while, if you use a non-stable / unreleased version (as 2.0 presently is). Substitute  for the path where your checked out copy resides:

 function load( url ) { var script = '\n'; document.write( script ); } if( location.protocol != "file:" ) { load( "http://simile.mit.edu/repository/exhibit/branches/2.0/src/webapp/api/exhibit-api.js?views=timeline" ); } else { load( "/home/svn/exhibit/branches/2.0/src/ajax/api/simile-ajax-api.js?bundle=false" ); load( "/home/svn/timeline/trunk/src/webapp/api/timeline-api.js?bundle=false" ); load( "/home/svn/exhibit/branches/2.0/src/webapp/api/exhibit-api.js?bundle=false" ); }