Ejemplo n.º 1
0
 public PageHandler(IPageRepository pageRepository, ICommunicationContext context, IUriResolver uriResolver, IMarkdown markdown)
 {
     this.pageRepository = pageRepository;
     this.context = context;
     this.uriResolver = uriResolver;
     this.markdown = markdown;
 }
Ejemplo n.º 2
0
 public BeatrixControllerFactory(IPageRepository pageRepository, IPathResolver pathResolver)
     : base()
 {
     this.pageRepository = pageRepository;
     this.pathResolver = pathResolver;
     this.beatrixControllerTypes = ReflectBeatrixControllers();
 }
Ejemplo n.º 3
0
 public ProductLinkHandler(Page page, TemplateUic uic, IPrincipal user, IPageRepository pageRepository, ILogger logger)
     : base(page, uic)
 {
     _user = user;
     _pageRepository = pageRepository;
     _logger = logger;
 }
Ejemplo n.º 4
0
		public WikiExporter(ApplicationSettings applicationSettings, PageService pageService, ISettingsRepository settingsRepository, IPageRepository pageRepository, IUserRepository userRepository, IPluginFactory pluginFactory)
		{
			if (applicationSettings == null)
				throw new ArgumentNullException(nameof(applicationSettings));

			if (pageService == null)
				throw new ArgumentNullException(nameof(pageService));

			if (settingsRepository == null)
				throw new ArgumentNullException(nameof(settingsRepository));

			if (pageRepository == null)
				throw new ArgumentNullException(nameof(pageRepository));

			if (userRepository == null)
				throw new ArgumentNullException(nameof(userRepository));

			if (pluginFactory == null)
				throw new ArgumentNullException(nameof(pluginFactory));

			_applicationSettings = applicationSettings;
			_pageService = pageService;
			_sqlExportBuilder = new SqlExportBuilder(settingsRepository, userRepository, pageRepository, pluginFactory);

			ExportFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "App_Data", "Export");
		}
Ejemplo n.º 5
0
		/// <summary>
		/// Creates a new markdown parser which handles the image and link parsing by the various different 
		/// markdown format parsers.
		/// </summary>
		/// <returns>An <see cref="IMarkupParser"/> for Creole,Markdown or Media wiki formats.</returns>
		public MarkupConverter(ApplicationSettings settings, ISettingsRepository settingsRepository, IPageRepository pageRepository,  IPluginFactory pluginFactory)
		{
			_externalLinkPrefixes = new List<string>()
			{
				"http://",
				"https://",
				"www.",
				"mailto:",
				"#",
				"tag:"
			};

			_pluginFactory = pluginFactory;
			_settingsRepository = settingsRepository;
			_pageRepository = pageRepository;
			_applicationSettings = settings;

			// Create the UrlResolver for all wiki urls
			HttpContextBase httpContext = null;
			if (HttpContext.Current != null)
				httpContext = new HttpContextWrapper(HttpContext.Current);

			UrlResolver = new UrlResolver(httpContext);		
	
			if (!_applicationSettings.Installed)
			{
				// Skip the chain of creation, as the markup converter isn't needed but is created by
				// StructureMap - this is required for installation
				return;
			}

			CreateParserForMarkupType();
		}
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PathResolver"/> class.
 /// </summary>
 /// <param name="pathData">The path data.</param>
 /// <param name="repository">The repository.</param>
 /// <param name="controllerMapper">The controller mapper.</param>
 /// <param name="container">The container.</param>
 public PathResolver(IPathData pathData, IPageRepository repository, IControllerMapper controllerMapper, IContainer container)
 {
     _pathData = pathData;
     _repository = repository;
     _controllerMapper = controllerMapper;
     _container = container;
 }
Ejemplo n.º 7
0
 public AdminManager()
 {
     _postRepo = new Factory().PostRepository();
     _pageRepo = new Factory().PageRepository();
     _categoryRepo = new Factory().CategoryRepository();
     _tagRepo = new Factory().TagRepository();
 }
Ejemplo n.º 8
0
 public FeedProcessor(
     IFeedRepository feeds,
     IPageRepository pages)
 {
     Feeds = feeds;
     Pages = pages;
 }
Ejemplo n.º 9
0
        public PublicModule(IApplication application, IRootPathProvider rootPathProvider,
		                    IArticleRepository articleRepository, IPageRepository pageRepository)
            : base(application)
        {
            this._ArticleRepository = articleRepository;
            this._PageRepository = pageRepository;
            this._rootPathProvider = rootPathProvider;

            // Bind the HTTP POST verb with /robots.txt with a response filled by text
            this.Get["/robots.txt"] = GetRobotTxt;

            // Bind the HTTP POST verb with /sitemap.xml to the GetSitemap method
            this.Get["/sitemap.xml"] = GetSitemap;

            // Define a route for urls "/{seoTitle}" which will returns the article matching the specified slug
            this.Get["/{category}/{seoTitle}"] = parameters => {
                // [BUG]: /sitemap.xml n'est pas prioritaire sur /{seoTitle}
                if(parameters.seoTitle == "rss")
                    return GetRSSFeed(parameters);
                // fin de [BUG]
                return GetStaticPage(parameters);
            };

            // Define a route for urls "/{seoTitle}" which will returns the article matching the specified slug
            this.Get["/{seoTitle}"] = parameters => {
                // [BUG]: /sitemap.xml n'est pas prioritaire sur /{seoTitle}
                if(parameters.seoTitle == "sitemap")
                    return GetSitemap(parameters);
                // fin de [BUG]
                return GetStaticPage(parameters);
            };
        }
