Exemplo n.º 1
0
        protected override void BeginWork()
        {
            base.BeginWork();

            var jobParameters = Utils.SmartXmlDeserializer(BootParameters);

            var profileBEO = jobParameters as ProfileBEO;

            if (profileBEO != null)
            {
                ThreadsLinkingRequested  = profileBEO.IsMapEmailThread;
                FamiliesLinkingRequested = profileBEO.IsImportFamilyRelations;

                if (profileBEO.ImportTypeName.Contains("E-docs"))
                {
                    ThreadsLinkingRequested  = true;
                    FamiliesLinkingRequested = true;
                }

                CollectionId = profileBEO.DatasetDetails.CollectionId;
                MatterId     = profileBEO.DatasetDetails.Matter.FolderID;
                IsOverlay    = !profileBEO.IsAppend;
            }

            var lawImportBEO = jobParameters as LawImportBEO;

            if (lawImportBEO != null)
            {
                ThreadsLinkingRequested  = lawImportBEO.CreateThreads;
                FamiliesLinkingRequested = lawImportBEO.CreateFamilyGroups;

                CollectionId = lawImportBEO.CollectionId;
                MatterId     = lawImportBEO.MatterId;
                IsOverlay    = lawImportBEO.ImportOptions != ImportOptionsBEO.AppendNew;
            }

            if (profileBEO == null && lawImportBEO == null)
            {
                throw new EVException().AddDbgMsg("Unknown type of bootparameters: {0}", BootParameters);
            }

            vaultHelper = new VaultHelper(MatterId, CollectionId);

            Tracer.Info(
                "MatterId = {0}, CollectionId = {1}, VaultConnectionString = {2}, IsOverlay = {3}, ThreadsLinkingRequested = {4}, FamiliesLinkingRequested = {5}",
                MatterId, CollectionId, vaultHelper.VaultConnectionString, IsOverlay, ThreadsLinkingRequested,
                FamiliesLinkingRequested);

            Dictionary <DocumentId, ExistingThreadRecord> existingThreads = null;

            if (IsOverlay)
            {
                existingThreads = vaultHelper.LoadExistingThreads();
            }

            _threadsProcessor = new ThreadsProcessor(IsOverlay, existingThreads);

            resultsAccumulator = new ThreadsCalculationResults();
        }
Exemplo n.º 2
0
        protected override void BeginWork()
        {
            base.BeginWork();

            var jobParameters = Utils.SmartXmlDeserializer(BootParameters);

            var profileBEO = jobParameters as ProfileBEO;
            if (profileBEO != null)
            {
                ThreadsLinkingRequested = profileBEO.IsMapEmailThread;
                FamiliesLinkingRequested = profileBEO.IsImportFamilyRelations;

                if (profileBEO.ImportTypeName.Contains("E-docs"))
                {
                    ThreadsLinkingRequested = true;
                    FamiliesLinkingRequested = true;
                }

                CollectionId = profileBEO.DatasetDetails.CollectionId;
                MatterId = profileBEO.DatasetDetails.Matter.FolderID;
                IsOverlay = !profileBEO.IsAppend;
            }

            var lawImportBEO = jobParameters as LawImportBEO;
            if (lawImportBEO != null)
            {
                ThreadsLinkingRequested = lawImportBEO.CreateThreads;
                FamiliesLinkingRequested = lawImportBEO.CreateFamilyGroups;

                CollectionId = lawImportBEO.CollectionId;
                MatterId = lawImportBEO.MatterId;
                IsOverlay = lawImportBEO.ImportOptions != ImportOptionsBEO.AppendNew;
            }

            if (profileBEO == null && lawImportBEO == null)
            {
                throw new EVException().AddDbgMsg("Unknown type of bootparameters: {0}", BootParameters);
            }

            vaultHelper = new VaultHelper(MatterId, CollectionId);

            Tracer.Info(
                "MatterId = {0}, CollectionId = {1}, VaultConnectionString = {2}, IsOverlay = {3}, ThreadsLinkingRequested = {4}, FamiliesLinkingRequested = {5}",
                MatterId, CollectionId, vaultHelper.VaultConnectionString, IsOverlay, ThreadsLinkingRequested,
                FamiliesLinkingRequested);

            Dictionary<DocumentId, ExistingThreadRecord> existingThreads = null;
            if (IsOverlay)
            {
                existingThreads = vaultHelper.LoadExistingThreads();
            }

            _threadsProcessor = new ThreadsProcessor(IsOverlay, existingThreads);

            resultsAccumulator = new ThreadsCalculationResults();
        }