public ArticleListWidgetService(IWidgetBasePartService widgetService, IArticleTypeService articleTypeService,
                                 IArticleService articleService, IApplicationContext applicationContext)
     : base(widgetService, applicationContext)
 {
     _articleTypeService = articleTypeService;
     _articleService     = articleService;
 }
Exemple #2
0
 public LayoutController(ILayoutService service, IPageService pageService, IZoneService zoneService, IWidgetBasePartService widgetService)
     : base(service)
 {
     _pageService   = pageService;
     _zoneService   = zoneService;
     _widgetService = widgetService;
 }
Exemple #3
0
 public PageSiteUrlProvider(SitemapDbContext sitemapDbContext,
                            IPageService pageService,
                            IWidgetBasePartService widgetBasePartService)
 {
     _sitemapDbContext      = sitemapDbContext;
     _pageService           = pageService;
     _widgetBasePartService = widgetBasePartService;
 }
Exemple #4
0
 public PageService(IWidgetBasePartService widgetService, IDataArchivedService dataArchivedService,
                    IApplicationContext applicationContext, IWidgetActivator widgetActivator)
     : base(applicationContext)
 {
     _widgetService       = widgetService;
     _dataArchivedService = dataArchivedService;
     _widgetActivator     = widgetActivator;
 }
Exemple #5
0
 public SectionGroupController(ISectionGroupService sectionGroupService,
                               ISectionContentProviderService sectionContentProviderService,
                               IWidgetBasePartService widgetService)
 {
     _sectionGroupService           = sectionGroupService;
     _sectionContentProviderService = sectionContentProviderService;
     _widgetService = widgetService;
 }
Exemple #6
0
 public ArticleListWidgetService(IWidgetBasePartService widgetService, IArticleTypeService articleTypeService,
                                 IArticleService articleService, IApplicationContext applicationContext, IPageService pageService, CMSDbContext dbContext)
     : base(widgetService, applicationContext, dbContext)
 {
     _articleTypeService = articleTypeService;
     _articleService     = articleService;
     _pageService        = pageService;
 }
Exemple #7
0
 public WidgetController(IWidgetBasePartService widgetService, IWidgetTemplateService widgetTemplateService,
                         ICookie cookie, IPackageInstallerProvider packageInstallerProvider)
 {
     _widgetService         = widgetService;
     _widgetTemplateService = widgetTemplateService;
     _cookie = cookie;
     _packageInstallerProvider = packageInstallerProvider;
 }
Exemple #8
0
 public FormWidgetService(IWidgetBasePartService widgetBasePartService,
                          IApplicationContext applicationContext,
                          CMSDbContext dbContext,
                          IFormService formService)
     : base(widgetBasePartService, applicationContext, dbContext)
 {
     _formService = formService;
 }
Exemple #9
0
 public ArticleTopWidgetService(IWidgetBasePartService widgetService,
                                IArticleService articleService,
                                IApplicationContext applicationContext,
                                IArticleTypeService articleTypeService,
                                ArticleDbContext dbContext) : base(widgetService, applicationContext, dbContext)
 {
     _articleService     = articleService;
     _articleTypeService = articleTypeService;
 }
 public SectionWidgetService(IWidgetBasePartService widgetService, ISectionGroupService sectionGroupService,
                             ISectionContentProviderService sectionContentProviderService, ISectionTemplateService sectionTemplateService,
                             IApplicationContext applicationContext, CMSDbContext dbContext)
     : base(widgetService, applicationContext, dbContext)
 {
     _sectionGroupService           = sectionGroupService;
     _sectionContentProviderService = sectionContentProviderService;
     _sectionTemplateService        = sectionTemplateService;
 }
 public SectionGroupController(ISectionGroupService sectionGroupService,
                               ISectionContentProviderService sectionContentProviderService,
                               IWidgetBasePartService widgetService, IPackageInstallerProvider packageInstallerProvider)
 {
     _sectionGroupService           = sectionGroupService;
     _sectionContentProviderService = sectionContentProviderService;
     _widgetService            = widgetService;
     _packageInstallerProvider = packageInstallerProvider;
 }
 public ProductGalleryWidgetService(IWidgetBasePartService widgetBasePartService,
                                    IApplicationContext applicationContext,
                                    CMSDbContext dbContext,
                                    IProductService productService,
                                    IProductGalleryService ProductGalleryService)
     : base(widgetBasePartService, applicationContext, dbContext)
 {
     _productService        = productService;
     _productGalleryService = ProductGalleryService;
 }
 public ArticleGalleryWidgetService(IWidgetBasePartService widgetBasePartService,
                                    IApplicationContext applicationContext,
                                    CMSDbContext dbContext,
                                    IArticleService articleService,
                                    IArticleGalleryService articleGalleryService)
     : base(widgetBasePartService, applicationContext, dbContext)
 {
     _articleService        = articleService;
     _articleGalleryService = articleGalleryService;
 }
