Пример #1
0
        protected override IMultistepActionStageCommand CreateCommand(MultistepActionStageCommandState state)
        {
            switch (state.Type)
            {
            case CopySiteStageCommandTypes.CopySiteContents:
                return(new CopySiteContentsCommand(state));

            case CopySiteStageCommandTypes.CopySiteVirtualContents:
                return(new CopySiteVirtualContentsCommand(state));

            case CopySiteStageCommandTypes.CopySiteContentLinks:
                return(new CopySiteContentLinksCommand(state));

            case CopySiteStageCommandTypes.CopySiteArticles:
                return(new CopySiteArticlesCommand(state));

            case CopySiteStageCommandTypes.CopySiteTemplates:
                return(new CopySiteTemlatesCommand(state));

            case CopySiteStageCommandTypes.CopySiteFiles:
                return(new CopySiteFilesCommand(state));

            case CopySiteStageCommandTypes.CopySiteSettings:
                return(new CopySiteSettingsCommand(state));

            case CopySiteStageCommandTypes.CopySiteUpdateArticleIds:
                return(new CopySiteUpdateArticleIdsCommand(state));

            default:
                throw new ApplicationException("Undefined Copy Site Stage Command Type: " + state.Type);
            }
        }
Пример #2
0
        protected override IMultistepActionStageCommand CreateCommand(MultistepActionStageCommandState state)
        {
            var command = Activator.CreateInstance <TCommand>();

            command.Initialize(state);
            return(command);
        }
Пример #3
0
        protected override IMultistepActionStageCommand CreateCommand(MultistepActionStageCommandState state)
        {
            var site = SiteRepository.GetById(state.Id);

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

            switch (state.Type)
            {
            case BuildSiteStageCommandTypes.CreateFolders:
                return(new CreateFoldersCommand(state));

            case BuildSiteStageCommandTypes.BuildTemplates:
                return(new AssembleTemplatesCommand(state));

            case BuildSiteStageCommandTypes.BuildPages:
                return(new AssemblePagesCommand(state, true, site.IsDotNet));

            case BuildSiteStageCommandTypes.BuildNotifications:
                return(new AssembleNotificationsCommand(state, true));

            default:
                throw new ApplicationException("Undefined Site Building Stage Command Type: " + state.Type);
            }
        }
 public void Initialize(MultistepActionStageCommandState state)
 {
     ContentId       = state.ParentId;
     ItemCount       = state.Ids.Length;
     Ids             = state.Ids;
     BoundToExternal = state.BoundToExternal;
     ItemsPerStep    = state.ItemsPerStep;
 }
Пример #5
0
        protected override IMultistepActionStageCommand CreateCommand(MultistepActionStageCommandState state)
        {
            switch (state.Type)
            {
            case RebuildVirtualContentsCommandTypes.RebuildViews:
                return(new RebuildVirtualContentViewsCommand(state));

            case RebuildVirtualContentsCommandTypes.RebuildUserQueries:
                return(new RebuildUserQueryCommand(state));

            default:
                throw new ApplicationException("Undefined Rebuilding Virtual Contents Stage Command Type: " + state.Type);
            }
        }
Пример #6
0
        protected MultistepActionServiceContext CreateContext(int parentId, int id, int[] ids, bool?boundToExternal)
        {
            var action       = BackendActionService.GetByCode(ActionCode);
            var itemsPerStep = action.EntityLimit ?? 1;
            var state        = new MultistepActionStageCommandState
            {
                ParentId            = parentId,
                Id                  = id,
                Ids                 = ids.ToList(),
                ExtensionContentIds = ContentRepository.GetReferencedAggregatedContentIds(parentId, ids).ToList(),
                BoundToExternal     = boundToExternal,
                ItemsPerStep        = itemsPerStep
            };

            Command = (TCommand)CreateCommand(state);
            var result = new MultistepActionServiceContext();

            result.CommandStates.Add(Command.GetState());
            return(result);
        }
Пример #7
0
        protected override IMultistepActionStageCommand CreateCommand(MultistepActionStageCommandState state)
        {
            switch (state.Type)
            {
            case RemovingStageCommandTypes.ClearContent:
                return(new ClearContentCommand(state));

            case RemovingStageCommandTypes.RemoveContent:
                return(new RemoveContentCommand(state));

            case RemovingStageCommandTypes.RemoveSite:
                return(new RemoveSiteCommand(state));

            case RemovingStageCommandTypes.RemoveSiteArticles:
                return(new RemoveSiteArticlesCommand(state));

            case RemovingStageCommandTypes.RemoveSiteContents:
                return(new RemoveSiteContentsCommand(state));

            default:
                throw new ApplicationException("Undefined Removing Stage Command Type: " + state.Type);
            }
        }
Пример #8
0
 public AssembleTemplateCommand(MultistepActionStageCommandState state)
     : this(state.Id, null)
 {
 }
Пример #9
0
 public CopySiteContentsCommand(MultistepActionStageCommandState state)
     : this(state.Id, null, 0)
 {
 }
Пример #10
0
 public AssemblePagesCommand(MultistepActionStageCommandState state, bool siteOrTemplate, bool isDotNet)
     : this(state.Id, null, siteOrTemplate, isDotNet)
 {
 }
Пример #11
0
 public AssembleNotificationsCommand(MultistepActionStageCommandState state, bool siteOrTemplate)
     : this(state.Id, null, siteOrTemplate)
 {
 }
Пример #12
0
 public RebuildUserQueryCommand(MultistepActionStageCommandState state)
     : this(state.Id, null)
 {
 }
Пример #13
0
 public ExportArticlesCommand(MultistepActionStageCommandState state)
     : this(state.ParentId, state.Id, 0, state.Ids.ToArray(), state.ExtensionContentIds.ToArray())
 {
 }
Пример #14
0
 public CopySiteItemLinksCommand(MultistepActionStageCommandState state)
     : this(state.Id, 0)
 {
 }
Пример #15
0
 public CopySiteSettingsCommand(MultistepActionStageCommandState state)
     : this(state.Id, null)
 {
 }
Пример #16
0
 protected override IMultistepActionStageCommand CreateCommand(MultistepActionStageCommandState state) => new ImportArticlesCommand(state);
Пример #17
0
 public CreateFoldersCommand(MultistepActionStageCommandState state)
     : this(state.Id, null)
 {
 }
Пример #18
0
 public ImportArticlesCommand(MultistepActionStageCommandState state)
     : this(state.ParentId, state.Id, 0)
 {
 }
Пример #19
0
 public RebuildVirtualContentViewsCommand(MultistepActionStageCommandState state)
     : this(state.Id, null)
 {
 }
Пример #20
0
 public RemoveSiteArticlesCommand(MultistepActionStageCommandState state)
     : this(state.Id, null, 0)
 {
 }
 public CopySiteUpdateArticleIdsCommand(MultistepActionStageCommandState state)
     : this(state.Id, 0)
 {
 }
Пример #22
0
 public CopySiteFilesCommand(MultistepActionStageCommandState state)
     : this(state.Id, null, false)
 {
 }
Пример #23
0
 public ClearContentCommand(MultistepActionStageCommandState state)
     : this(state.ParentId, state.Id, null, 0)
 {
 }
Пример #24
0
 public RemoveContentCommand(MultistepActionStageCommandState state)
     : this(state.ParentId, state.Id, null)
 {
 }
Пример #25
0
 public RemoveSiteCommand(MultistepActionStageCommandState state)
     : this(state.Id, null)
 {
 }