Permalink
Browse files

Add comment in generated BookReader main html showing how to use JSLo…

…cate for stable metadata access instead of referencing datanode directly.
  • Loading branch information...
mangtronix committed Oct 25, 2010
1 parent 794abae commit 50dd312114aa8bbf1d593eada5c57f3b179e810d
Showing with 16 additions and 1 deletion.
  1. +16 −1 BookReaderIA/inc/BookReader.inc
@@ -107,6 +107,7 @@ class BookReader
}
$metaURL = BookReader::jsMetadataURL($server, $identifier, $mainDir, $subPrefix);
+ $locateURL = BookReader::jsLocateURL($identifier, $subPrefix);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
@@ -149,8 +150,11 @@ class BookReader
brConfig["mode"] = 2;
<? } ?>
</script>
-<!-- The script included below is dynamically generated JavaScript that includes the book metadata and page image access functions -->
+<!-- The script included below is dynamically generated JavaScript that includes the book metadata and page image access functions.
+ The ia{number}.us.archive.org server referenced below can and does change, so this URL should NOT be used for permanent access. -->
<script type="text/javascript" src="<? echo($metaURL); ?>"></script>
+<!-- This URL will find the item and redirect to the correct server. Remove the line above and use the URL below for stable access. -->
+<!-- <script type="text/javascript" src="<? echo($locateURL); ?>"></script> -->
<? if ($uiMode == 'full') { ?>
<div id="BookReaderSearch" style="width:190px; right:0px; top:10px; bottom:2em;">
@@ -241,6 +245,17 @@ class BookReader
return $url;
}
+ // This returns a URL that finds the item then returns a redirect to BookReaderJSIA.php
+ // on the item's server.
+ public static function jsLocateURL($identifier, $subPrefix = '')
+ {
+ $locateURL = 'http://www.archive.org/bookreader/BookReaderJSLocate.php?id=' . $identifier;
+ if ($subPrefix) {
+ $locateURL .= '&subPrefix=' . $subPrefix;
+ }
+ return $locateURL;
+ }
+
// Return the URL for the requested /download/$path, or null
public static function getURL($path, $item) {
// $path should look like {itemId}/{operator}/{filename}

0 comments on commit 50dd312

Please sign in to comment.