public static void SynchronizeDatabase()
 {
     DataSyncPipelineArgs args = new DataSyncPipelineArgs
     {
         Provider = Factory.CreateObject("databaseSync/changesProvider", true) as IDatabaseSyncChangesProvider
     };
     CorePipeline.Run("SynchronizeDatabase", args);
 }
 public static void SynchronizeDatabase(IDatabaseSyncChangesProvider provider)
 {
     DataSyncPipelineArgs args = new DataSyncPipelineArgs
     {
         Provider = provider
     };
     CorePipeline.Run("SynchronizeDatabase", args);
 }
        public void Process(DataSyncPipelineArgs args)
        {
            List <ChangeRoot> roots = new List <ChangeRoot>();

            foreach (ItemChange change in args.Provider.GetItems())
            {
                SyncItem syncItem = GetSyncItem(change.PhysicalPath);
                if (syncItem != null)
                {
                    ChangeRoot root = new ChangeRoot(change)
                    {
                        Type = RootType.Item
                    };
                    roots.Add(root);
                }
            }
            args.ChangeRoots = roots;
        }
        public void Process(DataSyncPipelineArgs args)
        {
            List<ChangeRoot> roots = new List<ChangeRoot>();

            foreach (ItemChange change in args.Provider.GetItems())
            {
                SyncItem syncItem = GetSyncItem(change.PhysicalPath);
                if (syncItem != null)
                {
                    ChangeRoot root = new ChangeRoot(change)
                    {
                        Type = RootType.Item
                    };
                    roots.Add(root);
                }
            }
            args.ChangeRoots = roots;
        }
 public void Process(DataSyncPipelineArgs args)
 {
     LoadOptions loadOptions = new LoadOptions
     {
         DisableEvents = true,
         ForceUpdate = true
     };
     foreach (ChangeRoot root in args.ChangeRoots.Where(r => r.Type == RootType.Item))
     {
         using (new SecurityModel.SecurityDisabler())
         {
             try
             {
                 Manager.LoadItem(root.PhysicalPath, loadOptions);
             }
             catch (Exception e)
             {
                 Log.Error(String.Format("Cannot update following item {0}", root.PhysicalPath), e, this);
             }
         }
     }
 }
Esempio n. 6
0
        public void Process(DataSyncPipelineArgs args)
        {
            LoadOptions loadOptions = new LoadOptions
            {
                DisableEvents = true,
                ForceUpdate   = true
            };

            foreach (ChangeRoot root in args.ChangeRoots.Where(r => r.Type == RootType.Item))
            {
                using (new SecurityModel.SecurityDisabler())
                {
                    try
                    {
                        Manager.LoadItem(root.PhysicalPath, loadOptions);
                    }
                    catch (Exception e)
                    {
                        Log.Error(String.Format("Cannot update following item {0}", root.PhysicalPath), e, this);
                    }
                }
            }
        }