Exemplo n.º 1
0
        public PageViewModel(INavigationService navigationService, IPageContentService pageContentService)
            : base(navigationService)
        {
            this.pageContentService = pageContentService;

            // Load();
        }
Exemplo n.º 2
0
        async Task IAsyncActionFilter.OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
        {
            pageService        = HttpContext.RequestServices.GetRequiredService <IPageService>();
            pageEditingService = HttpContext.RequestServices.GetRequiredService <IPageContentService>();

            if (!Request.Query.TryGetValue("editId", out Microsoft.Extensions.Primitives.StringValues editIdValue) || !Guid.TryParse(editIdValue[0], out Guid editId))
            {
                context.Result = BadRequest();
                return;
            }

            editSession = await pageEditingService.FindEditByIdAsync(editId, HttpContext.RequestAborted);

            if (editSession == null)
            {
                context.Result = BadRequest();
                return;
            }

            page = await pageService.FindPageByIdAsync(editSession.PageId);

            if (page == null)
            {
                context.Result = BadRequest();
                return;
            }

            var content = await pageEditingService.GetContentAsync(editSession, HttpContext.RequestAborted);

            rootContentContext = new ContentContext(page, content, HttpContext.RequestServices, true);

            string modelPath = string.Empty;

            if (Request.Query.TryGetValue("path", out Microsoft.Extensions.Primitives.StringValues pathValue))
            {
                modelPath = pathValue[0];
            }

            contentContext = rootContentContext.Navigate(modelPath);
            if (contentContext == null)
            {
                context.Result = BadRequest();
                return;
            }

            if (!Request.Query.TryGetValue("field", out Microsoft.Extensions.Primitives.StringValues fieldNameValue))
            {
                context.Result = BadRequest();
                return;
            }
            string fieldName = fieldNameValue[0];

            if (!contentContext.Explorer.Metadata.TryGetField(fieldName, out field))
            {
                context.Result = BadRequest();
                return;
            }

            await next();
        }
Exemplo n.º 3
0
 public MeController(ILogger log, IContactService contactSrv, IMapper mapper, IPageContentService pageContentSrv)
 {
     _log            = log;
     _contactSrv     = contactSrv;
     _mapper         = mapper;
     _pageContentSrv = pageContentSrv;
 }
        public ContentSectionsController(IPageContentService pageContentService, IMappingService mappingService, IImageService imageService)
            : base(mappingService, imageService)
        {
            Guard.WhenArgument(pageContentService, "PageContent service is null.").IsNull().Throw();

            this.pageContentService = pageContentService;
        }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PageService" /> class.
 /// </summary>
 /// <param name="repository">The repository.</param>
 /// <param name="unitOfWork">The unit of work.</param>
 /// <param name="pagePropertiesService">The page properties service.</param>
 /// <param name="pageExistsService">The page exists service.</param>
 /// <param name="pageContentsService">The page contents service.</param>
 /// <param name="pageContentService">The page content service.</param>
 /// <param name="urlService">The URL service.</param>
 /// <param name="fileUrlResolver">The file URL resolver.</param>
 /// <param name="pageTranslationsService">The page translations service.</param>
 /// <param name="masterPageService">The master page service.</param>
 /// <param name="pageService">The page service.</param>
 /// <param name="sitemapService">The sitemap service.</param>
 /// <param name="tagService">The tag service.</param>
 /// <param name="accessControlService">The access control service.</param>
 public PageService(
     IRepository repository,
     IUnitOfWork unitOfWork,
     IPagePropertiesService pagePropertiesService,
     IPageExistsService pageExistsService,
     IPageContentsService pageContentsService,
     IPageContentService pageContentService,
     IUrlService urlService,
     IMediaFileUrlResolver fileUrlResolver,
     IPageTranslationsService pageTranslationsService,
     IMasterPageService masterPageService,
     Module.Pages.Services.IPageService pageService,
     ISitemapService sitemapService,
     ITagService tagService,
     IAccessControlService accessControlService)
 {
     this.pageContentsService     = pageContentsService;
     this.pageContentService      = pageContentService;
     this.pagePropertiesService   = pagePropertiesService;
     this.pageExistsService       = pageExistsService;
     this.repository              = repository;
     this.urlService              = urlService;
     this.fileUrlResolver         = fileUrlResolver;
     this.pageTranslationsService = pageTranslationsService;
 }
