예제 #1
0
 public CeusDLGenerator(CoreImport model)
 {
     this.model = new CoreModel(model);
 }
예제 #2
0
 public MainPageViewModel(INavigationService navigationService, CoreModel coreModel) : base(navigationService)
 {
     Command = new ReactiveCommand <string>().WithSubscribe(async x => await navigationService.NavigateAsync(x));
     Switch  = new ReactiveProperty <bool>();
     Switch.Subscribe(_ => coreModel.VisualSet(Switch.Value));
 }
        private static bool HasJustOneFinestTimeUnit(CoreModel m)
        {
            var count = m.Interfaces.Where(i => i.IsFinestTime).Count();

            return(count == 0 || count == 1);
        }
예제 #4
0
 public string GenerateFactAttribute(CoreBaseAttribute attr, CoreInterface ifa, CoreModel model)
 {
     return(GenerateBaseAttribute("fact", attr, ifa, model));
 }
예제 #5
0
        public void populateEnvironment(Environment environment, CoreModel model)
        {
            const bool isFirstLevel = true;

            addAllClassifiersFromInnerPackages(isFirstLevel, model, environment);
        }
예제 #6
0
 public CreateILGenerator(CoreModel model)
 {
     this.model = new ILModel(model);
 }
예제 #7
0
 public CreateDefDataGenerator(CoreModel model)
 {
     this.model = new BLModel(model);
 }
예제 #8
0
 public CopyStarALGenerator(CoreModel model)
 {
     this.model = new StarALModel(model);
 }
 public MainPageViewModel(INavigationService navigationService, CoreModel coreModel)
     : base(navigationService)
 {
     Command = new ReactiveCommand <object>().WithSubscribe(x => coreModel.DbSave());
 }
예제 #10
0
 public SinglePageViewModel(INavigationService navigationService, CoreModel coreModel) : base(navigationService)
 {
     // 画面に出るカウンター用のViewModelを作る(とりあえず最初のやつ)
     CounterViewModel = new ReactiveProperty <CounterViewModel>(new CounterViewModel(coreModel.Counters.First()));
 }
예제 #11
0
 public void Save(CoreModel Model)
 {
     _context.Core.Update(Model, User.Id);
 }
 public static void setUmlModelsRepository()
 {
     Assert.IsNotNull(umlModel = reader.getModel());
 }
