public static void RunForDiffElements(string[] args)
        {
            var oldESpacePath = args[1];
            var newESpacePath = args[2];

            if (!File.Exists(oldESpacePath))
            {
                Console.WriteLine($"File {oldESpacePath} not found");
                return;
            }
            if (!File.Exists(newESpacePath))
            {
                Console.WriteLine($"File {newESpacePath} not found");
                return;
            }

            var saveESpacePath  = new FileInfo(args[3]);
            var outputDirectory = saveESpacePath.Directory.FullName;

            if (!Directory.Exists(outputDirectory))
            {
                Directory.CreateDirectory(outputDirectory);
            }

            var modelServices = OutSystems.ModelAPILoader.Loader.ModelServicesInstance;

            var oldmodule = modelServices.LoadESpace(oldESpacePath);
            var newmodule = modelServices.LoadESpace(newESpacePath);

            var isoldtraditional = IsTraditional(oldmodule);
            var isnewtraditional = IsTraditional(newmodule);

            if (isoldtraditional != isnewtraditional)
            {
                Console.WriteLine("<oldFile.oml> and <newFile.oml> are not compatible");
                return;
            }

            if (isoldtraditional)
            {
                BlocksTraditional tradicionalBlocks = new BlocksTraditional();
                Screens           s = new Screens();
                ServerAction      l = new ServerAction();
                tradicionalBlocks.GetDiffElements(oldmodule, newmodule, "new");
                s.GetDiffElements(oldmodule, newmodule, "new");
                l.GetDiffElements(oldmodule, newmodule, "new");
            }
            else
            {
                BlocksReative reactiveBlocks = new BlocksReative();
                ScreensNR     s = new ScreensNR();
                ServerAction  l = new ServerAction();
                reactiveBlocks.GetDiffElements(oldmodule, newmodule, "new");
                s.GetDiffElements(oldmodule, newmodule, "new");
                l.GetDiffElements(oldmodule, newmodule, "new");
            }

            newmodule.Save(saveESpacePath.FullName);
            Console.WriteLine($"\nESpace saved to {saveESpacePath.FullName}");
        }
Example #2
0
        private static void ListTraditional(IESpace module)
        //only for debugging and experimentation purposes, to be deleted
        {
            BlocksTraditional tradicionalBlocks = new BlocksTraditional();

            tradicionalBlocks.ListBlocksAndScreens(module);
        }
        public static void RunForAllElements(string[] args)
        {
            var ESpacePath = args[1];

            if (!File.Exists(ESpacePath))
            {
                Console.WriteLine($"File {ESpacePath} not found");
                return;
            }

            var saveESpacePath  = new FileInfo(args[2]);
            var outputDirectory = saveESpacePath.Directory.FullName;

            if (!Directory.Exists(outputDirectory))
            {
                Directory.CreateDirectory(outputDirectory);
            }

            var modelServices = OutSystems.ModelAPILoader.Loader.ModelServicesInstance;

            //var restServices = modelServices.GetPluginService<IRestPluginService>();

            var module = modelServices.LoadESpace(ESpacePath);

            var isoldtraditional = IsTraditional(module);

            if (isoldtraditional)
            {
                BlocksTraditional traditionalBlocks = new BlocksTraditional();
                Screens           s = new Screens();
                ServerAction      l = new ServerAction();
                traditionalBlocks.GetAllElements(module);
                s.GetAllElements(module);
                l.GetAllElements(module);
            }
            else
            {
                BlocksReative reactiveBlocks = new BlocksReative();
                ScreensNR     s = new ScreensNR();
                ServerAction  l = new ServerAction();
                reactiveBlocks.GetAllElements(module);
                s.GetAllElements(module);
                l.GetAllElements(module);
            }
            module.Save(saveESpacePath.FullName);
            Console.WriteLine($"\nESpace saved to {saveESpacePath.FullName}");
        }