public ImportService(IContentRepository contentRepository, ReferenceConverter referenceConverter, IContentTypeRepository typeRepository, ILogger logger)
 {
     _contentRepository = contentRepository;
     _referenceConverter = referenceConverter;
     _typeRepository = typeRepository;
     _log = logger;
 }
Exemple #2
0
 public RenderingService(IContentRepository contentRepository, IWidgetSpecificationRepository widgetSpecificationRepository, IComponentSpecificationLibrary componentLibrary, IPluginContextProvider pluginContextProvider)
 {
     this.contentRepository = contentRepository;
     this.widgetSpecificationRepository = widgetSpecificationRepository;
     this.componentLibrary = componentLibrary;
     this.pluginContextProvider = pluginContextProvider;
 }
 public HomeController()
 {
     repo = ServiceProvider.Resolve<IContentRepository>();
     posList = (from x in repo.GetPositions()
                select new PositionItem { Index = index++, Value = x.Title })
                                 .ToArray();
 }
Exemple #4
0
 internal Archive(
     IContentRepository contentRep,
     IArchiveRepository archiveRep,
     ILinkRepository linkRep,
     IExtendFieldRepository extendRep,
     ICategoryRepository categoryRep,
     ITemplateRepository templateRep,
     int id,
     string strId,
     int categoryId,
     string title)
     : base(
         contentRep,
         extendRep,
         categoryRep,
         templateRep,
         linkRep,
         id,
         categoryId,
         title
         )
 {
     this.StrId = strId;
     this._archiveRep = archiveRep;
     this._templateRep = templateRep;
 }
        private void PublishChildren(IContentRepository repository, IContent root)
        {
            var children = repository.GetChildren<IContent>(root.ContentLink);

            foreach (IContent content in children)
            {

                try
                {
                    var imageContent = content as ImageData;
                    if (imageContent != null)
                    {
                        var unpublished = imageContent.CreateWritableClone() as ImageData;
                        repository.Save(unpublished, SaveAction.Publish);
                    }
                }
                catch (Exception e)
                {
                    _error.Add(e.Message);
                }
                if (_stopSignaled)
                {
                    break;
                }
                PublishChildren(repository, content);
            }
        }
        private PageReference CreatePageFromJson(PageObject pageObject, PageReference parent, IContentRepository contentRepo)
        {
            BasePage newPage;
            switch (pageObject.Type)
            {
                case 0:
                    ArticlePage aPage = contentRepo.GetDefault<ArticlePage>(parent);
                    aPage.MainBody = pageObject.MainBodyText;
                    newPage = aPage;
                    break;
                case 1:
                    newPage = contentRepo.GetDefault<FolderPage>(parent);
                    break;
                case 2:
                    ListPage lPage = contentRepo.GetDefault<ListPage>(parent);
                    lPage.MainBody = pageObject.MainBodyText;
                    newPage = lPage;
                    break;
                case 3:
                    newPage = contentRepo.GetDefault<PersonPage>(parent);
                    break;
                case 4:
                    newPage = contentRepo.GetDefault<PortalPage>(parent);
                    break;
                default:
                    newPage = contentRepo.GetDefault<ArticlePage>(parent);
                    break;
            }

            newPage.PageName = pageObject.PageName;
            newPage.IntroText = pageObject.IntroText;
            contentRepo.Save(newPage, SaveAction.Publish);
            return newPage.PageLink;
        }
		public ThemeServiceImpl(IContentRepository repository)
		{
			if (repository == null)
				throw new ArgumentNullException("repository");

			_repository = repository;
		}
        public HomeControllerTests()
        {
            // Database setup
            var services = new ServiceCollection();
            services.AddEntityFramework()
                    .AddSqlServer()
                    .AddInMemoryDatabase()
                    .AddDbContext<DataDbContext>(options =>
                        options.UseInMemoryDatabase()
                    );

            // Dependencies initializations
            _pageConfiguration = new FakePageConfiguration();

            var optionsBuilder = new DbContextOptionsBuilder<DataDbContext>();
            optionsBuilder.UseInMemoryDatabase();
            _dataDbContext = new DataDbContext(optionsBuilder.Options);

            _contentRepository = new ContentRepository(_dataDbContext);
            _humanReadableContentService = new HumanReadableContentService(_pageConfiguration, _contentRepository);

            _languageManipulationService = new LanguageManipulationService();

            // Controller initialization
            _homeController = new PersonalWebsite.Controllers.HomeController(
                _pageConfiguration,
                _humanReadableContentService,
                _languageManipulationService
            );
        }
		public ThemeServiceImpl(IContentRepository repository, string tempPath)
		{
			if (repository == null)
				throw new ArgumentNullException("repository");

			_repository = repository;
			_tempPath = HostingEnvironment.MapPath("~/App_Data/Uploads/");
		}
 public PageRatingController()
 {
     _reviewService = ServiceLocator.Current.GetInstance<IReviewService>();
     _loader = ServiceLocator.Current.GetInstance<IContentLoader>();
     contentAssetHelper = ServiceLocator.Current.GetInstance<ContentAssetHelper>();
     _repository = ServiceLocator.Current.GetInstance<IContentRepository>();
     _urlResolver = ServiceLocator.Current.GetInstance<UrlResolver>();
     //_logger = logger;
 }