예제 #13
0
        private static void ExecuteGenerationMsSql(GenerationOptions options, string conStr, CoreModel model)
        {
            // Diagramm generieren
            ExecuteStep(new GraphvizCeusDLGenerator(model, options.GenerateSlimDiagram), GENERATED_GRAPHVIZ);

            // IL generieren.
            CoreILSQLStatements.AddRange(ExecuteStep(new DropILGenerator(model), GENERATED_SQL));
            CoreILSQLStatements.AddRange(ExecuteStep(new CreateILGenerator(model), GENERATED_SQL));
            ExecuteStep(new LoadILGenerator(model), GENERATED_CODE);
            ExecuteStep(new GraphvizILGenerator(model), GENERATED_GRAPHVIZ);
            ExecuteStep(new DummyDataILGenerator(model), GENERATED_CSV);
            ExecuteStep(new DummyILPythonGenerator(model), GENERATED_PYCODE);

            // BL generieren
            ReplaceSQLStatements.AddRange(ExecuteStep(new DropBLGenerator(model), GENERATED_SQL));
            ReplaceSQLStatements.AddRange(ExecuteStep(new CreateBLGenerator(model, options.GenerateConstraints), GENERATED_SQL));
            ReplaceSQLStatements.AddRange(ExecuteStep(new InitialDefaultValuesGenerator(model), GENERATED_SQL));
            ExecuteStep(new GraphvizBLGenerator(model), GENERATED_GRAPHVIZ);
            ExecuteStep(new LoadBLGenerator(model), GENERATED_SQL);
            if (!string.IsNullOrEmpty(conStr))
            {
                // Aktualisierung nur generieren, wenn eine Verbindung zur Datenbank angegeben wurde.
                UpdateSQLStatements.AddRange(ExecuteStep(new UpdateBLGenerator(model, conStr, options.GenerateConstraints), GENERATED_SQL));
            }
            ExecuteStep(new CreateDefDataGenerator(model), GENERATED_PYCODE);

            // BT generieren
            CoreBTSQLStatements.AddRange(ExecuteStep(new DropBTGenerator(model), GENERATED_SQL));
            CoreBTSQLStatements.AddRange(ExecuteStep(new CreateBTGenerator(model), GENERATED_SQL));
            if (options.ExecuteUpdateWithReload)
            {
                CoreBTSQLStatements.AddRange(ExecuteStep(new LoadBTGenerator(model), GENERATED_SQL));
            }
            else
            {
                ExecuteStep(new LoadBTGenerator(model), GENERATED_SQL);
            }
            ExecuteStep(new GraphvizBTGenerator(model), GENERATED_GRAPHVIZ);

            // AL generieren (Starschema)
            if (options.GenerateStar)
            {
                StarSQLStatements.AddRange(ExecuteStep(new DropStarALGenerator(model), GENERATED_SQL));
                StarSQLStatements.AddRange(ExecuteStep(new CreateStarALGenerator(model), GENERATED_SQL));
                if (options.ExecuteUpdateWithReload)
                {
                    StarSQLStatements.AddRange(ExecuteStep(new LoadStarALGenerator(model), GENERATED_SQL));
                }
                else
                {
                    ExecuteStep(new LoadStarALGenerator(model), GENERATED_SQL);
                }
                ExecuteStep(new CopyStarALGenerator(model), GENERATED_SQL);
                ExecuteStep(new KDV.CeusDL.Generator.AL.Star.CreateMicrostrategyCmdStarGenerator(model), GENERATED_SCP);
            }

            // AL generieren (Snowflake-Schema)
            if (options.GenerateSnowflake)
            {
                SnowflakeSQLStatements.AddRange(ExecuteStep(new DropSnowflakeALGenerator(model), GENERATED_SQL));
                SnowflakeSQLStatements.AddRange(ExecuteStep(new CreateSnowflakeALGenerator(model), GENERATED_SQL));
                if (options.ExecuteUpdateWithReload)
                {
                    SnowflakeSQLStatements.AddRange(ExecuteStep(new LoadSnowflakeALGenerator(model), GENERATED_SQL));
                }
                else
                {
                    ExecuteStep(new LoadSnowflakeALGenerator(model), GENERATED_SQL);
                }
                ExecuteStep(new KDV.CeusDL.Generator.AL.Snowflake.CreateMicrostrategyCmdSnowflakeGenerator(model), GENERATED_SCP);
            }
        }
 public InitialDefaultValuesGenerator(CoreModel model)
 {
     this.model = new BLModel(model);
 }
예제 #15
0
 public BTModel(CoreModel m) : this(new BLModel(m))
 {
 }
예제 #16
0
        /* (non-Javadoc)
         * @see ocl20.CoreClassifier#getAllAssociationEnds()
         */

        public List <object> getAllAssociationEnds()
        {
            CoreModel model = getModel();

            return(model.getAssociationEndsForClassifier(this));
        }
예제 #17
0
 public CreateSnowflakeALGenerator(CoreModel model)
 {
     this.model = new SnowflakeALModel(model);
 }
예제 #18
0
 public static bool isOclTypesModel(CoreModel model)
 {
     return(model.getEnvironmentWithoutParents()
            .lookup("Set<T>") != null);
 }
예제 #19
0
 private void Remove(string url)
 {
     CoreModel.Log(GetResponse(HttpConfiguration(url, HttpMethod.Delete)));
 }
예제 #20
0
 protected override void Resolve(CoreModel model, Constants constants)
 {
     model.delete(QueryFields(model), _container, constants);
 }
예제 #21
0
 public LoadILGenerator(CoreModel model)
 {
     this.model = new ILModel(model);
 }
 private static void ValidateInterface(CoreInterface ifa, CoreModel m, ValidationResultRepository repo)
 {
     CoreInterfaceValidator.Validate(ifa, m, repo);
 }
예제 #23
0
 public DropBLGenerator(CoreModel model)
 {
     this.model = new BLModel(model);
 }
예제 #24
0
 public CeusDLGenerator(CoreModel model)
 {
     this.model = model;
 }
예제 #25
0
 public static void setEnvironment(CoreModel m)
 {
     model       = m;
     environment = m.getEnvironmentWithoutParents();
 }