Exemplo n.º 6
0
 public RedaktContext(IPageService pageService, IPageContentService contentService, IPageTypeService pageTypeService)
 {
     this.PageService        = pageService;
     this.PageContentService = contentService;
     this.PageTypeService    = pageTypeService;
     this.User = new User();
     this.Site = new Site();
 }
Exemplo n.º 7
0
 public PageService(IRepository repository, IPagePropertiesService pagePropertiesService, IPageExistsService pageExistsService, 
     IPageContentsService pageContentsService, IPageContentService pageContentService, IUrlService urlService)
 {
     this.pageContentsService = pageContentsService;
     this.pageContentService = pageContentService;
     this.pagePropertiesService = pagePropertiesService;
     this.pageExistsService = pageExistsService;
     this.repository = repository;
     this.urlService = urlService;
 }
Exemplo n.º 8
0
 public PageService(IRepository repository, IPagePropertiesService pagePropertiesService, IPageExistsService pageExistsService,
                    IPageContentsService pageContentsService, IPageContentService pageContentService, IUrlService urlService)
 {
     this.pageContentsService   = pageContentsService;
     this.pageContentService    = pageContentService;
     this.pagePropertiesService = pagePropertiesService;
     this.pageExistsService     = pageExistsService;
     this.repository            = repository;
     this.urlService            = urlService;
 }
Exemplo n.º 9
0
 public HeaderViewComponent(ICatalogFunctionService catalogFunctionService,
                            ICatalogSectorService catalogSectorService,
                            ICategoryBlogService categoryBlogService,
                            IPageContentService pageContentService)
 {
     _catalogFunctionService = catalogFunctionService;
     _catalogSectorService   = catalogSectorService;
     _categoryBlogService    = categoryBlogService;
     _pageContentService     = pageContentService;
 }
Exemplo n.º 10
0
 public AdminController(ILogger log, IAppLogService appLogSrv, IContactService contactSrv,
                        IArticleService articleSrv, IMapper mapper, IPageContentService pageContentSrv)
 {
     _log            = log;
     _appLogSrv      = appLogSrv;
     _contactSrv     = contactSrv;
     _articleSrv     = articleSrv;
     _mapper         = mapper;
     _pageContentSrv = pageContentSrv;
 }
Exemplo n.º 11
0
 public PageService(IRepository repository, IPagePropertiesService pagePropertiesService, IPageExistsService pageExistsService, 
     IPageContentsService pageContentsService, IPageContentService pageContentService, IUrlService urlService, IMediaFileUrlResolver fileUrlResolver)
 {
     this.pageContentsService = pageContentsService;
     this.pageContentService = pageContentService;
     this.pagePropertiesService = pagePropertiesService;
     this.pageExistsService = pageExistsService;
     this.repository = repository;
     this.urlService = urlService;
     this.fileUrlResolver = fileUrlResolver;
 }
Exemplo n.º 12
0
 public PageService(IRepository repository, IPagePropertiesService pagePropertiesService, IPageExistsService pageExistsService,
                    IPageContentsService pageContentsService, IPageContentService pageContentService, IUrlService urlService, IMediaFileUrlResolver fileUrlResolver)
 {
     this.pageContentsService   = pageContentsService;
     this.pageContentService    = pageContentService;
     this.pagePropertiesService = pagePropertiesService;
     this.pageExistsService     = pageExistsService;
     this.repository            = repository;
     this.urlService            = urlService;
     this.fileUrlResolver       = fileUrlResolver;
 }
Exemplo n.º 13
0
        public PageContentServiceTests()
        {
            var services = new ServiceCollection();

            services.AddPages()
            .AddContentTypesFromAssemblies(typeof(TestPageContent).Assembly)
            .AddFakes();

            services.AddSingleton <IWebsiteContext>(new TestWebsiteContext("test", "test"));

            serviceProvider = services.BuildServiceProvider();
            serviceScope    = serviceProvider.CreateScope();

            pageService           = serviceScope.ServiceProvider.GetService <IPageService>();
            pageCollectionService = serviceScope.ServiceProvider.GetService <IPageCollectionService>();
            pageContentService    = serviceScope.ServiceProvider.GetService <IPageContentService>();
            pageMetadataManager   = serviceScope.ServiceProvider.GetService <IPageMetadataManager>();
        }
Exemplo n.º 14
0
 public BaseController(IPageContentService pageContentService, IProductsService productsService)
 {
     this.pageContentService = pageContentService;
     this.productsService    = productsService;
 }
