diff --git a/feeds.module b/feeds.module
index a73e061..9d1d8be 100644
--- a/feeds.module
+++ b/feeds.module
@@ -180,6 +180,15 @@ function feeds_menu() {
         'file' => 'feeds.pages.inc',
         'type' => MENU_LOCAL_TASK,
       );
+      $items['import/'. $importer->id . '/mapping'] = array(
+      'title' => t('Mapping'),
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('feeds_import_mapping_form', 1),
+      'access callback' => 'feeds_access',
+      'access arguments' => array('import', $importer->id),
+      'file' => 'feeds.pages.inc',
+      'type' => MENU_LOCAL_TASK,
+      );
     }
     else {
       $items['node/%node/import'] = array(
@@ -202,6 +211,16 @@ function feeds_menu() {
         'type' => MENU_LOCAL_TASK,
         'weight' => 11,
       );
+      $items['node/%node/mapping'] = array(
+        'title' => t('Mapping'),
+        'page callback' => 'drupal_get_form',
+        'page arguments' => array('feeds_import_mapping_form', NULL, 1),
+        'access callback' => 'feeds_access',
+        'access arguments' => array('import', 1),
+        'file' => 'feeds.pages.inc',
+        'type' => MENU_LOCAL_TASK,
+        'weight' => 12,
+      );
     }
     $items += $importer->fetcher->menuItem();
   }
@@ -231,6 +250,9 @@ function feeds_theme() {
     'feeds_upload' => array(
       'file' => 'feeds.pages.inc',
     ),
+    'feeds_mapping_form' => array(
+      'file' => 'feeds.pages.inc'
+    ),
   );
 }
 
