public HomeController(IBlogManager blogManager, IDasBlogSettings settings, IXmlRpcManager rpcManager, IMapper mapper) : base(settings) { _blogManager = blogManager; _xmlRpcManager = rpcManager; _dasBlogSettings = settings; _mapper = mapper; }
public ArchiveController(IArchiveManager archiveManager, IHttpContextAccessor httpContextAccessor, IMapper mapper, IDasBlogSettings settings) : base(settings) { this.archiveManager = archiveManager; this.httpContextAccessor = httpContextAccessor; this.mapper = mapper; }
public CategoryController(ICategoryManager categoryManager, IDasBlogSettings dasBlogSettings, IHttpContextAccessor httpContextAccessor) : base(dasBlogSettings) { this.categoryManager = categoryManager; this.dasBlogSettings = dasBlogSettings; this.httpContextAccessor = httpContextAccessor; }
public BlogManager(IDasBlogSettings settings, ISiteSecurityManager siteSecurityRepository) { _dasBlogSettings = settings; _siteSecurity = siteSecurityRepository; _loggingDataService = LoggingDataServiceFactory.GetService(_dasBlogSettings.WebRootDirectory + _dasBlogSettings.SiteConfiguration.LogDir); _dataService = BlogDataServiceFactory.GetService(_dasBlogSettings.WebRootDirectory + _dasBlogSettings.SiteConfiguration.ContentDir, _loggingDataService); }
public static CategoryListViewModel Create(EntryCollection entries, IDasBlogSettings dasBlogSettings, string categoryName = "") { var viewModel = new CategoryListViewModel(); foreach (var entry in entries) { string[] categories = null; if (categoryName == string.Empty) { categories = entry.GetSplitCategories(); } else { categories = new string[] { categoryName }; } foreach (var category in categories) { var archiveItem = CategoryPostItem.CreateFromEntry(entry, dasBlogSettings); archiveItem.Category = category; if (viewModel.Categories.ContainsKey(category)) { viewModel.Categories[category].Add(archiveItem); continue; } viewModel.Categories[category] = new List <CategoryPostItem> { archiveItem }; } } return(viewModel); }
public XmlRpcManager(IDasBlogSettings settings, ISiteSecurityManager siteSecurityManager) { dasBlogSettings = settings; this.siteSecurityManager = siteSecurityManager; loggingDataService = LoggingDataServiceFactory.GetService(dasBlogSettings.WebRootDirectory + dasBlogSettings.SiteConfiguration.LogDir); dataService = BlogDataServiceFactory.GetService(dasBlogSettings.WebRootDirectory + dasBlogSettings.SiteConfiguration.ContentDir, loggingDataService); }
public SubscriptionManager(IDasBlogSettings settings) { dasBlogSettings = settings; loggingDataService = LoggingDataServiceFactory.GetService(Path.Combine(dasBlogSettings.WebRootDirectory, dasBlogSettings.SiteConfiguration.LogDir)); dataService = BlogDataServiceFactory.GetService(Path.Combine(dasBlogSettings.WebRootDirectory, dasBlogSettings.SiteConfiguration.ContentDir), loggingDataService); }
public XmlRpcManager(IDasBlogSettings dasBlogSettings, ISiteSecurityManager siteSecurityManager, IFileSystemBinaryManager binaryManager) { this.dasBlogSettings = dasBlogSettings; this.siteSecurityManager = siteSecurityManager; this.binaryManager = binaryManager; loggingDataService = LoggingDataServiceFactory.GetService(dasBlogSettings.WebRootDirectory + dasBlogSettings.SiteConfiguration.LogDir); dataService = BlogDataServiceFactory.GetService(dasBlogSettings.WebRootDirectory + dasBlogSettings.SiteConfiguration.ContentDir, loggingDataService); }
public CategoryController(ICategoryManager categoryManager, IDasBlogSettings settings, IHttpContextAccessor httpContextAccessor, IMapper mapper) : base(settings) { this.categoryManager = categoryManager; dasBlogSettings = settings; this.httpContextAccessor = httpContextAccessor; this.mapper = mapper; }
public BlogPostController(IBlogManager blogManager, IHttpContextAccessor httpContextAccessor, IDasBlogSettings settings, IMapper mapper) : base(settings) { _blogManager = blogManager; _httpContextAccessor = httpContextAccessor; _dasBlogSettings = settings; _mapper = mapper; }
public BlogManager(IDasBlogSettings settings, ILogger <BlogManager> logger) { dasBlogSettings = settings; var loggingDataService = LoggingDataServiceFactory.GetService(dasBlogSettings.WebRootDirectory + dasBlogSettings.SiteConfiguration.LogDir); dataService = BlogDataServiceFactory.GetService(dasBlogSettings.WebRootDirectory + dasBlogSettings.SiteConfiguration.ContentDir, loggingDataService); this.logger = logger; }
public CategoryController(ICategoryManager categoryManager, IDasBlogSettings settings, IHttpContextAccessor httpContextAccessor, IMapper mapper) { _categoryManager = categoryManager; _dasBlogSettings = settings; _httpContextAccessor = httpContextAccessor; _mapper = mapper; }
public SiteRepairer(IDasBlogSettings dasBlogSettings) { binariesPath = new DirectoryInfo(Path.Combine(dasBlogSettings.WebRootDirectory, dasBlogSettings.SiteConfiguration.BinariesDir.TrimStart('~', '/'))).FullName; themeFolder = new DirectoryInfo(Path.Combine(dasBlogSettings.WebRootDirectory, "Themes", dasBlogSettings.SiteConfiguration.Theme)).FullName; }
public SiteEmailReport(ILogger <SiteEmailReport> logger, IActivityService activityService, IDasBlogSettings dasBlogSettings) { this.logger = logger; this.activityService = activityService; this.dasBlogSettings = dasBlogSettings; midnight = DateTime.Now.Date; EMAIL_TITLE = string.Format("Weblog Daily Activity Report for {0}, {1}", midnight.DayOfWeek, midnight.ToString("MMMM dd, yyyy")); }
public BlogManager(ILogger <BlogManager> logger, IDasBlogSettings dasBlogSettings) { this.dasBlogSettings = dasBlogSettings; this.logger = logger; var loggingDataService = LoggingDataServiceFactory.GetService(this.dasBlogSettings.WebRootDirectory + this.dasBlogSettings.SiteConfiguration.LogDir);; dataService = BlogDataServiceFactory.GetService(this.dasBlogSettings.WebRootDirectory + this.dasBlogSettings.SiteConfiguration.ContentDir, loggingDataService); }
public HomeController(IBlogManager blogManager, IDasBlogSettings settings, IXmlRpcManager rpcManager, IMapper mapper, ILogger <HomeController> logger) : base(settings) { this.blogManager = blogManager; dasBlogSettings = settings; this.mapper = mapper; this.logger = logger; }
public ProfilePost(IDasBlogSettings dasBlogSettings) { _dasBlogSettings = dasBlogSettings; CreateMap <Entry, PostViewModel>() .ForMember(dest => dest.Title, opt => opt.MapFrom(src => src.Title)) .ForMember(dest => dest.Content, opt => opt.MapFrom(src => src.Content)) .ForMember(dest => dest.Description, opt => opt.MapFrom(src => src.Description)) .ForMember(dest => dest.Categories, opt => opt.MapFrom(src => ConvertCategory(src.Categories))) .ForMember(dest => dest.EntryId, opt => opt.MapFrom(src => src.EntryId)) .ForMember(dest => dest.AllowComments, opt => opt.MapFrom(src => src.AllowComments)) .ForMember(dest => dest.IsPublic, opt => opt.MapFrom(src => src.IsPublic)) .ForMember(dest => dest.Syndicated, opt => opt.MapFrom(src => src.Syndicated)) .ForMember(dest => dest.PermaLink, opt => opt.MapFrom(src => MakePermaLink(src))) .ForMember(dest => dest.ImageUrl, opt => opt.MapFrom(src => src.Content.FindFirstImage())) .ForMember(dest => dest.CreatedDateTime, opt => opt.MapFrom(src => src.CreatedLocalTime)) .ForMember(dest => dest.ModifiedDateTime, opt => opt.MapFrom(src => src.ModifiedLocalTime)); CreateMap <PostViewModel, Entry>() .ForMember(dest => dest.Title, opt => opt.MapFrom(src => src.Title)) .ForMember(dest => dest.Content, opt => opt.MapFrom(src => src.Content)) .ForMember(dest => dest.Description, opt => opt.MapFrom(src => (src.Description == null) ? string.Empty : src.Description)) .ForMember(dest => dest.Categories, opt => opt.MapFrom(src => string.Join(";", src.AllCategories.Where(x => x.Checked).Select(x => x.Category)))) .ForMember(dest => dest.EntryId, opt => opt.MapFrom(src => src.EntryId)) .ForMember(dest => dest.AllowComments, opt => opt.MapFrom(src => src.AllowComments)) .ForMember(dest => dest.IsPublic, opt => opt.MapFrom(src => src.IsPublic)) .ForMember(dest => dest.Syndicated, opt => opt.MapFrom(src => src.Syndicated)) .ForMember(dest => dest.CreatedUtc, opt => opt.MapFrom(src => src.CreatedDateTime)) .ForMember(dest => dest.ModifiedLocalTime, opt => opt.MapFrom(src => src.ModifiedDateTime)); CreateMap <CategoryCacheEntry, CategoryViewModel>() .ForMember(dest => dest.Category, opt => opt.MapFrom(src => src.DisplayName)) .ForMember(dest => dest.CategoryUrl, opt => opt.MapFrom(src => ConvertCategory(src.DisplayName).FirstOrDefault().CategoryUrl)); CreateMap <CategoryViewModel, CategoryCacheEntry>() .ForMember(dest => dest.DisplayName, opt => opt.MapFrom(src => src.Category)); CreateMap <Comment, CommentViewModel>() .ForMember(dest => dest.Name, opt => opt.MapFrom(src => src.Author)) .ForMember(dest => dest.Text, opt => opt.MapFrom(src => src.Content)) .ForMember(dest => dest.GravatarHashId, opt => opt.MapFrom(src => Utils.GetGravatarHash(src.AuthorEmail))) .ForMember(dest => dest.Date, opt => opt.MapFrom(src => src.CreatedLocalTime)) .ForMember(dest => dest.HomePageUrl, opt => opt.MapFrom(src => src.AuthorHomepage)) .ForMember(dest => dest.BlogPostId, opt => opt.MapFrom(src => src.TargetEntryId)) .ForMember(dest => dest.CommentId, opt => opt.MapFrom(src => src.EntryId)); CreateMap <AddCommentViewModel, Comment>() .ForMember(dest => dest.Author, opt => opt.MapFrom(src => src.Name)) .ForMember(dest => dest.Content, opt => opt.MapFrom(src => src.Content)) .ForMember(dest => dest.AuthorEmail, opt => opt.MapFrom(src => src.Email)) .ForMember(dest => dest.TargetEntryId, opt => opt.MapFrom(src => src.TargetEntryId)) .ForMember(dest => dest.AuthorHomepage, opt => opt.MapFrom(src => src.HomePage)); CreateMap <Entry, CategoryPostItem>() .ForMember(dest => dest.BlogTitle, opt => opt.MapFrom(src => src.Title)) .ForMember(dest => dest.BlogId, opt => opt.MapFrom(src => src.EntryId)); }
public SiteSearchBoxTagHelper(IDasBlogSettings dasBlogSettings, IHttpContextAccessor accessor) { this.dasBlogSettings = dasBlogSettings; urlHelper = accessor.HttpContext?.Items[typeof(IUrlHelper)] as IUrlHelper; if (urlHelper == null) { throw new Exception("No UrlHelper found in http context"); } }
public FeedController(ISubscriptionManager subscriptionManager, IXmlRpcManager xmlRpcManager, IMemoryCache memoryCache, IDasBlogSettings dasBlogSettings, ILogger <FeedController> logger) { this.subscriptionManager = subscriptionManager; this.xmlRpcManager = xmlRpcManager; this.memoryCache = memoryCache; this.dasBlogSettings = dasBlogSettings; this.logger = logger; }
public HomeController(IBlogManager blogManager, IDasBlogSettings dasBlogSettings, IMapper mapper, ILogger <HomeController> logger, IMemoryCache memoryCache) : base(dasBlogSettings) { this.blogManager = blogManager; this.dasBlogSettings = dasBlogSettings; this.mapper = mapper; this.logger = logger; this.memoryCache = memoryCache; }
public ThemesListViewModel(IDasBlogSettings dasBlogSettings) { this.dasBlogSettings = dasBlogSettings; var dir = Directory.GetDirectories(string.Format("{0}\\Themes", dasBlogSettings.WebRootDirectory)); dir.Select(f => Path.GetDirectoryName(f)); defaultfolders.AddRange(dir.Select(f => Path.GetFileName(f)).ToList()); }
public FeedController(ISubscriptionManager subscriptionManager, IHttpContextAccessor httpContextAccessor, IXmlRpcManager xmlRpcManager, IMemoryCache memoryCache, IDasBlogSettings dasBlogSettings) { this.subscriptionManager = subscriptionManager; this.xmlRpcManager = xmlRpcManager; this.memoryCache = memoryCache; this.dasBlogSettings = dasBlogSettings; loggingDataService = LoggingDataServiceFactory.GetService(dasBlogSettings.WebRootDirectory + dasBlogSettings.SiteConfiguration.LogDir); }
public ThemesListViewModel(IDasBlogSettings dasBlogSettings) { this.dasBlogSettings = dasBlogSettings; var dir = Directory.GetDirectories(Path.Combine(dasBlogSettings.WebRootDirectory, "Themes")); dir.Select(f => Path.GetDirectoryName(f)); defaultfolders.AddRange(dir.Select(f => Path.GetFileName(f)).ToList()); }
public AdminController(IDasBlogSettings dasBlogSettings, IFileSystemBinaryManager fileSystemBinaryManager, IMapper mapper, IBlogManager blogManager, IHostApplicationLifetime appLifetime, ILogger <AdminController> logger) : base(dasBlogSettings) { this.dasBlogSettings = dasBlogSettings; this.fileSystemBinaryManager = fileSystemBinaryManager; this.mapper = mapper; this.blogManager = blogManager; this.appLifetime = appLifetime; this.logger = logger; }
public static CategoryPostItem CreateFromEntry(Entry entry, IDasBlogSettings dasBlogSettings) { return(new CategoryPostItem { Category = entry.GetSplitCategories().FirstOrDefault(), BlogTitle = entry.Title, BlogId = dasBlogSettings.GeneratePostUrl(entry), Date = entry.CreatedLocalTime }); }
public SiteLastestBlogPostsTagHelper(IBlogManager blogManager, IDasBlogSettings dasBlogSettings, IMapper mapper, IHttpContextAccessor accessor) { this.dasBlogSettings = dasBlogSettings; this.blogManager = blogManager; this.mapper = mapper; urlHelper = accessor.HttpContext?.Items[typeof(IUrlHelper)] as IUrlHelper; if (urlHelper == null) { throw new Exception("No UrlHelper found in http context"); } }
public BlogPostController(IBlogManager blogManager, IHttpContextAccessor httpContextAccessor, IDasBlogSettings settings, IMapper mapper, ICategoryManager categoryManager , IFileSystemBinaryManager binaryManager) : base(settings) { _blogManager = blogManager; _categoryManager = categoryManager; _httpContextAccessor = httpContextAccessor; _dasBlogSettings = settings; _mapper = mapper; _binaryManager = binaryManager; }
public FileSystemBinaryManager(IDasBlogSettings settings) { var siteConfig = settings.SiteConfiguration; virtBinaryPathRelativeToContentRoot = siteConfig.BinariesDir.TrimStart('~'); // => "/content/binary" var physBinaryPath = Path.Combine(settings.WebRootDirectory, virtBinaryPathRelativeToContentRoot.TrimStart('/')); Uri physBinaryPathUrl = new Uri(physBinaryPath); var loggingDataService = LoggingDataServiceFactory.GetService(settings.WebRootDirectory + settings.SiteConfiguration.LogDir); dataService = BinaryDataServiceFactory.GetService(physBinaryPath, physBinaryPathUrl, loggingDataService); }
public BlogPostController(IBlogManager blogManager, IHttpContextAccessor httpContextAccessor, IDasBlogSettings settings, IMapper mapper, ICategoryManager categoryManager , IFileSystemBinaryManager binaryManager, ILogger <BlogPostController> logger) : base(settings) { this.blogManager = blogManager; this.categoryManager = categoryManager; this.httpContextAccessor = httpContextAccessor; dasBlogSettings = settings; this.mapper = mapper; this.binaryManager = binaryManager; this.logger = logger; }
public FileSystemBinaryManager(IDasBlogSettings settings) { var siteConfig = settings.SiteConfiguration; virtBinaryPathRelativeToContentRoot = siteConfig.BinariesDir.TrimStart('~'); // => "/content/binary" string physBinaryPath = Path.Combine(settings.WebRootDirectory, virtBinaryPathRelativeToContentRoot.TrimStart('/')); // => "c:\...\DaBlog.Web.UI\content/binary" // WebRootDirectory is a misnomer. It should be called ContentRootDirectory // ContentRootDirectory is not "c:\...\DasBlog.Web.UI\contnet". It is actually "c:\...\DasBlog.Web.UI" // WebRootDirectory is "wwwroot". Uri physBinaryPathUrl = new Uri(physBinaryPath); var loggingDataService = LoggingDataServiceFactory.GetService(settings.WebRootDirectory + settings.SiteConfiguration.LogDir); dataService = BinaryDataServiceFactory.GetService(physBinaryPath, physBinaryPathUrl, loggingDataService); }