Ejemplo n.º 1
0
 // GET: /<controller>/
 public WhereWeController(
     IProjectEngine projectEngine,
     IContentEngine contentEngine
     ) : base(contentEngine)
 {
     _projectEngine = projectEngine;
 }
 /// <summary>
 ///     Constructor to inject dependencies into the handler
 /// </summary>
 public XmlSitemapHandler(IDependencyFactory dependencyFactory)
 {
     _sitemapCache  = dependencyFactory.CreateCache();
     _generator     = dependencyFactory.CreateGenerator();
     _contentEngine = dependencyFactory.CreateEngine();
     _logger        = dependencyFactory.CreateLogger();
 }
Ejemplo n.º 3
0
 public static void AddHtmlContent(this IContentEngine contentEngine, Vertical vertical, string name, string text)
 {
     contentEngine.CreateContentItem(new HtmlContentItem
     {
         Name       = name,
         VerticalId = vertical == null ? (Guid?)null : vertical.Id,
         Text       = text
     });
 }
 public CategoriesController(
     IProjectEngine projectEngine,
     IContentEngine contentEngine,
     ICategoryServices categoryServices
     ) : base(contentEngine)
 {
     _projectEngine    = projectEngine;
     _categoryServices = categoryServices;
 }
Ejemplo n.º 5
0
 private static void AddTextContent(this IContentEngine contentEngine, Guid?verticalId, string name, string text)
 {
     contentEngine.CreateContentItem(new TextContentItem
     {
         Name       = name,
         VerticalId = verticalId,
         Text       = text
     });
 }
Ejemplo n.º 6
0
 private static void AddImageContent(this IContentEngine contentEngine, Guid?verticalId, string name, string rootFolder, string relativePath)
 {
     contentEngine.CreateContentItem(new ImageContentItem
     {
         Name         = name,
         VerticalId   = verticalId,
         RootFolder   = rootFolder,
         RelativePath = relativePath,
     });
 }
Ejemplo n.º 7
0
        public ModController(IMod mod)
            : base(mod) {
            Contract.Requires<ArgumentNullException>(mod != null);
            _contentEngine = CalculatedGameSettings.ContentManager.ContentEngine;
            Mod = mod;
            _modState = new ModState(mod);
            _sixSyncModInstaller = new SixSyncModInstaller(mod, _modState);

            Model.State = _modState.State;
        }
Ejemplo n.º 8
0
        public static void UpdateSectionContent(this IContentEngine contentEngine, Vertical vertical, bool enabled, string sectionName, string sectionTitle, string sectionContent)
        {
            var contentItem = contentEngine.GetContentItem <SectionContentItem>(sectionName, vertical == null ? (Guid?)null : vertical.Id, true);

            contentItem.IsEnabled      = enabled;
            contentItem.SectionTitle   = sectionTitle;
            contentItem.SectionContent = new HtmlContentItem {
                Text = sectionContent
            };

            contentEngine.UpdateContentItem(contentItem);
        }
Ejemplo n.º 9
0
        /// <summary>
        ///     Constructor for the sitemap handler
        /// </summary>
        public XmlSitemapHandler()
        {
            UmbracoContext.EnsureContext(
                new HttpContextWrapper(HttpContext.Current),
                ApplicationContext.Current,
                true);

            var factory = new WebConfigDependencyFactory();

            _sitemapCache  = factory.CreateCache();
            _generator     = factory.CreateGenerator();
            _contentEngine = factory.CreateEngine();
        }
Ejemplo n.º 10
0
        public void CanLoadModTest() {
            var serviceRegistry = new ServiceRegistry(_scriptRegistry, _depResolver);

            _contentEngine = new SN.withSIX.ContentEngine.Infra.ContentEngine(serviceRegistry, _scriptRegistry, _realResourceService);


            var acre2 = A.Fake<IMod>();
            var modController = SetupFakeModController(acre2);

            var mod = _contentEngine.LoadModS(acre2);

            A.CallTo(() => _scriptRegistry.RegisterMod(A<RegisteredMod>.That.Not.IsNull())).MustHaveHappened();
        }
Ejemplo n.º 11
0
        public ModController(IMod mod)
            : base(mod)
        {
            if (mod == null)
            {
                throw new ArgumentNullException(nameof(mod));
            }
            _contentEngine       = CalculatedGameSettings.ContentManager.ContentEngine;
            Mod                  = mod;
            _modState            = new ModState(mod);
            _sixSyncModInstaller = new SixSyncModInstaller(mod, _modState);

            Model.State = _modState.State;
        }
Ejemplo n.º 12
0
 public SynqInstallerSession(IInstallContentAction<IInstallableContent> action, IToolsInstaller toolsInstaller,
     bool isPremium, Func<double, double, Task> statusChange, IContentEngine contentEngine) {
     if (action == null)
         throw new ArgumentNullException(nameof(action));
     if (toolsInstaller == null)
         throw new ArgumentNullException(nameof(toolsInstaller));
     if (statusChange == null)
         throw new ArgumentNullException(nameof(statusChange));
     _action = action;
     _toolsInstaller = toolsInstaller;
     _isPremium = isPremium;
     _statusChange = statusChange;
     _contentEngine = contentEngine;
     _status = new Status(_action.Content.Count);
 }
