private static IndexingActivityBase CreateTreeActivity(IndexingActivityType type, string path, int nodeId, IndexDocumentData indexDocumentData) { var populatorAcc = new PrivateType(typeof(DocumentPopulator)); var result = populatorAcc.InvokeStatic("CreateTreeActivity", type, path, nodeId, indexDocumentData); return((IndexingActivityBase)result); }
/*================================================================================================================================*/ private static LuceneIndexingActivity CreateActivity(IndexingActivityType type, string path, int nodeId, int versionId, long versionTimestamp, bool?singleVersion, VersioningInfo versioningInfo, IndexDocumentData indexDocumentData) { var activity = (LuceneIndexingActivity)IndexingActivityFactory.Instance.CreateActivity(type); activity.Path = path.ToLowerInvariant(); activity.NodeId = nodeId; activity.VersionId = versionId; activity.VersionTimestamp = versionTimestamp; activity.SingleVersion = singleVersion; if (indexDocumentData != null) { var lucDocAct = activity as LuceneDocumentActivity; if (lucDocAct != null) { lucDocAct.IndexDocumentData = indexDocumentData; } } var documentActivity = activity as LuceneDocumentActivity; if (documentActivity != null) { documentActivity.Versioning = versioningInfo; } return(activity); }
private IIndexingActivity RegisterActivity(IndexingActivityType type, IndexingActivityRunningState state, int nodeId, int versionId, string path, DateTime?creationDate = null, DateTime?lockTime = null) { IndexingActivityBase activity; if (type == IndexingActivityType.AddTree || type == IndexingActivityType.RemoveTree) { activity = CreateTreeActivity(type, path, nodeId, null); } else { activity = CreateActivity(type, path, nodeId, versionId, 9999, null); } activity.RunningState = state; if (creationDate.HasValue) { activity.CreationDate = creationDate.Value; } if (lockTime.HasValue) { activity.LockTime = lockTime; } DataProvider.Current.RegisterIndexingActivity(activity); return(activity); }
private IndexingActivityBase CreateTreeActivity(IndexingActivityType type, string path, int nodeId) { var activity = (IndexingActivityBase)IndexingActivityFactory.Instance.CreateActivity(type); activity.Path = path.ToLowerInvariant(); activity.NodeId = nodeId; return(activity); }
private static IndexingActivity CreateActivity(IndexingActivityType type, string path, bool moveOrRename, IndexDocumentData indexDocumentData) { return(new IndexingActivity { ActivityType = type, Path = path.ToLower(), IndexDocumentData = indexDocumentData, MoveOrRename = moveOrRename }); }
/*================================================================================================================================*/ private static IndexingActivity CreateActivity(IndexingActivityType type, int nodeId, int versionId, long versionTimestamp, bool?singleVersion, IndexDocumentData indexDocumentData) { return(new IndexingActivity { ActivityType = type, NodeId = nodeId, VersionId = versionId, VersionTimestamp = versionTimestamp, SingleVersion = singleVersion, IndexDocumentData = indexDocumentData }); }
/* ============================================================================================== */ private void RegisterActivity(IndexingActivityType type, IndexingActivityRunningState state, int nodeId, int versionId, string path) { IndexingActivityBase activity; if (type == IndexingActivityType.AddTree || type == IndexingActivityType.RemoveTree) { activity = CreateTreeActivity(type, path, nodeId); } else { activity = CreateActivity(type, path, nodeId, versionId, 9999); } activity.RunningState = state; DataStore.DataProvider.RegisterIndexingActivityAsync(activity, CancellationToken.None).GetAwaiter().GetResult(); }
private void RegisterActivity(IndexingActivityType type, IndexingActivityRunningState state, int nodeId, int versionId, string path) { IndexingActivityBase activity; if (type == IndexingActivityType.AddTree || type == IndexingActivityType.RemoveTree) { activity = CreateTreeActivity(type, path, nodeId); } else { activity = CreateActivity(type, path, nodeId, versionId, 9999); } activity.RunningState = state; DataProvider.Current.RegisterIndexingActivity(activity); }
private static IndexingActivityBase CreateTreeActivity(IndexingActivityType type, string path, int nodeId, IndexDocumentData indexDocumentData) { var activity = (IndexingActivityBase)IndexingActivityFactory.Instance.CreateActivity(type); activity.Path = path.ToLowerInvariant(); activity.NodeId = nodeId; if (indexDocumentData != null) { if (activity is DocumentIndexingActivity docAct) { docAct.IndexDocumentData = indexDocumentData; } } return(activity); }
/* ====================================================================================== */ private async Task <IIndexingActivity> RegisterActivityAsync(IndexingActivityType type, IndexingActivityRunningState state, int nodeId, int versionId, string path) { IndexingActivityBase activity; if (type == IndexingActivityType.AddTree || type == IndexingActivityType.RemoveTree) { activity = CreateTreeActivity(type, path, nodeId, null); } else { activity = CreateActivity(type, path, nodeId, versionId, 9999, null); } activity.RunningState = state; await DP.RegisterIndexingActivityAsync(activity, CancellationToken.None); return(activity); }
private static LuceneIndexingActivity CreateTreeActivity(IndexingActivityType type, string path, int nodeId, bool moveOrRename, IndexDocumentData indexDocumentData) { var activity = (LuceneIndexingActivity)IndexingActivityFactory.Instance.CreateActivity(type); activity.Path = path.ToLowerInvariant(); activity.NodeId = nodeId; activity.MoveOrRename = moveOrRename; if (indexDocumentData != null) { var lucDocAct = activity as LuceneDocumentActivity; if (lucDocAct != null) { lucDocAct.IndexDocumentData = indexDocumentData; } } return(activity); }
/// <inheritdoc /> public IIndexingActivity CreateActivity(IndexingActivityType activityType) { IIndexingActivity activity; switch (activityType) { case IndexingActivityType.AddDocument: activity = new AddDocumentActivity(); break; case IndexingActivityType.AddTree: activity = new AddTreeActivity(); break; case IndexingActivityType.UpdateDocument: activity = new UpdateDocumentActivity(); break; case IndexingActivityType.RemoveTree: activity = new RemoveTreeActivity(); break; case IndexingActivityType.Rebuild: activity = new RebuildActivity(); break; default: throw new NotSupportedException("Unknown IndexingActivityType: " + activityType); } activity.ActivityType = activityType; return(activity); }
private IndexingActivityBase CreateActivity(IndexingActivityType type, string path, int nodeId, int versionId, long versionTimestamp) { var activity = (IndexingActivityBase)IndexingActivityFactory.Instance.CreateActivity(type); activity.Path = path.ToLowerInvariant(); activity.NodeId = nodeId; activity.VersionId = versionId; activity.VersionTimestamp = versionTimestamp; if (activity is DocumentIndexingActivity documentActivity) { documentActivity.SetDocument(new IndexDocument()); documentActivity.Versioning = new VersioningInfo { Delete = new int[0], Reindex = new int[0], LastDraftVersionId = versionId, LastPublicVersionId = versionId }; } return(activity); }
/*================================================================================================================================*/ private static IndexingActivityBase CreateActivity(IndexingActivityType type, string path, int nodeId, int versionId, long versionTimestamp, VersioningInfo versioningInfo, IndexDocumentData indexDocumentData) { var activity = (IndexingActivityBase)IndexingActivityFactory.Instance.CreateActivity(type); activity.Path = path.ToLowerInvariant(); activity.NodeId = nodeId; activity.VersionId = versionId; activity.VersionTimestamp = versionTimestamp; if (indexDocumentData != null) { if (activity is DocumentIndexingActivity docAct) { docAct.IndexDocumentData = indexDocumentData; } } if (activity is DocumentIndexingActivity documentActivity) { documentActivity.Versioning = versioningInfo; } return(activity); }
private static void CreateActivityAndExecute(IndexingActivityType type, string path, bool moveOrRename, IndexDocumentData indexDocumentData) { ExecuteActivity(CreateActivity(type, path, moveOrRename, indexDocumentData)); }
private static void CreateActivityAndExecute(IndexingActivityType type, int nodeId, int versionId, long versionTimestamp, bool? singleVersion, IndexDocumentData indexDocumentData) { ExecuteActivity(CreateActivity(type, nodeId, versionId, versionTimestamp, singleVersion, indexDocumentData)); }
private static IndexingActivity CreateActivity(IndexingActivityType type, string path, bool moveOrRename, IndexDocumentData indexDocumentData) { return new IndexingActivity { ActivityType = type, Path = path.ToLower(), IndexDocumentData = indexDocumentData, MoveOrRename = moveOrRename }; }
/*================================================================================================================================*/ private static IndexingActivity CreateActivity(IndexingActivityType type, int nodeId, int versionId, long versionTimestamp, bool? singleVersion, IndexDocumentData indexDocumentData) { return new IndexingActivity { ActivityType = type, NodeId = nodeId, VersionId = versionId, VersionTimestamp = versionTimestamp, SingleVersion = singleVersion, IndexDocumentData = indexDocumentData }; }
partial void OnActivityTypeChanging(IndexingActivityType value);
private static IndexingActivityBase CreateActivity(IndexingActivityType type, string path, int nodeId, int versionId, long versionTimestamp, IndexDocumentData indexDocumentData) { return(new DocumentPopulator(null, null).CreateActivity(type, path, nodeId, versionId, versionTimestamp, null, indexDocumentData)); }
private static void CreateTreeActivityAndExecute(IndexingActivityType type, string path, int nodeId, bool moveOrRename, IndexDocumentData indexDocumentData) { ExecuteActivity(CreateTreeActivity(type, path, nodeId, moveOrRename, indexDocumentData)); }
private static void CreateActivityAndExecute(IndexingActivityType type, string path, int nodeId, int versionId, long versionTimestamp, bool?singleVersion, VersioningInfo versioningInfo, IndexDocumentData indexDocumentData) { ExecuteActivity(CreateActivity(type, path, nodeId, versionId, versionTimestamp, singleVersion, versioningInfo, indexDocumentData)); }
private static IndexingActivityBase CreateTreeActivity(IndexingActivityType type, string path, int nodeId, IndexDocumentData indexDocumentData) { return(new DocumentPopulator(null, null).CreateTreeActivity(type, path, nodeId, indexDocumentData)); }
private static STT.Task CreateActivityAndExecuteAsync(IndexingActivityType type, string path, int nodeId, int versionId, long versionTimestamp, VersioningInfo versioningInfo, IndexDocumentData indexDocumentData, CancellationToken cancellationToken) { return(ExecuteActivityAsync(CreateActivity(type, path, nodeId, versionId, versionTimestamp, versioningInfo, indexDocumentData), cancellationToken)); }
private static STT.Task CreateTreeActivityAndExecuteAsync(IndexingActivityType type, string path, int nodeId, IndexDocumentData indexDocumentData, CancellationToken cancellationToken) { return(ExecuteActivityAsync(CreateTreeActivity(type, path, nodeId, indexDocumentData), cancellationToken)); }