Exemplo n.º 1
0
        /// <summary>
        /// Begins the work.
        /// </summary>
        protected override void BeginWork()
        {
            base.BeginWork();

            try
            {
                m_Parameters = DocumentImportHelper.GetProfileBeo((string)BootParameters);

                m_CounterForCorrelationId = 0;

                InitializeConfigurationItems();

                //?? need to percentage completion
                m_PercenatgeCompletion = 100;

                m_Documents = new List <RVWDocumentBEO>();

                #region Get Dataset Details
                if (m_Parameters != null && m_Parameters.DatasetDetails.FolderID > 0)
                {
                    m_FileProcessor = FileProcessorFactory.CreateFileProcessor(
                        FileProcessorFactory.ExtractionChoices.CompoundFileExtraction);
                    m_Dataset = DataSetBO.GetDataSetDetailForDataSetId(m_Parameters.DatasetDetails.FolderID);

                    if (m_Dataset.Matter != null && m_Dataset.Matter.FolderID > 0)
                    {
                        var matterDetails = MatterDAO.GetMatterDetails(m_Dataset.Matter.FolderID.ToString());
                        if (matterDetails != null)
                        {
                            m_Dataset.Matter = matterDetails;
                            var searchServerDetails = ServerDAO.GetSearchServer(matterDetails.SearchServer.Id);
                            if (searchServerDetails != null)
                            {
                                m_Dataset.Matter.SearchServer = searchServerDetails;
                            }
                        }
                    }
                    else
                    {
                        throw new EVException().AddErrorCode(ErrorCodes.EDLoaderExtractionWorker_FailedToObtainMatterDetails); //?? need to set message in resource file
                    }
                }
                else
                {
                    throw new EVException().AddErrorCode(ErrorCodes.EDLoaderExtractionWorker_ObtainDatasetDetailsFailure); //?? need to set message in resource file
                }
                #endregion
            }
            catch (Exception ex)
            {
                ex.Trace().Swallow();
            }
        }
        private static DcbOpticonJobBEO PopulateImportRequest(ProfileBEO profiledata)
        {
            var request = new DcbOpticonJobBEO();

            request.JobTypeName   = profiledata.ImportTypeName;
            request.JobName       = profiledata.ImportJobName;
            request.SysDocId      = profiledata.SysDocID;
            request.SysImportType = profiledata.SysImportTypeID;
            // Default settings
            request.StatusBrokerType          = BrokerType.Database;
            request.CommitIntervalBrokerType  = BrokerType.ConfigFile;
            request.CommitIntervalSettingType = SettingType.CommonSetting;
            //MatterName
            request.MatterName = profiledata.DatasetDetails.Matter.FolderName;
            //Source Path
            request.DcbSourcePath = profiledata.Locations[0];

            //For log.
            // TODO
            //JobLogInfo.AddParameters(Constants.SourcePath, profiledata.Locations[0].ToString());

            //Target DatasetId
            request.TargetDatasetId = profiledata.DatasetDetails.CollectionId;

            //DatasetFolderId
            request.DatasetFolderId = profiledata.DatasetDetails.FolderID;
            //fieldMappinga
            request.FieldMappings = profiledata.FieldMapping;
            //ContentFieldMappings
            request.ContentFields     = profiledata.ContentFields;
            request.MatterId          = profiledata.DatasetDetails.Matter.FolderID;
            request.IncludeTags       = profiledata.IncludeAssociatedTags;
            request.IncludeNotes      = profiledata.IncludeNotes;
            request.DcbCredentialList = profiledata.DcbUNPWs;
            request.NativeFilePath    = profiledata.NativeFilePathField;

            request.ImageSetName = profiledata.ImageSetName;
            request.ImportImages = profiledata.IsImportImages;
            request.NewImageset  = profiledata.IsNewImageSet;
            request.JobName      = profiledata.ImportJobName;

            //Populate Family Info
            request.IsImportFamilies = profiledata.IsImportFamilyRelations;
            request.FamilyRelations  = profiledata.FamilyRelations;

            return(request);
        }
        protected override void BeginWork()
        {
            base.BeginWork();

            try
            {
                var strFileParserBatchSize = ApplicationConfigurationManager.GetValue("FileParserBatchSize", "Imports",
                                                                                      false);
                if (!String.IsNullOrEmpty(strFileParserBatchSize))
                {
                    fileParserBatchSize = int.Parse(strFileParserBatchSize);
                }

                fileIoHelper = new FileIOHelper();

                // function that's called when a batch of documents are available.
                fileIoHelper.BatchOfDocumentsAvailable += Send;

                profileBEO = DocumentImportHelper.GetProfileBeo(BootParameters);

                #region Check for minimum required information.

                // Check if minimum required information, dataset details and matter details available.
                if (profileBEO.DatasetDetails == null)
                {
                    throw new EVException().AddResMsg(
                              ErrorCodes.EDLoaderFileParserWorker_DatasetOrMatterDetailsUnavailable);
                }
                if (profileBEO.DatasetDetails.Matter == null)
                {
                    throw new EVException().AddResMsg(
                              ErrorCodes.EDLoaderFileParserWorker_DatasetOrMatterDetailsUnavailable);
                }

                #endregion Check for minimum required information

                //TODO: Search Engine Replacement - Search Sub System - Create Seed Directory, if required
            }
            catch (Exception ex)
            {
                LogMessage(false, "Failed on initialize values. " + ex.ToUserString());
                ReportToDirector(ex);
                throw;
            }
        }
