proxyInterfaceURL = PATH_UP + "/" + proxyInterfaceURL;
proxyEngineURL = PATH_UP + "/" + proxyEngineURL;
proxyUtilURL = PATH_UP + "/" + proxyUtilURL;
}
Module module = moduleManager.getModule(scriptName, true);
MethodDeclaration[] methods = module.getMethods();
StringBuffer buffer = new StringBuffer();
buffer.append("<html>\n");
buffer.append("<head>\n");
buffer.append(" <title>DWR Test</title>\n");
buffer.append(" <!-- These paths use .. so that they still work behind a path mapping proxy. The fully qualified version is more cut and paste friendly. -->\n");
buffer.append(" <script type='text/javascript' src='" + proxyEngineURL + "'></script>\n");
buffer.append(" <script type='text/javascript' src='" + proxyUtilURL + "'></script>\n");
buffer.append(" <script type='text/javascript' src='" + proxyInterfaceURL + "'></script>\n");
buffer.append(" <script type='text/javascript'>\n");
buffer.append(" function objectEval(text)\n");
buffer.append(" {\n");
buffer.append(" // eval() breaks when we use it to get an object using the { a:42, b:'x' }\n");
buffer.append(" // syntax because it thinks that { and } surround a block and not an object\n");
buffer.append(" // So we wrap it in an array and extract the first element to get around\n");
buffer.append(" // this.\n");
buffer.append(" // This code is only needed for interpreting the parameter input fields,\n");
buffer.append(" // so you can ignore this for normal use.\n");
buffer.append(" // The regex = [start of line][whitespace]{[stuff]}[whitespace][end of line]\n");
buffer.append(" text = text.replace(/\\n/g, ' ');\n");
buffer.append(" text = text.replace(/\\r/g, ' ');\n");
buffer.append(" if (text.match(/^\\s*\\{.*\\}\\s*$/))\n");
buffer.append(" {\n");
buffer.append(" text = '[' + text + '][0]';\n");
buffer.append(" }\n");
buffer.append(" return eval(text);\n");
buffer.append(" }\n");
buffer.append(" </script>\n");
buffer.append(" <style>\n");
buffer.append(" input.itext { font-size: smaller; background: #E4E4E4; border: 0; }\n");
buffer.append(" input.ibutton { font-size: xx-small; border: 1px outset; margin: 0px; padding: 0px; }\n");
buffer.append(" span.reply { background: #ffffdd; white-space: pre; }\n");
buffer.append(" span.warning { font-size: smaller; color: red; }\n");
buffer.append(" </style>\n");
buffer.append("</head>\n");
buffer.append("<body onload='dwr.util.useLoadingMessage()'>\n");
buffer.append("<h2>Methods For: " + scriptName + " (" + module.toString() + ")</h2>\n");
buffer.append("<p>To use this class in your javascript you will need the following script includes:</p>\n");
buffer.append("<pre>\n");
buffer.append(" <script type='text/javascript' src='<a href='" + engineURL + "'>" + engineURL + "</a>'></script>\n");
buffer.append(" <script type='text/javascript' src='<a href='" + interfaceURL + "'>" + interfaceURL + "</a>'></script>\n");
buffer.append("</pre>\n");