Example #1
0
        protected override void DoRun(ILfProject project)
        {
            _lfProject     = project;
            _projectRecord = _projectRecordFactory.Create(_lfProject);
            if (_projectRecord == null)
            {
                Logger.Warning("No project named {0}", _lfProject.ProjectCode);
                Logger.Warning("If we are unit testing, this may not be an error");
                return;
            }
            _lfProjectConfig = _projectRecord.Config;
            if (_lfProjectConfig == null)
            {
                return;
            }

            if (project.FieldWorksProject == null)
            {
                Logger.Error("Failed to find the corresponding FieldWorks project!");
                return;
            }
            if (project.FieldWorksProject.IsDisposed)
            {
                Logger.Warning("Project {0} is already disposed; this shouldn't happen", project.ProjectCode);
            }
            _cache = project.FieldWorksProject.Cache;
            if (_cache == null)
            {
                Logger.Error("Failed to find the LCM cache!");
                return;
            }

            _servLoc = _cache.ServiceLocator;
            if (_servLoc == null)
            {
                Logger.Error("Failed to find the service locator; giving up.");
                return;
            }

            var converter = new ConvertMongoToLcmLexicon(Settings, project, Logger, Progress, _connection, _projectRecord, EntryCounts);

            converter.RunConversion();
        }
        protected override void DoRun(ILfProject project)
        {
            // TODO: Some of these checks might be overkill; consider removing some of them
            Logger.Debug("MongoToFdo: starting");
            _lfProject = project;
            _projectRecord = _projectRecordFactory.Create(_lfProject);
            if (_projectRecord == null)
            {
                Logger.Warning("No project named {0}", _lfProject.ProjectCode);
                Logger.Warning("If we are unit testing, this may not be an error");
                return;
            }
            _lfProjectConfig = _projectRecord.Config;
            if (_lfProjectConfig == null)
                return;

            if (project.FieldWorksProject == null)
            {
                Logger.Error("Failed to find the corresponding FieldWorks project!");
                return;
            }
            if (project.FieldWorksProject.IsDisposed)
                Logger.Warning("Project {0} is already disposed; this shouldn't happen", project.ProjectCode);
            _cache = project.FieldWorksProject.Cache;
            if (_cache == null)
            {
                Logger.Error("Failed to find the FDO cache!");
                return;
            }

            _servLoc = _cache.ServiceLocator;
            if (_servLoc == null)
            {
                Logger.Error("Failed to find the service locator; giving up.");
                return;
            }

            var converter = new ConvertMongoToFdoLexicon(Settings, project, Logger, _connection, _projectRecord);
            converter.RunConversion();
        }