Exemple #1
0
        public void Setup()
        {
            cruiseRequestMock         = new DynamicMock(typeof(ICruiseRequest));
            requestMock               = new DynamicMock(typeof(IRequest));
            linkFactoryMock           = new DynamicMock(typeof(ILinkFactory));
            velocityViewGeneratorMock = new DynamicMock(typeof(IVelocityViewGenerator));
            farmServiceMock           = new DynamicMock(typeof(IFarmService));

            viewBuilder = new TopControlsViewBuilder(
                (ICruiseRequest)cruiseRequestMock.MockInstance,
                (ILinkFactory)linkFactoryMock.MockInstance,
                (IVelocityViewGenerator)velocityViewGeneratorMock.MockInstance,
                (IFarmService)farmServiceMock.MockInstance,
                null, null);

            serverSpecifier         = new DefaultServerSpecifier("myServer");
            projectSpecifier        = new DefaultProjectSpecifier(serverSpecifier, "myProject");
            buildSpecifier          = new DefaultBuildSpecifier(projectSpecifier, "myBuild");
            expectedVelocityContext = new Hashtable();
            response = new HtmlFragmentResponse("foo");
            link1    = new GeneralAbsoluteLink("1");
            link2    = new GeneralAbsoluteLink("2");
            link3    = new GeneralAbsoluteLink("3");
            link4    = new GeneralAbsoluteLink("4");
        }
        public IAbsoluteLink CreateStyledBuildLink(IBuildSpecifier specifier, string action)
        {
            IAbsoluteLink link = CreateBuildLink(specifier, buildNameFormatter.GetPrettyBuildName(specifier), action, null);

            link.LinkClass = buildNameFormatter.GetCssClassForBuildLink(specifier);
            return(link);
        }
		public void Setup()
		{
			cruiseRequestMock = new DynamicMock(typeof(ICruiseRequest));
			requestMock = new DynamicMock(typeof(IRequest));
			linkFactoryMock = new DynamicMock(typeof(ILinkFactory));
			velocityViewGeneratorMock = new DynamicMock(typeof(IVelocityViewGenerator));
			farmServiceMock = new DynamicMock(typeof(IFarmService));

			viewBuilder = new TopControlsViewBuilder(
				(ICruiseRequest) cruiseRequestMock.MockInstance,
				(ILinkFactory) linkFactoryMock.MockInstance,
				(IVelocityViewGenerator) velocityViewGeneratorMock.MockInstance,
				(IFarmService) farmServiceMock.MockInstance,
				null, null);

			serverSpecifier = new DefaultServerSpecifier("myServer");
			projectSpecifier = new DefaultProjectSpecifier(serverSpecifier, "myProject");
			buildSpecifier = new DefaultBuildSpecifier(projectSpecifier, "myBuild");
			expectedVelocityContext = new Hashtable();
			response = new HtmlFragmentResponse("foo");
			link1 = new GeneralAbsoluteLink("1");
			link2 = new GeneralAbsoluteLink("2");
			link3 = new GeneralAbsoluteLink("3");
			link4 = new GeneralAbsoluteLink("4");
		}
        public void ShouldBuildViewForAllBuilds()
        {
            IBuildSpecifier[] buildSpecifiers   = new IBuildSpecifier [] { build2Specifier, build1Specifier };
            IAbsoluteLink[]   buildLinks        = new IAbsoluteLink[] { new GeneralAbsoluteLink("link1"), new GeneralAbsoluteLink("link2") };
            string            buildRows         = "renderred Links";
            IResponse         allBuildsResponse = new HtmlFragmentResponse("foo");
            Hashtable         context1          = new Hashtable();
            Hashtable         context2          = new Hashtable();

            farmServiceMock.ExpectAndReturn("GetBuildSpecifiers", new IBuildSpecifier [] { build2Specifier, build1Specifier }, projectSpecifier, null);
            linkListFactoryMock.ExpectAndReturn("CreateStyledBuildLinkList", buildLinks, buildSpecifiers, BuildReportBuildPlugin.ACTION_NAME);
            context1["links"] = buildLinks;
            velocityTransformerMock.ExpectAndReturn("Transform", buildRows, @"BuildRows.vm", new HashtableConstraint(context1));

            context2["buildRows"] = buildRows;
            IAbsoluteLink allBuildsLink = new GeneralAbsoluteLink("foo");

            linkFactoryMock.ExpectAndReturn("CreateProjectLink", allBuildsLink, projectSpecifier, "", ViewAllBuildsProjectPlugin.ACTION_NAME);
            context2["allBuildsLink"] = allBuildsLink;
            velocityViewGeneratorMock.ExpectAndReturn("GenerateView", allBuildsResponse, @"AllBuilds.vm", new HashtableConstraint(context2));

            Assert.AreEqual(allBuildsResponse, lister.GenerateAllBuildsView(projectSpecifier, null));

            VerifyAll();
        }
