예제 #1
0
 public VaultKeepService(VaultKeepRepository repo, KeepService ks, VaultRepository vrepo, KeepRepository krepo)
 {
     _krepo = krepo;
     _vrepo = vrepo;
     _ks    = ks;
     _repo  = repo;
 }
예제 #2
0
 public VaultKeepsController(KeepRepository KeepRepo, VaultRepository VaultRepo, VaultKeepRepository VaultKeepRepo, UserRepository UserRepo)
 {
     keepDb      = KeepRepo;
     vaultDb     = VaultRepo;
     vaultKeepDb = VaultKeepRepo;
     userDb      = UserRepo;
 }
        /// <summary>
        /// End of the work. process
        /// Update the job's boot parameter with total number of document processed and number of failed documents
        /// </summary>
        protected override void EndWork()
        {
            var bootParam = GetBootObject <ConversionReprocessJobBeo>(BootParameters);

            //the corresponding job id
            int jobId = WorkAssignment.JobId;

            //get various count
            DatasetBEO ds       = DataSetBO.GetDataSetDetailForDataSetId(bootParam.DatasetId);
            long       matterId = ds.Matter.FolderID;

            var vault = VaultRepository.CreateRepository(matterId);

            int totalDocCount;
            int failedDocCount;
            int succeedDocCount;

            vault.GetReconversionDocStatusCount(jobId, out totalDocCount, out succeedDocCount,
                                                out failedDocCount);

            bootParam.TotalDocCount  = totalDocCount;
            bootParam.FailedDocCount = failedDocCount;
            //bootParam.SucceedDocCount = succeedDocCount;


            //re serialize the boot param
            string newBootParam;

            var serializer = new XmlSerializer(typeof(ConversionReprocessJobBeo));

            using (var writer = new StringWriter())
            {
                serializer.Serialize(writer, bootParam);

                newBootParam = writer.ToString();
            }

            //update the boot parameters for the job
            ReconversionDAO.UpdateReconversionBootParamter(jobId, newBootParam);

            //clean up reconversion input file that contain the list of document to convert
            SafeDeleteFile(bootParam.FilePath);
        }
예제 #4
0
        /// <summary>
        /// This method helps to get all the Duplicate counts in a collection whose hash value count>0 (which is combination of original docs+ duplicate docs)
        /// </summary>
        private List <DocumentHashMapEntity> GetDocumentHashValues(IEnumerable <DeduplicationDatasetBEO> lsDataset,
                                                                   string algorithm, string compareType)
        {
            List <DocumentHashMapEntity> lsDocumentHash = null;

            try
            {
                var lsCollectionId = new List <string>();

                foreach (var datasetInfo in lsDataset)
                {
                    lsCollectionId.Add(datasetInfo.CollectionId);
                    if (_matterId == string.Empty)
                    {
                        _matterId = datasetInfo.MatterId.ToString(CultureInfo.InvariantCulture);
                    }
                }
                var hashTypeId = GetHashTypeId(algorithm, compareType);
                _vault = VaultRepository.CreateRepository(Convert.ToInt64(_matterId));

                var lsCollectionTemp = lsCollectionId.Select(collection => new Guid(collection)).ToList();
                if (lsCollectionId.Count > 1)
                {
                    lsDocumentHash = _vault.GetDocumentDuplicatesAcrossCollections(lsCollectionTemp, hashTypeId);
                }
                else
                {
                    DataSetCollectionId = lsCollectionTemp[0];
                    lsDocumentHash      = _vault.GetDocumentDuplicatesByHashValue(lsCollectionTemp[0], hashTypeId,
                                                                                  string.Empty);
                }
                GetOriginalDocuments(lsCollectionId);
            }
            catch (Exception ex)
            {
                EvLog.WriteEntry(_jobid + Constants.EVENT_GENERATE_TASK_KEY,
                                 Constants.ErrorForDocumentHashValues + ex.Message);
                LogException(_jobid, ex, Constants.ErrorForOriginalDocuments, LogCategory.Job, string.Empty,
                             ErrorCodes.ProblemInGenerateTasks);
            }
            return(lsDocumentHash);
        }
예제 #5
0
        /// <summary>
        /// Convert the document to the ProductionDocumentDetail that can be used by ProductionNearNativeConversionHelper class
        /// </summary>
        /// <param name="idList">idList</param>
        /// <param name="idType">id type</param>
        /// <param name="collectionId">collection id</param>
        /// <param name="matterId">matter id</param>

        public static IEnumerable <ReconversionDocumentBEO> GetImportDocumentListForIDList(List <string> idList,
                                                                                           string idType,
                                                                                           string collectionId,
                                                                                           long matterId)
        {
            //Convert the list of DCN to list of documentId
            var vault = VaultRepository.CreateRepository(matterId);

            var dsResult = vault.GetImportReprocessDocumentList(idList, idType, collectionId);

            ReconversionDocumentBEO        doc       = null;
            List <ReconversionDocumentBEO> documents = new List <ReconversionDocumentBEO>();

            if (dsResult != null && dsResult.Tables.Count > 0)
            {
                foreach (DataRow dr in dsResult.Tables[0].Rows)
                {
                    string docRefId = dr[Constants.ColumnDocReferenceId].ToString();
                    string docSetId = dr[Constants.ColumnCollectionId].ToString();
                    string dcn      = dr[Constants.ColumnDocTitle].ToString();

                    if (documents.Any(f => f.CollectionId == docSetId && f.DocumentId == docRefId))
                    //new document (need to check this due to that multiple rows are returned in case of one document with multiple file path associated)
                    {
                        //add file path to list of file path for the document
                        documents.FirstOrDefault(f => f.CollectionId == docSetId && f.DocumentId == docRefId).FileList.Add(dr[Constants.ColumnDocText].ToString());
                    }
                    else
                    {
                        doc = new ReconversionDocumentBEO {
                            DocumentId = docRefId, CollectionId = docSetId, DCNNumber = dcn
                        };
                        doc.FileList.Add(dr[Constants.ColumnDocText].ToString());//add file path to list of file path for the document
                        documents.Add(doc);
                    }
                }
            }
            return(documents.AsEnumerable());
        }
예제 #6
0
 public VaultKeepService(VaultKeepRepository repo, VaultRepository vr)
 {
     _repo = repo;
     _vr   = vr;
 }
예제 #7
0
 public VualtController(VaultRepository repo)
 {
     db = repo;
 }
예제 #8
0
 public VaultService(VaultRepository repo)
 {
     _repo = repo;
 }
예제 #9
0
        /// <summary>
        /// Gets the production document list for ID list.
        /// </summary>
        /// <param name="idList">The id list.</param>
        /// <param name="idType">Type of the id.</param>
        /// <param name="matterId">The matter id.</param>
        /// <param name="baseJobConfig">The base job config.</param>
        /// <param name="redactableCollectionId">The redactable collection id.</param>
        /// <param name="jobId"> </param>
        /// <returns></returns>
        public static IEnumerable <ReconversionProductionDocumentBEO> GetProductionDocumentListForIdList(
            List <string> idList, string idType, long matterId,
            ProductionDetailsBEO baseJobConfig, string redactableCollectionId, int jobId)
        {
            //init field id value
            int batesFieldId      = -1;
            int batesBeginFieldId = -1;
            int batesEndFieldId   = -1;
            int dpnFieldId        = -1;

            //bates field: 3004
            var batesField = baseJobConfig.Profile.ProductionFields.FirstOrDefault(f => f.FieldType.DataTypeId == 3004);

            if (batesField != null)
            {
                batesFieldId = batesField.ID;
            }

            //bates begin: 3005
            var batesBeginField =
                baseJobConfig.Profile.ProductionFields.FirstOrDefault(f => f.FieldType.DataTypeId == 3005);

            if (batesBeginField != null)
            {
                batesBeginFieldId = batesBeginField.ID;
            }

            //bates end: 3006
            var batesEndField =
                baseJobConfig.Profile.ProductionFields.FirstOrDefault(f => f.FieldType.DataTypeId == 3006);

            if (batesEndField != null)
            {
                batesEndFieldId = batesEndField.ID;
            }

            //dpn field: 3008
            var dpnField = baseJobConfig.Profile.ProductionFields.FirstOrDefault(f => f.FieldType.DataTypeId == 3008);

            if (dpnField != null)
            {
                dpnFieldId = dpnField.ID;
            }


            //get the collection id for the native collection
            string nativeCollectionId = baseJobConfig.OriginalCollectionId;


            //find the production collection id at the time of the original production
            string productionCollectionId = baseJobConfig.CollectionId;

            //Get the list of production documents for reprocessing
            var docList = new List <ReconversionProductionDocumentBEO>();

            var vault = VaultRepository.CreateRepository(matterId);

            DataSet dsResult = vault.GetProductionReprocessDocumentList(idList, idType, redactableCollectionId,
                                                                        nativeCollectionId, productionCollectionId,
                                                                        dpnFieldId, batesFieldId, batesBeginFieldId,
                                                                        batesEndFieldId, jobId);

            ReconversionProductionDocumentBEO doc = null;

            //process returned records
            if (dsResult != null && dsResult.Tables.Count > 0)
            {
                foreach (DataRow dr in dsResult.Tables[0].Rows)
                {
                    string docReferenceId = dr[Constants.ColumnDocReferenceId].ToString();

                    if (doc == null || !docReferenceId.Equals(doc.DocumentId))
                    //new document (need to check this due to that multiple rows are returned, one row for each field)
                    {
                        doc                = new ReconversionProductionDocumentBEO();
                        doc.DocumentId     = docReferenceId;
                        doc.DCNNumber      = dr[Constants.DCN].ToString();
                        doc.ProductionPath = dr[Constants.ProductionPath].ToString();
                        docList.Add(doc);
                    }

                    int fieldId = dr[Constants.ColumnFieldId] != DBNull.Value
                                      ? Convert.ToInt32(dr[Constants.ColumnFieldId].ToString())
                                      : -1;
                    string fieldValue = dr[Constants.ColumnFieldvalue] != DBNull.Value
                                            ? dr[Constants.ColumnFieldvalue].ToString()
                                            : "";

                    if (dpnFieldId > 0 && dpnFieldId == fieldId)
                    {
                        doc.DocumentProductionNumber = fieldValue;
                    }
                    if (batesFieldId > 0 && batesFieldId == fieldId)
                    {
                        doc.AllBates = fieldValue;
                    }
                    if (batesBeginFieldId > 0 && batesBeginFieldId == fieldId)
                    {
                        doc.StartingBatesNumber = fieldValue;
                    }
                    if (batesEndFieldId > 0 && batesEndFieldId == fieldId)
                    {
                        doc.EndingBatesNumber = fieldValue;
                    }
                }


                //if any of the bates or dpn contain comma,  ie, contain multiple bates or dpn
                string bates = docList[0].StartingBatesNumber;
                string dpn   = docList[0].DocumentProductionNumber;

                //extrac the correct dpn if dpn contain concatenated ids, which could happen because multiple productions done on
                //the same collection, with same dpn field name
                //sample dpn sequence: "dd003, dd103, k45k005, k45k105, dd203, kkk001, ddd002, dd303, k45k205"
                if (dpn != null && dpn.Contains(","))
                {
                    RecalculateCorrectDpnNumbers(docList, baseJobConfig,
                                                 vault.GetDocumentCountForCollection(new Guid(productionCollectionId)));
                }

                //extrac the correct bates info if bates contain concatenated ids, which could happen because multiple productions done on
                //the same collection, with same bates field name
                //if bates is configures, the file name for the production contain the beginBates number.
                if ((bates != null && bates.Contains(",")))
                {
                    RecalculateCorrectBatesNumbers(docList);
                }
            }

            return(docList);
        }
예제 #10
0
 public VaultsController(VaultRepository repo)
 {
     _repo = repo;
 }
예제 #11
0
 public VaultsController(VaultRepository vaultRepo)
 {
     db = vaultRepo;
 }
예제 #12
0
 public VaultsController(VaultRepository repo, KeepRepository keepsRepo)
 {
     _repo      = repo;
     _keepsRepo = keepsRepo;
 }
예제 #13
0
 public VaultService(VaultRepository vr)
 {
     _vr = vr;
 }
예제 #14
0
 public VaultController(VaultRepository vr)
 {
     _vr = vr;
 }