Exemplo n.º 1
0
 public IntegrityManager(IContentTypeManager contentTypeManager, IUrlParser urlParser, ILanguageManager languageManager, AdminSection adminSection)
 {
     _contentTypeManager = contentTypeManager;
     _urlParser = urlParser;
     _languageManager = languageManager;
     _adminConfig = adminSection;
 }
Exemplo n.º 2
0
        public ControllerMapper(ITypeFinder typeFinder, IContentTypeManager definitionManager, IKernel kernel)
        {
            IList<ControlsAttribute> controllerDefinitions = FindControllers(typeFinder);
            foreach (ContentType id in definitionManager.GetContentTypes())
            {
                IAdapterDescriptor controllerDefinition = GetControllerFor(id.ItemType, controllerDefinitions);
                if (controllerDefinition != null)
                {
                    string controllerName = GetControllerName(controllerDefinition.AdapterType, controllerDefinition.AreaName);

                    ControllerMap[id.ItemType] = controllerDefinition.ControllerName;
                    AreaMap[id.ItemType] = controllerDefinition.AreaName;

                    if (!kernel.GetBindings(typeof(IController)).Any(b => b.Metadata.Name == controllerName))
                        kernel.Bind<IController>().To(controllerDefinition.AdapterType)
                            .InTransientScope()
                            .Named(controllerName);

                    IList<IPathFinder> finders = PathDictionary.GetFinders(id.ItemType);
                    if (0 == finders.Where(f => f is ActionResolver).Count())
                    {
                        // TODO: Get the list of methods from a list of actions retrieved from somewhere within MVC
                        var methods = controllerDefinition.AdapterType.GetMethods().Select(m => m.Name).ToArray();
                        var actionResolver = new ActionResolver(this, methods);
                        PathDictionary.PrependFinder(id.ItemType, actionResolver);
                    }
                }
            }
        }
Exemplo n.º 3
0
        public LanguageManager(IPersister persister, 
			IHost host, IContentTypeManager contentTypeManager,
			GlobalizationSection globalizationConfig)
        {
            _persister = persister;
            _host = host;
            _contentTypeManager = contentTypeManager;
            _globalizationConfig = globalizationConfig;
        }
Exemplo n.º 4
0
        public CredentialService(ICredentialStore store, IMailSender mailSender,
			IContentTypeManager contentTypeManager,
			IPersister persister)
        {
            _store = store;
            _mailSender = mailSender;
            _contentTypeManager = contentTypeManager;
            _persister = persister;
        }
Exemplo n.º 5
0
        public SeoDefinitionAppender(IContentTypeManager contentTypeManager, TemplatesSection templatesConfig)
        {
            _contentTypeManager = contentTypeManager;
            _templatesConfig = templatesConfig;

            HtmlTitleTitle = "HTML Title";
            MetaKeywordsTitle = "Meta Keywords";
            MetaDescriptionTitle = "Meta Description";
            SeoTabTitle = "SEO";
        }
Exemplo n.º 6
0
 public InstallationManager(IHost host, IContentTypeManager contentTypeManager, Importer importer, IPersister persister,
     IFinder finder, ICredentialService credentialService, AdminSection adminConfig)
 {
     _host = host;
     _contentTypeManager = contentTypeManager;
     _importer = importer;
     _persister = persister;
     _finder = finder;
     _credentialService = credentialService;
     _adminConfig = adminConfig;
 }
Exemplo n.º 7
0
        public ConfigurationBuilder(IContentTypeManager definitions, DatabaseSection databaseSectionConfig)
        {
            _definitions = definitions;

            if (databaseSectionConfig == null)
                databaseSectionConfig = new DatabaseSection();

            var configuration = MsSqlConfiguration.MsSql2008
                //.ConnectionString(c => c.FromConnectionStringWithKey(databaseSectionConfig.ConnectionStringName))
                .Cache(c => c.ProviderClass(databaseSectionConfig.CacheProviderClass));

            if (databaseSectionConfig.CacheEnabled)
                configuration = configuration.Cache(c => c.UseQueryCache());

            IDictionary<string, string> properties = configuration.ToProperties();
            properties["cache.use_second_level_cache"] = databaseSectionConfig.CacheEnabled.ToString();
            properties["connection.connection_string_name"] = databaseSectionConfig.ConnectionStringName;

            //ZeusPersistenceModel persistenceModel = new ZeusPersistenceModel();
            //persistenceModel.Mappings.(DefaultLazy.AlwaysTrue());

            _configuration = new NHibernate.Cfg.Configuration().AddProperties(properties);

            AddMapping(_configuration, "Zeus.Persistence.NH.Mappings.Default.hbm.xml");
            //_configuration.AddAssembly(Assembly.GetExecutingAssembly());

            //persistenceModel.Configure(_configuration);

            //persistenceModel.WriteMappingsTo(@"C:\mappings");

            // For each definition, add a <subclass> element to mapping file.
            StringBuilder mappings = new StringBuilder();
            foreach (Type type in EnumerateDefinedTypes())
            {
                string format = (typeof(WidgetContentItem) == type) ? _widgetClassFormat : _classFormat;
                mappings.AppendFormat(format, GetName(type), GetName(type.BaseType), GetDiscriminator(type));
            }
            string configurationXml = string.Format(_mappingFormat, mappings);
            _configuration.AddXml(configurationXml);
        }
