カスタム・データ・ソースのソース・プロパティ

カスタム・データ・ソース・クロールのSourceConfigには、クロールへのカスタム・データ・ソースおよびカスタム・データ・ソースに必要なその他のオプションのプロパティを定義する必須のModuleIdおよびModulePropertyオブジェクトが含まれています。

カスタム・データ・ソースのモジュールID

プラグインの開発者は、カスタム・データ・ソースにModuleIdを指定します。IASデータの開発者は、IAS Serverコマンドライン・ユーティリティでlistModulesおよびタスクを実行して、カスタム・データ・ソースのModuleIdを決定できます。
  1. コマンド・プロンプトを起動し、<install path>\IAS\<version>\binに移動します。
  2. ias-cmdと入力し、listModulesタスクおよびモジュール・タイプ(-t)オプションを指定して、引数にSOURCEを指定します。たとえば、次のようになります。
    ias-cmd.bat listModules -t SOURCE
    Sample Data Source
     *Id: Sample Data Source
     *Type: SOURCE
     *Description: Sample Data Source for Testing
    
    ...
  3. listModulesによって返されるデータ・ソースのリストから、カスタム・データ・ソースおよびID値を見つけます。

カスタム・データ・ソースのモジュール・プロパティ

カスタム・データ・ソースは、任意の数のモジュール・プロパティを使用できます。プラグインの開発者は、カスタム・データ・ソースに必要なモジュール・プロパティおよびそのモジュール・プロパティがオプションに必要であるかどうかを決定できます。

IASデータの開発者は、IAS Serverコマンドライン・ユーティリティのgetModuleSpecタスクを実行して、カスタム・データ・ソースに利用可能なモジュール・プロパティを確認できます。
  1. コマンド・プロンプトを起動し、<install path>\IAS\<version>\binに移動します。
  2. ias-cmdと入力し、getModuleSpecタスクおよび表示するソース・プロパティのIDを指定します。たとえば、次のようになります。
    ias-cmd.bat getModuleSpec -id "Sample Data Source"
     Sample Data Source
     =================
     [Module Information]
     *Id: Sample Data Source
     *Type: SOURCE
     *Description: Sample Data Source for Testing
     
     [Sample Data Source Configuration Properties]
     Group: Basic Settings
     ---------------------
     User name:
      *Name: username
      *Type: {http://www.w3.org/2001/XMLSchema}string
      *Required: true
      *Max Length: 256
      *Description: The name of the user used to log on to the repository
      *Multiple Values: false
      *Multiple Lines: false
      *Password: false
      *Always Show: true
    
     Password:
      *Name: password
      *Type: {http://www.w3.org/2001/XMLSchema}string
      *Required: true
      *Max Length: 256
      *Description: The password used to log on to the repository
      *Multiple Values: false
      *Multiple Lines: false
      *Password: true
      *Always Show: true
    
    ...
カスタム・データ・ソース・クロールのソース・プロパティの例は、次のとおりです。
// Connect to the IAS Server.
ServiceAddress address = new ServiceAddress("localhost", 8401, contextPath); 
IasCrawlerLocator locator = IasCrawlerLocator.create(address); 
IasCrawler crawler = locator.getService();

// Create a new crawl Id with the name set to Demo.
CrawlId crawlId = new CrawlId("Demo"); 

// Create the crawl configuration.
CrawlConfig crawlConfig = new CrawlConfig(crawlId);

// Create the source configuration.
SourceConfig sourceConfig = new SourceConfig();

// Create a module ID for a Sample Data Source repository.
// Set the module ID in the constructor. 
ModuleId moduleId = new ModuleId("Sample Data Source");

// Create a list for the module property objects.
List<ModuleProperty> cmsPropsList = new ArrayList<ModuleProperty>();

// Create a module property for username.
// Set key/values of the module property as strings in the constructor.
ModuleProperty uname = new ModuleProperty("username", "SALES\\username");

// Set the module property in the module property list.
cmsPropsList.add(uname);

// Create a module property for password.
// Set key/values of the module property as strings in the constructor.
ModuleProperty upass = new ModuleProperty("password", "endeca");

// Set the module property in the module property list.
cmsPropsList.add(upass);

// Set the module property list in the source configuration.
sourceConfig.setModuleProperties(cmsPropsList);

// Set the source configuration in the crawl configuration.
crawlConfig.setSourceConfig(SourceConfig);

// Create the crawl.
crawler.createCrawl(crawlConfig);