}
// Display description
if ((algorithm != null) && (description != null)) {
// Error type description
try {
DocumentBuilderImpl dbi = new DocumentBuilderImpl(ucontext, rcontextDescription);
InputSource is = new InputSource(new StringReader(description));
CheckWiki cw = APIFactory.getCheckWiki();
is.setSystemId(cw.getUrlDescription(getWikipedia(), algorithm));
Document document = dbi.parse(is);
textDescription.setDocument(document, rcontextDescription);
} catch (SAXException e) {
textDescription.clearDocument();
} catch (IOException e) {
textDescription.clearDocument();
}
// Parameters description
try {
Configuration config = Configuration.getConfiguration();
boolean secured = config.getBoolean(null, ConfigurationValueBoolean.SECURE_URL);
EnumWikipedia wiki = getWikipedia();
String translationPage = wiki.getConfiguration().getString(
WPCConfigurationString.CW_TRANSLATION_PAGE);
String url = wiki.getSettings().getURL(translationPage, true, secured);
StringBuilder parametersDescription = new StringBuilder();
parametersDescription.append(GT._(
"The error n°{0} can be configured with the following parameters in the <a href=\"{1}\">translation file</a> :",
new Object[] { Integer.toString(errorNumber), url }));
parametersDescription.append("\n<ul>");
Map<String, String> parameters = algorithm.getParameters();
for (Map.Entry<String, String> entry : parameters.entrySet()) {
parametersDescription.append("<li><b>");
parametersDescription.append(entry.getKey());
parametersDescription.append("</b>: ");
parametersDescription.append(entry.getValue());
parametersDescription.append("</li>\n");
}
parametersDescription.append("</ul>");
DocumentBuilderImpl dbi = new DocumentBuilderImpl(ucontext, rcontextParameters);
InputSource is = new InputSource(new StringReader(parametersDescription.toString()));
is.setSystemId(url);
Document document = dbi.parse(is);
textParameters.setDocument(document, rcontextParameters);
} catch (SAXException e) {
textParameters.clearDocument();
} catch (IOException e) {
textParameters.clearDocument();