/// <summary> /// Method is processing integration config or integration folder item. /// </summary> /// <param name="integrationConfigDataSource">The item which contains integration config data.</param> /// <param name="processIntegrationItemsOptions">The process integration items options.</param> public static void ProcessTree([NotNull] Item integrationConfigDataSource, [NotNull] ProcessIntegrationItemsOptions processIntegrationItemsOptions) { Assert.ArgumentNotNull(integrationConfigDataSource, "integrationConfigDataSource"); Assert.ArgumentNotNull(processIntegrationItemsOptions, "processIntegrationItemsOptions"); CacheableIntegrationConfigData it = IntegrationCache.GetIntegrationConfigData(integrationConfigDataSource.ID); if (!IntegrationDisabler.CurrentValue && (processIntegrationItemsOptions.Force || it == null || it.IsExpired)) { if (processIntegrationItemsOptions.AsyncIntegration) { string jobName = string.Format("SharePoint_Integration_{0}", integrationConfigDataSource.ID); var parameters = new object[] { processIntegrationItemsOptions, integrationConfigDataSource }; JobUtil.StartJob(jobName, Instance, "ProcessTree", parameters); } else { Instance.ProcessTree(processIntegrationItemsOptions, integrationConfigDataSource); } } }
/// <summary> /// Method is processing integration config or integration folder item. /// </summary> /// <param name="processIntegrationItemsOptions">The process integration items options.</param> /// <param name="integrationConfigDataSource">The item which contains integration config data.</param> public virtual void ProcessTree([NotNull] ProcessIntegrationItemsOptions processIntegrationItemsOptions, [NotNull] Item integrationConfigDataSource) { Assert.ArgumentNotNull(processIntegrationItemsOptions, "processIntegrationItemsOptions"); Assert.ArgumentNotNull(integrationConfigDataSource, "integrationConfigDataSource"); CacheableIntegrationConfigData it = IntegrationCache.GetIntegrationConfigData(integrationConfigDataSource.ID); if (!IntegrationDisabler.CurrentValue && (processIntegrationItemsOptions.Force || it == null || it.IsExpired)) { using (new IntegrationDisabler()) { SynchContext synchContext; try { synchContext = new SynchContext(integrationConfigDataSource); } catch (Exception ex) { Log.Error(string.Format("Synchronization context can not be created for \"{0}\" integration config data source item.", integrationConfigDataSource.Name), ex, this); return; } IntegrationPipelinesRunner.SynchronizeTree(processIntegrationItemsOptions, synchContext); } } }
/// <exception cref="NullReferenceException">Throws <c>NullReferenceException</c> if Integration Config Data of the current Integration item is not specified.</exception> protected void Initialize() { CacheableIntegrationConfigData integrationConfigData = IntegrationCache.GetIntegrationConfigData(this.ParentID); if (integrationConfigData != null) { this.IntegrationConfigData = integrationConfigData.Data; } else { this.IntegrationConfigData = IntegrationConfigDataProvider.GetFromItem(this.ParentItem); } if (this.IntegrationConfigData == null) { string message = string.Format("Integration Config Data of Integration item \"{0}\" is not specified.", this.ParentItem.Paths.FullPath); throw new NullReferenceException(message); } }