Esempio n. 1
0
 /// <summary>
 /// Initialize this module. Attach the worker method to the BeginRequest event.
 /// </summary>
 /// <param name="application">Current HttpApplication</param>
 public void Init(HttpApplication application)
 {
     _logger        = DependencyResolver.Current.GetService <ILogger>();
     _configuration = DependencyResolver.Current.GetService <IDD4TConfiguration>();
     application.PreRequestHandlerExecute += new EventHandler(DistributionModule_OnPreRequestHandlerExecute);
     application.BeginRequest             += new EventHandler(DistributionModule_OnBeginRequest);
 }
Esempio n. 2
0
        public FactoriesFacade(IPublicationResolver resolver, ILogger logger, IDD4TConfiguration configuration, ICacheAgent cacheAgent, ISerializerService serializerService)
        {
            if (resolver == null)
            {
                throw new ArgumentNullException("resolver");
            }

            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            if (cacheAgent == null)
            {
                throw new ArgumentNullException("cacheAgent");
            }

            if (serializerService == null)
            {
                throw new ArgumentNullException("serializerService");
            }

            SerializerService   = serializerService;
            Logger              = logger;
            PublicationResolver = resolver;
            Configuration       = configuration;
            CacheAgent          = cacheAgent;
        }
Esempio n. 3
0
        public FactoryCommonServices(IPublicationResolver resolver, ILogger logger,
                                     IDD4TConfiguration configuration, ICacheAgent cacheAgent)
        {
            if (resolver == null)
            {
                throw new ArgumentNullException("resolver");
            }

            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            if (cacheAgent == null)
            {
                throw new ArgumentNullException("cacheAgent");
            }

            Logger = logger;
            PublicationResolver = resolver;
            Configuration       = configuration;
            CacheAgent          = cacheAgent;
        }
 public PageController(IPageFactory pageFactor,
                       IComponentPresentationFactory componentPresentationFactory,
                       ILogger logger,
                       IDD4TConfiguration configuration) :
     base(pageFactor, componentPresentationFactory, logger, configuration)
 {
 }
 /// <summary>
 /// Initialize this module. Attach the worker method to the BeginRequest event.
 /// </summary>
 /// <param name="application">Current HttpApplication</param>
 public void Init(HttpApplication application)
 {
     _logger = DependencyResolver.Current.GetService<ILogger>();
     _configuration = DependencyResolver.Current.GetService<IDD4TConfiguration>();
     application.PreRequestHandlerExecute += new EventHandler(DistributionModule_OnPreRequestHandlerExecute);
     application.BeginRequest += new EventHandler(DistributionModule_OnBeginRequest);
 }
Esempio n. 6
0
        public XpmMarkupService(IDD4TConfiguration configuration)
        {
            if (configuration == null)
                throw new ArgumentNullException("configuration");

            _configuration = configuration;
        }
        public DefaultPublicationResolver(IDD4TConfiguration configuration)
        {
            if (configuration == null)
                throw new ArgumentException("configuration");

            Configuration = configuration;
        }
 public DxaCacheAgent(ILogger logger, IDD4TConfiguration configuration)
 {
     _logger = logger;
     _logger?.Debug("DxaCacheAgent implementation initialised successfully.");
     // create our cache provider from CIL to make use of the new caching system provided
     // that includes distributed caching, multi-level caching, etc.
     _cilCacheProvider = CacheFactory <object> .CreateFromConfiguration();
 }
        public PageController(IPageFactory pageFactor, 
                                IComponentPresentationFactory componentPresentationFactory, 
                                ILogger logger, 
                                IDD4TConfiguration configuration) :
            base(pageFactor, componentPresentationFactory, logger, configuration)
        {

        }
Esempio n. 10
0
        public UsesTridionPage(ILogger logger, IDD4TConfiguration configuration)
        {
            if (logger == null)
                throw new ArgumentNullException("logger");
           

            _logger = logger;
        }
