public virtual void Process(IngestionPipelineArgs args)
        {
            if (args == null)
            {
                throw new ArgumentNullException("args");
            }
            var handlers = args.DataHandlers;

            if (handlers == null || handlers.Count == 0)
            {
                return;
            }
            foreach (var handler in handlers)
            {
                var reader   = handler.DataReader;
                var hydrator = handler.Hydrator;
                if (reader == null || hydrator == null)
                {
                    continue;
                }
                var data = handler.DataReader.GetDataStream();
                if (data == null)
                {
                    continue;
                }
                hydrator.Hydrate(data, handler.ApplyNullValues);
            }
        }
Ejemplo n.º 2
0
        public virtual void Process(IngestionPipelineArgs args)
        {
            if (args.Contact != null)
            {
                return;
            }
            if (Sitecore.Analytics.Tracker.Current == null)
            {
                Sitecore.Analytics.Tracker.Initialize();
            }
            var cookie = new ContactKeyCookie();

            if (!cookie.IsNewContact)
            {
                var contactManager = Sitecore.Configuration.Factory.CreateObject("tracking/contactManager", true) as ContactManager;
                if (contactManager != null)
                {
                    args.Contact = contactManager.LoadContactReadOnly(cookie.ContactId);
                }
            }
        }