Exemple #14
0
 public ProductDetailWidgetService(IWidgetBasePartService widgetService,
                                   IProductService productService,
                                   IApplicationContext applicationContext,
                                   Easy.Cache.ICacheManager <ConcurrentDictionary <string, object> > cacheManager,
                                   CMSDbContext dbContext)
     : base(widgetService, applicationContext, dbContext)
 {
     _productService     = productService;
     _allRelatedUrlCache = cacheManager.GetOrAdd(ProductDetailWidgetRelatedPageUrls, new ConcurrentDictionary <string, object>());
 }
 public SectionWidgetService(IWidgetBasePartService widgetService, ISectionGroupService sectionGroupService,
                             ISectionContentProviderService sectionContentProviderService, ISectionTemplateService sectionTemplateService,
                             IApplicationContext applicationContext, IPluginLoader pluginLoader)
     : base(widgetService, applicationContext)
 {
     _sectionGroupService           = sectionGroupService;
     _sectionContentProviderService = sectionContentProviderService;
     _sectionTemplateService        = sectionTemplateService;
     _pluginLoader = pluginLoader;
 }
Exemple #16
0
 public RuleService(IApplicationContext applicationContext,
                    IWidgetBasePartService widgetBasePartService,
                    IWidgetActivator widgetActivator, IRuleManager
                    ruleManager, CMSDbContext dbContext)
     : base(applicationContext, dbContext)
 {
     _widgetBasePartService = widgetBasePartService;
     _widgetActivator       = widgetActivator;
     _ruleManager           = ruleManager;
 }
Exemple #17
0
 public WidgetController(IWidgetBasePartService widgetService, IWidgetTemplateService widgetTemplateService,
                         ICookie cookie, IPackageInstallerProvider packageInstallerProvider, IWidgetActivator widgetActivator, IPageService pageService)
 {
     _widgetService         = widgetService;
     _widgetTemplateService = widgetTemplateService;
     _cookie = cookie;
     _packageInstallerProvider = packageInstallerProvider;
     _widgetActivator          = widgetActivator;
     _pageService = pageService;
 }
Exemple #18
0
 public ArticleTypeWidgetService(IWidgetBasePartService widgetService,
                                 IArticleTypeService articleTypeService,
                                 IApplicationContext applicationContext,
                                 ICacheManager <ConcurrentDictionary <string, object> > cacheManager,
                                 CMSDbContext dbContext)
     : base(widgetService, applicationContext, dbContext)
 {
     _articleTypeService = articleTypeService;
     _allRelatedUrlCache = cacheManager.GetOrAdd(ArticleTypeWidgetRelatedPageUrls, new ConcurrentDictionary <string, object>());
 }
Exemple #19
0
 public ProductListWidgetService(IWidgetBasePartService widgetService,
                                 IProductService productService,
                                 IProductCategoryService productCategoryService,
                                 IApplicationContext applicationContext,
                                 IPageService pageService)
     : base(widgetService, applicationContext)
 {
     _productService         = productService;
     _productCategoryService = productCategoryService;
     _pageService            = pageService;
 }