Esempio n. 11
0
        public DefaultPublicationResolver(IDD4TConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentException("configuration");
            }

            Configuration = configuration;
        }
        public XpmMarkupService(IDD4TConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            _configuration = configuration;
        }
Esempio n. 13
0
        public BaseProvider(IProvidersCommonServices providersCommonServices)
        {
            if (providersCommonServices == null)
                throw new ArgumentNullException("providersCommonServices");

            LoggerService = providersCommonServices.Logger;
            PublicationResolver = providersCommonServices.PublicationResolver;
            Configuration = providersCommonServices.Configuration;

        }
        public DefaultRichTextResolver(ILinkFactory linkFactory, ILogger logger, IDD4TConfiguration configuration)
        {
            if (linkFactory == null) throw new ArgumentNullException("linkFactory");
            if (logger == null) throw new ArgumentNullException("logger");
            if (configuration == null) throw new ArgumentNullException("configuration");

            _linkFactory = linkFactory;
            _logger = logger;
            _configuration = configuration;
        }
Esempio n. 15
0
        public UsesTridionPage(ILogger logger, IDD4TConfiguration configuration)
        {
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }


            _logger = logger;
        }
        public DefaultRichTextResolver(ILinkResolver linkResolver, ILogger logger, IDD4TConfiguration configuration)
        {
            Contract.ThrowIfNull(linkResolver, nameof(linkResolver));
            Contract.ThrowIfNull(logger, nameof(logger));
            Contract.ThrowIfNull(configuration, nameof(configuration));

            _linkResolver  = linkResolver;
            _logger        = logger;
            _configuration = configuration;
        }
Esempio n. 17
0
        private const string URL = "navigation"; //TODO: should this be configurabale?

        public NavigationProvider(IContentProvider contentProvider, ILogger logger, IDD4TConfiguration configuration)
        {
            contentProvider.ThrowIfNull(nameof(contentProvider));
            logger.ThrowIfNull(nameof(logger));
            configuration.ThrowIfNull(nameof(configuration));

            _configuration   = configuration;
            _contentProvider = contentProvider;
            _logger          = logger;
        }
        public BaseProvider(IProvidersCommonServices providersCommonServices)
        {
            if (providersCommonServices == null)
            {
                throw new ArgumentNullException("providersCommonServices");
            }

            LoggerService       = providersCommonServices.Logger;
            PublicationResolver = providersCommonServices.PublicationResolver;
            Configuration       = providersCommonServices.Configuration;
        }
        public DefaultComponentPresentationRenderer(ILogger logger, IDD4TConfiguration configuration)
        {
            if (logger == null)
                throw new ArgumentNullException("logger");

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

            DefaultComponentPresentationRenderer._loggerService = logger;
            DefaultComponentPresentationRenderer._configuration = configuration;
        }
        //Temp fix: Remove after 01-01-2016; IHttpMessageHandlerFactory is registered in the DI.
        //The DI needs to be upgraded for the registeration. below code prevent a runtime error in case that the DI is not upgraded.
        public BaseProvider(IProvidersCommonServices commonServices)
        {
            if (commonServices == null)
            {
                throw new ArgumentNullException("commonServices");
            }

            Logger = commonServices.Logger;
            _httpMessageHandlerFactory = new DefaultHttpMessageHandlerFactory();
            _publicationResolver       = commonServices.PublicationResolver;
            Configuration = commonServices.Configuration;
        }
Esempio n. 21
0
        public FactoryBase(IFactoriesFacade facade)
        {
            if (facade == null)
                throw new ArgumentNullException("facade");

            LoggerService = facade.Logger;
            PublicationResolver = facade.PublicationResolver;
            Configuration = facade.Configuration;
            CacheAgent = facade.CacheAgent;
            SerializerService = facade.SerializerService;
            CacheAgent.GetLastPublishDateCallBack = GetLastPublishedDateCallBack;
        }
