示例#1
0
 public DefinitionBuilder(DefinitionMap staticDefinitions, ITypeFinder typeFinder, TransformerBase <IUniquelyNamed>[] transformers, EngineSection config)
 {
     this.staticDefinitions = staticDefinitions;
     this.typeFinder        = typeFinder;
     this.transformers      = transformers;
     this.config            = config;
 }
 public InstallationManager(IHost host, DefinitionMap map, ContentActivator activator, Importer importer, IPersister persister, ISessionProvider sessionProvider, IConfigurationBuilder configurationBuilder, IWebContext webContext)
 {
     this.host = host;
     this.map = map;
     this.activator = activator;
     this.importer = importer;
     this.persister = persister;
     this.sessionProvider = sessionProvider;
     this.configurationBuilder = configurationBuilder;
     this.webContext = webContext;
 }
示例#3
0
		public InstallationManager(IHost host, DefinitionMap map, ContentActivator activator, Importer importer, IPersister persister, ISessionProvider sessionProvider, IConfigurationBuilder configurationBuilder, IWebContext webContext, ConnectionMonitor connectionContext, DatabaseSection config)
		{
			this.host = host;
			this.map = map;
			this.activator = activator;
			this.importer = importer;
			this.persister = persister;
			this.sessionProvider = sessionProvider;
			this.configurationBuilder = configurationBuilder;
			this.webContext = webContext;
			this.connectionContext = connectionContext;
			this.isDatabaseFileSystemEnbled = config.Files.StorageLocation == FileStoreLocation.Database;
		}
示例#4
0
		public override void SetUp()
		{
			base.SetUp();

			user = CreatePrincipal("SomeSchmuck");

			map = new DefinitionMap();
			DefinitionBuilder builder = new DefinitionBuilder(map, typeFinder, new TransformerBase<IUniquelyNamed>[0], new EngineSection());
			IItemNotifier notifier = mocks.DynamicMock<IItemNotifier>();
			mocks.Replay(notifier);
			var changer = new N2.Edit.Workflow.StateChanger();
			activator = new ContentActivator(changer, notifier, new EmptyProxyFactory());
			definitions = new DefinitionManager(new[] { new DefinitionProvider(builder) }, new ITemplateProvider[0], activator, changer);
		}
示例#5
0
		public void ItemEditor_AddsNewChild()
		{
			var item = new DecoratedItem();
			var definition = new DefinitionMap().GetOrCreateDefinition(item);
			var editable = (EditableItemAttribute)definition.Properties["TheItem"].Editable;

			var page = new Page();
			var enclosingEditor = new ItemEditor();
			var editor = AddEditorAndInit(item, editable, page, enclosingEditor);

			editable.UpdateEditor(item, editor);
			
			ItemUtility.FindInChildren<N2.Web.UI.WebControls.NameEditor>(editor).Single().Text = "Hello child";

			enclosingEditor.UpdateObject(new N2.Edit.Workflow.CommandContext(definition, item, Interfaces.Editing, engine.RequestContext.User));

			item.Children.Single().ShouldBe(item.TheItem);
		}
示例#6
0
		public void NewChild_IsSaved()
		{
			var item = new DecoratedItem();
			var definition = new DefinitionMap().GetOrCreateDefinition(item);
			var editable = (EditableItemAttribute)definition.Properties["TheItem"].Editable;

			var page = new Page();
			var enclosingEditor = new ItemEditor();
			var editor = AddEditorAndInit(item, editable, page, enclosingEditor);

			editable.UpdateEditor(item, editor);

			var ctx = new N2.Edit.Workflow.CommandContext(definition, item, Interfaces.Editing, engine.RequestContext.User);
			enclosingEditor.UpdateObject(ctx);

			ctx.GetItemsToSave().ShouldContain(item.TheItem);
		}
示例#7
0
 public TemplateProvider(DefinitionMap map)
 {
     this.map = map;
 }
 public ContentTemplateRepository(IPersister persister, DefinitionMap map, ContainerRepository<TemplateContainer> container)
 {
     this.persister = persister;
     this.map = map;
     this.container = container;
 }
示例#9
0
 public ViewTemplateAnalyzer(IProvider<ViewEngineCollection> viewEnginesProvider, DefinitionMap map, DefinitionBuilder builder)
 {
     this.viewEnginesProvider = viewEnginesProvider;
     this.map = map;
     this.builder = builder;
 }
示例#10
0
文件: ItemFinder.cs 项目: Jobu/n2cms
 public ItemFinder(ISessionProvider sessionProvider, DefinitionMap map)
 {
     this.sessionProvider = sessionProvider;
     this.map = map;
 }
示例#11
0
 public TemplateProvider(DefinitionMap map)
 {
     this.map = map;
 }
		public void TestFixtureSetUp()
		{
			factory = new InterceptingProxyFactory();
			var map = new DefinitionMap();
			factory.Initialize(new[] { typeof(InterceptableItem), typeof(InterceptableInheritorItem), typeof(IgnoringItem) }.Select(t => map.GetOrCreateDefinition(t)));
		}
示例#13
0
        public void SetUp()
        {
            Context.Replace(engine = new Fakes.FakeEngine(new[] { typeof(DecoratedItem), typeof(DecoratedItem2) }));
			engine.AddComponentInstance<ITemplateAggregator>(new TemplateAggregator(engine.Definitions, new ITemplateProvider[] { new TemplateProvider(TestSupport.SetupContentActivator(), map = new DefinitionMap()) }));
        }
示例#14
0
			public FakePartsAdapter(DefinitionMap map)
			{
				this.map = map;
			}
 public CrossLinkDefinitionBuilder(DefinitionMap staticDefinitions, CrossLinkTypeFinder typeFinder, TransformerBase<IUniquelyNamed>[] transformers, EngineSection config)
     : base(staticDefinitions, typeFinder, transformers, config)
 {
 }
示例#16
0
		public RavenInstallationManager(IHost host, DefinitionMap map, ContentActivator activator, Importer importer, IPersister persister, ISessionProvider sessionProvider, IConfigurationBuilder configurationBuilder, IWebContext webContext, ConnectionMonitor connectionContext, DatabaseSection config, RavenConnectionProvider cp)
			: base(connectionContext, importer, webContext, persister, activator)
		{
			this.cp = cp;
		}
示例#17
0
 public DefinitionMap()
 {
     definitions = new Dictionary <string, ItemDefinition>();
     _instance   = this;
 }
示例#18
0
 public DefinitionBuilder(DefinitionMap staticDefinitions, ITypeFinder typeFinder, EngineSection config)
 {
     this.staticDefinitions = staticDefinitions;
     this.typeFinder        = typeFinder;
     this.config            = config;
 }
		public ContentTemplateRepository(IRepository<ContentItem> repository, DefinitionMap map, ContainerRepository<TemplateContainer> container)
		{
			this.repository = repository;
			this.map = map;
			this.container = container;
		}
示例#20
0
		public ClassMappingGenerator(DefinitionMap map)
		{
			this.map = map;
		}
示例#21
0
		public TemplateProvider(ContentActivator activator, DefinitionMap map)
		{
			this.activator = activator;
			this.map = map;
			SortOrder = 1000;
		}
示例#22
0
 public TemplateProvider(ContentActivator activator, DefinitionMap map)
 {
     this.activator = activator;
     this.map       = map;
 }
示例#23
0
 public DefinitionMap()
 {
     definitions = new Dictionary<string, ItemDefinition>();
     _instance = this;
 }