Today Klaus Bild posted this very interesting article on his blog:

<![CDATA[
Will be replaced by iFramevar widgetId = “_” + this.iContext.widgetId + “_”;
var attributesItemSet = this.iContext.getiWidgetAttributes();
var displayedUserKey = attributesItemSet.getItemValue(“profileDisplayedUserKey”);
dojo.xhrGet({
url : “/profiles/atom/profile.do?key=” + displayedUserKey,
handleAs : “xml”,
load : function(xml, ioargs) {
var city = atomGetNodeValue(xml, “x-building”);
var street = atomGetNodeValue(xml, “x-office-number”);
dojo.byId(“customMap”).innerHTML = “https://maps.google.com/maps?f=q&source=s_q&q=“;
},
error : function(error, ioargs) { console.log(“error retrieving profile: ” + error); }
});
// iterate DOM to find the element with the requested class attribute
function atomGetNodeValue(xml, className) {
var nodeList = xml.getElementsByTagName(“span”);
for ( var i = 0; i < nodeList.length; i++) {
var element = nodeList.item(i);
if (element.getAttribute(“class”) == className) {
return (element.firstChild != null ? element.firstChild.nodeValue : “”);
}
}
}]]>
