Esempio n. 1
0
 public XmlStruct(EA.Repository rep, EA.Package pkg, string importFile, FileImportSettingsItem settings) : base(
         rep, pkg, importFile)
 {
     _settings = settings;
 }
 /// <summary>
 /// Import of ReqIF DOORS Requirements
 /// </summary>
 /// <param name="rep"></param>
 /// <param name="pkg"></param>
 /// <param name="importFile"></param>
 /// <param name="settings"></param>
 /// <param name="reqIfLog"></param>
 public DoorsReqIf(EA.Repository rep, EA.Package pkg, string importFile, FileImportSettingsItem settings, List <ReqIfLog> reqIfLog) : base(rep, pkg, importFile, settings, reqIfLog)
 {
 }
Esempio n. 3
0
        /// <summary>
        /// Import according to a list element / file. An item contains a file reference.
        /// </summary>
        /// <param name="listNumber"></param>
        /// <param name="item"></param>
        /// <param name="result"></param>
        /// <returns></returns>
        private bool ImportByFile(int listNumber, FileImportSettingsItem item, ref bool result)
        {
            if (item.PackageGuidList.Count == 0)
            {
                return(true);
            }
            string guid = item.PackageGuidList[0].Guid;

            _pkg = _rep.GetPackageByGuid(guid);
            if (_pkg == null)
            {
                MessageBox.Show(
                    $@"Package of import list {listNumber} with GUID='{guid}' not available.
{item.Description}
{item.Name}

Check Import settings in Settings.Json.",
                    @"Package to import into isn't available, break!");
                return(false);
            }


            string eaObjectType = item.ObjectType;
            string eaStereotype = item.Stereotype;
            string eaStatusNew  = String.IsNullOrEmpty(item.StatusNew) || item.StatusNew == "None"
                    ? ""
                    : item.StatusNew;
            string eaStatusChanged = String.IsNullOrEmpty(item.StatusChanged) || item.StatusChanged == "None"
                    ? ""
                    : item.StatusChanged;


            switch (item.ImportType)
            {
            case FileImportSettingsItem.ImportTypes.DoorsCsv:
                var doorsCsv = new DoorsCsv(_rep, _pkg, item.InputFile, item);
                result = result && doorsCsv.ImportForFile(eaObjectType, eaStereotype, eaStatusNew,
                                                          eaStatusChanged);
                //await Task.Run(() =>
                //     doorsCsv.ImportForFile(eaObjectType, eaStereotype, eaStatusNew, eaStatusChanged));
                break;

            case FileImportSettingsItem.ImportTypes.DoorsReqIf:
            case FileImportSettingsItem.ImportTypes.ReqIf:
                var doorsReqIf = new ReqIfs.ReqIfImport(_rep, _pkg, item.InputFile, item, _reqIfLogList);
                result = result && doorsReqIf.ImportForFile(eaObjectType, eaStereotype,
                                                            eaStatusNew);
                _reqIfDeserialized = doorsReqIf.ReqIfDeserialized;
                if (doorsReqIf.CountPackage > 1)
                {
                    return(result);
                }
                //await Task.Run(() =>
                //    doorsReqIf.ImportForFile(eaObjectType, eaStereotype, eaStatusNew, eaStatusChanged));
                break;



            case FileImportSettingsItem.ImportTypes.XmlStruct:
                var xmlStruct = new XmlStruct(_rep, _pkg, item.InputFile, item);
                result = result && xmlStruct.ImportForFile(eaObjectType, eaStereotype, eaStatusNew,
                                                           eaStatusChanged);
                //await Task.Run(() =>
                //    reqIf.ImportForFile(eaObjectType, eaStereotype, eaStatusNew, eaStatusChanged));
                break;
            }
            return(true);
        }