Exemplo n.º 1
0
        private void Build()
        {
            if (_core.Application.TapestryChangedSinceLastBuild)
            {
                SendObject(new { @action = "building" });

                var progressHandler = new ModalProgressHandler <EModule>((s) => { });
                progressHandler.Section(EModule.Tapestry, "Generating");

                var generator = new T2.Services.TapestryGenerateService(_core.Context, _core.Application, progressHandler, false);
                generator.Generate();

                _core.Application.TapestryChangedSinceLastBuild = false;
                _core.Context.SaveChanges();
            }
        }
Exemplo n.º 2
0
        public void Build(int ApplicationId, string menuPath, bool forceRebuild)
        {
            try
            {
                // INIT
                core             = COREobject.i;
                masterContext    = core.Context;
                core.Application = masterContext.Applications.Find(ApplicationId);
                masterApp        = core.Application;
                context          = core.AppContext;
                app = context != masterContext
                    ? context.Applications.SingleOrDefault(a => a.Name == masterApp.Name)
                    : masterApp;

                _rebuildInAction = forceRebuild;
                _menuPath        = menuPath;

                applicationViewPath     = $"{AppDomain.CurrentDomain.BaseDirectory}Views\\App\\{app.Name}";
                applicationPageViewPath = $"{applicationViewPath}\\Page";

                // Shared tables
                if (masterApp.IsSystem)
                {
                    progressHandler.Section(EModule.Entitron, "Actualize database");
                    BuildEntitron();
                    return;
                }

                // FrontEnd
                progressHandler.Section(EModule.Master, "Copy application");
                progressHandler.Section(EModule.Persona, "Copy user roles");
                progressHandler.Section(EModule.Entitron, "Actualize database");
                progressHandler.Section(EModule.Mozaic, "Generate pages");
                progressHandler.Section(EModule.Tapestry, "Generate workflow");
                progressHandler.Section(EModule.CORE, "Generate menu");
                progressHandler.Section(EModule.Hermes, "Copy email template");

                MoveApp();
                BuildPersona();
                BuildEntitron();
                BuildMozaic();
                BuildTapestry();
                BuildTapestry2();
                BuildMenu();
                BuildHermes();

                progressHandler.Section(EModule.Watchtower, "All DONE");
            }
            catch (OmniusMultipleException ex)
            {
                if (!ex.AllExceptions.Any())
                {
                    progressHandler.Error("Unknown error");
                }

                foreach (Exception e in ex.AllExceptions)
                {
                    progressHandler.Error(e.Message);
                }
            }
            catch (Exception ex)
            {
                progressHandler.Error(ex.Message);
            }
        }