<commit_before>using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows.Input;
using System.Xml;
using Arkivverket.Arkade.Core;
using Arkivverket.Arkade.UI.Models;
using Arkivverket.Arkade.UI.Util;
using Arkivverket.Arkade.Util;
using Prism.Commands;
using Prism.Mvvm;
using Prism.Regions;
using Serilog;
using System.Windows.Controls;

namespace Arkivverket.Arkade.UI.ViewModels
{
    public class CreatePackageViewModel : BindableBase, INavigationAware
    {
        private readonly ArkadeApi _arkadeApi;
        private static readonly ILogger Log = Serilog.Log.ForContext(MethodBase.GetCurrentMethod().DeclaringType);
        private bool _isRunningCreatePackage;
        private bool _selectedPackageTypeAip;
        private bool _selectedPackageTypeSip = true;
        private string _statusMessageText;
        private string _statusMessagePath;
        private TestSession _testSession;
        private readonly IRegionManager _regionManager;

        private readonly PopulateMetadataDataModels _populateMetadataDataModels = new PopulateMetadataDataModels();

        private GuiMetaDataModel _metaDataArchiveDescription = new GuiMetaDataModel(string.Empty, string.Empty);
        private ObservableCollection<GuiMetaDataModel> _metaDataArchiveCreators = new ObservableCollectionEx<GuiMetaDataModel>();
        private GuiMetaDataModel _metaDataTransferer = new GuiMetaDataModel(string.Empty, string.Empty, string.Empty, string.Empty);
        private GuiMetaDataModel _metaDataProducer = new GuiMetaDataModel(string.Empty, string.Empty, string.Empty, string.Empty);
        private ObservableCollection<GuiMetaDataModel> _metaDataOwners = new ObservableCollectionEx<GuiMetaDataModel>();
        private GuiMetaDataModel _metaDataRecipient = new GuiMetaDataModel(string.Empty, string.Empty, string.Empty, string.Empty);
        private GuiMetaDataModel _metaDataSystem = new GuiMetaDataModel(string.Empty, string.Empty, string.Empty, string.Empty, GuiObjectType.system);
        private GuiMetaDataModel _metaDataArchiveSystem = new GuiMetaDataModel(string.Empty, string.Empty, string.Empty, string.Empty, GuiObjectType.system);
        private ObservableCollection<GuiMetaDataModel> _metaDataComments = new ObservableCollection<GuiMetaDataModel>();
        private GuiMetaDataModel _metaDataHistory = new GuiMetaDataModel(string.Empty, GuiObjectType.history);
        private GuiMetaDataModel _metaDataNoarkSection = new GuiMetaDataModel(DateTime.Today, DateTime.Today, string.Empty, string.Empty);
        private GuiMetaDataModel _metaDataExtractionDate = new GuiMetaDataModel(DateTime.Today);

        private ObservableCollection<GuiMetaDataModel> _metadataPreregistreredUsers = new ObservableCollection<GuiMetaDataModel>();


        private GuiMetaDataModel _selectedCreatorDataModel;
        private GuiMetaDataModel _selectedTransfererDataModel;
        private GuiMetaDataModel _selectedProducerDataModel;
        private GuiMetaDataModel _selectedOwnerDataModel;
        private GuiMetaDataModel _selectedArchiveSystemDataModel;



        private readonly List<MetadataEntityInformationUnit> _metaDataEntityInformationUnits = new List<MetadataEntityInformationUnit>();

        public DelegateCommand CreatePackageCommand { get; set; }
        public DelegateCommand NewProgramSessionCommand { get; set; }
        public DelegateCommand AddMetadataAchiveCreatorEntry { get; set; }
        public DelegateCommand AddMetadataAchiveOwnerEntry { get; set; }
        public DelegateCommand AddMetadataCommentEntry { get; set; }

        //---------------------------------------------------------------------------


        public bool SelectedPackageTypeSip
        {
            get { return _selectedPackageTypeSip; }
            set
            {
                SetProperty(ref _selectedPackageTypeSip, value);
                CreatePackageCommand.RaiseCanExecuteChanged();
            }
        }

        public bool SelectedPackageTypeAip
        {
            get { return _selectedPackageTypeAip; }
            set
            {
                SetProperty(ref _selectedPackageTypeAip, value);
                CreatePackageCommand.RaiseCanExecuteChanged();
            }
        }


        public GuiMetaDataModel MetaDataModelArchiveDescription
        {
            get { return _metaDataArchiveDescription; }
            set { SetProperty(ref _metaDataArchiveDescription, value); }
        }


        public ObservableCollection<GuiMetaDataModel> MetaDataArchiveCreators
        {
            get {return _metaDataArchiveCreators; }
            set {SetProperty(ref _metaDataArchiveCreators, value); }
        }



        public GuiMetaDataModel MetaDataTransferer
        {
            get { return _metaDataTransferer; }
            set { SetProperty(ref _metaDataTransferer, value); }
        }