Exemple #20
0
 public PageController(IPageService service,
                       ICookie cookie,
                       IZoneService zoneService,
                       ILayoutService layoutService,
                       IWidgetBasePartService widgetService)
     : base(service)
 {
     _cookie        = cookie;
     _zoneService   = zoneService;
     _layoutService = layoutService;
     _widgetService = widgetService;
 }
 public SectionGroupController(ISectionGroupService sectionGroupService,
                               ISectionContentProviderService sectionContentProviderService,
                               IWidgetBasePartService widgetService, IPackageInstallerProvider packageInstallerProvider,
                               ILocalize localize,
                               IWidgetActivator widgetActivator)
 {
     _sectionGroupService           = sectionGroupService;
     _sectionContentProviderService = sectionContentProviderService;
     _widgetService            = widgetService;
     _packageInstallerProvider = packageInstallerProvider;
     _widgetActivator          = widgetActivator;
     _localize = localize;
 }
Exemple #22
0
 public LayoutService(IDataArchivedService dataArchivedService,
                      IZoneService zoneService,
                      IWidgetBasePartService widgetService,
                      IApplicationContext applicationContext,
                      ILayoutHtmlService layoutHtmlService,
                      IWidgetActivator widgetActivator,
                      CMSDbContext dbContext)
     : base(applicationContext, dbContext)
 {
     _zoneService       = zoneService;
     _widgetService     = widgetService;
     _layoutHtmlService = layoutHtmlService;
     _widgetActivator   = widgetActivator;
 }
Exemple #23
0
 public LayoutService(IDataArchivedService dataArchivedService,
                      IPageService pageService,
                      IZoneService zoneService,
                      IWidgetBasePartService widgetService,
                      IApplicationContext applicationContext,
                      ILayoutHtmlService layoutHtmlService)
     : base(applicationContext)
 {
     DataArchivedService = dataArchivedService;
     PageService         = pageService;
     ZoneService         = zoneService;
     WidgetService       = widgetService;
     LayoutHtmlService   = layoutHtmlService;
 }
 public PageController(IPageService service,
                       ICookie cookie,
                       ILayoutService layoutService,
                       IWidgetBasePartService widgetService,
                       IRuleService ruleService,
                       IApplicationSettingService applicationSettingService)
     : base(service)
 {
     _cookie                    = cookie;
     _layoutService             = layoutService;
     _widgetService             = widgetService;
     _ruleService               = ruleService;
     _applicationSettingService = applicationSettingService;
 }
Exemple #25
0
 public PageService(IWidgetBasePartService widgetService,
                    IApplicationContext applicationContext,
                    IHttpContextAccessor httpContextAccessor,
                    IWidgetActivator widgetActivator,
                    IZoneService zoneService,
                    ILayoutHtmlService layoutHtmlService,
                    CMSDbContext dbContext)
     : base(applicationContext, dbContext)
 {
     _widgetService       = widgetService;
     _httpContextAccessor = httpContextAccessor;
     _widgetActivator     = widgetActivator;
     _zoneService         = zoneService;
     _layoutHtmlService   = layoutHtmlService;
 }
Exemple #26
0
 public LayoutService(IDataArchivedService dataArchivedService,
                      IZoneService zoneService,
                      IWidgetBasePartService widgetService,
                      IApplicationContext applicationContext,
                      ILayoutHtmlService layoutHtmlService,
                      IWidgetActivator widgetActivator,
                      ICacheManager <ConcurrentDictionary <string, object> > cacheManager,
                      CMSDbContext dbContext)
     : base(applicationContext, dbContext)
 {
     _zoneService       = zoneService;
     _widgetService     = widgetService;
     _layoutHtmlService = layoutHtmlService;
     _widgetActivator   = widgetActivator;
     _cache             = cacheManager.GetOrAdd("LayoutCacheKey", key => new ConcurrentDictionary <string, object>());
 }
Exemple #27
0
 public PageService(IWidgetBasePartService widgetService,
                    IApplicationContext applicationContext,
                    IHttpContextAccessor httpContextAccessor,
                    IWidgetActivator widgetActivator,
                    IZoneService zoneService,
                    ILayoutHtmlService layoutHtmlService,
                    CMSDbContext dbContext)
     : base(applicationContext, dbContext)
 {
     _widgetService       = widgetService;
     _httpContextAccessor = httpContextAccessor;
     _widgetActivator     = widgetActivator;
     _zoneService         = zoneService;
     _layoutHtmlService   = layoutHtmlService;
     _cachedPage          = new Dictionary <string, IEnumerable <PageEntity> >();
 }
