Exemplo n.º 1
0
        public ApiClient(IOptions <SquidexOptions> appOptions)
        {
            var options = appOptions.Value;

            var clientManager =
                new SquidexClientManager(options);

            pagesClient = clientManager.CreateContentsClient <Page, PageData>("pages");
            postsClient = clientManager.CreateContentsClient <BlogPost, BlogPostData>("posts");
        }
        public void ConnectToCMS(AppOptions appOptions)
        {
            var options = new SquidexOptions()
            {
                AppName      = appOptions.AppName,
                ClientId     = appOptions.ClientId,
                ClientSecret = appOptions.ClientSecret,
                Url          = appOptions.Url
            };

            clientManager        = new SquidexClientManager(options);
            ledColorsSeqClient   = clientManager.CreateContentsClient <LedColorsSeq, LedColorsSeqData>("cp-led-color-sequence");
            collectionPointsData = clientManager.CreateContentsClient <CollectionPoint, CollectionPointData>("collection-points");
            cpImageAsset         = clientManager.CreateContentsClient <ImageAsset, ImageAssetData>("cp-image-asset");
            cpQuoteAsset         = clientManager.CreateContentsClient <QuoteAsset, QuoteAssetData>("cp-qoute-asset");
        }
Exemplo n.º 3
0
        public FeaturesService(IOptions <MyNewsOptions> options)
        {
            if (options.Value.IsConfigured())
            {
                var squidexOptions = new SquidexOptions
                {
                    AppName      = options.Value.AppName,
                    ClientId     = options.Value.ClientId,
                    ClientSecret = options.Value.ClientSecret,
                    Url          = "https://cloud.squidex.io"
                };

                var clientManager = new SquidexClientManager(squidexOptions);

                client = clientManager.CreateContentsClient <NewsEntity, FeatureDto>("feature-news");
            }
        }
Exemplo n.º 4
0
        public ApiClient(IOptions <AppOptions> appOptions)
        {
            var options = appOptions.Value;

            var clientManager =
                new SquidexClientManager(
                    options.Url,
                    options.AppName,
                    options.ClientId,
                    options.ClientSecret);

            pagesClient = clientManager.CreateContentsClient <Page, PageData>("pages");
            postsClient = clientManager.CreateContentsClient <BlogPost, BlogPostData>("posts");

            //pagesClient = clientManager.GetClient<Page, PageData>("pages");
            //postsClient = clientManager.GetClient<BlogPost, BlogPostData>("posts");
        }
Exemplo n.º 5
0
        public ContentReferencesFixture()
        {
            Task.Run(async() =>
            {
                try
                {
                    await TestEntityWithReferences.CreateSchemaAsync(Schemas, AppName, SchemaName);
                }
                catch (SquidexManagementException ex)
                {
                    if (ex.StatusCode != 400)
                    {
                        throw;
                    }
                }
            }).Wait();

            Contents = ClientManager.CreateContentsClient <TestEntityWithReferences, TestEntityWithReferencesData>(SchemaName);
        }
Exemplo n.º 6
0
 public ContentService(IContentsClient contents, ContentManagementOptions options)
 {
     UploadChunkSize   = options.UploadChunkSize;
     downloadChunkSize = options.DownloadChunkSize;
     this.contents     = contents;
 }
Exemplo n.º 7
0
 public AuthorImporter(ISession session)
 {
     client = session.Contents <AuthorContent, AuthorData>("author");
 }
Exemplo n.º 8
0
 public UserStore(SquidexClientManager clientManager)
 {
     apiClient = clientManager.CreateContentsClient <UserEntity, UserData>("users");
 }
Exemplo n.º 9
0
 public UserStore(SquidexClientManagerFactory factory)
 {
     apiClient = factory.GetContentsClient <UserEntity, UserData>("users");
 }