Exemple #5
0
        public void Setup()
        {
            urlBuilderMock = mocks.Create <ICruiseUrlBuilder>().Object;
            Mock.Get(urlBuilderMock).Setup(_urlBuilderMock => _urlBuilderMock.BuildProjectUrl(It.IsAny <string>(), It.IsAny <IProjectSpecifier>()))
            .Returns("myLinkUrl");
            linkFactoryMock = new Mock <ILinkFactory>();
            projectGrid     = new ProjectGrid();

            serverSpecifier  = new DefaultServerSpecifier("server");
            projectSpecifier = new DefaultProjectSpecifier(serverSpecifier, "my project");

            projectLink = new GeneralAbsoluteLink("myLinkText", "myLinkUrl");
        }
Exemple #6
0
        public void Setup()
        {
            urlBuilderMock = mocks.DynamicMock <ICruiseUrlBuilder>();
            SetupResult.For(urlBuilderMock.BuildProjectUrl(null, null))
            .IgnoreArguments()
            .Return("myLinkUrl");
            linkFactoryMock = new DynamicMock(typeof(ILinkFactory));
            projectGrid     = new ProjectGrid();

            serverSpecifier  = new DefaultServerSpecifier("server");
            projectSpecifier = new DefaultProjectSpecifier(serverSpecifier, "my project");

            projectLink = new GeneralAbsoluteLink("myLinkText", "myLinkUrl");
        }
		public void Setup()
		{
            urlBuilderMock = mocks.DynamicMock<ICruiseUrlBuilder>();
            SetupResult.For(urlBuilderMock.BuildProjectUrl(null, null))
                .IgnoreArguments()
                .Return("myLinkUrl");
			linkFactoryMock = new DynamicMock(typeof(ILinkFactory));
			projectGrid = new ProjectGrid();

			serverSpecifier = new DefaultServerSpecifier("server");
			projectSpecifier = new DefaultProjectSpecifier(serverSpecifier, "my project");

			projectLink = new GeneralAbsoluteLink("myLinkText", "myLinkUrl");
		}
