public void Prepare(ClientPipelineArgs args) { Assert.ArgumentNotNull(args, "args"); Assert.ArgumentNotNull(args, "args"); Database database = GetDatabase(args); ListString list = new ListString(args.Parameters["items"], '|'); foreach (string id in list) { Item item = database.GetItem(id); if (SharepointProvider.IsActiveIntegrationConfigItem(item)) { args.Parameters[CancelationKey] = "1"; } if (SharepointProvider.IsActiveIntegrationDataItem(item)) { if (item != null) { CacheableIntegrationItemInfo cacheableIntegrationItemInfo = IntegrationCache.GetIntegrationItemInfo(item.ID); if (cacheableIntegrationItemInfo != null) { args.Parameters[id] = cacheableIntegrationItemInfo.ParentItemId.ToString(); args.Parameters[id + "uniqueId"] = cacheableIntegrationItemInfo.SharepointItemId; } } } } }
public static bool UpdateSharepointItem([NotNull] Item sourceIntegrationItem) { Assert.ArgumentNotNull(sourceIntegrationItem, "sourceIntegrationItem"); CacheableIntegrationItemInfo cacheableIntegrationItemInfo = IntegrationCache.GetIntegrationItemInfo(sourceIntegrationItem.ID); if (cacheableIntegrationItemInfo == null) { Log.Warn("Can't find item in the Sharepoint cache and so can't update Sharepoint item. ", sourceIntegrationItem); return(false); } var synchContext = new SynchContext(cacheableIntegrationItemInfo.ParentItemId, sourceIntegrationItem.Database); ProcessSharepointItemArgs pipelineArgs = IntegrationPipelinesRunner.UpdateSharepointItem( cacheableIntegrationItemInfo.SharepointItemId, sourceIntegrationItem, synchContext); return(pipelineArgs != null); }