/// <summary> /// Constructor. /// </summary> public Install() { this._commonDao = IoC.Resolve<ICommonDao>(); this._siteService = IoC.Resolve<ISiteService>(); this._moduleLoader = IoC.Resolve<ModuleLoader>(); this._fileService = IoC.Resolve<IFileService>(); }
/// <summary> /// Default constructor calls base constructor with parameters for templatecontrol, /// templatepath and stylesheet. /// </summary> public ModuleAdminBasePage() : base("ModuleAdminTemplate.ascx", "~/Controls/", "~/Admin/Css/Admin.css") { this._node = null; this._section = null; this._moduleLoader = Container.Resolve<ModuleLoader>(); }
/// <summary> /// Default constructor calls base constructor with parameters for templatecontrol, /// templatepath and stylesheet. /// </summary> public ModuleAdminBasePage() : base("ModuleAdminTemplate.ascx", "~/Modules/Shared/WebForms/Controls/", "~/Modules/Shared/WebForms/Css/ModuleAdmin.css") { this._node = null; this._section = null; this._moduleLoader = Container.Resolve<ModuleLoader>(); this._searchService = Container.Resolve<ISearchService>(); }
/// <summary> /// Default constructor. /// </summary> public AdminBasePage() { this._activeNode = null; this._siteService = Container.Resolve<ISiteService>(); this._nodeService = Container.Resolve<INodeService>(); this._sectionService = Container.Resolve<ISectionService>(); this._moduleLoader = Container.Resolve<ModuleLoader>(); }
/// <summary> /// Default constructor. /// </summary> public AdminBasePage() { this._activeNode = null; this._siteService = Container.Resolve<ISiteService>(); this._userService = Container.Resolve<IUserService>(); this._nodeService = Container.Resolve<INodeService>(); this._sectionService = Container.Resolve<ISectionService>(); this._moduleTypeService = Container.Resolve<IModuleTypeService>(); this._moduleLoader = Container.Resolve<ModuleLoader>(); this._templateService = Container.Resolve<ITemplateService>(); this._fileService = Container.Resolve<IFileService>(); }
/// <summary> /// Default constructor. /// </summary> public PageEngine() { this._activeNode = null; this._activeSection = null; this._templateControl = null; this._shouldLoadContent = true; // Get services from the container. Ideally, it should be possible to register the aspx page in the container // to automatically resolve dependencies but there were memory issues with registering pages in the container. this._moduleLoader = Container.Resolve<ModuleLoader>(); this._nodeService = Container.Resolve<INodeService>(); this._siteService = Container.Resolve<ISiteService>(); this._sectionService = Container.Resolve<ISectionService>(); }
private void Page_Load(object sender, System.EventArgs e) { this._sectionService = Container.Resolve<ISectionService>(); this._moduleLoader = Container.Resolve<ModuleLoader>(); Context.Response.Clear(); Context.Response.ContentType = "text/xml"; if (Context.Request.QueryString["SectionId"] != null) { int sectionId = Int32.Parse(Context.Request.QueryString["SectionId"]); string pathInfo = Context.Request.PathInfo; string cacheKey = String.Format("RSS_{0}_{1}", sectionId, pathInfo); string content = null; if (Context.Cache[cacheKey] == null) { // Get the data for the RSS feed because it's not in the cache yet. // Use the same cache duration for the RSS feed as the Section. Section section = this._sectionService.GetSectionById(sectionId); ModuleBase module = this._moduleLoader.GetModuleFromSection(section); module.ModulePathInfo = pathInfo; ISyndicatable syndicatableModule = module as ISyndicatable; if (syndicatableModule != null) { RssChannel channel = syndicatableModule.GetRssFeed(); // Rss feed writer code from http://aspnet.4guysfromrolla.com/articles/021804-1.aspx // Use an XmlTextWriter to write the XML data to a string... StringWriter sw = new StringWriter(); XmlTextWriter writer = new XmlTextWriter(sw); writer.Formatting = Formatting.Indented; // write out writer.WriteStartElement("rss"); writer.WriteAttributeString("version", "2.0"); writer.WriteAttributeString("xmlns:dc", "http://purl.org/dc/elements/1.1/"); // write out writer.WriteStartElement("channel"); // write out -level elements writer.WriteElementString("title", channel.Title); writer.WriteElementString("link", Util.UrlHelper.GetFullUrlFromSection(section) + pathInfo); writer.WriteElementString("description", channel.Description); writer.WriteElementString("language", channel.Language); writer.WriteElementString("pubDate", channel.PubDate.ToUniversalTime().ToString("r")); writer.WriteElementString("lastBuildDate", channel.LastBuildDate.ToUniversalTime().ToString("r")); writer.WriteElementString("generator", channel.Generator); writer.WriteElementString("ttl", channel.Ttl.ToString()); // Regular expression to find relative urls string expression = String.Format(@"=[""']{0}", UrlHelper.GetApplicationPath()); Regex regExUrl = new Regex(expression, RegexOptions.Singleline | RegexOptions.CultureInvariant | RegexOptions.Compiled); foreach (RssItem item in channel.RssItems) { // replace inline relative hyperlinks with full hyperlinks if (item.Description != null) { item.Description = regExUrl.Replace(item.Description, String.Format(@"=""{0}/", UrlHelper.GetSiteUrl())); } // write out writer.WriteStartElement("item"); // write out -level information writer.WriteElementString("title", item.Title); // TODO: Only supports ID's in the pathinfo now... //writer.WriteElementString("link", Util.UrlHelper.GetFullUrlFromSection(section) + "/" + item.ItemId); writer.WriteElementString("link", item.Link); writer.WriteElementString("description", item.Description); writer.WriteElementString("dc:creator", item.Author); writer.WriteElementString("pubDate", item.PubDate.ToUniversalTime().ToString("r")); writer.WriteElementString("category", item.Category); // write out writer.WriteEndElement(); } // write out writer.WriteEndElement(); // write out writer.WriteEndElement(); content = sw.ToString(); // save the string in the cache Cache.Insert(cacheKey, content, null, DateTime.Now.AddSeconds(section.CacheDuration), TimeSpan.Zero); writer.Close(); } else { throw new Exception(String.Format("The module {0} doesn't implement ISyndicatable", module.GetType().FullName)); } } else { content = Context.Cache[cacheKey].ToString(); } Context.Response.Write(content); } Context.Response.End(); }
/// <summary> /// Constructor. /// </summary> public Rss() { this._sectionService = Container.Resolve<ISectionService>(); this._moduleLoader = Container.Resolve<ModuleLoader>(); }