Exemple #8
0
        public void ShouldBuildViewForAllBuilds()
        {
            IBuildSpecifier[]    buildSpecifiers   = new IBuildSpecifier [] { build2Specifier, build1Specifier };
            IAbsoluteLink[]      buildLinks        = new IAbsoluteLink[] { new GeneralAbsoluteLink("link1"), new GeneralAbsoluteLink("link2") };
            string               buildRows         = "renderred Links";
            HtmlFragmentResponse allBuildsResponse = new HtmlFragmentResponse("foo");

            farmServiceMock.Setup(service => service.GetBuildSpecifiers(projectSpecifier, null)).Returns(new IBuildSpecifier[] { build2Specifier, build1Specifier }).Verifiable();
            linkListFactoryMock.Setup(factory => factory.CreateStyledBuildLinkList(buildSpecifiers, BuildReportBuildPlugin.ACTION_NAME)).Returns(buildLinks).Verifiable();
            velocityTransformerMock.Setup(transformer => transformer.Transform(@"BuildRows.vm", It.Is <Hashtable>(t => t.Count == 1 && t["links"] == buildLinks))).Returns(buildRows).Verifiable();

            IAbsoluteLink allBuildsLink = new GeneralAbsoluteLink("foo");

            linkFactoryMock.Setup(factory => factory.CreateProjectLink(projectSpecifier, "", ViewAllBuildsProjectPlugin.ACTION_NAME)).Returns(allBuildsLink).Verifiable();
            velocityViewGeneratorMock.Setup(generator => generator.GenerateView(@"AllBuilds.vm", It.Is <Hashtable>(t => t.Count == 2 && (string)t["buildRows"] == buildRows && t["allBuildsLink"] == allBuildsLink))).Returns(allBuildsResponse).Verifiable();

            Assert.AreEqual(allBuildsResponse, lister.GenerateAllBuildsView(projectSpecifier, null));

            VerifyAll();
        }
        public void Setup()
        {
            serverSpecifier   = new DefaultServerSpecifier(serverName);
            projectSpecifier  = new DefaultProjectSpecifier(serverSpecifier, projectName);
            buildSpecifier    = new DefaultBuildSpecifier(projectSpecifier, buildName);
            linkFactoryMock   = new Mock <ILinkFactory>();
            configurationMock = new Mock <IPluginConfiguration>();
            Plugins           = new DefaultPluginLinkCalculator((ILinkFactory)linkFactoryMock.Object, (IPluginConfiguration)configurationMock.Object);

            pluginMock1 = new Mock <IPlugin>();
            pluginMock2 = new Mock <IPlugin>();
            action1     = new ImmutableNamedAction("Action Name 1", null);
            action2     = new ImmutableNamedAction("Action Name 2", null);
            action3     = new ImmutableNamedAction("Action Name 3", null);
            pluginMock1.SetupGet(plugin => plugin.LinkDescription).Returns("Description 1").Verifiable();
            pluginMock1.SetupGet(plugin => plugin.NamedActions).Returns(new INamedAction[] { action1 }).Verifiable();
            pluginMock2.SetupGet(plugin => plugin.LinkDescription).Returns("Description 2").Verifiable();
            pluginMock2.SetupGet(plugin => plugin.NamedActions).Returns(new INamedAction[] { action2 }).Verifiable();
            link1 = (IAbsoluteLink) new Mock <IAbsoluteLink>().Object;
            link2 = (IAbsoluteLink) new Mock <IAbsoluteLink>().Object;
        }
		public void Setup()
		{
			serverSpecifier = new DefaultServerSpecifier(serverName);
			projectSpecifier = new DefaultProjectSpecifier(serverSpecifier, projectName);
			buildSpecifier = new DefaultBuildSpecifier(projectSpecifier, buildName);
			linkFactoryMock = new DynamicMock(typeof (ILinkFactory));
			configurationMock = new DynamicMock(typeof (IPluginConfiguration));
			Plugins = new DefaultPluginLinkCalculator((ILinkFactory) linkFactoryMock.MockInstance, (IPluginConfiguration) configurationMock.MockInstance);

			pluginMock1 = new DynamicMock(typeof (IPlugin));
			pluginMock2 = new DynamicMock(typeof (IPlugin));
			action1 = new ImmutableNamedAction("Action Name 1", null);
			action2 = new ImmutableNamedAction("Action Name 2", null);
			action3 = new ImmutableNamedAction("Action Name 3", null);
			pluginMock1.ExpectAndReturn("LinkDescription", "Description 1");
			pluginMock1.ExpectAndReturn("NamedActions", new INamedAction[] {action1});
			pluginMock2.ExpectAndReturn("LinkDescription", "Description 2");
			pluginMock2.ExpectAndReturn("NamedActions", new INamedAction[] {action2});
			link1 = (IAbsoluteLink) new DynamicMock(typeof (IAbsoluteLink)).MockInstance;
			link2 = (IAbsoluteLink) new DynamicMock(typeof (IAbsoluteLink)).MockInstance;
		}