@@ -387,17 +409,19 @@ function feeds_nodeapi(&$node, $op, $form) {
         $source->addConfig($node_feeds);
         $source->save();
 
-        // Refresh feed if import on create is selected and suppress_import is
-        // not set.
-        if ($op == 'insert' && feeds_importer($importer_id)->config['import_on_create'] && !isset($node_feeds['suppress_import'])) {
-          feeds_batch_set(t('Importing'), 'import', $importer_id, $node->nid);
+        if ($source->importer->processor->config['mapping_on_import']) {
+          $_REQUEST['destination'] = 'node/' . $node->nid . '/mapping/' . $source->importer->id;
         }
-        // Add source to schedule, make sure importer is scheduled, too.
-        if ($op == 'insert') {
+        else {
+          // Refresh feed if import on create is selected and suppress_import is
+          // not set.
+          if ($op == 'insert' && feeds_importer($importer_id)->config['import_on_create'] && !isset($node_feeds['suppress_import'])) {
+            feeds_batch_set(t('Importing'), 'import', $importer_id, $node->nid);
+          }
+          // Add to schedule, make sure importer is scheduled, too.
           $source->schedule();
           $source->importer->schedule();
         }
-        $node_feeds = NULL;
         break;
       case 'delete':
         $source = feeds_source($importer_id, $node->nid);
diff --git a/feeds.pages.inc b/feeds.pages.inc
index 125a284..25edd2f 100644
--- a/feeds.pages.inc
+++ b/feeds.pages.inc
@@ -64,6 +64,12 @@ function feeds_import_form(&$form_state, $importer_id) {
     '#type' => 'submit',
     '#value' => t('Import'),
   );
+
+  // If mapping on import is selected, redirect to feeds_import_mapping_form
+  if ($source->importer->processor->config['mapping_on_import']) {
+    $form['#redirect'] = 'import/' . $importer_id . '/mapping';
+  }
+
   return $form;
 }
 
@@ -85,14 +91,19 @@ function feeds_import_form_submit($form, &$form_state) {
   $source->addConfig($form_state['values']['feeds']);
   $source->save();
 
-  // Refresh feed if import on create is selected.
-  if ($source->importer->config['import_on_create']) {
-    feeds_batch_set(t('Importing'), 'import', $form['#importer_id']);
+  if ($source->importer->processor->config['mapping_on_import']) {
+    // Handle the redirection to mapping form
+    $form_state['redirect'] = $form['#redirect'];
+  }
+  else {
+    // Refresh feed if import on create is selected.
+    if ($source->importer->config['import_on_create']) {
+      feeds_batch_set(t('Importing'), 'import', $form['#importer_id']);
+    }
+    // Add to schedule, make sure importer is scheduled, too.
+    $source->schedule();
+    $source->importer->schedule();
   }
-
-  // Add to schedule, make sure importer is scheduled, too.
-  $source->schedule();
-  $source->importer->schedule();
 }
 
 /**
@@ -188,3 +199,149 @@ function theme_feeds_upload($element) {
   $output .= '</div>';
   return theme('form_element', $element, $output);
 }
+
+/**
+ * Declare Feeds mapping on import form
+ */
+function feeds_import_mapping_form(&$form_state, $importer_id, $node = NULL) {
+  if (empty($node)) {
+    $feed_nid = 0;
+  }
+  else {
+    $importer_id = feeds_get_importer_id($node->type);
+    $feed_nid = empty($node) ? 0 : $node->nid;
+  }
+
+  $source = feeds_source($importer_id, $feed_nid);
+
+  // Fetch and parse the source to enable batch to provide mapping sources
+  $batch = $source->importer->fetcher->fetch($source);
+  // Signify to the parser that we're only after the fieldnames for mapping
+  $batch->context = 'mapping';
+  $source->importer->parser->parse($batch, $source);
+
+  $form = $source->importer->processor->mappingForm($form_state, $batch);
+
+  // Declare the appropriate configurable and forms method for appropriate submit handler
+  $form['#feeds_form_method'] = 'mappingForm';
+  $form['#configurable'] = $source->importer->processor;
+
+  $form['#importer_id'] = $importer_id;
+  $form['#feed_nid'] = $feed_nid;
+
+  $form['import'] = array(
+    '#type' => 'submit',
+    '#value' => t('Import'),
+    '#submit' => array('feeds_import_mapping_form_import_submit'),
+  );
+  return $form;
+}
+
+/**
+ * Default submit handler for mapping on import form
+ */
+function feeds_import_mapping_form_submit($form, &$form_state) {
+  $form['#configurable']->addConfig($form_state['values']);
+  $form['#configurable']->save();
+  drupal_set_message(t('Your changes have been saved.'));
+  feeds_cache_clear(FALSE);
+}
+
+/**
+ * Import submit handler for mapping on import form
+ */
+function feeds_import_mapping_form_import_submit($form, &$form_state) {
+  // Handle the redirections
+  if (!$form['#feed_nid']) {
+    $form_state['redirect'] = 'import/' . $form['#importer_id'];
+  }
+  else {
+    $form_state['redirect'] = 'node/' . $form['#feed_nid'];
+  }
+
+  $source = feeds_source($form['#importer_id'], $form['#feed_nid']);
+
+  // Refresh feed if import on create is selected.
+  if ($source->importer->config['import_on_create']) {
+    feeds_batch_set(t('Importing'), 'import', $form['#importer_id'], $form['#feed_nid']);
+  }
+
+  // Add to schedule, make sure importer is scheduled, too.
+  $source->schedule();
+  $source->importer->schedule();
+}
+
+/**
+ * Theme function for feeds_mapping_form().
+ */
+function theme_feeds_mapping_form($form) {
+  // Build the actual mapping table.
+  $header = array(
+    t('Source'),
+    t('Target'),
+    t('Unique target'),
+    '&nbsp;',
+  );
+  $rows = array();
+  if (is_array($form['#mappings'])) {
+    foreach ($form['#mappings'] as $i => $mapping) {
+      $rows[] = array(
+        check_plain($mapping['source']),
+        check_plain($mapping['target']),
+        drupal_render($form['unique_flags'][$i]),
+        drupal_render($form['remove_flags'][$i]),
+      );
+    }
+  }
+  if (!count($rows)) {
+    $rows[] = array(
+      array(
+        'colspan' => 4,
+        'data' => t('No mappings defined.'),
+      ),
+    );
+  }
+  $rows[] = array(
+    drupal_render($form['source']),
+    drupal_render($form['target']),
+    '',
+    drupal_render($form['add']),
+  );
+  $output = '<div class="help feeds-admin-ui""'. drupal_render($form['help']) .'</div>';
+  $output .= theme('table', $header, $rows);
+
+  // Build the help table that explains available sources.
+  $legend = '';
+  $rows = array();
+  foreach (element_children($form['legendset']['legend']['sources']) as $k) {
+    $rows[] = array(
+      check_plain(drupal_render($form['legendset']['legend']['sources'][$k]['name'])),
+      check_plain(drupal_render($form['legendset']['legend']['sources'][$k]['description'])),
+    );
+  }
+  if (count($rows)) {
+    $legend .= '<h4>'. t('Sources') .'</h4>';
+    $legend .= theme('table', array(t('Name'), t('Description')), $rows);
+  }
+
+  // Build the help table that explains available targets.
+  $rows = array();
+  foreach (element_children($form['legendset']['legend']['targets']) as $k) {
+    $rows[] = array(
+      check_plain(drupal_render($form['legendset']['legend']['targets'][$k]['name'])),
+      check_plain(drupal_render($form['legendset']['legend']['targets'][$k]['description'])),
+    );
+  }
+  $legend .= '<h4>'. t('Targets') .'</h4>';
+  $legend .= theme('table', array(t('Name'), t('Description')), $rows);
+
+  // Stick tables into collapsible fieldset.
+  $form['legendset']['legend'] = array(
+    '#value' => '<div>'. filter_xss($legend) .'</div>',
+  );
+
+  $output .= drupal_render($form['legendset']);
+
+  $output .= drupal_render($form);
+  return $output;
+}
diff --git a/feeds_ui/feeds_ui.admin.inc b/feeds_ui/feeds_ui.admin.inc
index ba2769e..df0a932 100644
--- a/feeds_ui/feeds_ui.admin.inc
+++ b/feeds_ui/feeds_ui.admin.inc
@@ -35,17 +35,6 @@ function feeds_ui_edit_help() {
 }
 
 /**
- * Help text for mapping.
- */
-function feeds_ui_mapping_help() {
-  return t('
-  <p>
-  Define which elements of a single item of a feed (= <em>Sources</em>) map to which content pieces in Drupal (= <em>Targets</em>). Make sure that at least one definition has a <em>Unique target</em>. A unique target means that a value for a target can only occur once. E. g. only one item with the URL <em>http://example.com/story/1</em> can exist.
-  </p>
-  ');
-}
-
-/**
  * Build overview of available configurations.
  */
 function feeds_ui_overview_form(&$form_status) {
@@ -311,8 +300,10 @@ function feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '') {
       }
       break;
     case 'mapping':
-      $active_container['title'] = t('Mapping for !processor', array('!processor' => $plugins[$config['processor']['plugin_key']]['name']));
-      $active_container['body'] = drupal_get_form('feeds_ui_mapping_form', $importer);
+      if (in_array($plugin_key, array_keys($plugins)) && $plugin = feeds_plugin_instance($plugin_key, $importer->id)) {
+        $active_container['title'] = t('Mapping for !processor', array('!processor' => $plugins[$config['processor']['plugin_key']]['name']));
+        $active_container['body'] = feeds_get_form($plugin, 'mappingForm');
+      }
       break;
   }
 
@@ -383,8 +374,8 @@ function feeds_ui_edit_page($importer, $active = 'help', $plugin_key = '') {
   $actions = array();
   if (feeds_get_form($importer->processor, 'configForm')) {
     $actions[] = l(t('Settings'), $path .'/settings/'. $config['processor']['plugin_key']);
+    $actions[] = l(t('Mapping'), $path .'/mapping/'. $config['processor']['plugin_key']);
   }
-  $actions[] = l(t('Mapping'), $path .'/mapping');
   $info['title'] = t('Processor');
   $info['body'] = array(
     array(
@@ -474,157 +465,6 @@ function theme_feeds_ui_plugin_form($form) {
 }
 
 /**
- * Edit mapping.
- *
- * @todo Completely merge this into config form handling. This is just a
- *   shared form of configuration, most of the common functionality can live in
- *   FeedsProcessor, a flag can tell whether mapping is supported or not.
- */
-function feeds_ui_mapping_form(&$form_state, $importer) {
-  drupal_add_js(drupal_get_path('module', 'feeds_ui') .'/feeds_ui.js');
-
-  $form = array();
-  $form['#importer'] = $importer;
-  $form['#mappings'] = $mappings = $importer->processor->getMappings();
-  $form['help']['#value'] = feeds_ui_mapping_help();
-
-  // Get mapping sources from parsers and targets from processor, format them
-  // for output.
-  // Some parsers do not define mapping sources but let them define on the fly.
-  if ($sources = $importer->parser->getMappingSources()) {
-    $source_options = _feeds_ui_format_options($sources);
-    foreach ($sources as $k => $source) {
-      $legend['sources'][$k]['name']['#value'] = empty($source['name']) ? $k : $source['name'];
-      $legend['sources'][$k]['description']['#value'] = empty($source['description']) ? '' : $source['description'];
-    }
-  }
-  else {
-    $legend['sources']['#value'] = t('This parser supports free source definitions. Enter the name of the source field in lower case into the Source text field above.');
-  }
-  $targets = $importer->processor->getMappingTargets();
-  $target_options = _feeds_ui_format_options($targets);
-  foreach ($targets as $k => $target) {
-    $legend['targets'][$k]['name']['#value'] = empty($target['name']) ? $k : $target['name'];
-    $legend['targets'][$k]['description']['#value'] = empty($target['description']) ? '' : $target['description'];
-  }
-
-  // Legend explaining source and target elements.
-  $form['legendset'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Legend'),
-    '#collapsible' => TRUE,
-    '#collapsed' => TRUE,
-    '#tree' => TRUE,
-  );
-  $form['legendset']['legend'] = $legend;
-
-  // Add unique and remove forms to mappings.
-  $form['unique_flags'] = $form['remove_flags'] = array(
-    '#tree' => TRUE,
-  );
-  if (is_array($mappings)) {
-    foreach ($mappings as $i => $mapping) {
-      $param = array(
-        'processor' => $importer->processor,
-        'mapping' => $mapping,
-      );
-      if (isset($targets[$mapping['target']]['optional_unique']) && $targets[$mapping['target']]['optional_unique'] === TRUE) {
-        $form['unique_flags'][$i] = array(
-          '#type' => 'checkbox',
-          '#default_value' => !empty($mapping['unique']),
-          '#attributes' => array('class' => 'feeds-ui-trigger-submit'),
-        );
-      }
-      $form['remove_flags'][$i] = array(
-        '#type' => 'checkbox',
-        '#title' => t('Remove'),
-        '#prefix' => '<div class="feeds-ui-checkbox-link">',
-        '#suffix' => '</div>',
-      );
-    }
-  }
-
-  if (isset($source_options)) {
-    $form['source'] = array(
-      '#type' => 'select',
-      '#options' => array('' => t('Select a source')) + $source_options,
-    );
-  }
-  else {
-    $form['source'] = array(
-      '#type' => 'textfield',
-      '#size' => 20,
-      '#default_value' => t('Name of source field'),
-      '#attributes' => array('class' => 'hide-text-on-focus'),
-    );
-  }
-  $form['target'] = array(
-    '#type' => 'select',
-    '#options' => array('' => t('Select a target')) + $target_options,
-  );
-  $form['add'] = array(
-    '#type' => 'submit',
-    '#value' => t('Add'),
-    '#submit' => array('feeds_ui_mapping_form_add_submit'),
-  );
-  $form['save'] = array(
-    '#type' => 'submit',
-    '#value' => t('Save'),
-    '#attributes' => array('class' => 'feeds-ui-hidden-submit'),
-  );
-  return $form;
-}
-
-/**
- * Submit handler for add button on feeds_ui_mapping_form().
- */
-function feeds_ui_mapping_form_add_submit($form, &$form_state) {
-  $importer = $form['#importer'];
-  try {
-    $mappings = $form['#mappings'];
-    $mappings[] = array(
-      'source' => $form_state['values']['source'],
-      'target' => $form_state['values']['target'],
-      'unique' => FALSE,
-    );
-    $importer->processor->addConfig(array('mappings' => $mappings));
-    $importer->processor->save();
-    drupal_set_message(t('Mapping has been added.'));
-  }
-  catch (Exception $e) {
-    drupal_set_message($e->getMessage(), 'error');
-  }
-}
-
-/**
- * Submit handler for save button on feeds_ui_mapping_form().
- */
-function feeds_ui_mapping_form_submit($form, &$form_state) {
-  $processor = $form['#importer']->processor;
-  // We may set some unique flags to mappings that we remove in the subsequent
-  // step, that's fine.
-  $mappings = $form['#mappings'];
-  if (isset($form_state['values']['unique_flags'])) {
-    foreach ($form_state['values']['unique_flags'] as $k => $v) {
-      $mappings[$k]['unique'] = $v;
-    }
-  }
-
-  if (!empty($form_state['values']['remove_flags'])) {
-    foreach ($form_state['values']['remove_flags'] as $k => $v) {
-      if ($v) {
-        unset($mappings[$k]);
-      }
-    }
-    // Keep our keys clean.
-    $mappings = array_values($mappings);
-  }
-  $processor->addConfig(array('mappings' => $mappings));
-  $processor->save();
-  drupal_set_message(t('Your changes have been saved.'));
-}
-
-/**
  * Walk the result of FeedsParser::getMappingSources() or
  * FeedsProcessor::getMappingTargets() and format them into
  * a Form API options array.
@@ -769,81 +609,3 @@ function theme_feeds_ui_container($container) {
   $output .= '</div>';
   return $output;
 }
-
-/**
- * Theme function for feeds_ui_mapping_form().
- */
-function theme_feeds_ui_mapping_form($form) {
-
-  // Build the actual mapping table.
-  $header = array(
-    t('Source'),
-    t('Target'),
-    t('Unique target'),
-    '&nbsp;',
-  );
-  $rows = array();
-  if (is_array($form['#mappings'])) {
-    foreach ($form['#mappings'] as $i => $mapping) {
-      // Some parsers do not define source options.
-      $source = isset($form['source']['#options'][$mapping['source']]) ? $form['source']['#options'][$mapping['source']] : $mapping['source'];
-      $rows[] = array(
-        check_plain($source),
-        check_plain($form['target']['#options'][$mapping['target']]),
-        drupal_render($form['unique_flags'][$i]),
-        drupal_render($form['remove_flags'][$i]),
-      );
-    }
-  }
-  if (!count($rows)) {
-    $rows[] = array(
-      array(
-        'colspan' => 4,
-        'data' => t('No mappings defined.'),
-      ),
-    );
-  }
-  $rows[] = array(
-    drupal_render($form['source']),
-    drupal_render($form['target']),
-    '',
-    drupal_render($form['add']),
-  );
-  $output = '<div class="help feeds-admin-ui""'. drupal_render($form['help']) .'</div>';
-  $output .= theme('table', $header, $rows);
-
-  // Build the help table that explains available sources.
-  $legend = '';
-  $rows = array();
-  foreach (element_children($form['legendset']['legend']['sources']) as $k) {
-    $rows[] = array(
-      check_plain(drupal_render($form['legendset']['legend']['sources'][$k]['name'])),
-      check_plain(drupal_render($form['legendset']['legend']['sources'][$k]['description'])),
-    );
-  }
-  if (count($rows)) {
-    $legend .= '<h4>'. t('Sources') .'</h4>';
-    $legend .= theme('table', array(t('Name'), t('Description')), $rows);
-  }
-
-  // Build the help table that explains available targets.
-  $rows = array();
-  foreach (element_children($form['legendset']['legend']['targets']) as $k) {
-    $rows[] = array(
-      check_plain(drupal_render($form['legendset']['legend']['targets'][$k]['name'])),
-      check_plain(drupal_render($form['legendset']['legend']['targets'][$k]['description'])),
-    );
-  }
-  $legend .= '<h4>'. t('Targets') .'</h4>';
-  $legend .= theme('table', array(t('Name'), t('Description')), $rows);
-
-  // Stick tables into collapsible fieldset.
-  $form['legendset']['legend'] = array(
-    '#value' => '<div>' . $legend . '</div>',
-  );
-
-  $output .= drupal_render($form['legendset']);
-
-  $output .= drupal_render($form);
-  return $output;
-}
diff --git a/feeds_ui/feeds_ui.module b/feeds_ui/feeds_ui.module
index 86cd508..73f8ac2 100644
--- a/feeds_ui/feeds_ui.module
+++ b/feeds_ui/feeds_ui.module
@@ -89,9 +89,6 @@ function feeds_ui_theme() {
     'feeds_ui_overview_form' => array(
       'file' => 'feeds_ui.admin.inc',
     ),
-    'feeds_ui_mapping_form' => array(
-      'file' => 'feeds_ui.admin.inc',
-    ),
     'feeds_ui_edit_page' => array(
       'file' => 'feeds_ui.admin.inc',
     ),
diff --git a/includes/FeedsBatch.inc b/includes/FeedsBatch.inc
index 4e1a031..81bb2d1 100644
--- a/includes/FeedsBatch.inc
+++ b/includes/FeedsBatch.inc
@@ -149,6 +149,7 @@ class FeedsImportBatch extends FeedsBatch {
   public $feed_nid;
   public $created;
   public $updated;
+  public $context;
 
   public function __construct($raw = '', $feed_nid = 0) {
     parent::__construct();
@@ -170,6 +171,7 @@ class FeedsImportBatch extends FeedsBatch {
     $this->feed_nid = $feed_nid;
     $this->created = 0;
     $this->updated = 0;
+    $this->context = 'import';
   }
 
   /**
@@ -345,6 +347,22 @@ class FeedsImportBatch extends FeedsBatch {
   public function getItemCount() {
     return count($this->items);
   }
+
+  /**
+   * Get mapping sources after the batch items has been populated
+   */
+  public function getMappingSources() {
+    $sources = array();
+    if ($this->total > 0) {
+      foreach ($this->items[0] as $k => $v) {
+        $sources[$k] = array(
+          'title' => $k,
+          'description' => '',
+        );
+      }
+    }
+    return $sources;
+  }
 }
 
 /**
diff --git a/plugins/FeedsCSVParser.inc b/plugins/FeedsCSVParser.inc
index 58af8de..ee8c82c 100644
--- a/plugins/FeedsCSVParser.inc
+++ b/plugins/FeedsCSVParser.inc
@@ -103,7 +103,7 @@ class FeedsCSVParser extends FeedsParser {
     $form = array();
     $form['#weight'] = -10;
 
-    $mappings = feeds_importer($this->id)->processor->config['mappings'];
+    $mappings = feeds_importer($this->id)->processor->getMappings();
     $sources = $uniques = array();
     foreach ($mappings as $mapping) {
       $sources[] = check_plain($mapping['source']);
diff --git a/plugins/FeedsDataProcessor.inc b/plugins/FeedsDataProcessor.inc
index 181bc91..7d97bac 100644
--- a/plugins/FeedsDataProcessor.inc
+++ b/plugins/FeedsDataProcessor.inc
@@ -237,6 +237,7 @@ class FeedsDataProcessor extends FeedsProcessor {
       'expire' => FEEDS_EXPIRE_NEVER, // Don't expire items by default.
       'mappings' => array(),
       'delete_with_source' => FALSE,
+      'mapping_on_import' => 0,
     );
   }
 
diff --git a/plugins/FeedsFeedNodeProcessor.inc b/plugins/FeedsFeedNodeProcessor.inc
index b083261..758d87e 100644
--- a/plugins/FeedsFeedNodeProcessor.inc
+++ b/plugins/FeedsFeedNodeProcessor.inc
@@ -107,6 +107,7 @@ class FeedsFeedNodeProcessor extends FeedsProcessor {
       'content_type' => '',
       'update_existing' => 0,
       'mappings' => array(),
+      'mapping_on_import' => 0,
     );
   }
 
diff --git a/plugins/FeedsNodeProcessor.inc b/plugins/FeedsNodeProcessor.inc
index f7c665a..6770357 100644
--- a/plugins/FeedsNodeProcessor.inc
+++ b/plugins/FeedsNodeProcessor.inc
@@ -164,6 +164,7 @@ class FeedsNodeProcessor extends FeedsProcessor {
       'mappings' => array(),
       'author' => 0,
       'authorize' => 0,
+      'mapping_on_import' => 0,
     );
   }
 
diff --git a/plugins/FeedsProcessor.inc b/plugins/FeedsProcessor.inc
index 3154def..9b64cac 100644
--- a/plugins/FeedsProcessor.inc
+++ b/plugins/FeedsProcessor.inc
@@ -105,7 +105,7 @@ abstract class FeedsProcessor extends FeedsPlugin {
       $target_item = (object)$target_item;
       $convert_to_array = TRUE;
     }
-    foreach ($this->config['mappings'] as $mapping) {
+    foreach ($this->getMappings() as $mapping) {
       if (isset($targets[$this->id][$mapping['target']]['real_target'])) {
         unset($target_item->{$targets[$this->id][$mapping['target']]['real_target']});
       }
@@ -165,14 +165,27 @@ abstract class FeedsProcessor extends FeedsPlugin {
    * Declare default configuration.
    */
   public function configDefaults() {
-    return array('mappings' => array());
+    return array('mappings' => array(),
+    'mapping_on_import' => 0,
+    );
   }
 
   /**
    * Get mappings.
+   *
+   * Mappings must not be got directly by using $this->config['mappings'] but instead via
+   * this function.
    */
   public function getMappings() {
-    return isset($this->config['mappings']) ? $this->config['mappings'] : array();
+    // If the source is not empty, use the source instead.
+    if (isset($this->source)) {
+      $config = $this->source->getConfigFor($this);
+      $mappings = isset($config['mappings']) ? $config['mappings'] : $this->config['mappings'];
+    }
+    else {
+      $mappings = $this->config['mappings'];
+    }
+    return $mappings;
   }
 
   /**
@@ -226,7 +239,7 @@ abstract class FeedsProcessor extends FeedsPlugin {
   protected function uniqueTargets(FeedsImportBatch $batch) {
     $parser = feeds_importer($this->id)->parser;
     $targets = array();
-    foreach ($this->config['mappings'] as $mapping) {
+    foreach ($this->getMappings() as $mapping) {
       if ($mapping['unique']) {
         // Invoke the parser's getSourceElement to retrieve the value for this
         // mapping's source.
@@ -235,4 +248,262 @@ abstract class FeedsProcessor extends FeedsPlugin {
     }
     return $targets;
   }
+
+  /**
+   * configDefaults for FeedsSource
+   */
+  function sourceDefaults() {
+    return array ('mappings' => $this->config['mappings']);
+  }
+
+  /**
+   * FeedsProcessor has source config
+   * default: mappings
+   */
+  function hasSourceConfig() {
+    return TRUE;
+  }
+
+  /**
+   * Render the mapping form.
+   * This function should NOT be overwritten.
+   * @param
+   *   The location from where this function is called. For now, it will be passed either
+   *   'import' or 'config'
+   * @param
+   *   The batch object that contains populated items that has been fetched and parsed.
+   *   This will only be handled if the first parameter is NOT 'config'
+   */
+  public function mappingForm(&$form_state, $batch = NULL) {
+    drupal_add_js(drupal_get_path('module', 'feeds_ui') .'/feeds_ui.js');
+
+    // Get the FeedsImporter object
+    $importer = feeds_importer($this->id);
+
+    $form = array();
+    if (empty($batch)) {
+      // Mapping on import checkbox
+      $form['mapping_on_import'] = array(
+        '#type' => 'checkbox',
+        '#title' => t('Define mapping on import'),
+        '#description' => t('If this is checked, the mapping form here will only act as a default mapping. User can further specify the preferred mapping in the import page.'),
+        '#weight' => -100,
+        '#default_value' => $this->config['mapping_on_import'],
+      );
+    }
+
+    $form['#theme'] = 'feeds_mapping_form';
+    $form['help']['#value'] = feeds_mapping_form_help();
+
+    // Get mapping sources from parsers or batch and targets from processor, format them
+    // for output.
+    // Some parsers do not define mapping sources but let them define on the fly.
+    if (empty($batch) || $batch->context <> 'mapping') {
+      $sources = $importer->parser->getMappingSources();
+    }
+    else {
+      $sources = $batch->getMappingSources();
+    }
+
+    if ($sources) {
+      $source_options = _feeds_mapping_form_format_options($sources);
+      foreach ($sources as $k => $source) {
+        $legend['sources'][$k]['name']['#value'] = empty($source['name']) ? $k : $source['name'];
+        $legend['sources'][$k]['description']['#value'] = empty($source['description']) ? '' : $source['description'];
+      }
+    }
+    else {
+      $legend['sources']['#value'] = t('This parser supports free source definitions. Enter the name of the source field in lower case into the Source text field above.');
+    }
+    $targets = $importer->processor->getMappingTargets();
+    $target_options = _feeds_mapping_form_format_options($targets);
+    foreach ($targets as $k => $target) {
+      $legend['targets'][$k]['name']['#value'] = empty($target['name']) ? $k : $target['name'];
+      $legend['targets'][$k]['description']['#value'] = empty($target['description']) ? '' : $target['description'];
+    }
+
+    $form['legendset'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Legend'),
+      '#collapsible' => TRUE,
+      '#collapsed' => TRUE,
+      '#tree' => TRUE,
+    );
+    $form['legendset']['legend'] = $legend;
+
+    $mappings = $this->getMappings();
+
+    // Add unique and remove forms to mappings.
+    $form['unique_flags'] = $form['remove_flags'] = array(
+      '#tree' => TRUE,
+    );
+
+    if (is_array($mappings)) {
+      $form['mappings']['#tree'] = TRUE;
+
+      foreach ($mappings as $i => $mapping) {
+        $mappings[$i]['source'] = isset($source_options) ? $source_options[$mappings[$i]['source']] : $mappings[$i]['source'];
+        $mappings[$i]['target'] = $target_options[$mappings[$i]['target']];
+        $param = array(
+          'processor' => $importer->processor,
+          'mapping' => $mapping,
+        );
+
+        if (isset($targets[$mapping['target']]['optional_unique']) && $targets[$mapping['target']]['optional_unique'] === TRUE) {
+
+          $form['unique_flags'][$i] = array(
+            '#type' => 'checkbox',
+            '#default_value' => !empty($mapping['unique']),
+            '#attributes' => array('class' => 'feeds-ui-trigger-submit'),
+          );
+        }
+        $form['remove_flags'][$i] = array(
+          '#type' => 'checkbox',
+          '#title' => t('Remove'),
+          '#prefix' => '<div class="feeds-ui-checkbox-link">',
+          '#suffix' => '</div>',
+        );
+
+        // Declare the mappings data in the hidden field, so later
+        // the full mapping data will be submitted.
+        foreach($mapping as $k => $v) {
+          $form['mappings'][$i][$k] = array (
+            '#type' => 'hidden',
+            '#value' => $v,
+          );
+        }
+      }
+
+      $form['#mappings'] = $mappings;
+      $form['#targets'] = $targets;
+      if ($sources) {
+        $form['source'] = array(
+          '#type' => 'select',
+          '#options' => array('' => t('Select a source')) + $source_options,
+        );
+      }
+      else {
+        $form['source'] = array(
+          '#type' => 'textfield',
+          '#size' => 20,
+          '#default_value' => t('Name of source field'),
+          '#attributes' => array('class' => 'hide-text-on-focus'),
+        );
+      }
+      $form['target'] = array(
+        '#type' => 'select',
+        '#options' => array('' => t('Select a target')) + _feeds_mapping_form_format_options($targets),
+      );
+      $form['add'] = array(
+        '#type' => 'submit',
+        '#value' => t('Add'),
+        '#submit' => array('feeds_form_submit'),
+      );
+    }
+
+    $form['save'] = array(
+      '#type' => 'submit',
+      '#value' => t('Save'),
+      '#attributes' => array('class' => 'feeds-ui-hidden-submit'),
+      '#submit' => array('feeds_form_submit'),
+    );
+    return $form;
+  }
+
+  /**
+   * Submit handler for FeedsProcessor::mappingForm()
+   */
+  function mappingFormSubmit(&$values) {
+    // If add new mappings submit is invoked.
+    if ($values['op'] == t('Add')) {
+      if (!empty($values['source']) && !empty($values['target'])) {
+        if (method_exists($this, 'addMapping')) {
+          $this->addMapping($values['source'], $values['target']);
+        }
+        $values['mappings'][] = array(
+          'source' => $values['source'],
+          'target' => $values['target'],
+          'unique' => FALSE,
+        );
+      }
+    }
+    // If other submit is invoked.
+    else {
+      // We may set some unique flags to mappings that we remove in the subsequent
+      // step, that's fine.
+      if (isset($values['unique_flags'])) {
+        foreach ($values['unique_flags'] as $k => $v) {
+          $values['mappings'][$k]['unique'] = $v;
+        }
+      }
+
+      if (isset($values['remove_flags'])) {
+        foreach ($values['remove_flags'] as $k => $v) {
+          if ($v) {
+            unset($values['mappings'][$k]);
+          }
+        }
+        // Keep our keys clean.
+        $values['mappings'] = array_values($values['mappings']);
+      }
+    }
+
+    if ($this->config['mapping_on_import'] && !empty($this->source)) {
+      $source_values[get_class($this)] = $values;
+      $this->source->addConfig($source_values);
+      $this->source->save();
+    }
+    else {
+      $this->addConfig($values);
+      $this->save();
+    }
+
+    drupal_set_message(t('Your changes have been saved.'));
+    feeds_cache_clear(FALSE);
+  }
+
+  /**
+   * Validation handler for mappingForm()
+   */
+  function mappingFormValidate(&$values) {
+  }
+}
+
+/**
+ * Walk the result of FeedsParser::getMappingSources() or
+ * FeedsProcessor::getMappingTargets() and format them into
+ * a Form API options array.
+ */
+function _feeds_mapping_form_format_options($options) {
+  $result = array();
+  foreach ($options as $k => $v) {
+    if (is_array($v) && !empty($v['name'])) {
+      $result[$k] = $v['name'];
+    }
+    elseif (is_array($v)) {
+      $result[$k] = $k;
+    }
+    else {
+      $result[$k] = $v;
+    }
+  }
+  return $result;
+}
+
+/**
+ * Help text for mapping.
+ */
+function feeds_mapping_form_help() {
+  return
+    '<p>' .
+    t('Define which elements of a single item of a feed') .
+    '(= <em>' . t('Sources') . '</em>) ' .
+    t('map to which content pieces in Drupal') .
+    ' (= <em>' . t('Targets') . '</em>). ' .
+    t('Make sure that at least one definition has a') .
+    ' <em>' . t('Unique target') . '</em>. ' .
+    t('A unique target means that a value for a target can only occur once. E. g. only one item with the URL ') .
+    '<em>http://example.com/story/1</em> ' .
+    t('can exist.') .
+    '</p>';
 }
diff --git a/plugins/FeedsTermProcessor.inc b/plugins/FeedsTermProcessor.inc
index 51c248e..ca51bd8 100644
--- a/plugins/FeedsTermProcessor.inc
+++ b/plugins/FeedsTermProcessor.inc
@@ -174,6 +174,7 @@ class FeedsTermProcessor extends FeedsProcessor {
       'vocabulary' => 0,
       'update_existing' => FEEDS_SKIP_EXISTING,
       'mappings' => array(),
+      'mapping_on_import' => 0,
     );
   }
 
diff --git a/plugins/FeedsUserProcessor.inc b/plugins/FeedsUserProcessor.inc
index 8027b0f..36ac53a 100644
--- a/plugins/FeedsUserProcessor.inc
+++ b/plugins/FeedsUserProcessor.inc
@@ -116,6 +116,7 @@ class FeedsUserProcessor extends FeedsProcessor {
       'update_existing' => FALSE,
       'status' => 1,
       'mappings' => array(),
+      'mapping_on_import' => 0,
     );
   }
 
diff --git a/tests/feeds.test b/tests/feeds.test
index 45ee2df..b1ba15c 100644
--- a/tests/feeds.test
+++ b/tests/feeds.test
@@ -322,7 +322,9 @@ class FeedsWebTestCase extends DrupalWebTestCase {
    */
   public function addMappings($id, $mappings) {
 
-    $path = 'admin/build/feeds/edit/'. $id .'/mapping';
+    $source = feeds_source($id);
+    $config = $source->importer->config;
+    $path = 'admin/build/feeds/edit/'. $id .'/mapping/' . $config['processor']['plugin_key'];
 
     // Iterate through all mappings and add the via the form.
     foreach ($mappings as $i => $mapping) {
diff --git a/tests/feeds_parser_sitemap.test b/tests/feeds_parser_sitemap.test
index 7fdf12b..a48a0b8 100644
--- a/tests/feeds_parser_sitemap.test
+++ b/tests/feeds_parser_sitemap.test
@@ -59,6 +59,7 @@ class FeedsSitemapParserTestCase extends FeedsWebTestCase {
     $path = $GLOBALS['base_url'] .'/'. drupal_get_path('module', 'feeds') .'/tests/feeds/';
     $nid = $this->createFeedNode('sitemap', $path .'sitemap-example.xml', 'Testing Sitemap Parser');
     $this->assertText('Created 5 Story nodes.');
+    $this->show();
 
     // Assert DB status.
     $count = db_result(db_query("SELECT COUNT(*) FROM {feeds_node_item}"));
