/// <summary>Creates a new instance of the DefaultPersistenceManager.</summary> public ContentPersister(IRepository <int, ContentItem> itemRepository, INHRepository <int, ContentDetail> linkRepository, IItemFinder finder) { this.itemRepository = itemRepository; this.linkRepository = linkRepository; this.finder = finder; }
public VersionManager(IRepository<int, ContentItem> itemRepository, IItemFinder finder, StateChanger stateChanger, EditSection config) { this.itemRepository = itemRepository; this.finder = finder; this.stateChanger = stateChanger; maximumVersionsPerItem = config.Versions.MaximumPerItem; }
/// <summary>Stores dependencies</summary> /// <param name="finder"></param> /// <param name="persister"></param> /// <param name="activator"></param> public ContainerRepository(IPersister persister, IItemFinder finder, IHost host, ContentActivator activator) { this.finder = finder; this.persister = persister; this.host = host; this.activator = activator; }
public TrashHandler(IPersister persister, IItemFinder finder, ISecurityManager security, ContainerRepository <TrashContainerItem> container, StateChanger stateChanger) { this.finder = finder; this.persister = persister; this.security = security; this.container = container; this.stateChanger = stateChanger; }
public LinkFixupScheduledAction(IItemFinder finder, IPersister persister, IHost host, IFileSystem fs, IEngine engine) { _finder = finder; _persister = persister; _host = host; _fs = fs; _rpp = engine.Resolve<RequestPathProvider>(); }
public LinkFixupScheduledAction(IItemFinder finder, IPersister persister, IHost host, IFileSystem fs, IEngine engine) { _finder = finder; _persister = persister; _host = host; _fs = fs; _rpp = engine.Resolve <RequestPathProvider>(); }
public override void Execute() { this.definitions = Engine.Resolve <IDefinitionManager>(); this.finder = Engine.Resolve <IItemFinder>(); foreach (var definition in definitions.GetDefinitions()) { definition.NumberOfItems = finder.Where.Type.Eq(definition.ItemType).Count(); } }
public override void Execute() { this.definitions = Engine.Resolve<IDefinitionManager>(); this.finder = Engine.Resolve<IItemFinder>(); foreach (var definition in definitions.GetDefinitions()) { definition.NumberOfItems = finder.Where.Type.Eq(definition.ItemType).Count(); } }
public ReplicationManager( IPersister persister, IItemFinder finder, IReplicationStorage repstore, IFileSystemFactory fileSystemFactory, DatabaseSection dataBaseSection, ISecurityManager security ) : this(persister, finder, repstore, fileSystemFactory, dataBaseSection, security, null, null) { // needed to be able to execute N2 unit tests w/o additional dependecies }
public Checkout(IItemFinder itemFinder, List<SpecialPrice> specials) { // guard clauses here to catch any issues early on if a null object is passed into this class if (itemFinder == null) throw new ArgumentNullException("itemFinder"); if (specials == null) throw new ArgumentNullException("specials"); _itemFinder = itemFinder; _specials = specials; _items = new List<Item>(); }
public ItemBridge(ContentActivator activator, IItemFinder finder, IPersister persister, ISecurityManager security, IHost host, EditSection config) { this.security = security; this.activator = activator; this.finder = finder; this.persister = persister; this.host = host; this.editorUsernames = ToArray(config.Editors.Users); this.administratorUsernames = ToArray(config.Administrators.Users); Type configuredUserType = Type.GetType(config.Membership.UserType); if (configuredUserType == null) throw new ArgumentException("Couldn't create configured membership user type: " + config.Membership.UserType); if (!typeof(User).IsAssignableFrom(configuredUserType)) throw new ArgumentException("Configured membership user type '" + config.Membership.UserType + "' doesn't derive from '" + typeof(User).AssemblyQualifiedName + "'"); this.userType = configuredUserType; }
public Checkout(IItemFinder itemFinder, List <SpecialPrice> specials) { // guard clauses here to catch any issues early on if a null object is passed into this class if (itemFinder == null) { throw new ArgumentNullException("itemFinder"); } if (specials == null) { throw new ArgumentNullException("specials"); } _itemFinder = itemFinder; _specials = specials; _items = new List <Item>(); }
public override void TestFixtureSetUp() { base.TestFixtureSetUp(); CreateRootItem(); SaveVersionAndUpdateRootItem(); CreateStartPageBelow(rootItem); item1 = CreatePageBelow(startPage, 1); item2 = CreatePageBelow(startPage, 2); item3 = CreatePageBelow(startPage, 3); all = new[] { rootItem, startPage, item1, item2, item3 }; engine.Resolve<IHost>().DefaultSite.RootItemID = rootItem.ID; engine.Resolve<IHost>().DefaultSite.StartPageID = startPage.ID; ISessionProvider sessionProvider = engine.Resolve<ISessionProvider>(); finder = new ItemFinder(sessionProvider, new DefinitionMap()); }
public override void SetUp() { base.SetUp(); CreateRootItem(); SaveVersionAndUpdateRootItem(); CreateStartPageBelow(rootItem); item1 = CreatePageBelow(startPage, 1); item2 = CreatePageBelow(startPage, 2); item3 = CreatePageBelow(startPage, 3); engine.Resolve<IHost>().DefaultSite.RootItemID = rootItem.ID; engine.Resolve<IHost>().DefaultSite.StartPageID = startPage.ID; finder = new ItemFinder(sessionProvider, new DefinitionMap()); sessionProvider.OpenSession.Session.Clear(); }
public override void SetUp() { base.SetUp(); CreateRootItem(); SaveVersionAndUpdateRootItem(); CreateStartPageBelow(rootItem); item1 = CreatePageBelow(startPage, 1); item2 = CreatePageBelow(startPage, 2); item3 = CreatePageBelow(startPage, 3); engine.Resolve <IHost>().DefaultSite.RootItemID = rootItem.ID; engine.Resolve <IHost>().DefaultSite.StartPageID = startPage.ID; finder = new ItemFinder(sessionProvider, new DefinitionMap()); sessionProvider.OpenSession.Session.Clear(); }
public override void TestFixtureSetUp() { base.TestFixtureSetUp(); CreateRootItem(); SaveVersionAndUpdateRootItem(); CreateStartPageBelow(rootItem); item1 = CreatePageBelow(startPage, 1); item2 = CreatePageBelow(startPage, 2); item3 = CreatePageBelow(startPage, 3); all = new[] { rootItem, startPage, item1, item2, item3 }; engine.Resolve <IHost>().DefaultSite.RootItemID = rootItem.ID; engine.Resolve <IHost>().DefaultSite.StartPageID = startPage.ID; ISessionProvider sessionProvider = engine.Resolve <ISessionProvider>(); finder = new ItemFinder(sessionProvider, new DefinitionMap()); }
public ItemBridge(ContentActivator activator, IItemFinder finder, IPersister persister, ISecurityManager security, IHost host, EditSection config) { this.security = security; this.activator = activator; this.finder = finder; this.persister = persister; this.host = host; this.editorUsernames = ToArray(config.Editors.Users); this.administratorUsernames = ToArray(config.Administrators.Users); Type configuredUserType = Type.GetType(config.Membership.UserType); if (configuredUserType == null) { throw new ArgumentException("Couldn't create configured membership user type: " + config.Membership.UserType); } if (!typeof(User).IsAssignableFrom(configuredUserType)) { throw new ArgumentException("Configured membership user type '" + config.Membership.UserType + "' doesn't derive from '" + typeof(User).AssemblyQualifiedName + "'"); } this.userType = configuredUserType; }
public ReplicationManager( IPersister persister, IItemFinder finder, IReplicationStorage repstore, IFileSystemFactory fileSystemFactory, DatabaseSection dataBaseSection, ISecurityManager security, IIndexer indexer, // optional IFlushable flushable // optional ) { _repstore = repstore; _security = security; _persister = persister; _finder = finder; _indexer = indexer; _flushable = flushable; // detect sync direction from Database Type and double check via config string value = ConfigurationManager.AppSettings["XmlReplication"] ?? "false"; IsSlave = value.Equals("Slave", StringComparison.InvariantCultureIgnoreCase) & (dataBaseSection.Flavour == DatabaseFlavour.Xml); IsMaster = value.Equals("Master", StringComparison.InvariantCultureIgnoreCase) & !IsSlave; if (IsMaster || IsSlave) { // only initialize if replication is active var storageConfig = (FileSystemNamespace)Enum.Parse(typeof(FileSystemNamespace), ConfigurationManager.AppSettings["AzureReplicationStorageContainerName"] ?? "ReplicationStorageDebug"); _fileSystem = fileSystemFactory.Create(storageConfig); // constructing these dependencies to ensure same filesystem and simplify construction _replicationWriteLockManager = new ReplicationWriteLockManager(_fileSystem); _replicationReadLockManager = new ReplicationReadLockManager(_fileSystem); } _replicationLogPath = "/_Xml_Sync_Log"; }
public LanguageGateway( IPersister persister, IItemFinder finder, IEditUrlManager editUrlManager, IDefinitionManager definitions, IHost host, ISecurityManager security, IWebContext context, StructureBoundDictionaryCache<int, LanguageInfo[]> languagesCache, DescendantItemFinder descendantFinder, EngineSection config) { this.persister = persister; this.finder = finder; this.editUrlManager = editUrlManager; this.definitions = definitions; this.host = host; this.security = security; this.context = context; this.languagesCache = languagesCache; this.descendantFinder = descendantFinder; Enabled = config.Globalization.Enabled; }
public LanguageGateway( IPersister persister, IItemFinder finder, IEditUrlManager editUrlManager, IDefinitionManager definitions, IHost host, ISecurityManager security, IWebContext context, StructureBoundDictionaryCache <int, LanguageInfo[]> languagesCache, DescendantItemFinder descendantFinder, EngineSection config) { this.persister = persister; this.finder = finder; this.editUrlManager = editUrlManager; this.definitions = definitions; this.host = host; this.security = security; this.context = context; this.languagesCache = languagesCache; this.descendantFinder = descendantFinder; Enabled = config.Globalization.Enabled; }
public DescendantItemFinder(IItemFinder finder, IDefinitionManager definitions) { this.finder = finder; this.definitions = definitions; }
public NewsContainerController(IItemFinder finder) { this.finder = finder; }
public FindingTextSearcher(IItemFinder finder) { this.finder = finder; }
/// <summary>Creates a new instance of the <see cref="IntegrityManager"/>.</summary> /// <param name="definitions">The definition manager.</param> /// <param name="urlParser"></param> public IntegrityManager(Definitions.IDefinitionManager definitions, IItemFinder finder, Web.IUrlParser urlParser) { this.definitions = definitions; this.finder = finder; this.urlParser = urlParser; }
public FindingContentSearcher(IItemFinder finder) { this.finder = finder; }
public VersionManager(IRepository<int, ContentItem> itemRepository, IItemFinder finder, StateChanger stateChanger) { this.itemRepository = itemRepository; this.finder = finder; this.stateChanger = stateChanger; }
public MyComponent(IItemFinder finder, IPersister persister) { this.finder = finder; this.persister = persister; }
public static ContentPersister SetupFakePersister(out FakeRepository <ContentItem> repository, out FakeRepository <ContentDetail> linkRepository, out IItemFinder finder) { repository = new Fakes.FakeRepository <ContentItem>(); linkRepository = new Fakes.FakeRepository <ContentDetail>(); finder = MockRepository.GenerateStub <N2.Persistence.Finder.IItemFinder>(); return(new ContentPersister(repository, linkRepository, finder)); }
public ContentQueryProvider(IItemFinder finder) { this.finder = finder; }
public BlogPostContainerController(IItemFinder finder) { this.finder = finder; }
public static void Setup(out N2.Edit.IEditManager editor, out IVersionManager versions, IDefinitionManager definitions, IPersister persister, IItemFinder finder) { var changer = new N2.Edit.Workflow.StateChanger(); versions = new VersionManager(persister.Repository, finder, changer, new N2.Configuration.EditSection()); editor = new EditManager(definitions, persister, versions, new SecurityManager(new ThreadContext(), new EditSection()), null, null, null, changer, new EditableHierarchyBuilder(new SecurityManager(new ThreadContext(), new EditSection()), new EngineSection()), null); }
public AppPathRebaser(IItemFinder finder, IPersister persister, IHost host) { this.finder = finder; this.persister = persister; this.host = host; }
public ItemModule(IBaseModuleService baseModuleService, IItemFinder itemFinder) : base("item", baseModuleService, itemFinder) { this.RequiresAuthorization(); }
/// <summary>Creates a new instance of the <see cref="IntegrityManager"/>.</summary> /// <param name="definitions">The definition manager.</param> /// <param name="finder"></param> /// <param name="urlParser"></param> public IntegrityManager(Definitions.IDefinitionManager definitions, IItemFinder finder, Web.IUrlParser urlParser) { this.definitions = definitions; this.finder = finder; this.urlParser = urlParser; }
public ReplicationManager( IPersister persister, IItemFinder finder, IReplicationStorage repstore, IFileSystemFactory fileSystemFactory, DatabaseSection dataBaseSection, ISecurityManager security, IIndexer indexer, // optional IFlushable flushable // optional ) { _repstore = repstore; _security = security; _persister = persister; _finder = finder; _indexer = indexer; _flushable = flushable; // detect sync direction from Database Type and double check via config string value = ConfigurationManager.AppSettings["XmlReplication"] ?? "false"; IsSlave = value.Equals("Slave", StringComparison.InvariantCultureIgnoreCase) & (dataBaseSection.Flavour == DatabaseFlavour.Xml); IsMaster = value.Equals("Master", StringComparison.InvariantCultureIgnoreCase) & !IsSlave; if (IsMaster || IsSlave) { // only initialize if replication is active var storageConfig = (FileSystemNamespace) Enum.Parse(typeof (FileSystemNamespace), ConfigurationManager.AppSettings["AzureReplicationStorageContainerName"] ?? "ReplicationStorageDebug"); _fileSystem = fileSystemFactory.Create(storageConfig); // constructing these dependencies to ensure same filesystem and simplify construction _replicationWriteLockManager = new ReplicationWriteLockManager(_fileSystem); _replicationReadLockManager = new ReplicationReadLockManager(_fileSystem); } _replicationLogPath = "/_Xml_Sync_Log"; }
private readonly IItemFinder _itemFinder; // TODO maybe create a new interface instead of extending deprecated one public ContentFinder(IItemFinder itemFinder) { _itemFinder = itemFinder; }