Exemple #11
0
        public void Setup()
        {
            serverSpecifier   = new DefaultServerSpecifier(serverName);
            projectSpecifier  = new DefaultProjectSpecifier(serverSpecifier, projectName);
            buildSpecifier    = new DefaultBuildSpecifier(projectSpecifier, buildName);
            linkFactoryMock   = new DynamicMock(typeof(ILinkFactory));
            configurationMock = new DynamicMock(typeof(IPluginConfiguration));
            Plugins           = new DefaultPluginLinkCalculator((ILinkFactory)linkFactoryMock.MockInstance, (IPluginConfiguration)configurationMock.MockInstance);

            pluginMock1 = new DynamicMock(typeof(IPlugin));
            pluginMock2 = new DynamicMock(typeof(IPlugin));
            action1     = new ImmutableNamedAction("Action Name 1", null);
            action2     = new ImmutableNamedAction("Action Name 2", null);
            action3     = new ImmutableNamedAction("Action Name 3", null);
            pluginMock1.ExpectAndReturn("LinkDescription", "Description 1");
            pluginMock1.ExpectAndReturn("NamedActions", new INamedAction[] { action1 });
            pluginMock2.ExpectAndReturn("LinkDescription", "Description 2");
            pluginMock2.ExpectAndReturn("NamedActions", new INamedAction[] { action2 });
            link1 = (IAbsoluteLink) new DynamicMock(typeof(IAbsoluteLink)).MockInstance;
            link2 = (IAbsoluteLink) new DynamicMock(typeof(IAbsoluteLink)).MockInstance;
        }
