Author: keith Date: Wed Aug 6 23:40:06 2008 New Revision: 20520 URL: http://wso2.org/svn/browse/wso2?view=rev&revision=20520
Log: Fixing a bug that surfaced due to Mashup-1072. Exceptions were not propogated to the UI. Modified: trunk/mashup/java/modules/www/cert_manager.jsp Modified: trunk/mashup/java/modules/www/cert_manager.jsp URL: http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/www/cert_manager.jsp?rev=20520&r1=20519&r2=20520&view=diff ============================================================================== --- trunk/mashup/java/modules/www/cert_manager.jsp (original) +++ trunk/mashup/java/modules/www/cert_manager.jsp Wed Aug 6 23:40:06 2008 @@ -228,7 +228,24 @@ } function addCertFromUrlCallback() { - WSO2.MashupUtils.dialog("Operation successfull", "Certificate Added succesfully<br><div style='text-align:right;'><input type='button' value='Close' onclick='handleSuccess();'/></div>", 300, 70); + + var returnElementList = this.req.responseXML.getElementsByTagName("ns:return"); + // Older browsers might not recognize namespaces (e.g. FF2) + if (returnElementList.length == 0) + returnElementList = this.req.responseXML.getElementsByTagName("return"); + var returnElement = returnElementList[0]; + + var response = returnElement.firstChild.nodeValue; + if (response.indexOf("Exception occured") > -1) { + WSO2.MashupUtils.dialog("Exception occured", response + "<br><div style='text-align:right;'><input type='button' value='Close' onclick='handleAddCertFromUrlErrorClose();'/></div>", 300, 70); + } else { + WSO2.MashupUtils.dialog("Operation successfull", "Certificate Added succesfully<br><div style='text-align:right;'><input type='button' value='Close' onclick='handleSuccess();'/></div>", 300, 70); + } + } + + function handleAddCertFromUrlErrorClose() { + clearText(); + WSO2.MashupUtils.dialog.close(); } function addCertFromUrl() { _______________________________________________ Mashup-dev mailing list [email protected] http://mailman.wso2.org/cgi-bin/mailman/listinfo/mashup-dev
