Experimental project

This is a sandbox project, which contains experimental code for developer use only.

First implementation of Migrate functionality for Location module

Data handling: JSON data support ONLY!

D6 XML Example

Drupal 6 example, the data is handled extending XMLMigration class: the $current_row stores a SimpleXMLElement and thus allows an XPath element selection..

   function prepareRow($current_row) {
    // Managing Address
    $address = array(
      'street' => (string) current($current_row->xml->xpath('Indirizzo')),
      'city' => (string) current($current_row->xml->xpath('Citta')),
      'province' => (string) current($current_row->xml->xpath('Prov')),
      'region' => (string) current($current_row->xml->xpath('Regione')),
      'country' => 'it',
      'additional' => NULL,
      'postal_code' => NULL,
      'latitude' => (string) current($current_row->xml->xpath('Latitudine')),
      'longitude' => (string) current($current_row->xml->xpath('Longitudine')),
    );
    
    }    
    $current_row->xml->addChild('Location', serialize(drupal_to_js($address)));

__construct() function:

   function __construct() {
    // Handling Location:
    $location_arguments = MigrateLocationFieldHandler::arguments();
    $this->addFieldMapping('field_location', 'Location')->xpath('Location')->callbacks('unserialize')->arguments($location_arguments);

Project information

  • caution Seeking co-maintainer(s)
    Maintainers are looking for help reviewing issues.
  • Project categories: Site structure
  • Created by thepanz on , updated