Ejemplo n.º 10
0
		public void SetUp()
		{
			// Setup the repository
			Repository = GetRepository();
			Clearup();

			// Create 5 Pages with 2 versions of content each
			_createdDate = DateTime.Today.ToUniversalTime().AddDays(-1);
			_editedDate = _createdDate.AddHours(1);

			_page1 = NewPage("admin", "homepage, newpage");
			_pageContent1 = Repository.AddNewPage(_page1, "text", "admin", _createdDate);
			_page1 = _pageContent1.Page;
			_pageContent2 = Repository.AddNewPageContentVersion(_page1, "v2", "admin", _editedDate, 2);
			_page1 = _pageContent2.Page; // update the modified date

			Page page2 = NewPage("editor1");
			PageContent pageContent2 = Repository.AddNewPage(page2, "text", "editor1", _createdDate);
			Repository.AddNewPageContentVersion(pageContent2.Page, "v2", "editor1", _editedDate, 1);

			Page page3 = NewPage("editor2");
			PageContent pageContent3 = Repository.AddNewPage(page3, "text", "editor2", _createdDate);
			Repository.AddNewPageContentVersion(pageContent3.Page, "v2", "editor2", _editedDate, 1);

			Page page4 = NewPage("editor3");
			PageContent pageContent4 = Repository.AddNewPage(page4, "text", "editor3", _createdDate);
			Repository.AddNewPageContentVersion(pageContent4.Page, "v2", "editor3", _editedDate, 1);

			Page page5 = NewPage("editor4");
			PageContent pageContent5 = Repository.AddNewPage(page5, "text", "editor4", _createdDate);
			Repository.AddNewPageContentVersion(pageContent5.Page, "v2", "editor4", _editedDate, 1);
		}
Ejemplo n.º 11
0
 public PageController(IPageRepository PageRepo, IJSONRepository JSONRepo, IFormRepository FormRepo, IFAQRepository FAQRepo, IBlogPostRepository BlogPostRepo, IImageRepository ImageRepo)
 {
     PageRepository = PageRepo;
     JSONRepository = JSONRepo;
     FormRepository = FormRepo;
     FAQRepository = FAQRepo;
     BlogPostRepository = BlogPostRepo;
     ImageRepository = ImageRepo;
 }
Ejemplo n.º 12
0
 public HomeController(IPageRepository PageRepo, IHomeRepository HomeRepo, IImageRepository ImageRepo, IFormRepository FormRepo, IFAQRepository FAQRepo, IBlogPostRepository BlogPostRepo)
 {
     PageRepository = PageRepo;
     HomeRepository = HomeRepo;
     ImageRepository = ImageRepo;
     FormRepository = FormRepo;
     FAQRepository = FAQRepo;
     BlogPostRepository = BlogPostRepo;
 }
Ejemplo n.º 13
0
		public PageHistoryService(ApplicationSettings settings, ISettingsRepository settingsRepository, IPageRepository pageRepository, IUserContext context, 
			PageViewModelCache pageViewModelCache, IPluginFactory pluginFactory)
		{
			_markupConverter = new MarkupConverter(settings, settingsRepository, pageRepository, pluginFactory);
			_context = context;
			_pageViewModelCache = pageViewModelCache;

			SettingsRepository = settingsRepository;
			PageRepository = pageRepository;
		}
Ejemplo n.º 14
0
 public PageController(IPageRepository repository, PageService pageService,
                       ITemplateRepository templateRepository, IPageTreeRepository pageTreeRepository,
                       IAuthorizer authorizer)
 {
     _repository = repository;
     _pageService = pageService;
     _templateRepository = templateRepository;
     _pageTreeRepository = pageTreeRepository;
     _authorizer = authorizer;
 }
Ejemplo n.º 15
0
		public void Initialize()
		{
			string indexPath = AppDomain.CurrentDomain.BaseDirectory + @"\App_Data\SearchTests";
			if (Directory.Exists(indexPath))
				Directory.Delete(indexPath, true);

			_settingsRepository = new SettingsRepositoryMock();
			_pageRepository = new PageRepositoryMock();

			_config = new ApplicationSettings();
			_config.Installed = true;
			_pluginFactory = new PluginFactoryMock();
		}
Ejemplo n.º 16
0
        public IPathData ResolvePath(string virtualUrl)
        {
            // Set the default action to index
            _pathData.Action = ContentRoute.DefaultAction;
            // Set the default controller to content
            _pathData.Controller = ContentRoute.DefaultControllerName;
            // Get an up to date page repository
            _repository = _container.GetInstance<IPageRepository>();
            // The requested url is for the start page with no action
            if (string.IsNullOrEmpty(virtualUrl) || string.Equals(virtualUrl,"/")) {
                _pageModel = _repository.SingleOrDefault<IPageModel>(x => x.Parent == null);
                _pathData.CurrentPageModel = _pageModel;

                return _pathData;
            }
            // Remove the trailing slash
            virtualUrl = VirtualPathUtility.RemoveTrailingSlash(virtualUrl);
            // The normal beahaviour should be to load the page based on the url
            _pageModel = _repository.GetPageByUrl<IPageModel>(virtualUrl);
            // Try to load the page without the last segment of the url and set the last segment as action))
            if (_pageModel == null && virtualUrl.LastIndexOf("/") > 0) {
                var index = virtualUrl.LastIndexOf("/");
                var action = virtualUrl.Substring(index, virtualUrl.Length - index).Trim(new[] {'/'});
                virtualUrl = virtualUrl.Substring(0, index).TrimStart(new[] { '/' });
                _pageModel = _repository.GetPageByUrl<IPageModel>(virtualUrl);
                _pathData.Action = action;
            }

            // If the page model still is empty, let's try to resolve if the start page has an action named (virtualUrl)
            if(_pageModel == null) {
                _pageModel = _repository.SingleOrDefault<IPageModel>(x => x.Parent == null);
                var controllerName = _controllerMapper.GetControllerName(typeof(ContentController));
                var action = virtualUrl.TrimStart(new[] {'/'});
                if(!_controllerMapper.ControllerHasAction(controllerName,action)) {
                    return null;
                }
                _pathData.Action = action;
            }

            if (_pageModel == null) {
                return null;
            }

            _pathData.CurrentPageModel = _pageModel;
            return _pathData;
        }