Esempio n. 22
0
        public DefaultLinkResolver(ILinkFactory linkFactory, ILogger logger, IBinaryFactory binaryFactory, IDD4TConfiguration configuration)
        {
            Contract.ThrowIfNull(linkFactory, nameof(linkFactory));
            Contract.ThrowIfNull(binaryFactory, nameof(binaryFactory));
            Contract.ThrowIfNull(logger, nameof(logger));
            Contract.ThrowIfNull(configuration, nameof(configuration));

            _binaryFactory = binaryFactory;
            _linkFactory   = linkFactory;
            _logger        = logger;
            _configuration = configuration;
        }
Esempio n. 23
0
        public FactoryBase(IFactoryCommonServices factoryCommonServices)
        {
            if (factoryCommonServices == null)
            {
                throw new ArgumentNullException("factoryCommonServices");
            }


            LoggerService       = factoryCommonServices.Logger;
            PublicationResolver = factoryCommonServices.PublicationResolver;
            Configuration       = factoryCommonServices.Configuration;
            CacheAgent          = factoryCommonServices.CacheAgent;
        }
Esempio n. 24
0
        public WebConfigViewModelKeyProvider(IDD4TConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            ViewModelKeyField = configuration.ViewModelKeyField;
            if (string.IsNullOrEmpty(ViewModelKeyField))
            {
                ViewModelKeyField = "viewModelKey";                                          //Default value
            }
        }
        public FactoryBase(IFactoriesFacade facade)
        {
            if (facade == null)
            {
                throw new ArgumentNullException("facade");
            }

            LoggerService       = facade.Logger;
            PublicationResolver = facade.PublicationResolver;
            Configuration       = facade.Configuration;
            CacheAgent          = facade.CacheAgent;
            SerializerService   = facade.SerializerService;
            CacheAgent.GetLastPublishDateCallBack = GetLastPublishedDateCallBack;
        }
Esempio n. 26
0
        //private readonly IBinaryFactory _binaryFactory;


        public DefaultRichTextResolver(ILinkResolver linkResolver, ILogger logger, IDD4TConfiguration configuration)
        {
            //binaryFactory.ThrowIfNull(nameof(binaryFactory));
            //linkFactory.ThrowIfNull(nameof(linkFactory));
            Contract.ThrowIfNull(linkResolver, nameof(linkResolver));
            Contract.ThrowIfNull(logger, nameof(logger));
            Contract.ThrowIfNull(configuration, nameof(configuration));

            //_binaryFactory = binaryFactory;
            //_linkFactory = linkFactory;
            _linkResolver  = linkResolver;
            _logger        = logger;
            _configuration = configuration;
        }
Esempio n. 27
0
        public DefaultComponentPresentationRenderer(ILogger logger, IDD4TConfiguration configuration)
        {
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            DefaultComponentPresentationRenderer._loggerService = logger;
            DefaultComponentPresentationRenderer._configuration = configuration;
        }
        public ProvidersCommonServices(IPublicationResolver resolver, ILogger logger, IDD4TConfiguration configuration)
        {
            if (resolver == null)
                throw new ArgumentNullException("resolver");

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

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

            Logger = logger;
            PublicationResolver = resolver;
            Configuration = configuration;
        }
Esempio n. 29
0
        public DefaultCacheAgent(IDD4TConfiguration configuration, ILogger logger)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            _logger        = logger;
            _configuration = configuration;
        }
Esempio n. 30
0
        static TridionHelper()
        {
            //this is Anti-Pattern, there is no other way to inject dependencies into this class.
            //This helper should not be used in views, this logic should get executed by the controller.

            var config = DependencyResolver.Current.GetService<IDD4TConfiguration>();
            var linkFactory = DependencyResolver.Current.GetService<ILinkFactory>();
            var logger = DependencyResolver.Current.GetService<ILogger>();
            var renderer = DependencyResolver.Current.GetService<IComponentPresentationRenderer>();

            _linkFactory = linkFactory;
            _configuration = config;
            _logger = logger;
            _renderer = renderer;
        }
