Ejemplo n.º 1
0
 public GraphStoryService(ContentInterface contentInterface, LocationInterface locationInterface, ProductInterface productInterface, PurchaseInterface purchaseInterface, TagInterface tagInterface, UserInterface userInterface)
 {
     this.contentInterface  = contentInterface;
     this.locationInterface = locationInterface;
     this.productInterface  = productInterface;
     this.purchaseInterface = purchaseInterface;
     this.tagInterface      = tagInterface;
     this.userInterface     = userInterface;
 }
Ejemplo n.º 2
0
        public void SetupDynamicTypes()
        {
            var fullDynamicTypeId = Guid.NewGuid();

            var repositories = new RepositoryMetadataManager();

            repositories.Save(new RepositoryMetdata
            {
                CustomRepositoryName = "Article",
                IsDynamic            = true,
                ApiId = fullDynamicTypeId
            });

            var mgr  = new ContentInterfaceRepository();
            var ext1 = new ContentInterface
            {
                ContentTypeId = fullDynamicTypeId,
                InterfaceName = KnownTypeExtensionNames.CustomFields
            };
            var ext2 = new ContentInterface
            {
                ContentTypeId = fullDynamicTypeId,
                InterfaceName = "SomePluginInfo"
            };

            mgr.Save(ext1);
            mgr.Save(ext2);

            var extension = mgr.GetCustomFieldsTypeExtension(fullDynamicTypeId);

            extension.InterfaceFields.Add(new ChoiceInterfaceField
            {
                PropertyName     = "IsFeatured",
                PropertyTypeName = typeof(bool).FullName
            });

            mgr.Save(extension);

            var repo = RepositoryActivator.ActivateRepository <ISupportsCmsForms>(fullDynamicTypeId);

            repo.Save(new DynamicVersionedContent(fullDynamicTypeId));
            //var drafts = repo.FindContentVersions("", ContentEnvironment.Draft);
            //if (!drafts.Any())
            //    throw new Exception();
        }