public DependencyResolverAttributeTypeRegistry()
 {
     var dependencyResolver = DependencyResolver.Current;
     Mandate.That(dependencyResolver != null, x => new InvalidOperationException("DependencyResolver.Current returned null, ensure that IoC is setup"));
     _internalRegistry = dependencyResolver.GetService<IAttributeTypeRegistry>();
     Mandate.That(_internalRegistry != null, x => new InvalidOperationException("Could not resolve an IAttributeTypeRegistry from the DependencyResolver, ensure that one is registered in IoC"));
 }
 /// <summary>
 /// Sets the passed in IAttributeTypeRegistry to be the current one resolved from the Current property
 /// </summary>
 /// <param name="attributeTypeRegistry"></param>
 public static void SetCurrent(IAttributeTypeRegistry attributeTypeRegistry)
 {
     using (new WriteLockDisposable(Locker))
     {
         _currentRegistry = attributeTypeRegistry;    
     }            
 }
예제 #3
0
 /// <summary>
 /// Sets the passed in IAttributeTypeRegistry to be the current one resolved from the Current property
 /// </summary>
 /// <param name="attributeTypeRegistry"></param>
 public static void SetCurrent(IAttributeTypeRegistry attributeTypeRegistry)
 {
     using (new WriteLockDisposable(Locker))
     {
         _currentRegistry = attributeTypeRegistry;
     }
 }
        public DependencyResolverAttributeTypeRegistry()
        {
            var dependencyResolver = DependencyResolver.Current;

            Mandate.That(dependencyResolver != null, x => new InvalidOperationException("DependencyResolver.Current returned null, ensure that IoC is setup"));
            _internalRegistry = dependencyResolver.GetService <IAttributeTypeRegistry>();
            Mandate.That(_internalRegistry != null, x => new InvalidOperationException("Could not resolve an IAttributeTypeRegistry from the DependencyResolver, ensure that one is registered in IoC"));
        }
 public DevDatasetInstallTask(
     IFrameworkContext frameworkContext,
     IPropertyEditorFactory propertyEditorFactory,
     IHiveManager hiveManager,
     IAttributeTypeRegistry attributeTypeRegistry)
     : base(frameworkContext, hiveManager)
 {
     _devDataSet = new DevDataset(propertyEditorFactory, frameworkContext, attributeTypeRegistry);
 }
 public DevDatasetInstallTask(
     IFrameworkContext frameworkContext,
     IPropertyEditorFactory propertyEditorFactory,
     IHiveManager hiveManager,
     IAttributeTypeRegistry attributeTypeRegistry)
     : base(frameworkContext, hiveManager)
 {
     _devDataSet = new DevDataset(propertyEditorFactory, frameworkContext, attributeTypeRegistry);
 }
예제 #7
0
 public CmsBootstrapper(UmbracoSettings settings,
                        UmbracoAreaRegistration areaRegistration,
                        InstallAreaRegistration installRegistration,
                        IEnumerable <PackageAreaRegistration> componentAreas)
 {
     _areaRegistration      = areaRegistration;
     _installRegistration   = installRegistration;
     _componentAreas        = componentAreas;
     _settings              = settings;
     _attributeTypeRegistry = new DependencyResolverAttributeTypeRegistry();
 }
예제 #8
0
 public CmsBootstrapper(RebelSettings settings,
     RebelAreaRegistration areaRegistration,
     InstallAreaRegistration installRegistration,
     IEnumerable<PackageAreaRegistration> componentAreas)
 {
     _areaRegistration = areaRegistration;
     _installRegistration = installRegistration;
     _componentAreas = componentAreas;
     _settings = settings;
     _attributeTypeRegistry = new DependencyResolverAttributeTypeRegistry();
 }
예제 #9
0
 public DevDataset(IPropertyEditorFactory propertyEditorFactory, IFrameworkContext frameworkContext, IAttributeTypeRegistry attributeTypeRegistry)
 {
     _frameworkContext      = frameworkContext;
     _attributeTypeRegistry = attributeTypeRegistry;
     PropertyEditorFactory  = propertyEditorFactory;
     InitCreators();
     InitDataTypes();
     InitTemplates();
     InitDocTypes();
     _nodeData = XDocument.Parse(Files.rebel);
 }
