To retrieve information from a Drupal content management system, create a new fetch task by following these steps. The connector runs fetch tasks automatically, based on the schedule that is configured in the configuration file.
To create a new Fetch Task
In the [FetchTasks]
section of the configuration file, specify the number of fetch tasks using the Number
parameter. If you are configuring the first fetch task, type Number=1
. If one or more fetch tasks have already been configured, increase the value of the Number
parameter by one (1). Below the Number
parameter, specify the names of the fetch tasks, starting from zero (0). For example:
[FetchTasks] Number=1 0=MyTask
Below the [FetchTasks]
section, create a new TaskName section. The name of the section must match the name of the new fetch task. For example:
[FetchTasks] Number=1 0=MyTask [MyTask]
In the new section, set the following configuration parameters:
DrupalHost
|
The machine that hosts the Drupal content management system. |
User
|
The user name to use to authenticate with the Drupal API. |
Password
|
The password to use to authenticate with the Drupal API. For information about how to encrypt the password before entering it into the configuration file, see Encrypt Passwords. |
EntitySections
|
A comma-separated list of configuration file sections that define the entity types to retrieve. |
Create a section for each of the entity types that you want to retrieve and set the following configuration parameters in each section:
Name
|
The name of the entity type. For example, comment , node , file , taxonomy_term , taxonomy_vocabulary or user . |
IdAttribute
|
The path to, or name of, the attribute in the response from the Drupal RESTws web service that contains the entity's unique ID number. |
ContentAttribute
|
The path to, or name of, the attribute in the response from the Drupal RESTws web service that contains the entity's content. This information becomes the content of the ingested document. |
ContentAttributeIsUrl
|
If the JSON attribute identified by ContentAttribute contains a URL to a file, set this parameter to true . |
CrawlEntity
|
A Boolean value that specifies whether to retrieve every instance of the entity type. You must configure the connector to crawl at least one entity type, otherwise no entities are retrieved. |
ScourEntities
|
The connector can follow links from the entities that it retrieves to entities of different types, and other entities of the same type if the type hasn't already been crawled. Set this parameter to a comma-separated list of the entity types to retrieve by following a link from an entity being processed. Any object in a JSON response containing only the attributes 'id', 'resource', and 'url' is treated as a link to another entity. The entity names you specify must relate to the 'resource' attribute in the response from the Drupal API. You can use the wildcard You can also set this parameter in the TaskName section, to provide a default value for all of your entity definitions. |
For example:
[MyTask] User=user Password=password DrupalHost=http://drupal.company.com EntitySections=ENTITY_NODE,ENTITY_FILE [ENTITY_NODE] name=node IdAttribute=nid ContentAttribute=body/value CrawlEntity=true ScourEntities=* [ENTITY_FILE] name=file IdAttribute=fid ContentAttribute=url ContentAttributeIsUrl=true ScourEntities=user
|