{
dispel = URLDecoder.decode(dispel,"UTF-8").substring("dispel=".length());
initGatewayBeanFactory();
LOG.debug("Validating DISPEL:\n" + dispel);
DISPELValidator processor = new DISPELValidator();
processor.setAdmireRegistry(GatewayBeanFactory.getInstance().getAdmireRegistry());
processor.process(dispel);
StringBuffer sb = new StringBuffer();
sb.append("<html xmlns=\"http://www.w3.org/1999/xhtml\">\n");
sb.append("<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />");
sb.append("<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/docs.css\" /></head>\n<body>\n");
if (processor.getError().length() > 0)
{
sb.append("<h2>Errors</h2>\n<pre><![CDATA[");
sb.append(processor.getError());
sb.append("]]></pre>\n");
} else {
sb.append("<h2>Your DISPEL is valid!</h2>");
sb.append("<h3>Submitted Graphs</h3>\n");
for (String svg : processor.getSubmitted())
{
sb.append(svg);
sb.append("\n");
}
sb.append("<h3>Registered Objects</h3>\n");
for (Entry<String, String> entry : processor.getRegistered().entrySet())
{
sb.append("<ul><li>");
sb.append(entry.getKey());
sb.append("</li></ul>\n");
// this could be inline svg, or just DISPEL