public override bool Process(IBase baseObject, Facet facet, IGeneratorConfiguration generatorConfiguration)
        {
            var             uiAttribute  = (UIAttribute)facet.Attribute;
            var             name         = baseObject.GetNavigationName(UIKind.BlankPage);
            var             parentObject = (IParentBase)baseObject;
            var             pagesPath    = generatorConfiguration.ApplicationFolderHierarchy[IonicFileSystemType.Pages];
            var             pagesFolder  = (Folder)generatorConfiguration.FileSystem[pagesPath];
            var             loadKind     = uiAttribute.UILoadKind;
            IModuleAssembly module;
            IEnumerable <ModuleImportDeclaration> imports;

            if (uiAttribute.UILoadKind == UILoadKind.RootPage)
            {
                this.Raise <ApplicationFacetHandler>();
            }

            imports = generatorConfiguration.CreateImports(this, baseObject, pagesFolder, false, 1);

            module            = generatorConfiguration.PushModuleAssembly <AngularModule>(name);
            module.UILoadKind = uiAttribute.UILoadKind;

            BlankPageGenerator.GeneratePage(baseObject, pagesPath, name, generatorConfiguration, module, imports, loadKind);

            return(true);
        }
        public override bool Process(IBase baseObject, Facet facet, IGeneratorConfiguration generatorConfiguration)
        {
            var             uiAttribute  = (UIAttribute)facet.Attribute;
            var             name         = baseObject.GetNavigationName();
            var             parentObject = (IParentBase)baseObject;
            var             pagesPath    = generatorConfiguration.ApplicationFolderHierarchy[IonicFileSystemType.Pages];
            var             pagesFolder  = (Folder)generatorConfiguration.FileSystem[pagesPath];
            var             imports      = generatorConfiguration.CreateImports(this, baseObject, pagesFolder, false, 1);
            var             slidingTabs  = new List <SlidingTab>();
            var             featureKind  = uiAttribute.GetFeatureKind();
            var             isComponent  = featureKind.IsComponent();
            IModuleAssembly module;

            foreach (var childObject in parentObject.GetFollowingChildren(generatorConfiguration.PartsAliasResolver, baseObject.Kind != DefinitionKind.StaticContainer))
            {
                slidingTabs.Add(new SlidingTab(childObject, generatorConfiguration));
            }

            module             = generatorConfiguration.PushModuleAssembly <AngularModule>(name);
            module.UILoadKind  = uiAttribute.UILoadKind;
            module.IsComponent = isComponent;

            SlidingTabsPageGenerator.GeneratePage(baseObject, pagesPath, name, generatorConfiguration, module, imports, slidingTabs, isComponent);

            return(true);
        }
Beispiel #3
0
        public override bool Process(IBase baseObject, Facet facet, IGeneratorConfiguration generatorConfiguration)
        {
            var             uiAttribute  = (UIAttribute)facet.Attribute;
            var             name         = baseObject.GetNavigationName();
            var             parentObject = (IParentBase)baseObject;
            var             pagesPath    = generatorConfiguration.ApplicationFolderHierarchy[IonicFileSystemType.Pages];
            var             pagesFolder  = (Folder)generatorConfiguration.FileSystem[pagesPath];
            var             imports      = generatorConfiguration.CreateImports(this, baseObject, pagesFolder, false, 1);
            var             inputObjects = new List <object>(); // TODO - change, preferably to a typed List, to match your needs
            IModuleAssembly module;

            foreach (var childObject in parentObject.GetFollowingChildren(generatorConfiguration.PartsAliasResolver))
            {
                // TODO - add code to capture children elements

                inputObjects.Add(new object());
            }

            module            = generatorConfiguration.PushModuleAssembly <AngularModule>(name);
            module.UILoadKind = uiAttribute.UILoadKind;

            $basename$PageGenerator.GeneratePage(baseObject, pagesPath, name, generatorConfiguration, module, imports, module /* , .. TODO - add additional parameters */);

            return(true);
        }