Exemple #11
0
        protected PageData FindParentByPageType(PageData pd, Type pagetype, IContentRepository contentLocator)
        {
            if (pd is BlogStartPage)
            {
                return pd;
            }
            return FindParentByPageType(contentLocator.Get<PageData>(pd.ParentLink), pagetype, contentLocator);

        }
 private static string PageUrl(this UrlHelper urlHelper, PageReference pageLink, object routeValues, IContentRepository contentRepository)
 {
     if (contentRepository == null)
         contentRepository = ServiceLocator.Current.GetInstance<IContentRepository>();
     if (PageReference.IsNullOrEmpty(pageLink))
         return string.Empty;
     PageData page = contentRepository.Get<PageData>((ContentReference)pageLink);
     return UrlExtensions.PageUrl(urlHelper, page, routeValues);
 }
Exemple #13
0
        public ContentController(IContentRepository repository, string catalog, LoginView view)
        {
            this._LoginId = view.LoginId.To<long>();
            this._UserId = view.UserId.To<int>();
            this._OfficeId = view.OfficeId.To<int>();
            this._Catalog = catalog;

            this.ContentRepository = repository;
        }
 protected SitemapXmlGenerator(ISitemapRepository sitemapRepository, IContentRepository contentRepository, UrlResolver urlResolver, SiteDefinitionRepository siteDefinitionRepository, ILanguageBranchRepository languageBranchRepository)
 {
     this.SitemapRepository = sitemapRepository;
     this.ContentRepository = contentRepository;
     this.UrlResolver = urlResolver;
     this.SiteDefinitionRepository = siteDefinitionRepository;
     this.LanguageBranchRepository = languageBranchRepository;
     this.EnabledLanguages = this.LanguageBranchRepository.ListEnabled();
     this._urlSet = new HashSet<string>();
 }
 public PageDataIndexer(ILanguageBranchRepository languageBranchRepository,IElasticClient elasticClient,
     CmsElasticSearchOptions options, IContentRepository contentRepository, IIndexableTypeMapperResolver indexableTypeMapperResolver, ILogger logger)
 {
     LanguageBranchRepository = languageBranchRepository;
     ElasticClient = elasticClient;
     Options = options;
     _contentRepository = contentRepository;
     _indexableTypeMapperResolver = indexableTypeMapperResolver;
     _logger = logger;
 }
Exemple #16
0
 public ArchiveService(
     IContentRepository contentRep,
     ISiteRepository siteRep,
     IExtendFieldRepository extendRep
     )
 {
     this._contentRep = contentRep;
     this._siteRep = siteRep;
     this._extendRep = extendRep;
 }
