You are here

function feed_import_feed_import_process_info in Feed Import 7.2

Same name and namespace in other branches
  1. 7 feed_import.module \feed_import_feed_import_process_info()

Implements hook_feed_import_process_info().

File

./feed_import.module, line 185
User interface, cron functions for feed_import module

Code

function feed_import_feed_import_process_info() {

  // Return default process functions located in FeedImport class.
  $processXmlSettings = array();
  for ($i = 0; $i < 5; $i++) {
    $processXmlSettings['namespace_' . $i] = array(
      'title' => t('Namespace') . ' ' . ($i + 1),
      'description' => '',
      'default' => '',
    );
  }
  return array(
    'processXML' => array(
      'info' => t('Set namespaces with format: name http://example.com/namespace. This may slow down import.'),
      'function' => array(
        'FeedImport',
        'processXML',
      ),
      'settings' => $processXmlSettings,
      'validate' => array(
        'FeedImportFilter',
        'processXMLValidate',
      ),
    ),
    'processXMLChunked' => array(
      'info' => t('Set xml properties and chunk size.'),
      'function' => array(
        'FeedImport',
        'processXMLChunked',
      ),
      'settings' => array(
        'items_count' => array(
          'title' => t('Save entities when this number of imported items is reached'),
          'description' => t('This is used to keep memory in a stable range and not exceed it.'),
          'default' => 1000,
        ),
        'xml_properties' => array(
          'title' => t('XML properties'),
          'description' => t('Change xml properties like encoding.'),
          'default' => '<?xml version="1.0" encoding="utf-8"?>',
        ),
        'chunk_size' => array(
          'title' => t('Chunk size in bytes'),
          'description' => t('How many bytes to read in each chunk.'),
          'default' => 8192,
        ),
        'substr_function' => array(
          'title' => t('Substring function'),
          'description' => t('What function to use for substring: substr, mb_substr or drupal_substr.'),
          'default' => 'substr',
        ),
      ),
      'validate' => array(
        'FeedImport',
        'processXMLChunkedValidate',
      ),
    ),
    'processHTMLPage' => array(
      'info' => t('You can ignore HTML errors so they will not appear in report.'),
      'function' => array(
        'FeedImport',
        'processHTMLPage',
      ),
      'settings' => array(
        'report_html_errors' => array(
          'title' => t('Report HTML errors'),
          'description' => t('Use 1 to report or 0 to ignore HTML errors.'),
          'default' => 1,
        ),
      ),
      'validate' => array(
        'FeedImport',
        'processHTMLPAgeValidate',
      ),
    ),
    'processCSV' => array(
      'info' => t('For parent xpath use //row') . '<br />' . t("Use column[@index='1'] or column[1] to get first column and use column[@name='age'] to get column 'age' if Use column names is enabled."),
      'function' => array(
        'FeedImport',
        'processCSV',
      ),
      'settings' => array(
        'length' => array(
          'title' => t('Line length'),
          'description' => t('Length must be greater than the longest line in CSV file.') . '<br />' . t('Use 0 if you want to omit this but reading will be slightly slow.'),
          'default' => 0,
        ),
        'delimiter' => array(
          'title' => t('Delimiter character'),
          'description' => t('Set the field delimiter.'),
          'default' => ',',
        ),
        'enclosure' => array(
          'title' => t('Enclosure character'),
          'description' => t('Set the field enclosure character.'),
          'default' => '"',
        ),
        'escape' => array(
          'title' => t('Escape character'),
          'description' => t('Set the escape character.'),
          'default' => '\\',
        ),
        'use_column_names' => array(
          'title' => t('Use column names'),
          'description' => t('Using this, first line will be interpretated as column names and not imported.') . '<br />' . t('Use 1 for YES and 0 for NO.'),
          'default' => 0,
        ),
      ),
      'validate' => array(
        'FeedImport',
        'processCSVValidate',
      ),
    ),
    'processXmlReader' => array(
      'function' => array(
        'FeedImport',
        'processXmlReader',
      ),
      'info' => t('Process xml using XmlReader.'),
      'settings' => array(
        'items_count' => array(
          'title' => t('Save entities when this number of imported items is reached'),
          'description' => t('This is used to keep memory in a stable range and not exceed it.'),
          'default' => 500,
        ),
      ),
      'validate' => array(
        'FeedImport',
        'processXmlReaderValidate',
      ),
    ),
    'processJSON' => array(
      'function' => array(
        'FeedImport',
        'processJSON',
      ),
      'info' => t('Process JSON string.'),
      'settings' => array(
        'xml_properties' => array(
          'title' => t('XML properties'),
          'description' => t('Change xml properties like encoding or root element.'),
          'default' => '<?xml version="1.0" encoding="utf-8"?><root/>',
        ),
      ),
      'validate' => array(
        'FeedImport',
        'processJSONValidate',
      ),
    ),
  );
}