Ejemplo n.º 17
0
		public ScrewTurnImporter(ApplicationSettings settings, IPageRepository pageRepository, IUserRepository userRepository)
		{
			if (settings == null)
				throw new ArgumentNullException(nameof(settings));

			if (pageRepository == null)
				throw new ArgumentNullException(nameof(pageRepository));

			if (userRepository == null)
				throw new ArgumentNullException(nameof(userRepository));

			UserRepository = userRepository;
			PageRepository = pageRepository;
			ApplicationSettings = settings;

			_attachmentsFolder = settings.AttachmentsDirectoryPath;
		}
Ejemplo n.º 18
0
		public PageService(ApplicationSettings settings, ISettingsRepository settingsRepository, IPageRepository pageRepository, SearchService searchService, 
			PageHistoryService historyService, IUserContext context, 
			ListCache listCache, PageViewModelCache pageViewModelCache, SiteCache sitecache, IPluginFactory pluginFactory)
		{
			_searchService = searchService;
			_markupConverter = new MarkupConverter(settings, settingsRepository, pageRepository, pluginFactory);
			_historyService = historyService;
			_context = context;
			_listCache = listCache;
			_pageViewModelCache = pageViewModelCache;
			_siteCache = sitecache;
			_pluginFactory = pluginFactory;
			_markupLinkUpdater = new MarkupLinkUpdater(_markupConverter.Parser);

			ApplicationSettings = settings;
			SettingsRepository = settingsRepository;
			PageRepository = pageRepository;
		}
Ejemplo n.º 19
0
		public SearchService(ApplicationSettings settings, ISettingsRepository settingsRepository, IPageRepository pageRepository, IPluginFactory pluginFactory)
		{
			if (settings == null)
				throw new ArgumentNullException(nameof(settings));

			if (settingsRepository == null)
				throw new ArgumentNullException(nameof(settingsRepository));

			if (pageRepository == null)
				throw new ArgumentNullException(nameof(pageRepository));

			if (pluginFactory == null)
				throw new ArgumentNullException(nameof(pluginFactory));

			_markupConverter = new MarkupConverter(settings, settingsRepository, pageRepository, pluginFactory);
			IndexPath = settings.SearchIndexPath;

			ApplicationSettings = settings;
			SettingsRepository = settingsRepository;
			PageRepository = pageRepository;
		}
Ejemplo n.º 20
0
		public AutoRegistrationPlugin(ISynchronizer synchronizer,
		                              IRegistrationRepository registrationRepository,
		                              IPageRepository pageRepository,
		                              IPageFormatter pageFormatter,
		                              IEntryFormatter entryFormatter,
		                              INotificationSender notificationSender,
		                              ILogger logger,
		                              IPluginConfiguration configuration,
		                              IFileReader fileReader,
		                              ISettings settings)
		{
			_synchronizer = synchronizer;
			_fileReader = fileReader;
			_settings = settings;
			_registrationRepository = registrationRepository;
			_pageRepository = pageRepository;
			_pageFormatter = pageFormatter;
			_entryFormatter = entryFormatter;
			_notificationSender = notificationSender;
			_logger = logger;
			_configuration = configuration;
		}
Ejemplo n.º 21
0
        private void UpdateLinksInternal(PreProcessorContext result, IPageRepository repository)
        {
            var added = result.LinkedPages.Except(References.Select(k => k.PagePath)).ToList();
            if (added.Any())
            {
                var pages = repository.GetPages(added);
                foreach (var page in pages)
                {
                    page.BackReferences.Any(); // lazy load.
                    page._backReferences.Add(this);
                }


                var missingPages = added.Except(pages.Select(x => x.PagePath));
                repository.AddMissingLinks(this, missingPages);
            }


            var removed = References.Select(k => k.PagePath).Except(result.LinkedPages).ToList();
            if (removed.Any())
                RemoveBackLinks(removed);
        }
Ejemplo n.º 22
0
 private void AddPendingRevision(PreProcessorContext result, string comment, IPageRepository repository)
 {
     var revision = new WikiPageRevision(this, WikiContext.Current.User, result, comment) {ReviewRequired = true};
     repository.Save(revision);
     _revisions.Add(revision);
     DomainEvent.Publish(new RevisionModerationRequired(revision));
 }
Ejemplo n.º 23
0
 static RequestHelper()
 {
     _sitesRepository = ServiceLocator.Current.Resolve <ISiteRepository>();
     _pagesRepository = ServiceLocator.Current.Resolve <IPageRepository>();
 }
Ejemplo n.º 24
0
 public HidePageHandler(IPageRepository pageRepository, IValidator <HidePage> validator)
 {
     _pageRepository = pageRepository;
     _validator      = validator;
 }
Ejemplo n.º 25
0
 public ExportController(IPageRepository pageRepository)
 {
     _pageRepository = pageRepository;
 }
Ejemplo n.º 26
0
 public PageController(IPageRepository pageRepository) => _pageRepository = pageRepository;
Ejemplo n.º 27
0
 public HostModel(IConfigManager configuration, ITenantManager tenantManager, ILocalizationManager localizationManager, ILanguageRepository languages, IAntiforgery antiforgery, ISiteRepository sites, IPageRepository pages, IUrlMappingRepository urlMappings, IVisitorRepository visitors, IAliasRepository aliases, ISettingRepository settings, ILogManager logger)
 {
     _configuration       = configuration;
     _tenantManager       = tenantManager;
     _localizationManager = localizationManager;
     _languages           = languages;
     _antiforgery         = antiforgery;
     _sites       = sites;
     _pages       = pages;
     _urlMappings = urlMappings;
     _visitors    = visitors;
     _aliases     = aliases;
     _settings    = settings;
     _logger      = logger;
 }
