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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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
     });
 }
Esempio n. 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
            });
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 15
0
 private static void CreateActivityAndExecute(IndexingActivityType type, string path, bool moveOrRename, IndexDocumentData indexDocumentData)
 {
     ExecuteActivity(CreateActivity(type, path, moveOrRename, indexDocumentData));
 }
Esempio n. 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));
 }
Esempio n. 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
     };
 }
Esempio n. 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
            };
        }
Esempio n. 19
0
 partial void OnActivityTypeChanging(IndexingActivityType value);
Esempio n. 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));
 }
Esempio n. 21
0
 private static void CreateTreeActivityAndExecute(IndexingActivityType type, string path, int nodeId, bool moveOrRename, IndexDocumentData indexDocumentData)
 {
     ExecuteActivity(CreateTreeActivity(type, path, nodeId, moveOrRename, indexDocumentData));
 }
Esempio n. 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));
 }
Esempio n. 23
0
 private static IndexingActivityBase CreateTreeActivity(IndexingActivityType type, string path, int nodeId, IndexDocumentData indexDocumentData)
 {
     return(new DocumentPopulator(null, null).CreateTreeActivity(type, path, nodeId, indexDocumentData));
 }
Esempio n. 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));
 }
Esempio n. 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));
 }
Esempio n. 26
0
 partial void OnActivityTypeChanging(IndexingActivityType value);