Exemple #1
0
        /// ------------------------------------------------------------------------------------
        public IDictionary <string, IEnumerable <string> > GetParticipantFilesToArchive(Type typeOfArchive)
        {
            Dictionary <string, IEnumerable <string> > d = new Dictionary <string, IEnumerable <string> >();

            foreach (var person in GetAllParticipants().Select(n => _personInformant.GetPersonByNameOrCode(n)).Where(p => p != null))
            {
                var filesInDir = Directory.GetFiles(person.FolderPath);
                d[person.Id] = filesInDir.Where(f => ArchivingHelper.IncludeFileInArchive(f, typeOfArchive, Settings.Default.PersonFileExtension));
            }
            return(d);
        }
Exemple #2
0
        /// ------------------------------------------------------------------------------------
        public IEnumerable <string> GetSessionFilesToArchive(Type typeOfArchive)
        {
            using (ZipFile zip = new ZipFile())
            {
                // RAMP packages must not be compressed or RAMP can't read them.
                zip.CompressionLevel = Ionic.Zlib.CompressionLevel.None;
                zip.AddDirectory(FolderPath);
                zip.Save(Path.Combine(FolderPath, "Sessions.zip"));
            }
            var filesInDir = Directory.GetFiles(FolderPath);

            return(filesInDir.Where(f => ArchivingHelper.IncludeFileInArchive(f, typeOfArchive, Settings.Default.SessionFileExtension)));
        }
Exemple #3
0
        /// ------------------------------------------------------------------------------------
        internal void ArchiveProjectUsingIMDI(Form parentForm)
        {
            Analytics.Track("Archive Project using IMDI");

            ArchivingHelper.ArchiveUsingIMDI(this);
        }
Exemple #4
0
 /// ------------------------------------------------------------------------------------
 public void InitializeModel(IMDIArchivingDlgViewModel model)
 {
     //Set project metadata here.
     model.OverrideDisplayInitialSummary = fileLists => DisplayInitialArchiveSummary(fileLists, model);
     ArchivingHelper.SetIMDIMetadataToArchive(this, model);
 }
Exemple #5
0
        /// ------------------------------------------------------------------------------------
        public void Load()
        {
            // SP-791: Invalid URI: The hostname could not be parsed.
            Uri settingsUri;

            if (!Uri.TryCreate(SettingsFilePath, UriKind.Absolute, out settingsUri))
            {
                var msg = LocalizationManager.GetString("DialogBoxes.LoadProject.InvalidPath", "SayMore is not able to open the project file. \"{0}\" is not a valid path.");
                ErrorReport.ReportNonFatalMessageWithStackTrace(msg, SettingsFilePath);

                // allow the user to select a different project
                var prs = new Process();
                prs.StartInfo.FileName  = Application.ExecutablePath;
                prs.StartInfo.Arguments = "-nl";
                prs.Start();

                Environment.Exit(0);
            }

            var project = XElement.Load(SettingsFilePath);

            var settingValue = GetStringSettingValue(project, "transcriptionFont", null);

            if (!string.IsNullOrEmpty(settingValue))
            {
                TranscriptionFont = FontHelper.MakeFont(settingValue);
                _needToDisposeTranscriptionFont = true;
            }
            settingValue = GetStringSettingValue(project, "freeTranslationFont", null);
            if (!string.IsNullOrEmpty(settingValue))
            {
                FreeTranslationFont = FontHelper.MakeFont(settingValue);
                _needToDisposeFreeTranslationFont = true;
            }
            var autoSegmenterSettings = project.Element("AutoSegmentersettings");

            if (autoSegmenterSettings != null)
            {
                AutoSegmenterMinimumSegmentLengthInMilliseconds = GetIntAttributeValue(autoSegmenterSettings,
                                                                                       "minSegmentLength");
                AutoSegmenterMaximumSegmentLengthInMilliseconds = GetIntAttributeValue(autoSegmenterSettings,
                                                                                       "maxSegmentLength");
                AutoSegmenterPreferrerdPauseLengthInMilliseconds = GetIntAttributeValue(autoSegmenterSettings,
                                                                                        "preferrerdPauseLength");
                AutoSegmenterOptimumLengthClampingFactor = GetDoubleAttributeValue(autoSegmenterSettings,
                                                                                   "optimumLengthClampingFactor");
            }

            Title = GetStringSettingValue(project, "Title", string.Empty);
            FundingProjectTitle       = GetStringSettingValue(project, "FundingProjectTitle", string.Empty);
            ProjectDescription        = GetStringSettingValue(project, "ProjectDescription", string.Empty);
            VernacularISO3CodeAndName = GetStringSettingValue(project, "VernacularISO3CodeAndName", string.Empty);
            AnalysisISO3CodeAndName   = GetStringSettingValue(project, "AnalysisISO3CodeAndName", ArchivingHelper.AnalysisLanguage());
            Location               = GetStringSettingValue(project, "Location", string.Empty);
            Region                 = GetStringSettingValue(project, "Region", string.Empty);
            Country                = GetStringSettingValue(project, "Country", "Unspecified");
            Continent              = GetStringSettingValue(project, "Continent", "Unspecified");
            ContactPerson          = GetStringSettingValue(project, "ContactPerson", string.Empty);
            AccessProtocol         = GetStringSettingValue(project, "AccessProtocol", string.Empty);
            _accessProtocolChanged = false;

            DateAvailable = GetStringSettingValue(project, "DateAvailable", string.Empty);
            RightsHolder  = GetStringSettingValue(project, "RightsHolder", string.Empty);
            Depositor     = GetStringSettingValue(project, "Depositor", string.Empty);

            IMDIOutputDirectory = GetStringSettingValue(project, "IMDIOutputDirectory", string.Empty);
        }
Exemple #6
0
        /// ------------------------------------------------------------------------------------
        public IEnumerable <string> GetSessionFilesToArchive(Type typeOfArchive)
        {
            var filesInDir = Directory.GetFiles(FolderPath);

            return(filesInDir.Where(f => ArchivingHelper.IncludeFileInArchive(f, typeOfArchive, Settings.Default.SessionFileExtension)));
        }
Exemple #7
0
        /// ------------------------------------------------------------------------------------
        public void ArchiveUsingIMDI()
        {
            Analytics.Track("Archive Session using IMDI");

            ArchivingHelper.ArchiveUsingIMDI(this);
        }