示例#1
0
        public override MultistepActionSettings Setup(int parentId, int templateId, bool?boundToExternal)
        {
            var site = SiteRepository.GetById(parentId);

            if (site == null)
            {
                throw new ApplicationException(string.Format(SiteStrings.SiteNotFound, parentId));
            }

            var template = PageTemplateRepository.GetPageTemplatePropertiesById(templateId);

            if (site.IsDotNet)
            {
                templateCommand = new AssembleTemplateCommand(templateId, template.Name);
                pagesCommand    = new AssemblePagesCommand(templateId, template.Name, false, true);
                pagesCommand.Setup();

                notificationsCommand = new AssembleNotificationsCommand(templateId, template.Name, false);
            }
            else
            {
                pagesCommand = new AssemblePagesCommand(templateId, template.Name, false, false);
                pagesCommand.Setup();
            }

            return(base.Setup(parentId, templateId, boundToExternal));
        }
示例#2
0
        public override MultistepActionSettings Setup(int dbId, int siteId, bool?boundToExternal)
        {
            var site = GetSite(siteId);

            if (site.IsDotNet)
            {
                createFoldersCommand = new CreateFoldersCommand(siteId, site.Name);
                notificationCommand  = new AssembleNotificationsCommand(siteId, site.Name, true);

                pagesCommand = new AssemblePagesCommand(siteId, site.Name, true, true);
                pagesCommand.Setup();

                templatesCommand = new AssembleTemplatesCommand(siteId, site.Name);
                templatesCommand.Setup();
            }
            else
            {
                pagesCommand = new AssemblePagesCommand(siteId, site.Name, true, false);
                pagesCommand.Setup();
            }

            return(base.Setup(dbId, siteId, boundToExternal));
        }