Permalink
Browse files

Refactoring: Simpler structure of import class

  • Loading branch information...
1 parent 60a549a commit 710d692fb921f6ce51883490ef5816fe3c6a0265 Samuel Lampa committed Nov 7, 2011
Showing with 5 additions and 7 deletions.
  1. +4 −5 classes/RDFIO_SMWDataImporter.php
  2. +1 −2 specials/SpecialRDFImport_body.php
@@ -8,11 +8,10 @@ public function __construct() {
$this->mWikiWriter = new RDFIOWikiWriter();
}
- public function execute() {
+ public function import( RDFIODataAggregate &$importData ) {
- $dataAggregate = $this->getImportData();
- $subjectDatas = $dataAggregate->getSubjectDatas();
- $namespaces = $dataAggregate->getNamespacePrefixesFromParser();
+ $subjectDatas = $importData->getSubjectDatas();
+ $namespaces = $importData->getNamespacePrefixesFromParser();
foreach ( $subjectDatas as $subjectData ) {
$subject = $subjectData->getSubject();
@@ -74,7 +73,7 @@ public function execute() {
# Getters and setters
- public function setImportData( RDFIODataAggregate $importData ) {
+ public function setImportData( RDFIODataAggregate &$importData ) {
$this->mImportData = $importData;
}
public function getImportData() {
@@ -37,8 +37,7 @@ function execute( $par ) {
$importDataAggregate = RDFIODataAggregate::newFromRawData( $data, $dataFormat );
$smwImporter = new RDFIOSMWDataImporter();
- $smwImporter->setImportData( $importDataAggregate );
- $smwImporter->execute();
+ $smwImporter->import( $importDataAggregate );
$wgOut->addHTML('Tried to import the stuff ...');

0 comments on commit 710d692

Please sign in to comment.