예제 #26
0
        private string GenerateBaseAttribute(string type, CoreBaseAttribute attr, CoreInterface ifa, CoreModel model)
        {
            var code = $"{type} {attr.Name}:{DataTypeToString(attr.DataType)}".Indent(1);

            if (attr.IsPrimaryKey ||
                attr.DataType == CoreDataType.DECIMAL ||
                attr.DataType == CoreDataType.VARCHAR ||
                !string.IsNullOrEmpty(attr.Unit) ||
                attr.IsCalculated)
            {
                bool dirty = false;
                code += "(";
                if (attr.IsPrimaryKey)
                {
                    dirty = true;
                    code += "primary_key=\"true\"";
                }
                if (attr.DataType == CoreDataType.DECIMAL)
                {
                    if (dirty)
                    {
                        code += ", ";
                    }
                    dirty = true;
                    code += $"len=\"{attr.Length},{attr.Decimals}\"";
                }
                if (attr.DataType == CoreDataType.VARCHAR)
                {
                    if (dirty)
                    {
                        code += ", ";
                    }
                    dirty = true;
                    code += $"len=\"{attr.Length}\"";
                }
                if (!string.IsNullOrEmpty(attr.Unit))
                {
                    if (dirty)
                    {
                        code += ", ";
                    }
                    dirty = true;
                    code += $"unit=\"{attr.Unit}\"";
                }
                if (attr.IsCalculated)
                {
                    if (dirty)
                    {
                        code += ", ";
                    }
                    dirty = true;
                    code += "calculated=\"true\"";
                }
                if (!String.IsNullOrEmpty(attr.FormerName))
                {
                    if (dirty)
                    {
                        code += ", ";
                    }
                    dirty = true;
                    code += $"former_name=\"{attr.FormerName}\"";
                }
                code += ")";
            }
            code += ";\n";
            return(code);
        }
예제 #27
0
 public GraphvizBLGenerator(CoreModel model) {
     this.model = new BLModel(model);
 }
예제 #28
0
        private string GenerateInterface(CoreInterface ifa, CoreModel model)
        {
            string code = $"\ninterface {ifa.Name} : {InterfaceTypeToString(ifa.Type)}";

            // Interface-Parameter setzen
            // --------------------------
            bool dirty = false;

            // Mandant und Historie
            if (ifa.IsMandant || ifa.IsHistorized)
            {
                code += "(";
                if (ifa.IsMandant)
                {
                    dirty = true;
                    code += "mandant=\"true\"";
                }
                if (dirty)
                {
                    code += ", ";
                }
                if (ifa.IsHistorized)
                {
                    dirty = true;
                    code += "history=\"true\"";
                }
                if (dirty)
                {
                    code += ", ";
                }
                if (ifa.IsWithNowTable)
                {
                    dirty = true;
                    code += $"with_nowtable=\"true\"";
                }
                // Ggf. feinste Zeiteinheit festlegen
            }
            else if (ifa.IsFinestTime)
            {
                dirty = true;
                code += "(finest_time_attribute=\"true\"";
            }
            // Falls Vorhanden alten Namen eintragen.
            if (!String.IsNullOrEmpty(ifa.FormerName))
            {
                if (dirty)
                {
                    code += ", ";
                }
                else
                {
                    code += "(";
                }
                dirty = true;
                code += $"former_name=\"{ifa.FormerName}\"";
            }
            if (dirty)
            {
                code += ")";
            }

            // Und die Attribute setzen
            code += " {\n";
            foreach (var item in ifa.ItemObjects)
            {
                if (item is CoreFactAttribute)
                {
                    code += GenerateFactAttribute((CoreFactAttribute)item, ifa, model);
                }
                else if (item is CoreBaseAttribute)
                {
                    code += GenerateBaseAttribute((CoreBaseAttribute)item, ifa, model);
                }
                else if (item is CoreRefAttribute)
                {
                    code += GenerateRefAttribute((CoreRefAttribute)item, ifa, model);
                }
                else if (item is CoreComment)
                {
                    code += item.ToString().TrimStart(new char[] { ' ', '\t', '\n', '\r' }).Indent(1);
                    //code += "\n";
                }
            }
            code += "}\n";
            return(code);
        }
예제 #29
0
 public DummyDataILGenerator(CoreModel model)
 {
     this.model = new ILModel(model);
 }
예제 #30
0
 public static void SetTheCoreModel( CoreModel           TheObject  )
 {
     TheCoreModel      = TheObject;
 }
예제 #31
0
 public CoreViewModel(CoreModel model)
 {
     this.model = model;
 }