public void handleAction_Html(string data)
{
var guid = tmWebServices.getGuidForMapping(data);
if (guid != Guid.Empty)
{
context.Response.ContentType = "text/html";
var article = tmWebServices.GetGuidanceItemById(guid);
if (article.notNull())
{
var articleHtml = tmWebServices.GetGuidanceItemHtml(guid);
var htmlTemplateFile = @"\Html_Pages\Gui\Pages\article_Html.html";
var htmlTemplate = context.Server.MapPath(htmlTemplateFile).fileContents();
var htmlContent = htmlTemplate.replace("#ARTICLE_TITLE", article.Metadata.Title)
.replace("#ARTICLE_HTML", articleHtml);
context.Response.Write(htmlContent);
tmWebServices.logUserActivity("View Article (HTML)", "{0} ({1})".info(article.Metadata.Title, data));
endResponse();
}
}
else
transfer_Request("articleViewer"); // will trigger exception
}