Sure, we could always use more documentation! Thanks a lot, and I'm
glad it's working now.
~Gabe
On Oct 11, 2007, at 11:56 PM, Ed Miller wrote:
Not closer: we have a winner! I made the changes indicated and it
produced the ideal result. Everything worked fine with the network
cable pulled out. Fantastic work, Gabriel and David.
Now, as a thank you, would you like me to draft some narrative for
the wiki? I can't thank you guys enough.
Ed
At 12:21 PM 10/11/2007, you wrote:
Aha, I think we're getting closer!
I poked around in the file
./exhibit/src/webapp/extensions/time/time-extension.js
as you suggested, and it looks like there is a change you have to
make. It turns out in that file, it loads timeline stuff from
simile's server, and even further, I forgot that there's a whole
timeline project you'll have to check out. :-)
So, go ahead and check out from svn:
http://simile.mit.edu/repository/timeline/trunk
into a local directory somewhere.
Next, you'll have to change the time-extension.js file mentioned
above, to point to that directory, instead of simile's server. If
you look in the file you'll see:
var scriptURLs = [ " http://static.simile.mit.edu/timeline/
api-2.0/timeline-api.js" ];
Try changing that URL to a "file:// " URL to the timeline-api.js
file that you just checked out.
So I changed it to:
var scriptURLs = [ " file:///Users/gabrieldurazo/Classwork/urop/
timeline/src/webapp/api/timeline-api.js " ];
and now it works for me. Last time when I tried it I just used the
Firebug Firefox extension to look at the external calls it was
making, and didn't think to actually check it with my wifi
disabled. When I disabled the wifi, my local Timeline stopped
working. But after checking out the project and making that
change, now it does work locally, so I have high hopes.
Let us know if this does it for you!
~Gabe
On Oct 11, 2007, at 2:21 PM, Ed Miller wrote:
For those following my efforts, I changed the subject line of
this thread to better reflect its content. I am trying to run
Exhibit with Timeline extensions completely offline on a laptop
for a demonstration.
To this point, David Huynh and Gabriel Durazo have offered very
helpful suggestions. You can see Gabriel's instructions (which
are essentially a superset of David's) below, which I have
effected on my machine. I'm here to report on the results of my
attempts with these new instructions. Hopefully when we get to
the end of this, I can wikify all this on the SIMILE wiki.
The short version is that these instructions make Exhibit work,
but not the Timeline extension aspect of it. When I try and load
a page that has a timeline in it, I get the error (from Internet
Explorer...maybe I should try Firefox): "Caught exception:
undefined. 'Timeline' is undefined." I'll recap exactly what
I've done and outline what I plan to try.
This assumes of course that you've already downloaded the full
source of Exhibit 2.0 from the Subversion repository. I have,
and stored it in a directory called "exhibit" that sits in the
same directory as the web page I am trying to create. For
example...
Desktop/-|
|- index.html
|- exhibit/
|- lib/
|- src/
|- tools/
|- etc...
So according to both David and Gabriel, step one is to change the
line in exhibit/src/webapp/api/exhibit-api.js:
// change this line from false to true
var useLocalResource = falsetrue;
I did that. Next, Gabriel says there are spots where a C-like
a ? b : c expression contains a web reference ( http://
127.0.0.1:8888) that assumes you're running a local web server on
port 8888. This has to be changed to a local file URL. Gabriel,
on a PC, a reference to the C:\ drive has the slightly peculiar
notation file:///C:/ . On my machine, since everything is in the
exhibit folder in the same directory as my web file, I would make
a change like this...
var url = useLocalResources ?
// " http://127.0.0.1:8888/exhibit/extensions/time/time-
extension.js" :
" file:///C:/Documents%20and%20Settings/miller113/Desktop/
exhibit/src/ajax/api/simile-ajax-api.js " :
" http://static.simile.mit.edu/ajax/api-2.0/simile-ajax-
api.js ";
and as Gabriel points out I need to make the same sort of change
in the reference to the timeline extension in the same file...
if (includeTimeline) {
scriptURLs.push(useLocalResources ?
// " http://127.0.0.1:8888/exhibit/extensions/
time/time-extension.js" :
" file:///C:/Documents%20and%20Settings/miller113/
Desktop/exhibit/src/webapp/extensions/time/time-extension.js " :
" http://static.simile.mit.edu/exhibit/
extensions-2.0/time/time-extension.js ");
}
Now if I embed this in the head of my web page one assumes it
will work...
<script src="./src/webapp/api/exhibit-api.js?
views=timeline&bundle=false" type="text/javascript"></script>
...and the answer is, yes, Exhibit correctly displays the various
facets like the view facets and text search facet. But as soon
as I include a timeline facet, I get the " 'Timeline' is
undefined " error. So I have a couple of theories I'm about to
explore.
* Perhaps the ./exhibit/src/webapp/extensions/time/time-
extension.js file has similar a ? b : c fixes needed?
* Can I have a web page with a timeline facet without having
Timeline's source tree stored locally as well? Maybe not.
In any case, I'll continue to work this and hopefully I'll have
an answer shortly. Gabriel and David, if something stands out
among the things I've observed, please let me know.
Ed
At 07:21 PM 10/9/2007, you wrote:
Hi Ed,
I'm pretty sure this is possible because I'm pretty sure I've
done it before. I know it definitely doesn't work with Safari (I
did it on a Mac), but I seem to remember having some success
with Firefox.
~~~~
Okay, actually I just tried it out and it worked for me, at
least on my Mac with Firefox. Here's what I did:
In the HTML, instead of loading the script from simile's
servers, you can load it from a local file, with something like
this:
<script src="../../../api/exhibit-api.js?
views=timeline&bundle=false" type="text/javascript"></script>
Now, you'll have to change the exhibit-api.js file a bit:
One of the first lines you'll see is:
var useLocalResource = false;
Unsurprisingly, you'll change this to "true".
Now, you'll have to go through the file and change a couple
places where that variable is used, since by default it expects
you to be running a server on your own computer, so it tries to
find stuff at 127.0.0.1. So scroll towards the end of the file
(or search for "useLocalResource") and you'll see this:
if (includeTimeline) {
scriptURLs.push(useLocalResources ?
" http://127.0.0.1:8888/exhibit/extensions/time/time-
extension.js" :
" http://static.simile.mit.edu/exhibit/extensions-2.0/
time/time-extension.js ");
}
That little ? after the useLocalResources is basically a
condensed "if" statement. If useLocalResources is true, then do
the thing before the colon, otherwise do the thing after the
colon. So now go ahead and comment out the 127.0.0.1 line, and
put in the address on your local drive. Since my time extension
folder is on my local drive here:
/Users/gabrieldurazo/Classwork/urop/exhibit/src/webapp/
extensions/time/time-extension.js
I changed it to:
if (includeTimeline) {
scriptURLs.push(useLocalResources ?
// " http://127.0.0.1:8888/exhibit/extensions/time/time-
extension.js" :
" file:///Users/gabrieldurazo/Classwork/urop/exhibit/src/
webapp/extensions/time/time-extension.js " :
" http://static.simile.mit.edu/exhibit/extensions-2.0/
time/time-extension.js ");
}
I'm not exactly sure what it would be on Windows -- maybe
something like file://C:/...... You may have to play around with
it a bit. Actually, after some Google searching, I see this may
be somewhat of a stumbling block. Make sure you can at least
just open an ordinary text file locally with file:// before you
try messing with the javascript files.
You can change the Map one this way, too, though I don't know
how useful the map will be without an internet connection.
You have to do this type of change to the third
useLocalResources, in order to load the simile-ajax stuff. e.g:
var url = useLocalResources ?
// " http://127.0.0.1:8888/ajax/api/simile-ajax-api.js" :
" file:///Users/gabrieldurazo/Classwork/urop/exhibit/src/
ajax/api/simile-ajax-api.js " :
" http://static.simile.mit.edu/ajax/api-2.0/simile-ajax-
api.js ";
~~~~~~~~
I hope this helps. I did this with Exhibit 2.0 since I don't
have 1.0 on my computer. You can just get the whole deal with an
svn checkout.
svn checkout http://simile.mit.edu/repository/exhibit/branches/
2.0/ exhibit
I think some of this may be able to be avoided by just loading
the Timeline extensions directly from the HTML in a script tag
along the lines of:
<script src="../../extensions/time/time-extension.js"></script>
but I'm not sure. Maybe David or someone can chime in with a
more straightforward way of doing this.
Cheers,
Gabe
On Oct 9, 2007, at 4:36 PM, Ed Miller wrote:
Uh, it's a little more complicated than just that. I looked at
the
instructions to run Exhibit offline in the wiki. For starters,
it's
for version 1.0. Secondly, I need it to run with the Timeline
facet,
which the instructions don't address.
1 - Is this even possible?
2 - Is it as simple as a bunch of find/replace operations?
3 - Are there even more web linkages that I haven't anticipated
that
will have to be found and fixed?
_____________________________________________________
Ed Miller
Lawrence Livermore National Laboratory (LLNL)
_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general
_____________________________________________________
Ed Miller
Lawrence Livermore National Laboratory (LLNL)
(925)423-4351
_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general