Exemple #17
0
        public void Initialize(InitializationEngine context)
        {
            this._tagService = ServiceLocator.Current.GetInstance<ITagService>();
            this._contentTypeRepository = ServiceLocator.Current.GetInstance<IContentTypeRepository>();
            this._contentRepository = ServiceLocator.Current.GetInstance<IContentRepository>();
            this._contentVersionRepository = ServiceLocator.Current.GetInstance<IContentVersionRepository>();
            this._contentEvents = ServiceLocator.Current.GetInstance<IContentEvents>();

            this._contentEvents.PublishedContent += OnPublishedContent;
        }
 public RelatedPagesNotQuery(
     IContentQueryHelper queryHelper,
     IContentRepository contentRepository,
     SearchProvidersManager searchProvidersManager,
     LanguageSelectorFactory languageSelectorFactory)
     : base(ServiceLocator.Current.GetInstance<IContentRepository>(),queryHelper)
 {
     _contentRepository = contentRepository;
     _searchProvidersManager = searchProvidersManager;
     _languageSelectorFactory = languageSelectorFactory;
 }
 public InstagramQuery(
     IContentQueryHelper queryHelper,
     IContentRepository contentRepository,
     SearchProvidersManager searchProvidersManager,
     LanguageSelectorFactory languageSelectorFactory)
     : base(contentRepository, queryHelper)
 {
     _contentRepository = contentRepository;
     _searchProvidersManager = searchProvidersManager;
     _languageSelectorFactory = languageSelectorFactory;
 }
		public PagesServiceImpl(IContentRepository repository, IBlobStorageProvider blobProvider, string tempPath)
		{
			if (repository == null)
				throw new ArgumentNullException("repository");

			if (blobProvider == null)
				throw new ArgumentNullException("blobProvider");

			_repository = repository;
			_blobProvider = blobProvider;
			_tempPath = HostingEnvironment.MapPath("~/App_Data/Uploads/");
		}
 public EntryImporter(IContentRepository contentRepository,
     ReferenceConverter referenceConverter, IContentTypeRepository typeRepository,
     ILogger logger, UrlResolver urlResolver,
     IWarehouseRepository warehouseRepository,
     IWarehouseInventoryService inventoryService,
     IPriceService priceService)
     : base(contentRepository, referenceConverter, typeRepository, logger)
 {
     _urlResolver = urlResolver;
     _warehouseRepository = warehouseRepository;
     _inventoryService = inventoryService;
     _priceService = priceService;
 }
        private static string GetTypeSpecificCssClasses(ContentAreaItem contentAreaItem, IContentRepository contentRepository)
        {
            var content = contentAreaItem.GetContent(contentRepository);
            var cssClass = content == null ? String.Empty : content.GetOriginalType().Name.ToLowerInvariant();

            var customClassContent = content as ICustomCssInContentArea;
            if (customClassContent != null && !string.IsNullOrWhiteSpace(customClassContent.ContentAreaCssClass))
            {
                cssClass += string.Format("{0}", customClassContent.ContentAreaCssClass);
            }

            return cssClass;
        }
Exemple #23
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="contentRep"></param>
 /// <param name="archiveRep"></param>
 /// <param name="extendRep"></param>
 /// <param name="categoryRep"></param>
 /// <param name="templateRep"></param>
 /// <param name="linkRep"></param>
 /// <param name="id"></param>
 /// <param name="strId"></param>
 /// <param name="categoryId"></param>
 /// <param name="title"></param>
 /// <returns></returns>
 public IArchive CreateArchive(
     IContentRepository contentRep,
     IArchiveRepository archiveRep,
     IExtendFieldRepository extendRep,
     ICategoryRepository categoryRep,
     ITemplateRepository templateRep,
     ILinkRepository linkRep,
     int id,
     string strId,
     int categoryId,
     string title)
 {
     return new Archive(contentRep, archiveRep, linkRep, extendRep, categoryRep, templateRep, id, strId, categoryId, title);
 }