Beispiel #4
0
        public override bool Process(IBase baseObject, Facet facet, IGeneratorConfiguration generatorConfiguration)
        {
            var uiAttribute     = (UIAttribute)facet.Attribute;
            var baseElement     = (IElement)baseObject;
            var userFields      = new List <IdentityField>();
            var parentObject    = (IElement)baseObject.Parent;
            var name            = baseElement.GetNavigationName(UIKind.LoginPage);
            var subFolderName   = name.ToLower();
            var pagePath        = FileSystemObject.PathCombine(generatorConfiguration.ApplicationFolderHierarchy[IonicFileSystemType.Pages], subFolderName);
            var resourcesHelper = generatorConfiguration.ResourcesHandler.CreateHelper(UIKind.LoginPage, baseObject);
            IDictionary <string, IEnumerable <ModuleImportDeclaration> > importGroups;
            IModuleAssembly module;
            Folder          pageFolder = null;
            string          loginTitleTranslationKey;
            string          loginButtonTranslationKey;

            if (!generatorConfiguration.FileSystem.Exists(pagePath))
            {
                var newPath = generatorConfiguration.FileSystem.CreatePath(pagePath);

                pageFolder = (Folder)generatorConfiguration.FileSystem[newPath];
            }
            else
            {
                pageFolder = (Folder)generatorConfiguration.FileSystem[pagePath];
            }

            if (uiAttribute.UILoadKind == UILoadKind.RootPage)
            {
                this.Raise <ApplicationFacetHandler>();
            }

            importGroups = generatorConfiguration.CreateImportGroups(this, baseObject, pageFolder, true);
            importGroups.AddIndexImport("Page", "MainPage", 1);

            foreach (var childObject in baseElement.GetIdentityFields(IdentityFieldCategory.Login))
            {
                if (childObject is IAttribute)
                {
                    userFields.Add(new IdentityField((IAttribute)childObject, generatorConfiguration));
                }
                else
                {
                    DebugUtils.Break();
                }
            }

            module                    = generatorConfiguration.PushModuleAssembly <AngularModule>("Login");
            module.UILoadKind         = uiAttribute.UILoadKind;
            loginTitleTranslationKey  = resourcesHelper.Get(() => LOGIN_TITLE);
            loginButtonTranslationKey = resourcesHelper.Get(() => LOGIN_BUTTON);

            LoginPageGenerator.GeneratePage(baseObject, pagePath, name, generatorConfiguration, module, importGroups, userFields, loginTitleTranslationKey, loginButtonTranslationKey);

            return(true);
        }
        public override bool Process(IBase baseObject, Facet facet, IGeneratorConfiguration generatorConfiguration)
        {
            var uiAttribute   = (UIAttribute)facet.Attribute;
            var baseElement   = (IElement)baseObject;
            var name          = baseElement.GetNavigationName();
            var formFields    = new List <FormField>();
            var parentObject  = (IElement)baseObject.Parent;
            var subFolderName = name.ToLower();
            var pagePath      = FileSystemObject.PathCombine(generatorConfiguration.ApplicationFolderHierarchy[IonicFileSystemType.Pages], subFolderName);
            IDictionary <string, IEnumerable <ModuleImportDeclaration> > importGroups;
            IModuleAssembly module;
            Folder          pageFolder = null;

            if (!generatorConfiguration.FileSystem.Exists(pagePath))
            {
                var newPath = generatorConfiguration.FileSystem.CreatePath(pagePath);

                pageFolder = (Folder)generatorConfiguration.FileSystem[newPath];
            }
            else
            {
                pageFolder = (Folder)generatorConfiguration.FileSystem[pagePath];
            }

            if (uiAttribute.UILoadKind == UILoadKind.RootPage)
            {
                this.Raise <ApplicationFacetHandler>();
            }

            importGroups = generatorConfiguration.CreateImportGroups(this, baseObject, pageFolder, true);

            foreach (var childObject in baseElement.GetFormFields(generatorConfiguration.PartsAliasResolver))
            {
                if (childObject is IAttribute)
                {
                    formFields.Add(new FormField((IAttribute)childObject, generatorConfiguration));
                }
                else
                {
                    DebugUtils.Break();
                }
            }

            module            = generatorConfiguration.PushModuleAssembly <AngularModule>("Edit" + name);
            module.UILoadKind = uiAttribute.UILoadKind;

            EditPopupPageGenerator.GeneratePage(baseObject, pagePath, name, generatorConfiguration, module, importGroups, formFields);

            return(true);
        }