Exemple #28
0
 public PageService(IWidgetBasePartService widgetService,
                    IApplicationContext applicationContext,
                    IWidgetActivator widgetActivator,
                    IZoneService zoneService,
                    ILayoutHtmlService layoutHtmlService,
                    ILocalize localize,
                    CMSDbContext dbContext,
                    IEventManager eventManager)
     : base(applicationContext, dbContext)
 {
     _widgetService     = widgetService;
     _widgetActivator   = widgetActivator;
     _zoneService       = zoneService;
     _layoutHtmlService = layoutHtmlService;
     _eventManager      = eventManager;
     _localize          = localize;
     _cachedPage        = new Dictionary <string, IEnumerable <PageEntity> >(StringComparer.OrdinalIgnoreCase);
 }
        public IActionResult PageZones(QueryContext context)
        {
            ILayoutService         layoutService         = HttpContext.RequestServices.GetService <ILayoutService>();
            IWidgetBasePartService widgetBasePartService = HttpContext.RequestServices.GetService <IWidgetBasePartService>();
            IRuleService           ruleService           = HttpContext.RequestServices.GetService <IRuleService>();
            var page      = Service.Get(context.PageID);
            var layout    = layoutService.GetByPage(page);
            var viewModel = new LayoutZonesViewModel
            {
                Page       = page,
                Layout     = layout,
                PageID     = context.PageID,
                LayoutID   = layout.ID,
                Zones      = layout.Zones,
                Widgets    = widgetBasePartService.GetAllByPage(page),
                LayoutHtml = layout.Html
            };
            var rules = ruleService.GetMatchRule(new RuleWorkContext
            {
                Url       = Url.Content(page.Url),
                UserAgent = Request.Headers["User-Agent"]
            });

            if (rules.Any())
            {
                var ruleDic     = rules.ToDictionary(m => m.RuleID, m => m);
                var rulesID     = rules.Select(m => m.RuleID).ToArray();
                var ruleWidgets = widgetBasePartService.GetAllByRule(rulesID);
                ruleWidgets.Each(widget =>
                {
                    var availableZones = layout.Zones.Where(z => ruleDic[widget.RuleID.Value].ZoneNames.Contains(z.ZoneName));
                    foreach (var item in availableZones)
                    {
                        widget.SetZone(item.HeadingCode);
                    }
                });
                viewModel.Widgets = viewModel.Widgets.Concat(ruleWidgets);
            }


            return(View(viewModel));
        }
Exemple #30
0
        public IActionResult PageZones(QueryContext context)
        {
            ILayoutService         layoutService         = HttpContext.RequestServices.GetService <ILayoutService>();
            IWidgetBasePartService widgetBasePartService = HttpContext.RequestServices.GetService <IWidgetBasePartService>();
            IRuleService           ruleService           = HttpContext.RequestServices.GetService <IRuleService>();
            var page      = Service.Get(context.PageID);
            var layout    = layoutService.GetByPage(page);
            var viewModel = new LayoutZonesViewModel
            {
                Page       = page,
                Layout     = layout,
                PageID     = context.PageID,
                LayoutID   = layout.ID,
                Zones      = layout.Zones,
                Widgets    = widgetBasePartService.GetAllByPage(page),
                LayoutHtml = layout.Html
            };
            var rules = ruleService.GetMatchRule(new RuleWorkContext
            {
                Url       = Url.Content(page.Url),
                UserAgent = Request.Headers["User-Agent"]
            });

            if (rules.Any())
            {
                var rulesID     = rules.Select(m => m.RuleID).ToArray();
                var ruleWidgets = widgetBasePartService.GetAllByRule(rulesID);
                ruleWidgets.Each(widget =>
                {
                    var zone = layout.Zones.FirstOrDefault(z => z.ZoneName == rules.First(m => m.RuleID == widget.RuleID).ZoneName);
                    if (zone != null)
                    {
                        widget.ZoneID = zone.HeadingCode;
                    }
                });
                viewModel.Widgets = viewModel.Widgets.Concat(ruleWidgets);
            }


            return(View(viewModel));
        }