Exemplo n.º 4
0
        private DcbOpticonJobBEO PopulateImportRequest(ProfileBEO profiledata)
        {
            DcbOpticonJobBEO request = new DcbOpticonJobBEO();

            request.JobTypeName = profiledata.ImportTypeName;
            request.JobName = profiledata.ImportJobName;
            request.SysDocId = profiledata.SysDocID;
            request.SysImportType = profiledata.SysImportTypeID;
            // Default settings
            request.StatusBrokerType = BrokerType.Database;
            request.CommitIntervalBrokerType = BrokerType.ConfigFile;
            request.CommitIntervalSettingType = SettingType.CommonSetting;
            //MatterName
            request.MatterName = profiledata.DatasetDetails.Matter.FolderName;
            //Source Path
            request.DcbSourcePath = profiledata.Locations[0].ToString(CultureInfo.InvariantCulture);

            //Target DatasetId
            request.TargetDatasetId = profiledata.DatasetDetails.CollectionId;

            //DatasetFolderId
            request.DatasetFolderId = profiledata.DatasetDetails.FolderID;
            //fieldMappinga
            request.FieldMappings = profiledata.FieldMapping;
            //ContentFieldMappings
            request.ContentFields = profiledata.ContentFields;
            request.MatterId = profiledata.DatasetDetails.Matter.FolderID;
            request.IncludeTags = profiledata.IncludeAssociatedTags;
            request.IncludeNotes = profiledata.IncludeNotes;
            request.DcbCredentialList = profiledata.DcbUNPWs;
            request.NativeFilePath = profiledata.NativeFilePathField;

            request.ImageSetName = profiledata.ImageSetName;
            request.ImportImages = profiledata.IsImportImages;
            request.NewImageset = profiledata.IsNewImageSet;
            request.JobName = profiledata.ImportJobName;

            _dataset = DataSetBO.GetDataSetDetailForDataSetId(request.DatasetFolderId);

            //Populate Family Info
            request.IsImportFamilies = profiledata.IsImportFamilyRelations;
            request.FamilyRelations = profiledata.FamilyRelations;

            return request;
        }
        protected override void BeginWork()
        {
            base.BeginWork();

            _bootParameters = Utils.SmartXmlDeserializer(BootParameters) as ProfileBEO;

            _createdBy = string.Empty;
            if (_bootParameters.CreatedBy != null)
            {
                _createdBy = _bootParameters.CreatedBy;
            }
            _modifiedBy = string.Empty;
            if (_bootParameters.ModifiedBy != null)
            {
                _modifiedBy = _bootParameters.ModifiedBy;
            }

            _session = EstablishSession(_createdBy);
        }
        protected override void BeginWork()
        {
            base.BeginWork();

            _bootParameters = Utils.SmartXmlDeserializer(BootParameters) as ProfileBEO;

            _createdBy = string.Empty;
            if (_bootParameters.CreatedBy != null)
            {
                _createdBy = _bootParameters.CreatedBy;
            }
            _modifiedBy = string.Empty;
            if (_bootParameters.ModifiedBy != null)
            {
                _modifiedBy = _bootParameters.ModifiedBy;
            }

            _session = EstablishSession(_createdBy);
        }
        protected override void BeginWork()
        {
            base.BeginWork();

            try
            {
                var strFileParserBatchSize = ApplicationConfigurationManager.GetValue("FileParserBatchSize", "Imports",
                    false);
                if (!String.IsNullOrEmpty(strFileParserBatchSize))
                {
                    fileParserBatchSize = int.Parse(strFileParserBatchSize);
                }

                fileIoHelper = new FileIOHelper();

                // function that's called when a batch of documents are available.
                fileIoHelper.BatchOfDocumentsAvailable += Send;

                profileBEO = DocumentImportHelper.GetProfileBeo(BootParameters);

                #region Check for minimum required information.

                // Check if minimum required information, dataset details and matter details available.
                if (profileBEO.DatasetDetails == null)
                    throw new EVException().AddResMsg(
                        ErrorCodes.EDLoaderFileParserWorker_DatasetOrMatterDetailsUnavailable);
                if (profileBEO.DatasetDetails.Matter == null)
                    throw new EVException().AddResMsg(
                        ErrorCodes.EDLoaderFileParserWorker_DatasetOrMatterDetailsUnavailable);

                #endregion Check for minimum required information

                //TODO: Search Engine Replacement - Search Sub System - Create Seed Directory, if required
            }
            catch (Exception ex)
            {
                LogMessage(false, "Failed on initialize values. " + ex.ToUserString());
                ReportToDirector(ex);
                throw;
            }
        }
        /// <summary>
        /// Begins the work.
        /// </summary>
        protected override void BeginWork()
        {
            base.BeginWork();

            try
            {
                m_Parameters = DocumentImportHelper.GetProfileBeo((string)BootParameters);

                m_CounterForCorrelationId = 0;

                InitializeConfigurationItems();

                //?? need to percentage completion
                m_PercenatgeCompletion = 100;

                m_Documents = new List<RVWDocumentBEO>();

                #region Get Dataset Details
                if (m_Parameters != null && m_Parameters.DatasetDetails.FolderID > 0)
                {
                    m_FileProcessor = FileProcessorFactory.CreateFileProcessor(
                                             FileProcessorFactory.ExtractionChoices.CompoundFileExtraction);
                    m_Dataset = DataSetBO.GetDataSetDetailForDataSetId(m_Parameters.DatasetDetails.FolderID);

                    if (m_Dataset.Matter != null && m_Dataset.Matter.FolderID > 0)
                    {
                        var matterDetails = MatterDAO.GetMatterDetails(m_Dataset.Matter.FolderID.ToString());
                        if (matterDetails != null)
                        {
                            m_Dataset.Matter = matterDetails;
                            var searchServerDetails = ServerDAO.GetSearchServer(matterDetails.SearchServer.Id);
                            if (searchServerDetails != null)
                            {
                                m_Dataset.Matter.SearchServer = searchServerDetails;
                            }
                        }
                    }
                    else
                        throw new EVException().AddErrorCode(ErrorCodes.EDLoaderExtractionWorker_FailedToObtainMatterDetails); //?? need to set message in resource file
                }
                else
                {
                    throw new EVException().AddErrorCode(ErrorCodes.EDLoaderExtractionWorker_ObtainDatasetDetailsFailure); //?? need to set message in resource file
                }
                #endregion
            }
            catch (Exception ex)
            {
                ex.Trace().Swallow();
            }
        }