Ejemplo n.º 13
0
 public ItemController(
     UserManager <User> userManager,
     IUserEngine userEngine,
     IProjectEngine projectEngine,
     INotificationService notificationService,
     ILogger logger,
     IContentEngine contentEngine
     ) : base(contentEngine)
 {
     _userManager         = userManager;
     _userEngine          = userEngine;
     _projectEngine       = projectEngine;
     _notificationService = notificationService;
     _logger = logger;
 }
Ejemplo n.º 14
0
        public void Setup() {
            SharedSupport.Init();
            _depResolver = A.Fake<IDependencyResolver>();
            _serviceRegistry = A.Fake<IServiceRegistry>();
            _scriptRegistry = A.Fake<IModScriptRegistry>();
            _resourceService = A.Fake<ICEResourceService>();
            _realServiceRegistry = new ServiceRegistry(_scriptRegistry, _depResolver);
            _realScriptRegistry = new ModScriptRegistry();
            _realResourceService = new CEResourceService();

            //_bootstrapper = new TestAppBootstrapper();
            //_bootstrapper.OnStartup();

            _contentEngine = new SN.withSIX.ContentEngine.Infra.ContentEngine(_serviceRegistry, _scriptRegistry, _realResourceService);

        }
Ejemplo n.º 15
0
        public static void AddSectionContent(this IContentEngine contentEngine, Vertical vertical, bool enabled, string sectionName, string sectionTitle, string sectionContent)
        {
            var contentItem = new SectionContentItem
            {
                Name           = sectionName,
                IsEnabled      = enabled,
                VerticalId     = vertical == null ? (Guid?)null : vertical.Id,
                SectionTitle   = sectionTitle,
                SectionContent = new HtmlContentItem
                {
                    Text = sectionContent
                }
            };

            contentEngine.CreateContentItem(contentItem);
        }
        /// <summary>
        ///     Constructor for the sitemap handler
        /// </summary>
        public XmlSitemapHandler()
        {
            /*
             * UmbracoContext.EnsureContext(
             *  new HttpContextWrapper(HttpContext.Current),
             *  ApplicationContext.Current,
             *  true);
             */
            // TODO context ^. use providers. cleanup configuration folder and maybe file/folder organizing in project. update/add tests.

            var factory = new WebConfigDependencyFactory();

            _sitemapCache  = factory.CreateCache();
            _generator     = factory.CreateGenerator();
            _contentEngine = factory.CreateEngine();
            _logger        = factory.CreateLogger();
        }
Ejemplo n.º 17
0
 public AccountController(
     IHttpContextAccessor httpContextAccessor,
     UserManager <User> userManager,
     SignInManager <User> signInManager,
     INotificationService notificationService,
     ILogger logger,
     IContentEngine contentEngine,
     IProjectEngine projectEngine,
     IUserEngine userEngine
     ) : base(contentEngine)
 {
     _httpContextAccessor = httpContextAccessor;
     _userManager         = userManager;
     _signInManager       = signInManager;
     _notificationService = notificationService;
     _projectEngine       = projectEngine;
     _userEngine          = userEngine;
     _logger = logger;
 }
Ejemplo n.º 18
0
        private static void CreateContent(this IContentEngine contentEngine, Guid?verticalId, string headerHtml, string footerHtml, string homePageTitle, string imageRootFolder, string candidateImageRelativePath, string faviconRelativePath)
        {
            // Create some content.

            if (!string.IsNullOrEmpty(headerHtml))
            {
                contentEngine.CreateContentItem(new CommunityHeaderContentItem
                {
                    Name       = "Page header",
                    VerticalId = verticalId,
                    Content    = new HtmlContentItem {
                        Text = headerHtml
                    },
                });
            }

            if (!string.IsNullOrEmpty(footerHtml))
            {
                contentEngine.CreateContentItem(new CommunityFooterContentItem
                {
                    Name       = "Page footer",
                    VerticalId = verticalId,
                    Content    = new HtmlContentItem {
                        Text = footerHtml
                    },
                });
            }

            if (!string.IsNullOrEmpty(homePageTitle))
            {
                AddTextContent(contentEngine, verticalId, "Home page title", homePageTitle);
            }

            if (!string.IsNullOrEmpty(imageRootFolder) && candidateImageRelativePath != null)
            {
                AddImageContent(contentEngine, verticalId, "Candidate logo", imageRootFolder, candidateImageRelativePath);
            }

            if (!string.IsNullOrEmpty(imageRootFolder) && faviconRelativePath != null)
            {
                AddImageContent(contentEngine, verticalId, "Favicon", imageRootFolder, faviconRelativePath);
            }
        }