Esempio n. 31
0
        static TridionHelper()
        {
            //this is Anti-Pattern, there is no other way to inject dependencies into this class.
            //This helper should not be used in views, this logic should get executed by the controller.

            var config      = DependencyResolver.Current.GetService <IDD4TConfiguration>();
            var linkFactory = DependencyResolver.Current.GetService <ILinkFactory>();
            var logger      = DependencyResolver.Current.GetService <ILogger>();
            var renderer    = DependencyResolver.Current.GetService <IComponentPresentationRenderer>();

            _linkFactory   = linkFactory;
            _configuration = config;
            _logger        = logger;
            _renderer      = renderer;
        }
Esempio n. 32
0
        public TridionSiteMapProvider(IPageFactory pageFactory, ICacheAgent cacheAgent, ILogger logger, IDD4TConfiguration configuration)
        {
            if (pageFactory == null)
                throw new ArgumentNullException("pageFactory");
            if (logger == null)
                throw new ArgumentNullException("logger");
            if (configuration == null)
                throw new ArgumentNullException("configuration");
            if (cacheAgent == null)
                throw new ArgumentNullException("cacheAgent");

            _pageFactory = pageFactory;
            _configuration = configuration;
            _cacheAgent = cacheAgent;
            _logger = logger;
        }
        public JMSMessageProvider(ILogger logger, IDD4TConfiguration configuration)
        {
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }


            _logger        = logger;
            _configuration = configuration;
            _observers     = new List <IObserver <ICacheEvent> >();
        }
        public TridionBackedCacheAgent(IDD4TConfiguration configuration, ILogger logger, IPageFactory pageFactory, IComponentPresentationFactory componentpresentationFactory)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            _logger        = logger;
            _configuration = configuration;
            _pageFactory   = pageFactory;
            _componentPresentationFactory = componentpresentationFactory;
        }
Esempio n. 35
0
        public DefaultCacheAgent(IDD4TConfiguration configuration, ILogger logger)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            _logger = logger;
            // add hardcoded file system logger because for some reason log4net does not work on a background thread
            _backgroundlogger = new FSLogger();
            _configuration    = configuration;
        }
        public FactoryCommonServices(IPublicationResolver resolver, ILogger logger,
                        IDD4TConfiguration configuration, ICacheAgent cacheAgent)
        {
            if (resolver == null)
                throw new ArgumentNullException("resolver");

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

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

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

            Logger = logger;
            PublicationResolver = resolver;
            Configuration = configuration;
            CacheAgent = cacheAgent;
        }
        public ProvidersCommonServices(IPublicationResolver resolver, ILogger logger, IDD4TConfiguration configuration)
        {
            if (resolver == null)
            {
                throw new ArgumentNullException("resolver");
            }

            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            Logger = logger;
            PublicationResolver = resolver;
            Configuration       = configuration;
        }
Esempio n. 38
0
        //private readonly IExtendedPublicationResolver _publicationResolver;

        public DefaultContentProvider(IPageFactory pageFactory,
                                      IComponentPresentationFactory componentPresentationFactory,
                                      IViewModelFactory viewModelFactory,
                                      ILogger logger,
                                      //IExtendedPublicationResolver publicationResolver,
                                      IDD4TConfiguration configuration)
        {
            pageFactory.ThrowIfNull(nameof(pageFactory));
            viewModelFactory.ThrowIfNull(nameof(viewModelFactory));
            logger.ThrowIfNull(nameof(logger));
            componentPresentationFactory.ThrowIfNull(nameof(componentPresentationFactory));
            configuration.ThrowIfNull(nameof(configuration));
            //publicationResolver.ThrowIfNull(nameof(publicationResolver));

            //this._publicationResolver = publicationResolver;
            this._pageFactory                  = pageFactory;
            this._viewModelFactory             = viewModelFactory;
            this._componentPresentationFactory = componentPresentationFactory;
            this._logger        = logger;
            this._configuration = configuration;
        }