Beispiel #6
0
        public bool Process(IBase baseObject, Facet facet, IGeneratorConfiguration generatorConfiguration)
        {
            var projectRootPath = generatorConfiguration.ApplicationFolderHierarchy[IonicFileSystemType.AppProjectRoot];
            var appPath         = generatorConfiguration.ApplicationFolderHierarchy[IonicFileSystemType.App];
            var module          = generatorConfiguration.PushModuleAssembly <AngularModule>("App");
            var folder          = (Folder)generatorConfiguration.FileSystem[appPath];

            generatorConfiguration.AddPackageInstalls(this);

            module.BaseObject = baseObject.Parent;
            appModule         = (AngularModule)module;

            generatorConfiguration.SetModuleAssemblyFolder(folder);

            EmbeddedFilesGenerator.Generate(projectRootPath, generatorConfiguration);

            return(true);
        }
Beispiel #7
0
        public override bool Process(IBase baseObject, Facet facet, IView view, IGeneratorConfiguration generatorConfiguration)
        {
            var             name         = baseObject.GetNavigationName();
            var             parentObject = (IParentBase)baseObject;
            var             pagesPath    = generatorConfiguration.ApplicationFolderHierarchy[IonicFileSystemType.Pages];
            var             pagesFolder  = (Folder)generatorConfiguration.FileSystem[pagesPath];
            var             imports      = generatorConfiguration.CreateImports(this, baseObject, pagesFolder, false, 1);
            IModuleAssembly module;

            this.BaseObject = baseObject;
            this.Facet      = facet;
            this.Name       = name;

            module = generatorConfiguration.PushModuleAssembly <AngularModule>(name);

            RepeaterPageGenerator.GeneratePage(baseObject, pagesPath, name, generatorConfiguration, module, imports, (View)view, this);

            return(true);
        }
Beispiel #8
0
        public override bool Process(IBase baseObject, Facet facet, IGeneratorConfiguration generatorConfiguration)
        {
            var             uiAttribute  = (UIAttribute)facet.Attribute;
            var             name         = baseObject.GetNavigationName();
            var             parentObject = (IParentBase)baseObject;
            var             mainObject   = parentObject.ChildElements.Single();
            var             managedLists = new List <ManagedList>();
            var             gridColumns  = new List <GridColumn>();
            var             pagesPath    = generatorConfiguration.ApplicationFolderHierarchy[IonicFileSystemType.Pages];
            var             pagesFolder  = (Folder)generatorConfiguration.FileSystem[pagesPath];
            var             featureKind  = uiAttribute.GetFeatureKind();
            var             isComponent  = featureKind.IsComponent();
            IModuleAssembly module;
            IEnumerable <ModuleImportDeclaration> imports;

            if (mainObject is IParentBase)
            {
                foreach (var childObject in mainObject.GetFollowingNavigationChildren(generatorConfiguration.PartsAliasResolver))
                {
                    managedLists.Add(new ManagedList(childObject, generatorConfiguration));
                }
            }

            foreach (var childObject in mainObject.GetGridColumns(generatorConfiguration.PartsAliasResolver))
            {
                gridColumns.Add(new GridColumn(childObject, generatorConfiguration));
            }

            if (uiAttribute.UILoadKind == UILoadKind.RootPage)
            {
                this.Raise <ApplicationFacetHandler>();
            }

            imports = generatorConfiguration.CreateImports(this, baseObject, pagesFolder, false, 1);

            module             = generatorConfiguration.PushModuleAssembly <AngularModule>(name);
            module.UILoadKind  = uiAttribute.UILoadKind;
            module.IsComponent = isComponent;

            NavigationGridPageGenerator.GeneratePage(baseObject, pagesPath, name, generatorConfiguration, module, imports, module, managedLists, gridColumns, isComponent);

            return(true);
        }