コード例 #1
0
        public IResponse Execute(IRequest cruiseRequest)
        {
            Hashtable velocityContext         = new Hashtable();
            IResponse decoratedActionResponse = decoratedAction.Execute(cruiseRequest);

            if (decoratedActionResponse is HtmlFragmentResponse)
            {
                ICruiseRequestFactory CruiseRequestFactory = (ICruiseRequestFactory)objectGiver.GiveObjectByType(typeof(ICruiseRequestFactory));
                IBuildNameFormatter   BuildNameFormatter   = (IBuildNameFormatter)objectGiver.GiveObjectByType(typeof(IBuildNameFormatter));
                ICruiseRequest        request = CruiseRequestFactory.CreateCruiseRequest(cruiseRequest);

                if (!string.IsNullOrEmpty(request.ServerName))
                {
                    velocityContext["serverName"] = request.ServerName;
                    if (!string.IsNullOrEmpty(request.ProjectName))
                    {
                        velocityContext["projectName"] = request.ProjectName;
                        if (!string.IsNullOrEmpty(request.BuildName))
                        {
                            velocityContext["prettybuildName"] = BuildNameFormatter.GetPrettyBuildName(request.BuildSpecifier);
                        }
                    }
                }

                velocityContext["breadcrumbs"]      = (((TopControlsViewBuilder)objectGiver.GiveObjectByType(typeof(TopControlsViewBuilder))).Execute()).ResponseFragment;
                velocityContext["sidebar"]          = (((SideBarViewBuilder)objectGiver.GiveObjectByType(typeof(SideBarViewBuilder))).Execute()).ResponseFragment;
                velocityContext["mainContent"]      = ((HtmlFragmentResponse)decoratedActionResponse).ResponseFragment;
                velocityContext["dashboardversion"] = GetVersion();

                return(velocityViewGenerator.GenerateView("SiteTemplate.vm", velocityContext));
            }
            else
            {
                return(decoratedActionResponse);
            }
        }
コード例 #2
0
 public IAbsoluteLink CreateBuildLink(IBuildSpecifier buildSpecifier, string action)
 {
     return(new BuildLink(cruiseUrlBuilder, buildSpecifier, buildNameFormatter.GetPrettyBuildName(buildSpecifier), action, null));
 }