---
title: "エンドポイント設定プラグインを実装してください"
slug: "implement-an-endpoint-settings-plugin"
abstract: "Sitecore Data Exchange Frameworkでエンドポイント設定プラグインの作成と実装方法。"
---
# エンドポイント設定プラグインを実装してください

エンドポイントの設定はエンドポイントテンプレートを使って設定されます。この例では、読み取れるファイルのパスや、ファイルの最初の行に列ヘッダーがあるかどうかなどの設定が可能です。

エンドポイントテンプレートは、エンドポイント設定へのデザインタイムアクセスを提供します。エンドポイント設定への実行時アクセスはプラグインを通じて提供されます。エンドポイントの特定の設定を処理するにはプラグインを使用する必要があります。

エンドポイント設定プラグインを実装するには:

1.  Visual Studioで、次のクラスを追加します:
    
    using Sitecore.DataExchange;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace Examples.DataExchange.Providers.FileSystem
    {
     public class TextFileSettings : IPlugin
     {
     public TextFileSettings() { }
     public bool ColumnHeadersInFirstLine { get; set; }
     public string ColumnSeparator { get; set; }
     public string Path { get; set; }
     }
    }
    
2.  次のクラスを加えます:
    
    using Sitecore.DataExchange.Models;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace Examples.DataExchange.Providers.FileSystem
    {
     public static class EndpointExtensions
     {
     public static TextFileSettings GetTextFileSettings(this Endpoint endpoint)
     {
     return endpoint.GetPlugin<TextFileSettings>();
     }
     public static bool HasTextFileSettings(this Endpoint endpoint)
     {
     return (GetTextFileSettings(endpoint) != null);
     }
     }
    }
    

> !注この拡張メソッドは、必要なときにプラグインにアクセスしやすくします。
> 
> プラグインへのアクセスための拡張メソッドを提供することは、Data Exchange Frameworkのプロバイダーを実装する際に考慮すべきベストプラクティスです。