        public GuiMetaDataModel MetaDataProducer
        {
            get { return _metaDataProducer; }
            set { SetProperty(ref _metaDataProducer, value); }
        }

        public ObservableCollection<GuiMetaDataModel> MetaDataOwners
        {
            get { return _metaDataOwners; }
            set { SetProperty(ref _metaDataOwners, value); }
        }

        public GuiMetaDataModel MetaDataRecipient
        {
            get { return _metaDataRecipient; }
            set { SetProperty(ref _metaDataRecipient, value); }
        }
        public GuiMetaDataModel MetaDataSystem
        {
            get { return _metaDataSystem; }
            set { SetProperty(ref _metaDataSystem, value); }
        }

        public GuiMetaDataModel MetaDataArchiveSystem
        {
            get { return _metaDataArchiveSystem; }
            set { SetProperty(ref _metaDataArchiveSystem, value); }
        }

        public ObservableCollection<GuiMetaDataModel> MetaDataComments
        {
            get { return _metaDataComments; }
            set { SetProperty(ref _metaDataComments, value); }
        }

        public GuiMetaDataModel MetaDataHistory
        {
            get { return _metaDataHistory; }
            set { SetProperty(ref _metaDataHistory, value); }
        }

        public GuiMetaDataModel MetaDataNoarkSection
        {
            get { return _metaDataNoarkSection; }
            set { SetProperty(ref _metaDataNoarkSection, value); }
        }

        public GuiMetaDataModel MetaDataExtractionDate
        {
            get { return _metaDataExtractionDate; }
            set { SetProperty(ref _metaDataExtractionDate, value); }
        }

        public ObservableCollection<GuiMetaDataModel> MetaDataPreregistreredUsers
        {
            get { return _metadataPreregistreredUsers; }
            set { SetProperty(ref _metadataPreregistreredUsers, value); }
        }


        //---------------------------------------------------------------------------


