示例#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);
            }
        }
 public IResponse Execute(IRequest request)
 {
     return(proxiedAction.Execute(cruiseRequestFactory.CreateCruiseRequest(request, urlBuilder, retriever)));
 }
示例#3
0
 public IResponse Execute(IRequest request)
 {
     return(proxiedAction.Execute(cruiseRequestFactory.CreateCruiseRequest(request)));
 }