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);
        }
Пример #2
0
        /*================================================================================================================================*/

        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
 private static IndexingActivity CreateActivity(IndexingActivityType type, string path, bool moveOrRename, IndexDocumentData indexDocumentData)
 {
     return(new IndexingActivity
     {
         ActivityType = type,
         Path = path.ToLower(),
         IndexDocumentData = indexDocumentData,
         MoveOrRename = moveOrRename
     });
 }
Пример #6
0
        /*================================================================================================================================*/

        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
            });
        }
Пример #7
0
        /* ============================================================================================== */

        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);
        }
Пример #9
0
        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);
        }
Пример #10
0
        /* ====================================================================================== */

        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);
        }
Пример #11
0
        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);
        }
Пример #12
0
        /// <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);
        }
Пример #14
0
        /*================================================================================================================================*/

        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);
        }
Пример #15
0
 private static void CreateActivityAndExecute(IndexingActivityType type, string path, bool moveOrRename, IndexDocumentData indexDocumentData)
 {
     ExecuteActivity(CreateActivity(type, path, moveOrRename, indexDocumentData));
 }
Пример #16
0
 private static void CreateActivityAndExecute(IndexingActivityType type, int nodeId, int versionId, long versionTimestamp, bool? singleVersion, IndexDocumentData indexDocumentData)
 {
     ExecuteActivity(CreateActivity(type, nodeId, versionId, versionTimestamp, singleVersion, indexDocumentData));
 }
Пример #17
0
 private static IndexingActivity CreateActivity(IndexingActivityType type, string path, bool moveOrRename, IndexDocumentData indexDocumentData)
 {
     return new IndexingActivity
     {
         ActivityType = type,
         Path = path.ToLower(),
         IndexDocumentData = indexDocumentData,
         MoveOrRename = moveOrRename
     };
 }
Пример #18
0
        /*================================================================================================================================*/

        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
            };
        }
Пример #19
0
 partial void OnActivityTypeChanging(IndexingActivityType value);
Пример #20
0
 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));
 }
Пример #21
0
 private static void CreateTreeActivityAndExecute(IndexingActivityType type, string path, int nodeId, bool moveOrRename, IndexDocumentData indexDocumentData)
 {
     ExecuteActivity(CreateTreeActivity(type, path, nodeId, moveOrRename, indexDocumentData));
 }
Пример #22
0
 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));
 }
Пример #23
0
 private static IndexingActivityBase CreateTreeActivity(IndexingActivityType type, string path, int nodeId, IndexDocumentData indexDocumentData)
 {
     return(new DocumentPopulator(null, null).CreateTreeActivity(type, path, nodeId, indexDocumentData));
 }
Пример #24
0
 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));
 }
Пример #25
0
 private static STT.Task CreateTreeActivityAndExecuteAsync(IndexingActivityType type, string path, int nodeId, IndexDocumentData indexDocumentData, CancellationToken cancellationToken)
 {
     return(ExecuteActivityAsync(CreateTreeActivity(type, path, nodeId, indexDocumentData), cancellationToken));
 }
Пример #26
0
 partial void OnActivityTypeChanging(IndexingActivityType value);