Exemple #12
0
        public void ShouldGenerateFarmViewIfNoServerSpecified()
        {
            // Setup
            cruiseRequestWrapperMock.SetupGet(_cruiseRequest => _cruiseRequest.ServerName).Returns("").Verifiable();
            pluginLinkCalculatorMock.Setup(calculator => calculator.GetFarmPluginLinks()).Returns(links).Verifiable();
            farmServiceMock.Setup(service => service.GetServerSpecifiers()).Returns(serverSpecifiers).Verifiable();
            linkListFactoryMock.Setup(factory => factory.CreateServerLinkList(serverSpecifiers, "ViewServerReport")).Returns(serverLinks).Verifiable();

            ProjectStatus ps = new ProjectStatus("", "", null, 0, 0, null, DateTime.Now, null, null, DateTime.Now, null, "", 0, new List <ParameterBase>());

            ProjectStatusOnServer[]        psosa = new ProjectStatusOnServer[] { new ProjectStatusOnServer(ps, serverSpecifiers[0]) };
            ProjectStatusListAndExceptions pslae = new ProjectStatusListAndExceptions(psosa, new CruiseServerException[0]);

            farmServiceMock.Setup(service => service.GetProjectStatusListAndCaptureExceptions(serverSpecifiers[0], null)).Returns(pslae).Verifiable();

            velocityContext["links"]       = links;
            velocityContext["serverlinks"] = serverLinks;

            velocityContext["showCategories"] = false;
            velocityContext["categorylinks"]  = null;
            CruiseControl.WebDashboard.Dashboard.DefaultLinkFactory x = new DefaultLinkFactory(new DefaultUrlBuilder(), null, null);

            IAbsoluteLink farmLink = x.CreateFarmLink("Dashboard", FarmReportFarmPlugin.ACTION_NAME);

            linkFactoryMock.Setup(factory => factory.CreateFarmLink("Dashboard", FarmReportFarmPlugin.ACTION_NAME)).Returns(farmLink).Verifiable();
            velocityContext["farmLink"] = farmLink;

            System.Diagnostics.Debug.WriteLine("starting");

            velocityViewGeneratorMock.Setup(generator => generator.GenerateView(@"FarmSideBar.vm", It.IsAny <Hashtable>())).
            Callback <string, Hashtable>((name, context) => Assert.AreEqual(context, velocityContext)).Returns(velocityResponse).Verifiable();

            // Execute
            HtmlFragmentResponse returnedResponse = sideBarViewBuilder.Execute(cruiseRequestWrapperMock.Object as ICruiseRequest);

            // Verify
            Assert.AreEqual(velocityResponse, returnedResponse);
            VerifyAll();
        }
        public void ShouldGenerateFarmViewIfNoServerSpecified()
        {
            // Setup
            cruiseRequestWrapperMock.ExpectAndReturn("ServerName", "");
            pluginLinkCalculatorMock.ExpectAndReturn("GetFarmPluginLinks", links);
            farmServiceMock.ExpectAndReturn("GetServerSpecifiers", serverSpecifiers);
            linkListFactoryMock.ExpectAndReturn("CreateServerLinkList", serverLinks, serverSpecifiers, "ViewServerReport");

            ProjectStatus ps = new ProjectStatus("", "", null, 0, 0, null, DateTime.Now, null, null, DateTime.Now, null, "", 0);

            ProjectStatusOnServer[]        psosa = new ProjectStatusOnServer[] { new ProjectStatusOnServer(ps, serverSpecifiers[0]) };
            ProjectStatusListAndExceptions pslae = new ProjectStatusListAndExceptions(psosa, new CruiseServerException[0]);

            farmServiceMock.ExpectAndReturn("GetProjectStatusListAndCaptureExceptions", pslae, serverSpecifiers[0], (string)null);

            velocityContext["links"]       = links;
            velocityContext["serverlinks"] = serverLinks;

            velocityContext["showCategories"] = false;
            velocityContext["categorylinks"]  = null;
            CruiseControl.WebDashboard.Dashboard.DefaultLinkFactory x = new DefaultLinkFactory(new DefaultUrlBuilder(), null, null);

            IAbsoluteLink farmLink = x.CreateFarmLink("Dashboard", FarmReportFarmPlugin.ACTION_NAME);

            linkFactoryMock.ExpectAndReturn("CreateFarmLink", farmLink, "Dashboard", FarmReportFarmPlugin.ACTION_NAME);
            velocityContext["farmLink"] = farmLink;

            System.Diagnostics.Debug.WriteLine("starting");

            velocityViewGeneratorMock.ExpectAndReturn("GenerateView", velocityResponse, @"FarmSideBar.vm", new HashtableConstraint(velocityContext));

            // Execute
            HtmlFragmentResponse returnedResponse = sideBarViewBuilder.Execute(cruiseRequestWrapperMock.MockInstance as ICruiseRequest);

            // Verify
            Assert.AreEqual(velocityResponse, returnedResponse);
            VerifyAll();
        }
		public void ShouldBuildViewForRecentBuilds()
		{
			IBuildSpecifier[] buildSpecifiers = new IBuildSpecifier [] {build2Specifier, build1Specifier };
			IAbsoluteLink[] buildLinks = new IAbsoluteLink[] { new GeneralAbsoluteLink("link1"), new GeneralAbsoluteLink("link2") };
			string buildRows = "renderred Links";
			string recentBuilds = "recentBuilds";
			Hashtable context1 = new Hashtable();
			Hashtable context2 = new Hashtable();

			farmServiceMock.ExpectAndReturn("GetMostRecentBuildSpecifiers", buildSpecifiers, projectSpecifier, 10, null);
			linkListFactoryMock.ExpectAndReturn("CreateStyledBuildLinkList", buildLinks, buildSpecifiers, build1Specifier, BuildReportBuildPlugin.ACTION_NAME);
			context1["links"] = buildLinks;
			velocityTransformerMock.ExpectAndReturn("Transform", buildRows, @"BuildRows.vm", new HashtableConstraint(context1));

			context2["buildRows"] = buildRows;
			IAbsoluteLink allBuildsLink = new GeneralAbsoluteLink("foo");
			linkFactoryMock.ExpectAndReturn("CreateProjectLink", allBuildsLink, projectSpecifier, "", ViewAllBuildsProjectPlugin.ACTION_NAME);
			context2["allBuildsLink"] = allBuildsLink;
			velocityTransformerMock.ExpectAndReturn("Transform", recentBuilds, @"RecentBuilds.vm", new HashtableConstraint(context2));

			Assert.AreEqual(recentBuilds, lister.BuildRecentBuildsTable(build1Specifier, null));

			VerifyAll();
		}
        public HtmlFragmentResponse Execute(ICruiseRequest request)
        {
            Hashtable velocityContext = new Hashtable();
            string    velocityTemplateName;

            string serverName = request.ServerName;

            if (serverName == string.Empty)
            {
                velocityContext["links"] = pluginLinkCalculator.GetFarmPluginLinks();

                IServerSpecifier[] serverspecifiers = farmService.GetServerSpecifiers();
                velocityContext["serverlinks"] = linkListFactory.CreateServerLinkList(serverspecifiers, "ViewServerReport");

                IAbsoluteLink[] categoryLinks = GetCategoryLinks(serverspecifiers, request);
                velocityContext["showCategories"] = (categoryLinks != null) ? true : false;
                velocityContext["categorylinks"]  = categoryLinks;
                velocityContext["farmLink"]       = linkFactory.CreateFarmLink("Dashboard", FarmReportFarmPlugin.ACTION_NAME);
                velocityTemplateName = @"FarmSideBar.vm";
            }
            else
            {
                string projectName = request.ProjectName;
                if (projectName == string.Empty)
                {
                    IServerSpecifier serverSpecifier = request.ServerSpecifier;
                    velocityContext["links"]      = pluginLinkCalculator.GetServerPluginLinks(serverSpecifier);
                    velocityContext["serverlink"] = linkFactory.CreateServerLink(serverSpecifier, "ViewServerReport");

                    IAbsoluteLink[] categoryLinks = new IAbsoluteLink[0];
                    try
                    {
                        categoryLinks = GetCategoryLinks(serverSpecifier);
                    }
                    catch
                    {
                        // Ignore any error here - this is normally because the URL is incorrect, the error will be displayed in the main content
                    }

                    velocityContext["showCategories"] = (categoryLinks != null) ? true : false;
                    velocityContext["categorylinks"]  = categoryLinks;

                    velocityTemplateName = @"ServerSideBar.vm";
                }
                else
                {
                    string buildName = request.BuildName;
                    if (buildName == string.Empty)
                    {
                        IProjectSpecifier projectSpecifier = request.ProjectSpecifier;
                        velocityContext["links"]             = pluginLinkCalculator.GetProjectPluginLinks(projectSpecifier);
                        velocityContext["recentBuildsTable"] = recentBuildsViewBuilder.BuildRecentBuildsTable(projectSpecifier, request.RetrieveSessionToken());
                        velocityTemplateName = @"ProjectSideBar.vm";
                    }
                    else
                    {
                        IBuildSpecifier buildSpecifier = request.BuildSpecifier;
                        velocityContext["links"]             = pluginLinkCalculator.GetBuildPluginLinks(buildSpecifier);
                        velocityContext["recentBuildsTable"] = recentBuildsViewBuilder.BuildRecentBuildsTable(buildSpecifier, request.RetrieveSessionToken());
                        velocityContext["latestLink"]        = linkFactory.CreateProjectLink(request.ProjectSpecifier, LatestBuildReportProjectPlugin.ACTION_NAME);
                        velocityContext["nextLink"]          = linkFactory.CreateBuildLink(buildNameRetriever.GetNextBuildSpecifier(buildSpecifier, request.RetrieveSessionToken()), string.Empty, BuildReportBuildPlugin.ACTION_NAME);
                        velocityContext["previousLink"]      = linkFactory.CreateBuildLink(buildNameRetriever.GetPreviousBuildSpecifier(buildSpecifier, request.RetrieveSessionToken()), string.Empty, BuildReportBuildPlugin.ACTION_NAME);
                        velocityTemplateName = @"BuildSideBar.vm";
                    }
                }
            }

            return(velocityViewGenerator.GenerateView(velocityTemplateName, velocityContext));
        }
        public HtmlFragmentResponse Execute(ICruiseRequest request)
        {
            Hashtable velocityContext = new Hashtable();
            string velocityTemplateName;

            string serverName = request.ServerName;
            if (serverName == string.Empty)
            {
                velocityContext["links"] = pluginLinkCalculator.GetFarmPluginLinks();

                IServerSpecifier[] serverspecifiers = farmService.GetServerSpecifiers();
                velocityContext["serverlinks"] = linkListFactory.CreateServerLinkList(serverspecifiers, "ViewServerReport");

                IAbsoluteLink[] categoryLinks = GetCategoryLinks(serverspecifiers, request);
                velocityContext["showCategories"] = (categoryLinks != null) ? true : false;
                velocityContext["categorylinks"] = categoryLinks;
                velocityContext["farmLink"] = linkFactory.CreateFarmLink("Dashboard", FarmReportFarmPlugin.ACTION_NAME);
                velocityTemplateName = @"FarmSideBar.vm";
            }
            else
            {
                string projectName = request.ProjectName;
                if (projectName == string.Empty)
                {
                    IServerSpecifier serverSpecifier = request.ServerSpecifier;
                    velocityContext["links"] = pluginLinkCalculator.GetServerPluginLinks(serverSpecifier);
                    velocityContext["serverlink"] = linkFactory.CreateServerLink(serverSpecifier, "ViewServerReport");

                    IAbsoluteLink[] categoryLinks = new IAbsoluteLink[0];
                    try
                    {
                        categoryLinks = GetCategoryLinks(serverSpecifier);
                    }
                    catch
                    {
                        // Ignore any error here - this is normally because the URL is incorrect, the error will be displayed in the main content
                    }

                    velocityContext["showCategories"] = (categoryLinks != null) ? true : false;
                    velocityContext["categorylinks"] = categoryLinks;

                    velocityTemplateName = @"ServerSideBar.vm";
                }
                else
                {
                    string buildName = request.BuildName;
                    if (buildName == string.Empty)
                    {
                        IProjectSpecifier projectSpecifier = request.ProjectSpecifier;
                        velocityContext["links"] = pluginLinkCalculator.GetProjectPluginLinks(projectSpecifier);
                        velocityContext["recentBuildsTable"] = recentBuildsViewBuilder.BuildRecentBuildsTable(projectSpecifier, request.RetrieveSessionToken());
                        velocityTemplateName = @"ProjectSideBar.vm";
                    }
                    else
                    {
                        IBuildSpecifier buildSpecifier = request.BuildSpecifier;
                        velocityContext["links"] = pluginLinkCalculator.GetBuildPluginLinks(buildSpecifier);
                        velocityContext["recentBuildsTable"] = recentBuildsViewBuilder.BuildRecentBuildsTable(buildSpecifier, request.RetrieveSessionToken());
                        velocityContext["latestLink"] = linkFactory.CreateProjectLink(request.ProjectSpecifier, LatestBuildReportProjectPlugin.ACTION_NAME);
                        velocityContext["nextLink"] = linkFactory.CreateBuildLink(buildNameRetriever.GetNextBuildSpecifier(buildSpecifier, request.RetrieveSessionToken()), string.Empty, BuildReportBuildPlugin.ACTION_NAME);
                        velocityContext["previousLink"] = linkFactory.CreateBuildLink(buildNameRetriever.GetPreviousBuildSpecifier(buildSpecifier, request.RetrieveSessionToken()), string.Empty, BuildReportBuildPlugin.ACTION_NAME);
                        velocityTemplateName = @"BuildSideBar.vm";
                    }
                }
            }

            return velocityViewGenerator.GenerateView(velocityTemplateName, velocityContext);
        }