Look Ma, No Plugins!
var f = function (OpenHandleJson) {
var h = new OpenHandle(OpenHandleJson);
var hv = h.getHandleValues();
for (var i = 0; i < hv.length; i++) {
var v = new HandleValue(hv[i]);
if (v.hasType('URL')) {
print(v.getData());
}
else if (v.hasType('HS_ADMIN')) {
var a = new AdminRecord(v.getData());
print(a.getAdminPermissionString())
}
}
}
| "And that, gentlemen, is how we do that." - Apollo 13 |
Following on from my earlier Client Handle Demo post, this entry is just to mention the availability of a port of (part of) the Handle client library (in Java) to JavaScript: openhandle-0.1.1.js which is being maintained on the OpenHandle site. The JavaScript module contains methods for three classes: OpenHandle, HandleValue and AdminRecord.
What does all that mean? It means that Handles and their constituent values and value fields can be accessed directly within any Web browser (using an OpenHandle service) which allows a dynamic Handle client to be generated and presented within a user context. No plugins required. The port mirrors the class methods in the standard Java client library for Handle.
As a demo of this JavaScript module in action, see this Inspector app for a card index view of Handle (and by implication DOI) records.

Comments
Just fixed a minor bug that was preventing the cards to be stacked correctly. (Now tested on IE7, Chrome, FF2/3, Opera, Safari.)
There are some outstanding issues, e.g. error handling in the app. Also the treatment of dates in the JavaScript module is a bit rough and ready - needs to be addressed on the server side.
Posted by: Tony Hammond | September 23, 2008 6:34 AM