Exemplo n.º 8
0
        public AdminManager(AdminSection configSection, ISecurityManager securityManager, IAdminAssemblyManager adminAssembly,
			IAuthorizationService authorizationService, IAuthenticationContextService authenticationContextService,
			IPersister persister, IVersionManager versionManager, IContentTypeManager contentTypeManager,
			Web.IWebContext webContext, ILanguageManager languageManager,
			IPluginFinder<ActionPluginGroupAttribute> actionPluginGroupFinder,
			ITypeFinder typeFinder, IEmbeddedResourceManager embeddedResourceManager)
        {
            _configSection = configSection;
            _securityManager = securityManager;
            _adminAssembly = adminAssembly;
            DeleteItemUrl = embeddedResourceManager.GetServerResourceUrl(adminAssembly.Assembly, "Zeus.Admin.Delete.aspx");
            EditItemUrl = embeddedResourceManager.GetServerResourceUrl(adminAssembly.Assembly, "Zeus.Admin.Plugins.EditItem.Default.aspx");
            NewItemUrl = embeddedResourceManager.GetServerResourceUrl(adminAssembly.Assembly, "Zeus.Admin.New.aspx");
            EnableVersioning = configSection.Versioning.Enabled;
            _authorizationService = authorizationService;
            _authenticationContextService = authenticationContextService;
            _persister = persister;
            _versionManager = versionManager;
            _contentTypeManager = contentTypeManager;
            _webContext = webContext;
            _languageManager = languageManager;

            _cachedActionPluginGroups = actionPluginGroupFinder.GetPlugins().OrderBy(g => g.SortOrder);
        }
Exemplo n.º 9
0
        public override void SetUp()
        {
            base.SetUp();

            CreatePersister();

            parser = mocks.StrictMock<IUrlParser>();

            ITypeFinder typeFinder = CreateTypeFinder();
            ContentTypeBuilder builder = new ContentTypeBuilder(typeFinder, new EditableHierarchyBuilder<IEditor>(),
                new AttributeExplorer<IDisplayer>(), new AttributeExplorer<IEditor>(),
                new AttributeExplorer<IContentProperty>(), new AttributeExplorer<IEditorContainer>());
            IItemNotifier notifier = mocks.DynamicMock<IItemNotifier>();
            mocks.Replay(notifier);
            definitions = new ContentTypeManager(builder, notifier);
            integrityManger = new IntegrityManager(definitions, parser, null, null);
            IntegrityEnforcer enforcer = new IntegrityEnforcer(persister, integrityManger);
            enforcer.Start();
        }
 public ContentTypeConfigurationService(ContentTypesSection configSection, IContentTypeManager contentTypeManager)
 {
     _configSection = configSection;
     _contentTypeManager = contentTypeManager;
 }
Exemplo n.º 11
0
 public TaggingDefinitionAppender(IContentTypeManager contentTypeManager, TemplatesSection templatesConfig)
 {
     _contentTypeManager = contentTypeManager;
     _templatesConfig = templatesConfig;
 }
Exemplo n.º 12
0
 public TagService(IFinder tagFinder, IContentTypeManager contentTypeManager, IPersister persister)
 {
     _tagFinder = tagFinder;
     _contentTypeManager = contentTypeManager;
     _persister = persister;
 }
Exemplo n.º 13
0
 public ItemXmlReader(IContentTypeManager definitions, IDictionary<string, IXmlReader> readers)
 {
     IgnoreMissingTypes = true;
     this.definitions = definitions;
     this.readers = readers;
 }
Exemplo n.º 14
0
 public ItemXmlReader(IContentTypeManager definitions)
     : this(definitions, DefaultReaders())
 {
 }
Exemplo n.º 15
0
 public DefinedPropertyXmlWriter(IContentTypeManager definitions)
 {
     this.definitions = definitions;
 }
Exemplo n.º 16
0
        public LanguageManager(IPersister persister,
			IHost host, IContentTypeManager contentTypeManager)
            : this(persister, host, contentTypeManager, null)
        {
        }
Exemplo n.º 17
0
 public ItemXmlWriter(IContentTypeManager definitions, IUrlParser parser)
 {
     this.definitions = definitions;
     this.parser = parser;
 }
Exemplo n.º 18
0
 public SyndicatableDefinitionAppender(IContentTypeManager definitions)
 {
     _contentTypeManager = definitions;
 }
Exemplo n.º 19
0
 public FileSystemService(IContentTypeManager contentTypeManager)
 {
     _contentTypeManager = contentTypeManager;
 }