Exemple #1
0
        protected override MultistepActionServiceContext CreateContext(int dbId, int siteId, bool?boundToExternal)
        {
            var site = GetSite(siteId);

            if (site.IsDotNet)
            {
                return(new MultistepActionServiceContext
                {
                    CommandStates = new[]
                    {
                        createFoldersCommand.GetState(),
                        templatesCommand.GetState(),
                        pagesCommand.GetState(),
                        notificationCommand.GetState()
                    }
                });
            }

            return(new MultistepActionServiceContext
            {
                CommandStates = new[]
                {
                    pagesCommand.GetState()
                }
            });
        }
        protected override MultistepActionServiceContext CreateContext(int siteId, int templateId, bool?boundToExternal)
        {
            var site = SiteRepository.GetById(siteId);

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

            if (site.IsDotNet)
            {
                return(new MultistepActionServiceContext
                {
                    CommandStates = new[]
                    {
                        templateCommand.GetState(),
                        pagesCommand.GetState(),
                        notificationsCommand.GetState()
                    }
                });
            }

            return(new MultistepActionServiceContext
            {
                CommandStates = new[]
                {
                    pagesCommand.GetState()
                }
            });
        }