Ejemplo n.º 28
0
 public UpdatePageModuleDetailsHandler(IPageRepository pageRepository,
                                       IValidator <UpdatePageModuleDetails> validator)
 {
     _pageRepository = pageRepository;
     _validator      = validator;
 }
Ejemplo n.º 29
0
 public PagesController(IUserRepository userRepository, IPageRepository pageRepository, IBookRepository bookRepository)
 {
     _userRepository = userRepository;
     _pageRepository = pageRepository;
     _bookRepository = bookRepository;
 }
Ejemplo n.º 30
0
 public PageService(IPageRepository pageRepository)
 {
     _pageRepository = pageRepository;
 }
Ejemplo n.º 31
0
 public PageRules(IPageRepository pageRepository)
 {
     _pageRepository = pageRepository;
 }
Ejemplo n.º 32
0
        public void SetUp()
        {
            var optionsBuilder = new DbContextOptionsBuilder <WeapsyDbContext>();

            optionsBuilder.UseInMemoryDatabase();
            _dbContext = new WeapsyDbContext(optionsBuilder.Options);

            _siteId        = Guid.NewGuid();
            _pageId1       = Guid.NewGuid();
            _pageId2       = Guid.NewGuid();
            _moduleId1     = Guid.NewGuid();
            _pageModuleId1 = Guid.NewGuid();
            _languageId1   = Guid.NewGuid();

            _dbContext.Set <PageDbEntity>().AddRange(
                new PageDbEntity
            {
                SiteId      = _siteId,
                Id          = _pageId1,
                Name        = "Name 1",
                Url         = "Url 1",
                Status      = PageStatus.Active,
                PageModules = new List <PageModuleDbEntity>
                {
                    new PageModuleDbEntity
                    {
                        PageId   = _pageId1,
                        ModuleId = _moduleId1,
                        Id       = _pageModuleId1,
                        Title    = "Title 1",
                        Status   = PageModuleStatus.Active,
                        PageModuleLocalisations = new List <PageModuleLocalisationDbEntity>
                        {
                            new PageModuleLocalisationDbEntity
                            {
                                PageModuleId = _pageModuleId1,
                                LanguageId   = _languageId1
                            },
                            new PageModuleLocalisationDbEntity
                            {
                                PageModuleId = _pageModuleId1,
                                LanguageId   = Guid.NewGuid()
                            }
                        }
                    },
                    new PageModuleDbEntity
                    {
                        PageId   = _pageId1,
                        ModuleId = Guid.NewGuid(),
                        Id       = Guid.NewGuid(),
                        Title    = "Title 2",
                        Status   = PageModuleStatus.Deleted
                    }
                }
            },
                new PageDbEntity
            {
                SiteId = _siteId,
                Id     = _pageId2,
                Name   = "Name 2",
                Url    = "Url 2",
                Status = PageStatus.Active
            },
                new PageDbEntity
            {
                Status = PageStatus.Deleted
            }
                );

            _dbContext.SaveChanges();

            var mapperMock = new Mock <AutoMapper.IMapper>();

            mapperMock.Setup(x => x.Map <PageDbEntity>(It.IsAny <Page>())).Returns(new PageDbEntity());
            mapperMock.Setup(x => x.Map <Page>(It.IsAny <PageDbEntity>())).Returns(new Page());
            mapperMock.Setup(x => x.Map <ICollection <Page> >(It.IsAny <ICollection <PageDbEntity> >())).Returns(new List <Page>
            {
                PageFactory.Page(_siteId, _pageId1, "Name"),
                PageFactory.Page(_siteId, _pageId2, "Name")
            });

            _sut = new PageRepository(_dbContext, mapperMock.Object);
        }
Ejemplo n.º 33
0
 public PageService(ILogger <PageService> logger,
                    IUserContextProvider userContextProvider,
                    IPageRepository pageRepository) : base(logger, userContextProvider)
 {
     _pageRepository = Require.IsNotNull(pageRepository, nameof(pageRepository));
 }
 public DirectoryListDisplayModelMapper(
     IPageRepository pageRepository
     )
 {
     _pageRepository = pageRepository;
 }
Ejemplo n.º 35
0
 public PageService(IPageRepository pageRepository, IStorageService storageService)
 {
     _pageRepository = pageRepository;
     _storageService = storageService;
 }
Ejemplo n.º 36
0
 public PageSettingsController(IPageRepository pageRepo)
 {
     this.pageRepo = pageRepo;
 }
Ejemplo n.º 37
0
 public PageController(IPageRepository pageRepository)
 {
     _pageRepository         = pageRepository;
     _pageRepository.Context = rc;
 }
Ejemplo n.º 38
0
 protected PageRepository_Test()
 {
     _cmsKitTestData = GetRequiredService <CmsKitTestData>();
     _pageRepository = GetRequiredService <IPageRepository>();
 }
Ejemplo n.º 39
0
 public MainMenuViewComponent(IPageRepository pageRepository) => _pageRepository = pageRepository;
Ejemplo n.º 40
0
 public SiteService(ISiteRepository siteRepository,IPageRepository pageRepository)
 {
     this.siteRepository = siteRepository;
     this.pageRepository = pageRepository;
 }
Ejemplo n.º 41
0
 public MenuViewComponent(IPageRepository _repository)
 {
     repository = _repository;
 }
Ejemplo n.º 42
0
 public PagesController()
 {
     pageRepository      = new PageRepository(db);
     pageGrropRepository = new PageGroupRepository(db);
 }