Exemple #24
0
        public ContentController()
        {
            this._LoginId = AppUsers.GetCurrent().View.LoginId.To<long>();
            this._UserId = AppUsers.GetCurrent().View.UserId.To<int>();
            this._OfficeId = AppUsers.GetCurrent().View.OfficeId.To<int>();
            this._Catalog = AppUsers.GetCatalog();

            this.ContentRepository = new Frapid.WebsiteBuilder.DataAccess.Content
            {
                _Catalog = this._Catalog,
                _LoginId = this._LoginId,
                _UserId = this._UserId
            };
        }
Exemple #25
0
 public ArchiveRepository(
     IContentRepository contentRep,
     IExtendFieldRepository extendRep,
     ITemplateRepository templateRep,
     ICategoryRepository categoryRep,
     ILinkRepository linkRep
     )
 {
     this._contentRep = contentRep;
     this._extendRep = extendRep;
     this._templateRep = templateRep;
     this._categoryRep = categoryRep;
     this._linkRep = linkRep;
 }
Exemple #26
0
        protected override void Initialize(HttpControllerContext context)
        {
            base.Initialize(context);

            if (this.ContentRepository == null)
            {
                this.ContentRepository = new Frapid.WebsiteBuilder.DataAccess.Content
                {
                    _Catalog = this.MetaUser.Catalog,
                    _LoginId = this.MetaUser.LoginId,
                    _UserId = this.MetaUser.UserId
                };
            }
        }
 /// <summary>
 /// Initializes a new instance of the ContentService class.
 /// </summary>
 /// <param name="contentRepository">Instance of content repository</param>
 /// <param name="blobDataRepository">Instance of Blob data repository</param>
 /// <param name="tagRepository">Instance of tagRepository</param>
 /// <param name="communityRepository">Instance of community repository</param>
 /// <param name="userRepository">Instance of User repository</param>
 public ContentService(
     IContentRepository contentRepository,
     IBlobDataRepository blobDataRepository,
     IRepositoryBase<Tag> tagRepository,
     ICommunityRepository communityRepository,
     IUserRepository userRepository,
     IRepositoryBase<OffensiveContent> offensiveContentRepository)
     : base(communityRepository, userRepository)
 {
     this._contentRepository = contentRepository;
     this._blobDataRepository = blobDataRepository;
     this._tagRepository = tagRepository;
     this._communityRepository = communityRepository;
     this._userRepository = userRepository;
     this._offensiveContentRepository = offensiveContentRepository;
 }
        public HumanReadableContentService(
            IPageConfiguration pageConfiguration,
            IContentRepository contentRespository)
        {
            if(pageConfiguration == null)
            {
                throw new ArgumentNullException(nameof(pageConfiguration));
            }

            if(contentRespository == null)
            {
                throw new ArgumentNullException(nameof(contentRespository));
            }
            _contentRepository = contentRespository;
            _pageConfiguration = pageConfiguration;
        }
        public MarkdownBaseController(IConfig config, 
            IMarkdownToHtml markdownToHtml,
            IContentRepository contentRepo,
            GitHelper gitHelper,
            IPathHelper pathHelper
            )
        {
            if (config == null) { throw new ArgumentNullException("config"); }
            if (markdownToHtml == null) { throw new ArgumentNullException("markdownToHtml"); }
            if (contentRepo == null) { throw new ArgumentNullException("contentRepo"); }

            this.Config = config;
            this.MarkdownToHtml = markdownToHtml;
            this.ContentRepo = contentRepo;
            this.PathHelper = pathHelper;
            this.GitHelper = gitHelper;
        }
Exemple #30
0
        public BaseContent(
            IContentRepository contentRep,
            IExtendFieldRepository extendRep,
            ICategoryRepository categoryRep,
            ITemplateRepository templateRep,
            ILinkRepository linkRep,
            int id,
            int categoryId,
            string title)
        {
            this._contentRep = contentRep;
            this._linkRep = linkRep;
            this._extendRep = extendRep;
            this._categoryRep = categoryRep;
            this._templateRep = templateRep;

            this.ID = id;
            this._category = this._categoryRep.CreateCategory(categoryId, null);
            this.Title = title;
            this.ID = id;
        }