        public GuiMetaDataModel SelectedTransfererDataModel
        {
            get { return _selectedTransfererDataModel; }
            set
            {
                SetProperty(ref _selectedTransfererDataModel, value);
                MetaDataTransferer.Entity = SelectedTransfererDataModel.Entity;<commit_msg>Added list for valid archivetypes<commit_after>using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows.Input;
using System.Xml;
using Arkivverket.Arkade.Core;
using Arkivverket.Arkade.UI.Models;
using Arkivverket.Arkade.UI.Util;
using Arkivverket.Arkade.Util;
using Prism.Commands;
using Prism.Mvvm;
using Prism.Regions;
using Serilog;
using System.Windows.Controls;

namespace Arkivverket.Arkade.UI.ViewModels
{
    public class CreatePackageViewModel : BindableBase, INavigationAware
    {
        private readonly ArkadeApi _arkadeApi;
        private static readonly ILogger Log = Serilog.Log.ForContext(MethodBase.GetCurrentMethod().DeclaringType);
        private bool _isRunningCreatePackage;
        private bool _selectedPackageTypeAip;
        private bool _selectedPackageTypeSip = true;
        private string _statusMessageText;
        private string _statusMessagePath;
        private TestSession _testSession;
        private readonly IRegionManager _regionManager;

        private readonly PopulateMetadataDataModels _populateMetadataDataModels = new PopulateMetadataDataModels();

        private GuiMetaDataModel _metaDataArchiveDescription = new GuiMetaDataModel(string.Empty, string.Empty);
        private ObservableCollection<GuiMetaDataModel> _metaDataArchiveCreators = new ObservableCollectionEx<GuiMetaDataModel>();
        private GuiMetaDataModel _metaDataTransferer = new GuiMetaDataModel(string.Empty, string.Empty, string.Empty, string.Empty);
        private GuiMetaDataModel _metaDataProducer = new GuiMetaDataModel(string.Empty, string.Empty, string.Empty, string.Empty);
        private ObservableCollection<GuiMetaDataModel> _metaDataOwners = new ObservableCollectionEx<GuiMetaDataModel>();
        private GuiMetaDataModel _metaDataRecipient = new GuiMetaDataModel(string.Empty, string.Empty, string.Empty, string.Empty);
        private GuiMetaDataModel _metaDataSystem = new GuiMetaDataModel(string.Empty, string.Empty, string.Empty, string.Empty, GuiObjectType.system);
        private GuiMetaDataModel _metaDataArchiveSystem = new GuiMetaDataModel(string.Empty, string.Empty, string.Empty, string.Empty, GuiObjectType.system);
        private ObservableCollection<GuiMetaDataModel> _metaDataComments = new ObservableCollection<GuiMetaDataModel>();
        private GuiMetaDataModel _metaDataHistory = new GuiMetaDataModel(string.Empty, GuiObjectType.history);
        private GuiMetaDataModel _metaDataNoarkSection = new GuiMetaDataModel(DateTime.Today, DateTime.Today, string.Empty, string.Empty);
        private GuiMetaDataModel _metaDataExtractionDate = new GuiMetaDataModel(DateTime.Today);


        private ObservableCollection<GuiMetaDataModel> _metadataPreregistreredUsers = new ObservableCollection<GuiMetaDataModel>();
        private IList<String> _systemTypeList  = new List<string>()
        {
            "Noark3", "Noark4", "Noark5", "Fagsystem"
        }; 


        private GuiMetaDataModel _selectedCreatorDataModel;
        private GuiMetaDataModel _selectedTransfererDataModel;
        private GuiMetaDataModel _selectedProducerDataModel;
        private GuiMetaDataModel _selectedOwnerDataModel;
        private GuiMetaDataModel _selectedArchiveSystemDataModel;



        private readonly List<MetadataEntityInformationUnit> _metaDataEntityInformationUnits = new List<MetadataEntityInformationUnit>();

        public DelegateCommand CreatePackageCommand { get; set; }
        public DelegateCommand NewProgramSessionCommand { get; set; }
        public DelegateCommand AddMetadataAchiveCreatorEntry { get; set; }
        public DelegateCommand AddMetadataAchiveOwnerEntry { get; set; }
        public DelegateCommand AddMetadataCommentEntry { get; set; }

        //---------------------------------------------------------------------------


        public bool SelectedPackageTypeSip
        {
            get { return _selectedPackageTypeSip; }
            set
            {
                SetProperty(ref _selectedPackageTypeSip, value);
                CreatePackageCommand.RaiseCanExecuteChanged();
            }
        }

        public bool SelectedPackageTypeAip
        {
            get { return _selectedPackageTypeAip; }
            set
            {
                SetProperty(ref _selectedPackageTypeAip, value);
                CreatePackageCommand.RaiseCanExecuteChanged();
            }
        }


        public GuiMetaDataModel MetaDataModelArchiveDescription
        {
            get { return _metaDataArchiveDescription; }
            set { SetProperty(ref _metaDataArchiveDescription, value); }
        }


        public ObservableCollection<GuiMetaDataModel> MetaDataArchiveCreators
        {
            get {return _metaDataArchiveCreators; }
            set {SetProperty(ref _metaDataArchiveCreators, value); }
        }



        public GuiMetaDataModel MetaDataTransferer
        {
            get { return _metaDataTransferer; }
            set { SetProperty(ref _metaDataTransferer, value); }
        }

        public GuiMetaDataModel MetaDataProducer
        {
            get { return _metaDataProducer; }
            set { SetProperty(ref _metaDataProducer, value); }
        }

        public ObservableCollection<GuiMetaDataModel> MetaDataOwners
        {
            get { return _metaDataOwners; }
            set { SetProperty(ref _metaDataOwners, value); }
        }

        public GuiMetaDataModel MetaDataRecipient
        {
            get { return _metaDataRecipient; }
            set { SetProperty(ref _metaDataRecipient, value); }
        }
        public GuiMetaDataModel MetaDataSystem
        {
            get { return _metaDataSystem; }
            set { SetProperty(ref _metaDataSystem, value); }
        }

        public GuiMetaDataModel MetaDataArchiveSystem
        {
            get { return _metaDataArchiveSystem; }
            set { SetProperty(ref _metaDataArchiveSystem, value); }
        }

        public ObservableCollection<GuiMetaDataModel> MetaDataComments
        {
            get { return _metaDataComments; }
            set { SetProperty(ref _metaDataComments, value); }
        }

        public GuiMetaDataModel MetaDataHistory
        {
            get { return _metaDataHistory; }
            set { SetProperty(ref _metaDataHistory, value); }
        }

        public GuiMetaDataModel MetaDataNoarkSection
        {
            get { return _metaDataNoarkSection; }
            set { SetProperty(ref _metaDataNoarkSection, value); }
        }

        public GuiMetaDataModel MetaDataExtractionDate
        {
            get { return _metaDataExtractionDate; }
            set { SetProperty(ref _metaDataExtractionDate, value); }
        }

        public ObservableCollection<GuiMetaDataModel> MetaDataPreregistreredUsers
        {
            get { return _metadataPreregistreredUsers; }
            set { SetProperty(ref _metadataPreregistreredUsers, value); }
        }


        public IList<String> SystemTypeList
        {
            get { return _systemTypeList; }
            set { SetProperty(ref _systemTypeList, value); }
        }


        //---------------------------------------------------------------------------


        public GuiMetaDataModel SelectedTransfererDataModel
        {
            get { return _selectedTransfererDataModel; }
            set
            {
                SetProperty(ref _selectedTransfererDataModel, value);
                MetaDataTransferer.Entity = SelectedTransfererDataModel.Entity;
{'fraction_non_alphanumeric': 0.07979219395231117, 'fraction_numerical': 0.00019981350739309978, 'mean_word_length': 2.68737721021611, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6719361', 'n_tokens_mistral': 3755, 'n_tokens_neox': 3718, 'n_words': 784}