예제 #10
0
        public DevDataset(IPropertyEditorFactory propertyEditorFactory, IFrameworkContext frameworkContext, IAttributeTypeRegistry attributeTypeRegistry)
        {
            _frameworkContext = frameworkContext;
            _attributeTypeRegistry = attributeTypeRegistry;
            PropertyEditorFactory = propertyEditorFactory;
            InitCreators();
            InitDataTypes();
            InitTemplates();
            InitDocTypes();
            _nodeData = XDocument.Parse(Files.umbraco);

        }
예제 #11
0
 public CmsBootstrapper(UmbracoSettings settings,
                        UmbracoAreaRegistration areaRegistration,
                        InstallAreaRegistration installRegistration,
                        IEnumerable <PackageAreaRegistration> componentAreas,
                        IAttributeTypeRegistry attributeTypeRegistry)
 {
     _areaRegistration      = areaRegistration;
     _installRegistration   = installRegistration;
     _componentAreas        = componentAreas;
     _attributeTypeRegistry = attributeTypeRegistry;
     _settings = settings;
 }
예제 #12
0
 public CmsBootstrapper(RebelSettings settings,
     RebelAreaRegistration areaRegistration,
     InstallAreaRegistration installRegistration,
     IEnumerable<PackageAreaRegistration> componentAreas,
     IAttributeTypeRegistry attributeTypeRegistry)
 {
     _areaRegistration = areaRegistration;
     _installRegistration = installRegistration;
     _componentAreas = componentAreas;
     _attributeTypeRegistry = attributeTypeRegistry;
     _settings = settings;
 }
        public PugpigDataset(IPropertyEditorFactory propertyEditorFactory, IFrameworkContext frameworkContext, IAttributeTypeRegistry attributeTypeRegistry)
        {
            _frameworkContext = frameworkContext;
            PropertyEditorFactory = propertyEditorFactory;
            //InitCreators();

            // Anthony's code
            var helper = new UmbracoXmlImportHelper(attributeTypeRegistry, propertyEditorFactory);
            _templates = helper.InitTemplates();
            _dataTypes = helper.InitDataTypes(_frameworkContext);
            _docTypes = helper.InitDocTypes();

            // get content node xml
            _nodeData = XDocument.Parse(Files.umbraco);
        }
예제 #14
0
 public static DevDataset GetDemoData(IUmbracoApplicationContext appContext, IAttributeTypeRegistry attributeTypeRegistry)
 {
     return new DevDataset(new MockedPropertyEditorFactory(appContext), appContext.FrameworkContext, attributeTypeRegistry);
 }
 public UmbracoXmlImportHelper(IAttributeTypeRegistry attributeTypeRegistry, IPropertyEditorFactory propertyEditorFactory)
 {
     _attributeTypeRegistry = attributeTypeRegistry;
     _propertyEditorFactory = propertyEditorFactory;
     _Schema = XDocument.Parse(Files.Schema);
 }
        public static ISchemaBuilderStep <AttributeType, TProviderFilter> UseExistingType <TProviderFilter>(this IBuilderStep <AttributeType, TProviderFilter> builder, IAttributeTypeRegistry registry, string alias)
            where TProviderFilter : class, IProviderTypeFilter
        {
            var check = registry.TryGetAttributeType(alias);

            if (!check.Success)
            {
                throw new InvalidOperationException("AttributeType '{0}' is not registered with the supplied IAttributeTypeRegistry".InvariantFormat(alias));
            }
            var existing = check.Result;

            return(new SchemaBuilderStep <AttributeType, TProviderFilter>(builder.HiveManager, existing));
        }
