/// <summary> /// Creates a new <see cref="AtomWriter"/> instance. /// </summary> public AtomWriter(TextWriter writer, ICollection<Entry> entries, DateTime dateLastViewedFeedItemPublished, bool useDeltaEncoding, ISubtextContext context) : base(writer, dateLastViewedFeedItemPublished, useDeltaEncoding, context) { Items = entries; UseAggBugs = true; }
/// <summary> /// Creates a new <see cref="CategoryWriter"/> instance. /// </summary> public CategoryWriter(TextWriter writer, ICollection<Entry> ec, LinkCategory lc, Uri url, ISubtextContext context) : base(writer, ec, NullValue.NullDateTime, false, context) { Category = lc; Url = url; }
public BlogImportRepository(ISubtextContext context, ICommentService commentService, IEntryPublisher entryPublisher, IBlogMLImportMapper mapper) { SubtextContext = context; CommentService = commentService; EntryPublisher = entryPublisher; Mapper = mapper; }
/// <summary> /// Initializes a new instance of the <see cref="CommentFilter"/> class. /// </summary> public CommentFilter(ISubtextContext context, ICommentSpamService spamService) { SubtextContext = context; SpamService = spamService; Blog = context.Blog; Cache = context.Cache; }
public EmailService(EmailProvider provider, ITemplateEngine templateEngine, ISubtextContext context) { EmailProvider = provider; TemplateEngine = templateEngine; Url = context.UrlHelper; Blog = context.Blog; Context = context; }
public EntryViewModel(Entry entry, ISubtextContext context) { if (entry == null) { throw new ArgumentNullException("entry"); } Entry = entry; SubtextContext = context; }
public void CreateWelcomeContent(ISubtextContext context, IEntryPublisher entryPublisher, Blog blog) { var repository = context.Repository; CreateWelcomeCategories(repository, blog); var adminUrlHelper = new AdminUrlHelper(context.UrlHelper); Entry article = CreateWelcomeArticle(blog, entryPublisher, adminUrlHelper); Entry entry = CreateWelcomeBlogPost(context, blog, entryPublisher, adminUrlHelper, article); CreateWelcomeComment(repository, adminUrlHelper, entry); }
/// <summary> /// Creates a new <see cref="BaseSyndicationWriter"/> instance. /// </summary> protected BaseSyndicationWriter(TextWriter writer, DateTime dateLastViewedFeedItemPublished, bool useDeltaEncoding, ISubtextContext context) : base(writer) { LatestPublishDateUtc = NullValue.NullDateTime; DateLastViewedFeedItemPublishedUtc = dateLastViewedFeedItemPublished; _writer = writer; SubtextContext = context; Blog = context.Blog; UrlHelper = context.UrlHelper; UseDeltaEncoding = useDeltaEncoding; Formatting = Formatting.Indented; Indentation = 4; }
public EntryPublisher(ISubtextContext context, ITextTransformation transformation, ISlugGenerator slugGenerator, IIndexingService indexingService) { if (context == null) { throw new ArgumentNullException("context"); } if (indexingService == null) { throw new ArgumentNullException("indexingService"); } SubtextContext = context; Transformation = transformation ?? EmptyTextTransformation.Instance; SlugGenerator = slugGenerator ?? new SlugGenerator(FriendlyUrlSettings.Settings, context.Repository); IndexingService = indexingService; }
public void Logout(ISubtextContext context) { var request = context.HttpContext.Request; var response = context.HttpContext.Response; var authCookie = new HttpCookie(request.GetFullCookieName(context.Blog)) { Expires = DateTime.Now.AddYears(-30) }; response.Cookies.Add(authCookie); if(Log.IsDebugEnabled) { string username = context.HttpContext.User.Identity.Name; if(Log.IsDebugEnabled) { Log.Debug("Logging out " + username); Log.Debug("the code MUST call a redirect after this"); } } FormsAuthentication.SignOut(); }
/// <summary> /// Returns all the feedback for the specified entry. Checks the cache first. /// </summary> public static ICollection <FeedbackItem> GetFeedback(Entry parentEntry, ISubtextContext context) { string key = GetFeedbackCacheKey(parentEntry, context); return(context.Cache.GetOrInsertSliding(key, () => context.Repository.GetFeedbackForEntry(parentEntry), null, LongDuration)); }
public AccountService(ISubtextContext context) { SubtextContext = context; }
public RsdHandler(ISubtextContext subtextContext) : base(subtextContext) { }
public CommentApiController(ISubtextContext context, ICommentService commentService) { SubtextContext = context; CommentService = commentService; }
public AtomHandler(ISubtextContext subtextContext) : base(subtextContext) { }
public ManifestController(ISubtextContext context) { SubtextContext = context; }
public RssAdminHandler(ISubtextContext subtextContext) : base(subtextContext) { }
protected GenericRssWriter(TextWriter writer, DateTime dateLastViewedFeedItemPublished, bool useDeltaEncoding, ISubtextContext context) : base(writer, dateLastViewedFeedItemPublished, useDeltaEncoding, context) { }
protected SubtextHttpHandler(ISubtextContext subtextContext) : base(subtextContext) { }
public MetaWeblog(ISubtextContext context, IEntryPublisher entryPublisher) : base(context) { EntryPublisher = entryPublisher; }
public MetaWeblog(ISubtextContext context) : this(context, context.ServiceLocator.GetService<IEntryPublisher>()) { }
public TrackBackHandler(ISubtextContext subtextContext) : base(subtextContext) { }
public SiteMapHttpHandler(ISubtextContext subtextContext) : base(subtextContext) { }
public IndexingService(ISubtextContext subtextContext, ISearchEngineService searchEngine) { SubtextContext = subtextContext; SearchEngineService = searchEngine; }
public LogRssWriter(TextWriter writer, ICollection <LogEntry> logs, bool useDeltaEncoding, ISubtextContext context) : base(writer, NullValue.NullDateTime, useDeltaEncoding, context) { Items = logs; }
private static XmlNodeList GetRssHandlerItemNodes(ISubtextContext context, StringBuilder sb) { string output = sb.ToString(); return GetRssHandlerItemNodes(context, ref output); }
public CommentViewModel(FeedbackItem feedbackItem, ISubtextContext context) { Feedback = feedbackItem; SubtextContext = context; }
protected EntryCollectionHandler(ISubtextContext subtextContext) : base(subtextContext) { }
public BlogMLExportMapper(ISubtextContext subtextContext) { SubtextContext = subtextContext; Blog = subtextContext.Blog; Url = subtextContext.UrlHelper; }
public static void InvalidateFeedback(IIdentifiable parentEntry, ISubtextContext context) { string key = GetFeedbackCacheKey(parentEntry, context); context.Cache.Remove(key); }
protected SubtextXmlRpcService(ISubtextContext context) { SubtextContext = context; }
private static string GetFeedbackCacheKey(IIdentifiable parentEntry, ISubtextContext context) { return(string.Format(CultureInfo.InvariantCulture, ParentCommentEntryKey, parentEntry.Id, context.Blog.Id)); }
private static Entry CreateWelcomeBlogPost(ISubtextContext context, Blog blog, IEntryPublisher entryPublisher, AdminUrlHelper adminUrlHelper, IEntryIdentity article) { string body = ScriptHelper.UnpackEmbeddedScriptAsString("WelcomePost.htm"); string articleUrl = context.UrlHelper.EntryUrl(article); body = String.Format(body, articleUrl, adminUrlHelper.Home(), context.UrlHelper.HostAdminUrl("default.aspx")); var entry = new Entry(PostType.BlogPost) { Title = "Welcome to Subtext!", EntryName = "welcome-to-subtext", BlogId = blog.Id, Author = blog.Author, Body = body, DateCreated = DateTime.Now, DateModified = DateTime.Now, DateSyndicated = DateTime.Now, IsActive = true, IncludeInMainSyndication = true, DisplayOnHomePage = true, AllowComments = true }; entryPublisher.Publish(entry); return entry; }
public StatisticsController(ISubtextContext context, IStatisticsService statisticsService) { StatisticsService = statisticsService; SubtextContext = context; }
/// <summary> /// Gets the entries for the specified month. /// </summary> public static ICollection <Entry> GetEntriesForMonth(DateTime dateTime, ISubtextContext context) { string key = string.Format(CultureInfo.InvariantCulture, EntryMonthKey, dateTime, context.Blog.Id); return(context.Cache.GetOrInsert(key, () => context.Repository.GetPostsByMonth(dateTime.Month, dateTime.Year), LongDuration)); }
public OpmlHandler(ISubtextContext subtextContext, OpmlWriter writer, LazyNotNull <HostInfo> hostInfo) : base(subtextContext) { OpmlWriter = writer; _hostInfo = hostInfo; }
public StatisticsService(ISubtextContext context, Configuration.Tracking settings) { SubtextContext = context; Settings = settings; }
public OpenSearchController(ISubtextContext context) { SubtextContext = context; }
public ModeratedCommentRssWriter(TextWriter writer, ICollection<FeedbackItem> commentEntries, Entry entry, ISubtextContext context) : base(writer, commentEntries, entry, context) { }
public RssCategoryHandler(ISubtextContext subtextContext) : base(subtextContext) { }
public BlogMLSource(ISubtextContext context, IBlogMLExportMapper blogMLConverter) { SubtextContext = context; BlogMLConverter = blogMLConverter; }
private static XmlNodeList GetRssHandlerItemNodes(ISubtextContext context, ref string rssOutput) { var handler = new RssHandler(context); handler.ProcessRequest(); var doc = new XmlDocument(); doc.LoadXml(rssOutput); return doc.SelectNodes("/rss/channel/item"); }
/// <summary> /// Clears the comment cache. /// </summary> public static void ClearCommentCache(int entryId, ISubtextContext context) { string key = string.Format(CultureInfo.InvariantCulture, ParentCommentEntryKey, entryId, context.Blog.Id); context.Cache.Remove(key); }
protected SubtextHttpHandler(ISubtextContext subtextContext) { SubtextContext = subtextContext; }
protected BaseSyndicationHandler(ISubtextContext subtextContext) : base(subtextContext) { }
public PingBackService(ISubtextContext context) : base(context) { }
/// <summary> /// Retrieves the current tags from the cache based on the ItemCount and /// Blog Id. If it is not in the cache, it gets it from the database and /// inserts it into the cache. /// </summary> public static IEnumerable <Tag> GetTopTags(int itemCount, ISubtextContext context) { string key = string.Format(CultureInfo.InvariantCulture, TagsKey, itemCount, context.Blog.Id); return(context.Cache.GetOrInsert(key, () => context.Repository.GetMostUsedTags(itemCount), LongDuration)); }