Monday, September 21, 2009

FGDC Status Checker, GOS Dashboard and the "pulse" of NSDI

The FGDC Status Checker is a new web service that offers a simple but powerful interface to obtain the status information for WMS, WFS and other services in the NSDI - meaning you can get a near real-time picture of thousands of services in the NSDI and beyond. The Status Checker uses the list of services maintained by Geodata.gov, the federal government's information service for maps and data - and is implemented in the new open source GOS Dashboard. The result is the geospatial community can now get a near real-time "pulse" of what services are online today, their reliability and connect directly to them with applications like the Gaia platform.

How do the Status Checker and the GOS Dashboard work together? Simple - The service accepts a document containing the identifiers of the services you want to get a status for, and returns information regarding those services. The document must submitted to the service via an HTML POST, using the application/x-www-form-urlencoded content-type, and the results are sent as an XML document. For our implementation the request is submitted as AJAX.

Here's a Javascript code sample of how our team at The Carbon Project request the 'Status' and reliability 'Score' in the GOS Dashboard gadget. Note that because gadgets only run in a Microsoft environment, this code is tailored to a Microsoft environment (apologies to Linux and Mac folks, we're working on it).

function getStatus(guid) {
_xhrStatus = new ActiveXObject("Microsoft.XMLHTTP");
_xhrStatus.open("POST", "http://registry.fgdc.gov/statuschecker/serviceResults.php?request=XML", true);

_xhrStatus.onreadystatechange = function() {
if (_xhrStatus.readyState == 4 && _xhrStatus.status == 200) {
clearTimeout(_xhrStatusTimeout);

var xmlDocument = new ActiveXObject("MSXML2.DOMDocument");
xmlDocument.loadXML(_xhrStatus.responseText);

var response = xmlDocument.getElementsByTagName("response")[0];
var service = response.getElementsByTagName("service")[0];

setScore(service.getElementsByTagName("score")[0].childNodes[0].nodeValue);
}
}

var request = "requestXml=brief";
request = request + "{" + guid + "}
";

_xhrStatus.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
_xhrStatus.send(request);
_xhrStatusTimeout = setTimeout("getStatusTimeout();", _ajaxTimeout);
}


The result is displayed in the graphic above. You can get more information on the NSDI Status Checker web service by visiting the information page and source code for the GOS Dashboard is available. Community feedback on the GOS Dashboard is welcome through upcoming workshops (here is info on the first one), or you can contribute anytime at the GOS Dashboard discussion forum.

- Jeff and Mark

1 Comments:

At 9/24/2009 10:02:00 AM, Blogger Jeff Harrison said...

Much thanks to Dan for providing some great comments on the GOS Dashboard here - http://tinyurl.com/ya5p4f4

 

Post a Comment

<< Home