Ejemplo n.º 19
0
 protected TemplateEngine(IContentEngine contentEngine)
 {
     _contentEngine = contentEngine;
 }
Ejemplo n.º 20
0
        public static Community CreateTestCommunity(this CommunityTestData data, ICommunitiesCommand communitiesCommand, IVerticalsCommand verticalsCommand, IContentEngine contentEngine)
        {
            data.CreateTestVertical(verticalsCommand, contentEngine);
            var community = new Community
            {
                Id               = data.Id.Value,
                Name             = data.Name,
                EmailDomain      = data.EmailDomain,
                HasMembers       = data.HasMembers,
                HasOrganisations = data.HasOrganisationalUnits,
                OrganisationsCanSearchAllMembers = data.OrganisationsCanSearchAllMembers,
                OrganisationsAreBranded          = data.OrganisationsAreBranded,
            };

            communitiesCommand.CreateCommunity(community);
            return(community);
        }
Ejemplo n.º 21
0
 public Content(IContentEngine contentEngine)
 {
     _contentEngine = contentEngine;
 }
Ejemplo n.º 22
0
 private static Community CreateTestCommunity(this ICommunitiesCommand communitiesCommand, IVerticalsCommand verticalsCommand, IContentEngine contentEngine, string name)
 {
     return(GetCommunityTestData(name).CreateTestCommunity(communitiesCommand, verticalsCommand, contentEngine));
 }
Ejemplo n.º 23
0
 public static Community CreateTestCommunity(this TestCommunity community, ICommunitiesCommand communitiesCommand, IVerticalsCommand verticalsCommand, IContentEngine contentEngine)
 {
     return(communitiesCommand.CreateTestCommunity(verticalsCommand, contentEngine, community.ToString()));
 }
Ejemplo n.º 24
0
 public ContentController(IContentEngine contentEngine) : base(contentEngine)
 {
 }
Ejemplo n.º 25
0
 public WebSiteTemplateEngine(IContentEngine contentEngine, IWebSiteQuery webSiteQuery, ITinyUrlCommand tinyUrlCommand)
     : base(contentEngine)
 {
     _webSiteQuery   = webSiteQuery;
     _tinyUrlCommand = tinyUrlCommand;
 }
 public InstallerSessionFactory(Func<bool> isPremium, IToolsInstaller toolsInstaller,
     IContentEngine contentEngine) {
     _isPremium = isPremium;
     _toolsInstaller = toolsInstaller;
     _contentEngine = contentEngine;
 }
Ejemplo n.º 27
0
 public static Vertical CreateTestVertical(this TestVertical vertical, IVerticalsCommand verticalsCommand, IContentEngine contentEngine)
 {
     return(vertical.GetVerticalTestData().CreateTestVertical(verticalsCommand, contentEngine));
 }
Ejemplo n.º 28
0
        public static Vertical CreateTestVertical(this VerticalTestData data, IVerticalsCommand verticalsCommand, IContentEngine contentEngine)
        {
            if (data.Id != null)
            {
                var vertical = new Vertical
                {
                    Id                           = data.Id.Value,
                    Name                         = data.Name,
                    Url                          = data.Url,
                    Host                         = data.Host,
                    SecondaryHost                = data.SecondaryHost,
                    TertiaryHost                 = data.TertiaryHost,
                    CountryId                    = data.CountryId,
                    RequiresExternalLogin        = data.RequiresExternalLogin,
                    ExternalLoginUrl             = data.ExternalLoginUrl,
                    ExternalCookieDomain         = data.ExternalCookieDomain,
                    EmailDisplayName             = data.EmailDisplayName,
                    ReturnEmailAddress           = data.ReturnEmailAddress,
                    MemberServicesEmailAddress   = data.MemberServicesEmailAddress,
                    EmployerServicesEmailAddress = data.EmployerServicesEmailAddress
                };
                verticalsCommand.CreateVertical(vertical);

                if (contentEngine != null)
                {
                    contentEngine.CreateContent(vertical.Id, data.Header, data.Footer, data.HomePageTitle, data.ImageRootFolder, data.CandidateImageRelativePath, data.FaviconRelativePath);
                }
                return(vertical);
            }

            // Default, so just create the content.

            if (contentEngine != null)
            {
                contentEngine.CreateContent(null, data.Header, data.Footer, data.HomePageTitle, data.ImageRootFolder, data.CandidateImageRelativePath, data.FaviconRelativePath);
            }
            return(null);
        }
Ejemplo n.º 29
0
 public BaseController(IContentEngine contentEngine)
 {
     _contentEngine = contentEngine;
 }
Ejemplo n.º 30
0
        public static void DisableSectionContent(this IContentEngine contentEngine, Vertical vertical, string sectionName)
        {
            var contentItem = contentEngine.GetContentItem <SectionContentItem>(sectionName, vertical == null ? (Guid?)null : vertical.Id, true);

            contentEngine.DisableContentItem(contentItem.Id);
        }