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); } }
protected override IMultistepActionStageCommand CreateCommand(MultistepActionStageCommandState state) { var command = Activator.CreateInstance <TCommand>(); command.Initialize(state); return(command); }
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; }
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); } }
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); }
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); } }
public AssembleTemplateCommand(MultistepActionStageCommandState state) : this(state.Id, null) { }
public CopySiteContentsCommand(MultistepActionStageCommandState state) : this(state.Id, null, 0) { }
public AssemblePagesCommand(MultistepActionStageCommandState state, bool siteOrTemplate, bool isDotNet) : this(state.Id, null, siteOrTemplate, isDotNet) { }
public AssembleNotificationsCommand(MultistepActionStageCommandState state, bool siteOrTemplate) : this(state.Id, null, siteOrTemplate) { }
public RebuildUserQueryCommand(MultistepActionStageCommandState state) : this(state.Id, null) { }
public ExportArticlesCommand(MultistepActionStageCommandState state) : this(state.ParentId, state.Id, 0, state.Ids.ToArray(), state.ExtensionContentIds.ToArray()) { }
public CopySiteItemLinksCommand(MultistepActionStageCommandState state) : this(state.Id, 0) { }
public CopySiteSettingsCommand(MultistepActionStageCommandState state) : this(state.Id, null) { }
protected override IMultistepActionStageCommand CreateCommand(MultistepActionStageCommandState state) => new ImportArticlesCommand(state);
public CreateFoldersCommand(MultistepActionStageCommandState state) : this(state.Id, null) { }
public ImportArticlesCommand(MultistepActionStageCommandState state) : this(state.ParentId, state.Id, 0) { }
public RebuildVirtualContentViewsCommand(MultistepActionStageCommandState state) : this(state.Id, null) { }
public RemoveSiteArticlesCommand(MultistepActionStageCommandState state) : this(state.Id, null, 0) { }
public CopySiteUpdateArticleIdsCommand(MultistepActionStageCommandState state) : this(state.Id, 0) { }
public CopySiteFilesCommand(MultistepActionStageCommandState state) : this(state.Id, null, false) { }
public ClearContentCommand(MultistepActionStageCommandState state) : this(state.ParentId, state.Id, null, 0) { }
public RemoveContentCommand(MultistepActionStageCommandState state) : this(state.ParentId, state.Id, null) { }
public RemoveSiteCommand(MultistepActionStageCommandState state) : this(state.Id, null) { }