Esempio n. 1
0
        /// <summary>
        /// transform the selected package to the JSON profile
        /// </summary>
        private void transform()
        {
            //let the user select a class to be the root class
            MessageBox.Show("Please select the root element");
            var rootObject = this.model.getUserSelectedElement(new List <string> {
                "Class"
            }) as UML.Classes.Kernel.Class;
            var selectedPackage = this.model.selectedElement as UML.Classes.Kernel.Package;

            if (selectedPackage != null)
            {
                //inform user
                EAOutputLogger.clearLog(this.model, outputName);
                EAOutputLogger.log(this.model, outputName
                                   , $"{DateTime.Now.ToLongTimeString()} Starting transform of package '{selectedPackage.name}'"
                                   , ((TSF_EA.ElementWrapper)selectedPackage).id
                                   , LogTypeEnum.log);
                //perform the actual transformation
                EAJSONSchema.transformPackage(selectedPackage, rootObject);
                //inform user
                EAOutputLogger.log(this.model, outputName
                                   , $"{DateTime.Now.ToLongTimeString()} Finished transform of package '{selectedPackage.name}'"
                                   , ((TSF_EA.ElementWrapper)selectedPackage).id
                                   , LogTypeEnum.log);
            }
        }
Esempio n. 2
0
        private void generateJSONSchema(TSF_EA.ElementWrapper element)
        {
            EAOutputLogger.log(this.model, outputName
                               , $"{DateTime.Now.ToLongTimeString()} Generating Schema for element '{element.name}'"
                               , element.id
                               , LogTypeEnum.log);
            var eaJsonSchema = new EAJSONSchema(element);

            //print the schema to the file
            eaJsonSchema.print();
        }