Ejemplo n.º 43
0
 public StarterKitService(IHierarchyRepository <PageTemplate> pageTemplateRepository,
                          IRepository <Style> styleRepository, IRepository <Script> scriptRepository, IPageRepository pageRepository, IRepository <WidgetTemplate> widgetTemplateRepository)
 {
     _pageTemplateRepository   = pageTemplateRepository;
     _styleRepository          = styleRepository;
     _scriptRepository         = scriptRepository;
     _pageRepository           = pageRepository;
     _widgetTemplateRepository = widgetTemplateRepository;
 }
Ejemplo n.º 44
0
 public PageManager(IPageRepository pageRepository)
 {
     PageRepository = pageRepository;
 }
Ejemplo n.º 45
0
        private void AddRevision(PreProcessorContext result, string comment, IPageRepository repository)
        {
            var isNew = !_revisions.Any();


            UpdatedAt = DateTime.Now;
            UpdatedBy = WikiContext.Current.User;
            RawBody = result.OriginalBody;
            HtmlBody = result.Body;
            repository.Save(this);

            if (isNew)
            {
                DomainEvent.Publish(new PageCreated(this));
            }
            else
            {
                DomainEvent.Publish(new PageUpdated(this));
            }

            var revision = new WikiPageRevision(this, comment);
            revision.Approve();
            repository.Save(revision);
            _revisions.Add(revision);
        }
Ejemplo n.º 46
0
 public ReorderPageModulesHandler(IPageRepository pageRepository, IValidator <ReorderPageModules> validator)
 {
     _pageRepository = pageRepository;
     _validator      = validator;
 }
Ejemplo n.º 47
0
 /// <summary>
 ///   The body have been reparsed to reflect changed links.
 /// </summary>
 public virtual void UpdateLinks(PreProcessorContext result, IPageRepository repository)
 {
     //var result = Parser.Parse(PageName, RawBody);
     HtmlBody = result.Body;
     UpdateLinksInternal(result, repository);
 }
Ejemplo n.º 48
0
 public ShowTopPageComponent(IPageRepository pageRepository)
 {
     _pageRepository = pageRepository;
 }
Ejemplo n.º 49
0
        /// <summary>
        ///   Set the body to a specific revision
        /// </summary>
        /// <param name="repository"> Used to parse links </param>
        /// <param name="revision"> Revision ot use </param>
        /// <param name="result"> Result from body parsing </param>
        public virtual void SetRevision(IPageRepository repository, WikiPageRevision revision, PreProcessorContext result)
        {
            if (repository == null) throw new ArgumentNullException("repository");
            if (revision == null) throw new ArgumentNullException("revision");
            if (result == null) throw new ArgumentNullException("result");

            UpdatedAt = revision.CreatedAt;
            UpdatedBy = revision.CreatedBy;
            RawBody = result.OriginalBody;
            HtmlBody = result.Body;
            DomainEvent.Publish(new PageUpdated(this));
            UpdateLinksInternal(result, repository);
        }
Ejemplo n.º 50
0
 public PageAdminAppService(IPageRepository pageRepository)
 {
     PageRepository = pageRepository;
 }
