Exemplo n.º 1
0
        /// <summary>
        /// Runs synchronization for integration configuration items with checked ScheduledBlobTransfer field.
        /// </summary>
        /// <param name="itemArray">
        /// The item array.
        /// </param>
        /// <param name="commandItem">
        /// The command item.
        /// </param>
        /// <param name="scheduledItem">
        /// The scheduled item.
        /// </param>
        public void Execute(Item[] itemArray, CommandItem commandItem, ScheduleItem scheduledItem)
        {
            try
            {
                Database database = commandItem.Database;
                string   query    = string.Format("fast://*[@{0} = '1' and @@templateid = '{1}']", FieldNames.ScheduledBlobTransfer, TemplateIDs.IntegrationConfig);
                Item[]   items    = database.SelectItems(query);

                foreach (var item in items)
                {
                    var processIntegrationItemsOptions = new ProcessIntegrationItemsOptions
                    {
                        Force = true,
                        ScheduledBlobTransfer = true,
                        Recursive             = true,
                        AsyncIntegration      = true
                    };

                    SharepointProvider.ProcessTree(item, processIntegrationItemsOptions);
                }
            }
            catch (Exception exception)
            {
                Log.Error("Tasks.ScheduledBlobTransfer.Execute() failed", exception);
            }
        }
        public void should_process_tree_via_pipeline()
        {
            // Arrange
            using (var pipelines = new PipelinesHandler())
            {
                var options = ProcessIntegrationItemsOptions.DefaultOptions;
                options.Force = true;
                Item item = new ItemMock().AsConfigurationItem();

                // Act
                SharepointProvider.ProcessTree(item, options);

                // Assert
                pipelines.ShouldReceiveCall <SynchronizeTreeArgs>(PipelineNames.SynchronizeTree, x => true);
            }
        }
Exemplo n.º 3
0
        /// <summary>The process.</summary>
        /// <param name="args">The args.</param>
        public virtual void Process([NotNull] GetChildrenArgs args)
        {
            Assert.ArgumentNotNull(args, "args");

            if (!IntegrationDisabler.CurrentValue)
            {
                if (SharepointProvider.IsActiveIntegrationConfigItem(args.Item) || SharepointProvider.IsActiveIntegrationFolder(args.Item))
                {
                    SharepointProvider.ProcessTree(args.Item, ProcessIntegrationItemsOptions.DefaultAsyncOptions);
                }
            }

            if (!args.Handled)
            {
                using (new IntegrationDisabler())
                {
                    args.Result  = args.FallbackProvider.GetChildren(args.Item, args.SecurityCheck);
                    args.Handled = true;
                }
            }
        }