예제 #17
0
        private static EntitySchema CreateAndSaveCompositeSchema(IAttributeTypeRegistry attributeTypeRegistry, ProviderSetup providerSetup)
        {
            var nameNameType = attributeTypeRegistry.GetAttributeType(NodeNameAttributeType.AliasValue);
            var textstringType = attributeTypeRegistry.GetAttributeType("singleLineTextBox");

            var schema1 = HiveModelCreationHelper.CreateEntitySchema("schema1", "Schema1", true, new[] { new AttributeDefinition(NodeNameAttributeDefinition.AliasValue, "Node Name")
            {
                Id = new HiveId("mi-schema1-name".EncodeAsGuid()),
                AttributeType = nameNameType,
                AttributeGroup = FixedGroupDefinitions.GeneralGroup,
                Ordinal = 0
            }, new AttributeDefinition("alias1", "Alias1")
            {
                Id = new HiveId("mi-schema1-alias1".EncodeAsGuid()),
                AttributeType = textstringType,
                AttributeGroup = new AttributeGroup("group1", "Group 1", 50).FixedDates(),
                Ordinal = 1
            } });
            schema1.AttributeGroups.Add(new AttributeGroup("empty-group", "Empty Group", 100).FixedDates());

            var schema2 = HiveModelCreationHelper.CreateEntitySchema("schema2", "Schema2", true, new[] { new AttributeDefinition(NodeNameAttributeDefinition.AliasValue, "Node Name")
            {
                Id = new HiveId("mi-schema2-name".EncodeAsGuid()),
                AttributeType = nameNameType,
                AttributeGroup = FixedGroupDefinitions.GeneralGroup,
                Ordinal = 0
            }, new AttributeDefinition("alias2", "Alias2")
            {
                Id = new HiveId("mi-schema2-alias2".EncodeAsGuid()),
                AttributeType = textstringType,
                AttributeGroup = new AttributeGroup("group1", "Group 1", 50).FixedDates(),
                Ordinal = 1
            } });

            var schema3 = HiveModelCreationHelper.CreateEntitySchema("schema3", "Schema3", true, new[] { new AttributeDefinition(NodeNameAttributeDefinition.AliasValue, "Node Name")
            {
                Id = new HiveId("mi-schema3-name".EncodeAsGuid()),
                AttributeType = nameNameType,
                AttributeGroup = FixedGroupDefinitions.GeneralGroup,
                Ordinal = 0
            }, new AttributeDefinition("alias3", "Alias3")
            {
                Id = new HiveId("mi-schema3-alias3".EncodeAsGuid()),
                AttributeType = textstringType,
                AttributeGroup = new AttributeGroup("group2", "Group 2", 100).FixedDates(),
                Ordinal = 1
            } });

            schema3.XmlConfiguration = XDocument.Parse("<test />");

            // Act
            using (var uow = providerSetup.UnitFactory.Create())
            {
                // Add schemas
                uow.EntityRepository.Schemas.AddOrUpdate(schema1);
                uow.EntityRepository.Schemas.AddOrUpdate(schema2);
                uow.EntityRepository.Schemas.AddOrUpdate(schema3);

                // Add relations
                uow.EntityRepository.Schemas.AddRelation(new Relation(FixedRelationTypes.DefaultRelationType, schema1.Id, schema2.Id));
                uow.EntityRepository.Schemas.AddRelation(new Relation(FixedRelationTypes.DefaultRelationType, schema2.Id, schema3.Id));

                uow.Complete();
            }

            return schema3;
        }
예제 #18
0
 public static DevDataset GetDemoData(IUmbracoApplicationContext appContext, IAttributeTypeRegistry attributeTypeRegistry)
 {
     return(new DevDataset(new MockedPropertyEditorFactory(appContext), appContext.FrameworkContext, attributeTypeRegistry));
 }
예제 #19
0
 public MembershipWrapperModelMapper(IAttributeTypeRegistry attributeTypeRegistry, IFrameworkContext frameworkContext)
     : base(frameworkContext)
 {
     _attributeTypeRegistry = attributeTypeRegistry;
 }
예제 #20
0
        public static ISchemaBuilderStep <AttributeType, TProviderFilter> UseExistingType <TProviderFilter>(this IEntityBuilderStep <AttributeType, TProviderFilter> builder, IAttributeTypeRegistry registry, string alias)
            where TProviderFilter : class, IProviderTypeFilter
        {
            var check = registry.TryGetAttributeType(alias);

            if (!check.Success)
            {
                // Get all the registered types to provide a helpful message
                var allAliases = registry.GetAllRegisteredAliases();
                throw new InvalidOperationException(
                          "AttributeType '{0}' is not registered with the supplied IAttributeTypeRegistry. Available types are:\n{1}"
                          .InvariantFormat(alias, string.Join(@"\n", allAliases)));
            }
            var existing = check.Result;

            return(new SchemaBuilderStep <AttributeType, TProviderFilter>(builder.HiveManager, existing));
        }
 public MembershipWrapperModelMapper(IAttributeTypeRegistry attributeTypeRegistry, IFrameworkContext frameworkContext)
     : base(frameworkContext)
 {
     _attributeTypeRegistry = attributeTypeRegistry;
 }