Ejemplo n.º 51
0
        public SiteRepository(TenantDBContext context, IRoleRepository roleRepository, IProfileRepository profileRepository, IFolderRepository folderRepository, IFileRepository fileRepository, IPageRepository pageRepository, IModuleRepository moduleRepository, IPageModuleRepository pageModuleRepository, IModuleDefinitionRepository moduleDefinitionRepository, IPermissionRepository permissionRepository, IServiceProvider serviceProvider, IConfigurationRoot config)
        {
            _db                         = context;
            _roleRepository             = roleRepository;
            _profileRepository          = profileRepository;
            _folderRepository           = folderRepository;
            _fileRepository             = fileRepository;
            _pageRepository             = pageRepository;
            _moduleRepository           = moduleRepository;
            _pageModuleRepository       = pageModuleRepository;
            _moduleDefinitionRepository = moduleDefinitionRepository;
            _permissionRepository       = permissionRepository;
            _serviceProvider            = serviceProvider;
            _config                     = config;

            // define the default site template ( admin pages )
            _pageTemplates = new List <PageTemplate>();
            _pageTemplates.Add(new PageTemplate {
                Name            = "Admin", Parent = "", Path = "admin", Icon = "", IsNavigation = false, IsPersonalizable = false, EditMode = true,
                PagePermissions = _permissionRepository.EncodePermissions(new List <Permission> {
                    new Permission(PermissionNames.View, Constants.AdminRole, true),
                    new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                }),
                PageTemplateModules = new List <PageTemplateModule> {
                    new PageTemplateModule {
                        ModuleDefinitionName = "Oqtane.Modules.Admin.Dashboard, Oqtane.Client", Title = "Admin Dashboard", Pane = "Content",
                        ModulePermissions    = _permissionRepository.EncodePermissions(new List <Permission> {
                            new Permission(PermissionNames.View, Constants.AdminRole, true),
                            new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                        }), Content = ""
                    }
                }
            });
            _pageTemplates.Add(new PageTemplate {
                Name            = "Site Management", Parent = "Admin", Path = "admin/sites", Icon = "globe", IsNavigation = false, IsPersonalizable = false, EditMode = true,
                PagePermissions = _permissionRepository.EncodePermissions(new List <Permission> {
                    new Permission(PermissionNames.View, Constants.AdminRole, true),
                    new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                }),
                PageTemplateModules = new List <PageTemplateModule> {
                    new PageTemplateModule {
                        ModuleDefinitionName = "Oqtane.Modules.Admin.Sites, Oqtane.Client", Title = "Site Management", Pane = "Content",
                        ModulePermissions    = _permissionRepository.EncodePermissions(new List <Permission> {
                            new Permission(PermissionNames.View, Constants.AdminRole, true),
                            new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                        }), Content = ""
                    }
                }
            });
            _pageTemplates.Add(new PageTemplate {
                Name            = "Site Settings", Parent = "Admin", Path = "admin/site", Icon = "home", IsNavigation = false, IsPersonalizable = false, EditMode = true,
                PagePermissions = _permissionRepository.EncodePermissions(new List <Permission> {
                    new Permission(PermissionNames.View, Constants.AdminRole, true),
                    new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                }),
                PageTemplateModules = new List <PageTemplateModule> {
                    new PageTemplateModule {
                        ModuleDefinitionName = "Oqtane.Modules.Admin.Site, Oqtane.Client", Title = "Site Settings", Pane = "Content",
                        ModulePermissions    = _permissionRepository.EncodePermissions(new List <Permission> {
                            new Permission(PermissionNames.View, Constants.AdminRole, true),
                            new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                        }), Content = ""
                    }
                }
            });
            _pageTemplates.Add(new PageTemplate {
                Name            = "Page Management", Parent = "Admin", Path = "admin/pages", Icon = "layers", IsNavigation = false, IsPersonalizable = false, EditMode = true,
                PagePermissions = _permissionRepository.EncodePermissions(new List <Permission> {
                    new Permission(PermissionNames.View, Constants.AdminRole, true),
                    new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                }),
                PageTemplateModules = new List <PageTemplateModule> {
                    new PageTemplateModule {
                        ModuleDefinitionName = "Oqtane.Modules.Admin.Pages, Oqtane.Client", Title = "Page Management", Pane = "Content",
                        ModulePermissions    = _permissionRepository.EncodePermissions(new List <Permission> {
                            new Permission(PermissionNames.View, Constants.AdminRole, true),
                            new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                        }), Content = ""
                    }
                }
            });
            _pageTemplates.Add(new PageTemplate {
                Name            = "User Management", Parent = "Admin", Path = "admin/users", Icon = "people", IsNavigation = false, IsPersonalizable = false, EditMode = true,
                PagePermissions = _permissionRepository.EncodePermissions(new List <Permission> {
                    new Permission(PermissionNames.View, Constants.AdminRole, true),
                    new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                }),
                PageTemplateModules = new List <PageTemplateModule> {
                    new PageTemplateModule {
                        ModuleDefinitionName = "Oqtane.Modules.Admin.Users, Oqtane.Client", Title = "User Management", Pane = "Content",
                        ModulePermissions    = _permissionRepository.EncodePermissions(new List <Permission> {
                            new Permission(PermissionNames.View, Constants.AdminRole, true),
                            new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                        }), Content = ""
                    }
                }
            });
            _pageTemplates.Add(new PageTemplate {
                Name            = "Profile Management", Parent = "Admin", Path = "admin/profiles", Icon = "person", IsNavigation = false, IsPersonalizable = false, EditMode = true,
                PagePermissions = _permissionRepository.EncodePermissions(new List <Permission> {
                    new Permission(PermissionNames.View, Constants.AdminRole, true),
                    new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                }),
                PageTemplateModules = new List <PageTemplateModule> {
                    new PageTemplateModule {
                        ModuleDefinitionName = "Oqtane.Modules.Admin.Profiles, Oqtane.Client", Title = "Profile Management", Pane = "Content",
                        ModulePermissions    = _permissionRepository.EncodePermissions(new List <Permission> {
                            new Permission(PermissionNames.View, Constants.AdminRole, true),
                            new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                        }), Content = ""
                    }
                }
            });
            _pageTemplates.Add(new PageTemplate {
                Name            = "Role Management", Parent = "Admin", Path = "admin/roles", Icon = "lock-locked", IsNavigation = false, IsPersonalizable = false, EditMode = true,
                PagePermissions = _permissionRepository.EncodePermissions(new List <Permission> {
                    new Permission(PermissionNames.View, Constants.AdminRole, true),
                    new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                }),
                PageTemplateModules = new List <PageTemplateModule> {
                    new PageTemplateModule {
                        ModuleDefinitionName = "Oqtane.Modules.Admin.Roles, Oqtane.Client", Title = "Role Management", Pane = "Content",
                        ModulePermissions    = _permissionRepository.EncodePermissions(new List <Permission> {
                            new Permission(PermissionNames.View, Constants.AdminRole, true),
                            new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                        }), Content = ""
                    }
                }
            });
            _pageTemplates.Add(new PageTemplate {
                Name            = "Event Log", Parent = "Admin", Path = "admin/log", Icon = "magnifying-glass", IsNavigation = false, IsPersonalizable = false, EditMode = true,
                PagePermissions = _permissionRepository.EncodePermissions(new List <Permission> {
                    new Permission(PermissionNames.View, Constants.AdminRole, true),
                    new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                }),
                PageTemplateModules = new List <PageTemplateModule> {
                    new PageTemplateModule {
                        ModuleDefinitionName = "Oqtane.Modules.Admin.Logs, Oqtane.Client", Title = "Event Log", Pane = "Content",
                        ModulePermissions    = _permissionRepository.EncodePermissions(new List <Permission> {
                            new Permission(PermissionNames.View, Constants.AdminRole, true),
                            new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                        }), Content = ""
                    }
                }
            });
            _pageTemplates.Add(new PageTemplate {
                Name            = "File Management", Parent = "Admin", Path = "admin/files", Icon = "file", IsNavigation = false, IsPersonalizable = false, EditMode = true,
                PagePermissions = _permissionRepository.EncodePermissions(new List <Permission> {
                    new Permission(PermissionNames.View, Constants.AdminRole, true),
                    new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                }),
                PageTemplateModules = new List <PageTemplateModule> {
                    new PageTemplateModule {
                        ModuleDefinitionName = "Oqtane.Modules.Admin.Files, Oqtane.Client", Title = "File Management", Pane = "Content",
                        ModulePermissions    = _permissionRepository.EncodePermissions(new List <Permission> {
                            new Permission(PermissionNames.View, Constants.AdminRole, true),
                            new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                        }), Content = ""
                    }
                }
            });
            _pageTemplates.Add(new PageTemplate {
                Name            = "Recycle Bin", Parent = "Admin", Path = "admin/recyclebin", Icon = "trash", IsNavigation = false, IsPersonalizable = false, EditMode = true,
                PagePermissions = _permissionRepository.EncodePermissions(new List <Permission> {
                    new Permission(PermissionNames.View, Constants.AdminRole, true),
                    new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                }),
                PageTemplateModules = new List <PageTemplateModule> {
                    new PageTemplateModule {
                        ModuleDefinitionName = "Oqtane.Modules.Admin.RecycleBin, Oqtane.Client", Title = "Recycle Bin", Pane = "Content",
                        ModulePermissions    = _permissionRepository.EncodePermissions(new List <Permission> {
                            new Permission(PermissionNames.View, Constants.AdminRole, true),
                            new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                        }), Content = ""
                    }
                }
            });
            _pageTemplates.Add(new PageTemplate {
                Name            = "Tenant Management", Parent = "Admin", Path = "admin/tenants", Icon = "list", IsNavigation = false, IsPersonalizable = false, EditMode = true,
                PagePermissions = _permissionRepository.EncodePermissions(new List <Permission> {
                    new Permission(PermissionNames.View, Constants.AdminRole, true),
                    new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                }),
                PageTemplateModules = new List <PageTemplateModule> {
                    new PageTemplateModule {
                        ModuleDefinitionName = "Oqtane.Modules.Admin.Tenants, Oqtane.Client", Title = "Tenant Management", Pane = "Content",
                        ModulePermissions    = _permissionRepository.EncodePermissions(new List <Permission> {
                            new Permission(PermissionNames.View, Constants.AdminRole, true),
                            new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                        }), Content = ""
                    }
                }
            });
            _pageTemplates.Add(new PageTemplate {
                Name            = "Module Management", Parent = "Admin", Path = "admin/modules", Icon = "browser", IsNavigation = false, IsPersonalizable = false, EditMode = true,
                PagePermissions = _permissionRepository.EncodePermissions(new List <Permission> {
                    new Permission(PermissionNames.View, Constants.AdminRole, true),
                    new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                }),
                PageTemplateModules = new List <PageTemplateModule> {
                    new PageTemplateModule {
                        ModuleDefinitionName = "Oqtane.Modules.Admin.ModuleDefinitions, Oqtane.Client", Title = "Module Management", Pane = "Content",
                        ModulePermissions    = _permissionRepository.EncodePermissions(new List <Permission> {
                            new Permission(PermissionNames.View, Constants.AdminRole, true),
                            new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                        }), Content = ""
                    }
                }
            });
            _pageTemplates.Add(new PageTemplate {
                Name            = "Theme Management", Parent = "Admin", Path = "admin/themes", Icon = "brush", IsNavigation = false, IsPersonalizable = false, EditMode = true,
                PagePermissions = _permissionRepository.EncodePermissions(new List <Permission> {
                    new Permission(PermissionNames.View, Constants.AdminRole, true),
                    new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                }),
                PageTemplateModules = new List <PageTemplateModule> {
                    new PageTemplateModule {
                        ModuleDefinitionName = "Oqtane.Modules.Admin.Themes, Oqtane.Client", Title = "Theme Management", Pane = "Content",
                        ModulePermissions    = _permissionRepository.EncodePermissions(new List <Permission> {
                            new Permission(PermissionNames.View, Constants.AdminRole, true),
                            new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                        }), Content = ""
                    }
                }
            });
            _pageTemplates.Add(new PageTemplate {
                Name            = "Scheduled Jobs", Parent = "Admin", Path = "admin/jobs", Icon = "timer", IsNavigation = false, IsPersonalizable = false, EditMode = true,
                PagePermissions = _permissionRepository.EncodePermissions(new List <Permission> {
                    new Permission(PermissionNames.View, Constants.AdminRole, true),
                    new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                }),
                PageTemplateModules = new List <PageTemplateModule> {
                    new PageTemplateModule {
                        ModuleDefinitionName = "Oqtane.Modules.Admin.Jobs, Oqtane.Client", Title = "Scheduled Jobs", Pane = "Content",
                        ModulePermissions    = _permissionRepository.EncodePermissions(new List <Permission> {
                            new Permission(PermissionNames.View, Constants.AdminRole, true),
                            new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                        }), Content = ""
                    }
                }
            });
            _pageTemplates.Add(new PageTemplate {
                Name            = "Upgrade Service", Parent = "Admin", Path = "admin/upgrade", Icon = "aperture", IsNavigation = false, IsPersonalizable = false, EditMode = true,
                PagePermissions = _permissionRepository.EncodePermissions(new List <Permission> {
                    new Permission(PermissionNames.View, Constants.AdminRole, true),
                    new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                }),
                PageTemplateModules = new List <PageTemplateModule> {
                    new PageTemplateModule {
                        ModuleDefinitionName = "Oqtane.Modules.Admin.Upgrade, Oqtane.Client", Title = "Upgrade Service", Pane = "Content",
                        ModulePermissions    = _permissionRepository.EncodePermissions(new List <Permission> {
                            new Permission(PermissionNames.View, Constants.AdminRole, true),
                            new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                        }), Content = ""
                    }
                }
            });
            _pageTemplates.Add(new PageTemplate {
                Name            = "Login", Parent = "", Path = "login", Icon = "lock-locked", IsNavigation = false, IsPersonalizable = false, EditMode = false,
                PagePermissions = _permissionRepository.EncodePermissions(new List <Permission> {
                    new Permission(PermissionNames.View, Constants.AdminRole, true),
                    new Permission(PermissionNames.View, Constants.AllUsersRole, true),
                    new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                }),
                PageTemplateModules = new List <PageTemplateModule> {
                    new PageTemplateModule {
                        ModuleDefinitionName = "Oqtane.Modules.Admin.Login, Oqtane.Client", Title = "User Login", Pane = "Content",
                        ModulePermissions    = _permissionRepository.EncodePermissions(new List <Permission> {
                            new Permission(PermissionNames.View, Constants.AdminRole, true),
                            new Permission(PermissionNames.View, Constants.AllUsersRole, true),
                            new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                        }), Content = ""
                    }
                }
            });
            _pageTemplates.Add(new PageTemplate {
                Name            = "Register", Parent = "", Path = "register", Icon = "person", IsNavigation = false, IsPersonalizable = false, EditMode = false,
                PagePermissions = _permissionRepository.EncodePermissions(new List <Permission> {
                    new Permission(PermissionNames.View, Constants.AdminRole, true),
                    new Permission(PermissionNames.View, Constants.AllUsersRole, true),
                    new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                }),
                PageTemplateModules = new List <PageTemplateModule> {
                    new PageTemplateModule {
                        ModuleDefinitionName = "Oqtane.Modules.Admin.Register, Oqtane.Client", Title = "User Registration", Pane = "Content",
                        ModulePermissions    = _permissionRepository.EncodePermissions(new List <Permission> {
                            new Permission(PermissionNames.View, Constants.AdminRole, true),
                            new Permission(PermissionNames.View, Constants.AllUsersRole, true),
                            new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                        }), Content = ""
                    }
                }
            });

            _pageTemplates.Add(new PageTemplate {
                Name            = "Reset", Parent = "", Path = "reset", Icon = "person", IsNavigation = false, IsPersonalizable = false, EditMode = false,
                PagePermissions = _permissionRepository.EncodePermissions(new List <Permission> {
                    new Permission(PermissionNames.View, Constants.AdminRole, true),
                    new Permission(PermissionNames.View, Constants.AllUsersRole, true),
                    new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                }),
                PageTemplateModules = new List <PageTemplateModule> {
                    new PageTemplateModule {
                        ModuleDefinitionName = "Oqtane.Modules.Admin.Reset, Oqtane.Client", Title = "Password Reset", Pane = "Content",
                        ModulePermissions    = _permissionRepository.EncodePermissions(new List <Permission> {
                            new Permission(PermissionNames.View, Constants.AdminRole, true),
                            new Permission(PermissionNames.View, Constants.AllUsersRole, true),
                            new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                        }), Content = ""
                    }
                }
            });
            _pageTemplates.Add(new PageTemplate {
                Name            = "Profile", Parent = "", Path = "profile", Icon = "person", IsNavigation = false, IsPersonalizable = false, EditMode = false,
                PagePermissions = _permissionRepository.EncodePermissions(new List <Permission> {
                    new Permission(PermissionNames.View, Constants.AdminRole, true),
                    new Permission(PermissionNames.View, Constants.RegisteredRole, true),
                    new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                }),
                PageTemplateModules = new List <PageTemplateModule> {
                    new PageTemplateModule {
                        ModuleDefinitionName = "Oqtane.Modules.Admin.UserProfile, Oqtane.Client", Title = "User Profile", Pane = "Content",
                        ModulePermissions    = _permissionRepository.EncodePermissions(new List <Permission> {
                            new Permission(PermissionNames.View, Constants.AdminRole, true),
                            new Permission(PermissionNames.View, Constants.RegisteredRole, true),
                            new Permission(PermissionNames.Edit, Constants.AdminRole, true)
                        }), Content = ""
                    }
                }
            });
        }
