How to use Exhibit offline
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.
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.
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
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)
or on Mac,
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
file: URL, or from Simile, when it was fetched from elsewhere (an
http: 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
/home/svn for the path where your checked out copy resides:
Note that by default, Exhibit loads its bundled code generated by concatenating its original code and stripping out whitespace (for better performance). If you make changes to any of the .js or .css file, you need to do one of the following:
- In an HTML file that references the Exhibit API on your computer, you need to add the
bundleparameter to that reference, as follows:
- You can re-bundle Exhibit's .js and .css files by running
antin the exhibit directory, given that you have installed Apache Ant.
One more caveat: map markers and exhibit logos are hardwired to our site. They are not included in the download because they take too much space. And obviously, Google Maps and Timeline ain't included.