Skip to content

Instantly share code, notes, and snippets.

@cboulanger
Last active April 28, 2016 20:53
Show Gist options
  • Save cboulanger/1461027 to your computer and use it in GitHub Desktop.
Save cboulanger/1461027 to your computer and use it in GitHub Desktop.
HTML file for Bookends server unAPI support
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="author" content="Christian Boulanger" />
<title>Bookends Database Access with unAPI support</title>
<link rel="unapi-server" type="application/xml" title="unAPI" href="http://localhost/~cboulanger/unapi.php" />
</head>
<body>
<h2>Search Bookends</h2>
<form method="post" action="http://localhost:2001/BEPost">
<!-- static params sent to bookends server -->
<input type="hidden" name="DB" value="cboulanger.bdb" />
<input type="hidden" name="ShowHitNum" value="true" />
<input type="hidden" name="HTMLOutput" value="1" />
<input type="hidden" id="Head" name="Head" />
<input type="hidden" id="Foot" name="Foot" />
<!-- search result header -->
<div id="resultheader" style="display:none">
<h1>Search Results</h1>
</div>
<!-- search result footer -->
<div id="resultfooter" style="display:none">
<p><a href="default.html">Back to Search</a></p>
</div>
<!-- programmatically insert header and footer into request -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#Head").val( "<html><head>" + document.head.innerHTML + "</head><body>" + $("#resultheader").html());
$("#Foot").val( $("#resultfooter").html() );
});
</script>
<!-- search query params -->
<fieldset>
<p>
<label for="Query">Search in all fields:</label>
<input name="Query" style="width:500px">
<input hidden name="Field" value="allFields">
</p>
<p> OR </p>
<p>
<label for="Field">Provide SQL query:</label>
<input name="SQLQuery" style="width:500px">
</p>
<hr/>
<p>
<label for="Format">Return in format of:</label>
<select id="Format" name="Format" />
<option value="MLA-unAPI" selected="selected">MLA (with unAPI support)</option>
<option value="BibTeX">BibTeX</option>
<option value="RIS">RIS</option>
</select>
</p>
<p><label for="HitLimit">Maximum number of hits to return:</label>
<select id="HitLimit" name="HitLimit">
<option>1</option>
<option>5</option>
<option>10</option>
<option selected="selected">20</option>
<option>Unlimited</option>
</select>
</p>
<p><input type="submit" value="Submit Search" /> <input type="reset" value="Start over" /></p>
</fieldset>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment