/// <summary> /// Converts the search result document to FilteredDocumentBusinessEntity. /// </summary> private static FilteredDocumentBusinessEntity ConvertToFilteredDocumentBusinessEntity(ResultDocument resultDocument) { var filteredDocument = new FilteredDocumentBusinessEntity { Id = resultDocument.DocumentId.DocumentId, MatterId = resultDocument.DocumentId.MatterId, CollectionId = resultDocument.DocumentId.CollectionId, IsLocked = resultDocument.IsLocked, FamilyId = resultDocument.DocumentId.FamilyId }; if (resultDocument.FieldValues == null || !resultDocument.FieldValues.Any()) { return(filteredDocument); } foreach (var fieldResult in resultDocument.FieldValues.Select(ConvertDocumentFieldToFieldResult)) { filteredDocument.OutPutFields.Add(fieldResult); if (fieldResult.DataTypeId == 3000) { filteredDocument.DCN = fieldResult.Value; } } return(filteredDocument); }
/// <summary> /// Converts the search result document to FilteredDocumentBusinessEntity. /// </summary> private static FilteredDocumentBusinessEntity ConvertToFilteredDocumentBusinessEntity(ResultDocument resultDocument) { var filteredDocument = new FilteredDocumentBusinessEntity { Id = resultDocument.DocumentId.DocumentId, MatterId = resultDocument.DocumentId.MatterId, CollectionId = resultDocument.DocumentId.CollectionId, IsLocked = resultDocument.IsLocked, FamilyId = resultDocument.DocumentId.FamilyId }; if (resultDocument.FieldValues == null || !resultDocument.FieldValues.Any()) return filteredDocument; foreach (var fieldResult in resultDocument.FieldValues.Select(ConvertDocumentFieldToFieldResult)) { filteredDocument.OutPutFields.Add(fieldResult); if (fieldResult.DataTypeId == 3000) filteredDocument.DCN = fieldResult.Value; } return filteredDocument; }
private void FillExcludedDoucuments(FilteredDocumentBusinessEntity document, ref List<ProductionDocumentDetail> documents) { using (new EVTransactionScope(TransactionScopeOption.Suppress)) { //Fill production document detail for excluded documents var productionExcludeDocument = new ProductionDocumentDetail { MatterId = _mProductionDocumentDetail.MatterId, CreatedBy = _mProductionDocumentDetail.CreatedBy, DocumentSelectionContext = _mProductionDocumentDetail.DocumentSelectionContext, DatasetCollectionId = _mProductionDocumentDetail.DatasetCollectionId, OriginalCollectionId = _mProductionDocumentDetail.OriginalCollectionId, DocumentExclusionContext = _mProductionDocumentDetail.DocumentExclusionContext, ProductionCollectionId = _mProductionDocumentDetail.ProductionCollectionId, Profile = _mProductionDocumentDetail.Profile }; productionExcludeDocument.Profile.DatasetId = _mProductionDocumentDetail.Profile.DatasetId; productionExcludeDocument.ArchivePath = _mProductionDocumentDetail.ArchivePath; CreateVolume(); productionExcludeDocument.ExtractionLocation = Path.Combine(_mProductionDocumentDetail.ExtractionLocation, _volumeFolderName); productionExcludeDocument.IsVolumeContainExistingDocuments = _volumeContainExistingDocuments; productionExcludeDocument.OriginalDatasetId = _mProductionDocumentDetail.OriginalDatasetId; productionExcludeDocument.OriginalDatasetName = _mProductionDocumentDetail.OriginalDatasetName; productionExcludeDocument.GetText = _mProductionDocumentDetail.GetText; productionExcludeDocument.lstProductionFields = _mProductionDocumentDetail.lstProductionFields; productionExcludeDocument.dataSetBeo = _mProductionDocumentDetail.dataSetBeo; productionExcludeDocument.lstDsFieldsBeo = _mProductionDocumentDetail.lstDsFieldsBeo; productionExcludeDocument.matterBeo = _mProductionDocumentDetail.matterBeo; productionExcludeDocument.SearchServerDetails = _mProductionDocumentDetail.SearchServerDetails; productionExcludeDocument.NearNativeConversionPriority = _mProductionDocumentDetail.NearNativeConversionPriority; productionExcludeDocument.lstProductionFieldValues.AddRange(document.OutPutFields); _taskId += 1; productionExcludeDocument.CorrelationId = _taskId; //If a document is excluded & placeholder page is also not requested then the document is not added as a handler document //Also None of the numbers will be generated for the same if (!productionExcludeDocument.Profile.IsInsertPlaceHolderPage) { return; } SetBatesConfiguration(1, productionExcludeDocument); // We must increment the bates running number so that we get the correct bates field values... _batesRunningNumber++; productionExcludeDocument.DocumentId = document.Id; string originalDocRefId = document.Id; productionExcludeDocument.OriginalDocumentReferenceId = originalDocRefId; productionExcludeDocument.NumberOfPages = 1; productionExcludeDocument.IsDocumentExcluded = true; //Add DPN productionExcludeDocument.DocumentProductionNumber = _dpnPrefix + (productionExcludeDocument.Profile.DpnStartingNumber == null ? string.Empty : GetStartingNumber(_dpnRunningNumber, productionExcludeDocument.Profile.DpnStartingNumber)); _dpnRunningNumber++; productionExcludeDocument.DCNNumber = document.DCN; documents.Add(productionExcludeDocument); } }
/// <summary> /// Converts the specified source collection. /// </summary> /// <param name="filteredDocument"> </param> /// <param name="processStatus"> </param> /// <param name="reasonId"> </param> /// <returns></returns> private DocumentConversionLogBeo ConvertToDocumentConversionLogBeo(FilteredDocumentBusinessEntity filteredDocument, int processStatus = EVRedactItErrorCodes.Submitted, short reasonId = EVRedactItErrorCodes.Na) { return new DocumentConversionLogBeo { DocumentId = filteredDocument.Id, CollectionId = _mProductionDocumentDetail.OriginalCollectionId, JobRunId = WorkAssignment.JobId, DCN = filteredDocument.DCN, CrossReferenceId = "N/A", ProcessJobId = WorkAssignment.JobId, Status = (byte)processStatus, ReasonId = reasonId, ModifiedDate = DateTime.UtcNow, CreatedDate = DateTime.UtcNow }; }
/// <summary> /// Gets the number of pages in document. /// </summary> /// <param name="productionSelectedDocument">The production selected document.</param> /// <param name="originalDocRefId">The original document reference identifier.</param> /// <param name="document">The document.</param> /// <returns></returns> private int GetNumberOfPagesInDocument(ProductionDocumentDetail productionSelectedDocument, string originalDocRefId, FilteredDocumentBusinessEntity document) { var numberOfPagesInDoc = 0; var getDocumentSetType = DocumentBO.GetDocumentSetType(productionSelectedDocument.OriginalCollectionId); getDocumentSetType.ShouldNotBe(null); FieldResult fieldResults; switch (getDocumentSetType.DocumentSetTypeId) { case ImageSetTypeId: fieldResults = document.OutPutFields.FirstOrDefault(f => f.Name == EVSystemFields.PagesImages); if (fieldResults != null && !string.IsNullOrEmpty(fieldResults.Value)) numberOfPagesInDoc = Convert.ToInt32(fieldResults.Value); break; case NativeSetTypeId: fieldResults = document.OutPutFields.FirstOrDefault(f => f.Name == EVSystemFields.PagesNatives); if (fieldResults != null && !string.IsNullOrEmpty(fieldResults.Value)) numberOfPagesInDoc = Convert.ToInt32(fieldResults.Value); break; default: numberOfPagesInDoc = CountPagesInDocument(productionSelectedDocument.MatterId, productionSelectedDocument.OriginalCollectionId, originalDocRefId); break; } return numberOfPagesInDoc; }
private static FilteredDocumentBusinessEntity ConstructFilteredDocument(DocumentResult documentResult) { var filteredDocument = new FilteredDocumentBusinessEntity { Id = documentResult.DocumentID, MatterId = documentResult.MatterID.ToString(CultureInfo.InvariantCulture), CollectionId = documentResult.CollectionID, IsLocked = documentResult.IsLocked, ReviewsetId = documentResult.ReviewsetID, DCN = documentResult.DocumentControlNumber, FamilyId = documentResult.FamilyID }; filteredDocument.OutPutFields.AddRange(documentResult.Fields); return filteredDocument; }