public IResponse Execute(ICruiseRequest request)
{
Hashtable velocityContext = new Hashtable();
ArrayList links = new ArrayList();
links.Add(new ServerLink(urlBuilder, request.ServerSpecifier, "Server Log", ActionName));
ProjectStatusListAndExceptions projects = farmService.GetProjectStatusListAndCaptureExceptions(request.ServerSpecifier,
request.RetrieveSessionToken());
foreach (ProjectStatusOnServer projectStatusOnServer in projects.StatusAndServerList)
{
DefaultProjectSpecifier projectSpecifier = new DefaultProjectSpecifier(projectStatusOnServer.ServerSpecifier, projectStatusOnServer.ProjectStatus.Name);
links.Add(new ProjectLink(urlBuilder, projectSpecifier, projectSpecifier.ProjectName, ServerLogProjectPlugin.ActionName));
}
velocityContext["projectLinks"] = links;
if (string.IsNullOrEmpty(request.ProjectName))
{
velocityContext["log"] = HttpUtility.HtmlEncode(farmService.GetServerLog(request.ServerSpecifier, request.RetrieveSessionToken()));
}
else
{
velocityContext["currentProject"] = request.ProjectSpecifier.ProjectName;
velocityContext["log"] = HttpUtility.HtmlEncode(farmService.GetServerLog(request.ProjectSpecifier, request.RetrieveSessionToken()));
}
return viewGenerator.GenerateView(@"ServerLog.vm", velocityContext);
}