protected function import( array &$catalogMap, array $data, array $mapping,
		\Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Iface $processor, $strict )
	{
		$errors = 0;
		$context = $this->getContext();
		$manager = \Aimeos\MShop::create( $context, 'catalog' );

		foreach( $data as $code => $list )
		{
			$manager->begin();

			try
			{
				$code = trim( $code );

				if( isset( $catalogMap[$code] ) ) {
					$item = $catalogMap[$code];
				} else {
					$item = $manager->createItem();
				}

				$map = $this->getMappedChunk( $list, $mapping );

				if( isset( $map[0] ) )
				{
					$map = $map[0]; // there can only be one chunk for the base catalog data
					$parentid = $this->getParentId( $catalogMap, $map, $code );
					$item->fromArray( $map, true );

					if( isset( $catalogMap[$code] ) )
					{
						$manager->moveItem( $item->getId(), $item->getParentId(), $parentid );
						$item = $manager->saveItem( $item );
					}
					else
					{
						$item = $manager->insertItem( $item, $parentid );
					}

					$list = $processor->process( $item, $list );
					$catalogMap[$code] = $item;

					$manager->saveItem( $item );
				}

				$manager->commit();
			}
			catch( \Exception $e )
			{
				$manager->rollback();

				$msg = sprintf( 'Unable to import catalog with code "%1$s": %2$s', $code, $e->getMessage() );
				$context->getLogger()->log( $msg );

				$errors++;
			}

			if( $strict && !empty( $list ) ) {
				$context->getLogger()->log( 'Not imported: ' . print_r( $list, true ) );
			}
		}

		return $errors;
	}