private HtmlFragmentResponse GenerateView(ProjectStatusListAndExceptions projectStatusListAndExceptions, Hashtable velocityContext, string actionName, IRequest request, IServerSpecifier serverSpecifier) { ProjectGridSortColumn sortColumn = GetSortColumn(request); bool sortReverse = SortAscending(request); velocityContext["projectNameSortLink"] = GenerateSortLink(serverSpecifier, actionName, ProjectGridSortColumn.Name, sortColumn, sortReverse); velocityContext["buildStatusSortLink"] = GenerateSortLink(serverSpecifier, actionName, ProjectGridSortColumn.BuildStatus, sortColumn, sortReverse); velocityContext["lastBuildDateSortLink"] = GenerateSortLink(serverSpecifier, actionName, ProjectGridSortColumn.LastBuildDate, sortColumn, sortReverse); velocityContext["projectGrid"] = projectGrid.GenerateProjectGridRows( farmService, projectStatusListAndExceptions.StatusAndServerList, actionName, sortColumn, sortReverse); velocityContext["exceptions"] = projectStatusListAndExceptions.Exceptions; velocityContext["refreshButtonName"] = urlBuilder.BuildFormName(actionName); return viewGenerator.GenerateView(@"ProjectGrid.vm", velocityContext); }
private HtmlFragmentResponse GenerateView(ProjectStatusListAndExceptions projectStatusListAndExceptions, string actionName, ICruiseRequest request, IServerSpecifier serverSpecifier) { this.translations = Translations.RetrieveCurrent(); cruiseUrlBuilder = request.UrlBuilder; urlBuilder = request.UrlBuilder.InnerBuilder; Hashtable velocityContext = new Hashtable(); velocityContext["forceBuildMessage"] = ForceBuildIfNecessary(request.Request); velocityContext["parametersCall"] = new ServerLink(cruiseUrlBuilder, new DefaultServerSpecifier("null"), string.Empty, ProjectParametersAction.ActionName).Url; velocityContext["wholeFarm"] = serverSpecifier == null ? true : false; string category = request.Request.GetText("Category"); velocityContext["showCategoryColumn"] = string.IsNullOrEmpty(category) ? true : false; ProjectGridSortColumn sortColumn = GetSortColumn(request.Request); bool sortReverse = SortAscending(request.Request); velocityContext["projectNameSortLink"] = GenerateSortLink(serverSpecifier, actionName, ProjectGridSortColumn.Name, sortColumn, sortReverse); velocityContext["buildStatusSortLink"] = GenerateSortLink(serverSpecifier, actionName, ProjectGridSortColumn.BuildStatus, sortColumn, sortReverse); velocityContext["lastBuildDateSortLink"] = GenerateSortLink(serverSpecifier, actionName, ProjectGridSortColumn.LastBuildDate, sortColumn, sortReverse); velocityContext["serverNameSortLink"] = GenerateSortLink(serverSpecifier, actionName, ProjectGridSortColumn.ServerName, sortColumn, sortReverse); velocityContext["projectCategorySortLink"] = GenerateSortLink(serverSpecifier, actionName, ProjectGridSortColumn.Category, sortColumn, sortReverse); ProjectGridRow[] projectGridRows = projectGrid.GenerateProjectGridRows(projectStatusListAndExceptions.StatusAndServerList, actionName, sortColumn, sortReverse, category, cruiseUrlBuilder, this.translations); velocityContext["projectGrid"] = projectGridRows; velocityContext["exceptions"] = projectStatusListAndExceptions.Exceptions; Array categoryList = this.GenerateCategoryList(projectGridRows); velocityContext["categoryList"] = categoryList; velocityContext["barAtTop"] = (this.SuccessIndicatorBarLocation == IndicatorBarLocation.Top) || (this.SuccessIndicatorBarLocation == IndicatorBarLocation.TopAndBottom); velocityContext["barAtBottom"] = (this.SuccessIndicatorBarLocation == IndicatorBarLocation.Bottom) || (this.SuccessIndicatorBarLocation == IndicatorBarLocation.TopAndBottom); return(viewGenerator.GenerateView(@"ProjectGrid.vm", velocityContext)); }