Esempio n. 39
0
        public DD4TControllerBase(IPageFactory pageFactory, IComponentPresentationFactory componentPresentationFactory, ILogger logger, IDD4TConfiguration dd4tConfiguration)
        {
            if (pageFactory == null)
            {
                throw new ArgumentNullException("pageFactory");
            }

            if (componentPresentationFactory == null)
            {
                throw new ArgumentNullException("componentPresentationFactory");
            }

            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            LoggerService = logger;
            PageFactory   = pageFactory;
            ComponentPresentationFactory = componentPresentationFactory;
            DD4TConfiguration            = dd4tConfiguration;
        }
Esempio n. 40
0
        public FactoriesFacade(IPublicationResolver resolver, ILogger logger, IDD4TConfiguration configuration, ICacheAgent cacheAgent, ISerializerService serializerService)
        {
            if (resolver == null)
                throw new ArgumentNullException("resolver");

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

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

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

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

            SerializerService = serializerService;
            Logger = logger;
            PublicationResolver = resolver;
            Configuration = configuration;
            CacheAgent = cacheAgent;
        }
Esempio n. 41
0
        public TridionSiteMapProvider(IPageFactory pageFactory, ICacheAgent cacheAgent, ILogger logger, IDD4TConfiguration configuration)
        {
            if (pageFactory == null)
            {
                throw new ArgumentNullException("pageFactory");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }
            if (cacheAgent == null)
            {
                throw new ArgumentNullException("cacheAgent");
            }

            _pageFactory   = pageFactory;
            _configuration = configuration;
            _cacheAgent    = cacheAgent;
            _logger        = logger;
        }
Esempio n. 42
0
        public WebConfigViewModelKeyProvider(IDD4TConfiguration configuration)
        {
            if (configuration == null) throw new ArgumentNullException("configuration");

            ViewModelKeyField = configuration.ViewModelKeyField;
            if (string.IsNullOrEmpty(ViewModelKeyField)) ViewModelKeyField = "viewModelKey"; //Default value
        } 
Esempio n. 43
0
 public ModelControllerBase(IPageFactory pageFactory, IComponentPresentationFactory componentPresentationFactory, ILogger logger, IDD4TConfiguration dd4tConfiguration, IViewModelFactory viewModelFactory) : base(pageFactory, componentPresentationFactory, logger, dd4tConfiguration)
 {
     this.ViewModelFactory = viewModelFactory;
 }
Esempio n. 44
0
 public RenderDataAttribute()
 {
     DD4TConfiguration = DependencyResolver.Current.GetService<IDD4TConfiguration>();
 }
Esempio n. 45
0
 public JMSMessageProvider(ILogger logger, IDD4TConfiguration dd4tConfiguration)
 {
     Logger            = logger;
     DD4TConfiguration = dd4tConfiguration;
     observers         = new List <IObserver <ICacheEvent> >();
 }
Esempio n. 46
0
 public RenderDataAttribute()
 {
     DD4TConfiguration = DependencyResolver.Current.GetService <IDD4TConfiguration>();
 }
Esempio n. 47
0
 public TridionControllerBase(IPageFactory pageFactory, IComponentPresentationFactory componentPresentationFactory, ILogger logger, IDD4TConfiguration dd4tConfiguration) : base(pageFactory, componentPresentationFactory, logger, dd4tConfiguration)
 {
 }
Esempio n. 48
0
 public ModelControllerBase(IPageFactory pageFactory, IComponentPresentationFactory componentPresentationFactory, ILogger logger, IDD4TConfiguration dd4tConfiguration, IViewModelFactory viewModelFactory) : base(pageFactory, componentPresentationFactory, logger, dd4tConfiguration)
 {
     this.ViewModelFactory = viewModelFactory;
 }