Ejemplo n.º 52
0
 public SearchController()
 {
     pageRepository      = new PageRepository(db);
     residenceRepository = new ResidenceRepository(db);
     flightRepository    = new FlightRepository(db);
 }
Ejemplo n.º 53
0
 public PageService(IPageRepository postRepository)
 {
     this._pageRepository = postRepository;
 }
Ejemplo n.º 54
0
		public FormsAuthUserService(ApplicationSettings settings, IUserRepository userRepository, IPageRepository pageRepository)
			: base(settings, userRepository)
		{
			_pageRepository = pageRepository;
		}
Ejemplo n.º 55
0
 public PageController(IPageRepository repository, IMappingEngine mapper)
 {
     this.repository = repository;
     this.mapper = mapper;
 }
Ejemplo n.º 56
0
 public PagesController(IPageRepository pageRepo, IMenuRepository menuRepo)
 {
     _pageRepo = pageRepo;
     _menuRepo = menuRepo;
 }
Ejemplo n.º 57
0
 public PagesController(IPageRepository repository)
 {
     this.repository = repository;
 }
Ejemplo n.º 58
0
 public PagePublicAppService(IPageRepository pageRepository)
 {
     PageRepository = pageRepository;
 }
Ejemplo n.º 59
0
 public DynamicPageService(IPageRepository pageRepository, IDynamicPageFilters dynamicPageFilters)
 {
     _pageRepository = pageRepository;
     _dynamicPageFilters = dynamicPageFilters;
     _dynamicPageMapper = new DynamicPageMapper();
 }
Ejemplo n.º 60
0
 public PageService(IPageRepository pageRepository, IUnitOfWork unitOfWork)
 {
     this._pageRepository = pageRepository;
     this._unitOfWork     = unitOfWork;
 }