Exemplo n.º 15
0
 public HomeController(IPageContentService pageContentService, IProductsService productsService)
     : base(pageContentService, productsService)
 {
 }
Exemplo n.º 16
0
 public IntegrateController(IPageContentService pageContentService,
                            IWebImageService webImageService)
 {
     _pageContentService = pageContentService;
     _webImageService    = webImageService;
 }
Exemplo n.º 17
0
 public PageController(IPageService pageService, IPageTypeService pageTypeService, IPageContentService pageContentService)
 {
     _pageService        = pageService;
     _pageTypeService    = pageTypeService;
     _pageContentService = pageContentService;
 }
Exemplo n.º 18
0
 public HomeController(IHomeService homeService, IPageContentService contentService)
 {
     this.homeService    = homeService;
     this.contentService = contentService;
 }
Exemplo n.º 19
0
 public FooterViewComponent(IInfoService infoService, IPageContentService pageContentService)
 {
     _infoService        = infoService;
     _pageContentService = pageContentService;
 }
Exemplo n.º 20
0
 public PageContentController(IPageContentService pageContentRepository)
 {
     _pageContentService = pageContentRepository;
 }
Exemplo n.º 21
0
 public PageContentController(ILogger <PageContentController> logger, IPageContentService service)
 {
     _logger  = logger;
     _service = service;
 }
Exemplo n.º 22
0
 public HomeController(IPageContentService _pageServices, IConfiguration config, ICommonService _serv)
 {
     PageService = _pageServices;
     BaseUrl     = config.GetValue <string>("FilePath");
     serv        = _serv;
 }
 public PageContentController(IPageService pageService, IPageContentService pageContentService, Url.IPageLinkGenerator pageLinkGenerator)
 {
     this.pageService        = pageService ?? throw new ArgumentNullException(nameof(pageService));
     this.pageContentService = pageContentService ?? throw new ArgumentNullException(nameof(pageContentService));
     this.pageLinkGenerator  = pageLinkGenerator ?? throw new ArgumentNullException(nameof(pageLinkGenerator));
 }
Exemplo n.º 24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PageService" /> class.
 /// </summary>
 /// <param name="repository">The repository.</param>
 /// <param name="unitOfWork">The unit of work.</param>
 /// <param name="pagePropertiesService">The page properties service.</param>
 /// <param name="pageExistsService">The page exists service.</param>
 /// <param name="pageContentsService">The page contents service.</param>
 /// <param name="pageContentService">The page content service.</param>
 /// <param name="urlService">The URL service.</param>
 /// <param name="fileUrlResolver">The file URL resolver.</param>
 /// <param name="pageTranslationsService">The page translations service.</param>
 /// <param name="masterPageService">The master page service.</param>
 /// <param name="pageService">The page service.</param>
 /// <param name="sitemapService">The sitemap service.</param>
 /// <param name="tagService">The tag service.</param>
 /// <param name="accessControlService">The access control service.</param>
 public PageService(
     IRepository repository,
     IUnitOfWork unitOfWork,
     IPagePropertiesService pagePropertiesService,
     IPageExistsService pageExistsService,
     IPageContentsService pageContentsService,
     IPageContentService pageContentService,
     IUrlService urlService,
     IMediaFileUrlResolver fileUrlResolver,
     IPageTranslationsService pageTranslationsService,
     IMasterPageService masterPageService,
     Module.Pages.Services.IPageService pageService,
     ISitemapService sitemapService,
     ITagService tagService,
     IAccessControlService accessControlService)
 {
     this.pageContentsService = pageContentsService;
     this.pageContentService = pageContentService;
     this.pagePropertiesService = pagePropertiesService;
     this.pageExistsService = pageExistsService;
     this.repository = repository;
     this.urlService = urlService;
     this.fileUrlResolver = fileUrlResolver;
     this.pageTranslationsService = pageTranslationsService;
 }
 public HomeController(IPageContentService pageContentService, IAuthenticationService authenticationService)
 {
     _pageContentService    = pageContentService;
     _authenticationService = authenticationService;
 }
Exemplo n.º 26
0
 public PageController(IPageContentService contentService)
 {
     this.contentService = contentService;
 }
Exemplo n.º 27
0
 public ContentController(IPageContentService pageContentService)
 {
     _pageContentService = pageContentService;
 }
Exemplo n.º 28
0
 public WhereToBuyController(IPageContentService pageContentService, IProductsService productsService, IRetailerService retailerService)
     : base(pageContentService, productsService)
 {
     this.retailerService = retailerService;
 }