Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release_10' into release_10
Browse files Browse the repository at this point in the history
  • Loading branch information
mjansenDatabay committed Dec 4, 2024
2 parents 491c318 + 6f80ada commit 1ed9a51
Show file tree
Hide file tree
Showing 21 changed files with 105 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function validateImportFile(): ilImportStatusCollectionInterface
}
$import = new ilImportHandlerFactory();
$xml_spl_info = new SplFileInfo($this->getInputFile());
$xsd_schema_info = $import->schema()->folder()->handler()->getLatest(self::SCHEMA_TYPE);
$xsd_schema_info = $import->schemaFolder()->handler()->getLatest(self::SCHEMA_TYPE);
$xml_file_handler = $import->file()->xml()->handler()->withFileInfo($xml_spl_info);
$xsd_file_handler = $import->file()->xsd()->handler()->withFileInfo($xsd_schema_info->getFile());
return $import->validation()->handler()->validateXMLFile($xml_file_handler, $xsd_file_handler);
Expand Down
17 changes: 16 additions & 1 deletion components/ILIAS/Export/classes/ImportHandler/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@
use ILIAS\Export\ImportHandler\I\Parser\FactoryInterface as ParserFactoryInterface;
use ILIAS\Export\ImportHandler\I\Path\FactoryInterface as PathFactoryInterface;
use ILIAS\Export\ImportHandler\I\Schema\FactoryInterface as SchemaFactoryInterface;
use ILIAS\Export\ImportHandler\I\SchemaFolder\FactoryInterface as SchemaFolderFactoryInterface;
use ILIAS\Export\ImportHandler\I\Validation\FactoryInterface as ValidationFactoryInterface;
use ILIAS\Export\ImportHandler\Parser\Factory as ParserFactory;
use ILIAS\Export\ImportHandler\Path\Factory as PathFactory;
use ILIAS\Export\ImportHandler\Schema\Factory as SchemaFactory;
use ILIAS\Export\ImportHandler\SchemaFolder\Factory as SchemaFolderFactory;
use ILIAS\Export\ImportHandler\I\SchemaFolder\HandlerInterface as SchemaFolderInterface;
use ILIAS\Export\ImportHandler\Validation\Factory as ValidationFactory;
use ILIAS\Export\ImportStatus\ilFactory as ImportStatusFactory;
use ilLanguage;
Expand All @@ -42,6 +45,7 @@ class Factory implements ImportHandlerFactoryInterface
protected ilLanguage $lng;
protected ImportStatusFactory $import_status_factory;
protected DataFactory $data_factory;
protected SchemaFolderInterface $schema_folder;

public function __construct()
{
Expand All @@ -51,6 +55,7 @@ public function __construct()
$this->lng->loadLanguageModule("exp");
$this->import_status_factory = new ImportStatusFactory();
$this->data_factory = new DataFactory();
$this->schema_folder = $this->schemaFolder()->handler();
}

public function parser(): ParserFactoryInterface
Expand All @@ -68,19 +73,29 @@ public function file(): FileFactoryInterface
$this->import_status_factory,
$this->logger,
$this->lng,
$this->data_factory
$this->data_factory,
$this->schema_folder
);
}

public function schema(): SchemaFactoryInterface
{
return new SchemaFactory(
$this->schema_folder,
$this,
$this->data_factory,
$this->logger
);
}

public function schemaFolder(): SchemaFolderFactoryInterface
{
return new SchemaFolderFactory(
$this,
$this->logger
);
}

public function path(): PathFactoryInterface
{
return new PathFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@
use ILIAS\Export\ImportHandler\I\File\Namespace\FactoryInterface as FileNamespaceFactoryInterface;
use ILIAS\Export\ImportHandler\I\File\XML\FactoryInterface as XMLFileFactoryInterface;
use ILIAS\Export\ImportHandler\I\File\XSD\FactoryInterface as XSDFileFactoryInterface;
use ILIAS\Export\ImportHandler\I\SchemaFolder\HandlerInterface as SchemaFolderInterface;
use ILIAS\Export\ImportStatus\ilFactory as ImportStatusFactory;
use ilLanguage;
use ilLogger;

class Factory implements FileFactory
{
protected SchemaFolderInterface $schema_folder;
protected ImportHandlerFactoryInterface $import_handler;
protected ilLogger $logger;
protected ilLanguage $lng;
Expand All @@ -46,13 +48,15 @@ public function __construct(
ImportStatusFactory $import_status_factory,
ilLogger $logger,
ilLanguage $lng,
DataFactory $data_factory
DataFactory $data_factory,
SchemaFolderInterface $schema_folder
) {
$this->import_handler = $import_handler;
$this->import_status_factory = $import_status_factory;
$this->logger = $logger;
$this->lng = $lng;
$this->data_factory = $data_factory;
$this->schema_folder = $schema_folder;
}

public function xml(): XMLFileFactoryInterface
Expand All @@ -62,7 +66,8 @@ public function xml(): XMLFileFactoryInterface
$this->import_status_factory,
$this->logger,
$this->lng,
$this->data_factory
$this->data_factory,
$this->schema_folder
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
use ILIAS\Export\ImportHandler\I\File\XML\HandlerInterface as XMLFileInterface;
use ILIAS\Export\ImportHandler\I\File\XML\Manifest\FactoryInterface as ManifestFileFactoryInterface;
use ILIAS\Export\ImportHandler\I\Schema\FactoryInterface as SchemaFactoryInterface;
use ILIAS\Export\ImportHandler\I\SchemaFolder\HandlerInterface as SchemaFolderInterface;
use ILIAS\Export\ImportHandler\Schema\Factory as SchemaFactory;
use ILIAS\Export\ImportStatus\ilFactory as ImportStatusFactory;
use ilLanguage;
Expand All @@ -44,14 +45,17 @@ class Factory implements XMLFileFactoryInterface
protected ilLanguage $lng;
protected ImportStatusFactory $import_status_factory;
protected DataFactory $data_factory;
protected SchemaFolderInterface $schema_folder;

public function __construct(
ImportHandlerFactoryInterface $import_handler,
ImportStatusFactory $import_status_factory,
ilLogger $logger,
ilLanguage $lng,
DataFactory $data_factory
DataFactory $data_factory,
SchemaFolderInterface $schema_folder
) {
$this->schema_folder = $schema_folder;
$this->import_handler = $import_handler;
$this->logger = $logger;
$this->lng = $lng;
Expand All @@ -77,7 +81,8 @@ public function manifest(): ManifestFileFactoryInterface
return new ManifestFileFactory(
$this->import_handler,
$this->logger,
$this->import_status_factory
$this->import_status_factory,
$this->schema_folder
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,26 @@
use ILIAS\Export\ImportHandler\I\File\XML\Manifest\HandlerCollectionInterface as ManifestXMLFileCollectionInterface;
use ILIAS\Export\ImportHandler\I\File\XML\Manifest\HandlerInterface as ManifestXMLFileInterface;
use ILIAS\Export\ImportStatus\ilFactory as ImportStatusFactory;
use ILIAS\Export\ImportHandler\I\SchemaFolder\HandlerInterface as SchemaFolderInterface;
use ilLogger;

class Factory implements ManifestFileFactoryInterface
{
protected ImportHandlerFactoryInterface $import_handler;
protected ilLogger $logger;
protected ImportStatusFactory $import_status_factory;
protected SchemaFolderInterface $schema_folder;

public function __construct(
ImportHandlerFactoryInterface $import_handler,
ilLogger $logger,
ImportStatusFactory $import_status_factory
ImportStatusFactory $import_status_factory,
SchemaFolderInterface $schema_folder
) {
$this->import_handler = $import_handler;
$this->logger = $logger;
$this->import_status_factory = $import_status_factory;
$this->schema_folder = $schema_folder;
}

public function handler(): ManifestXMLFileInterface
Expand All @@ -55,7 +59,7 @@ public function handler(): ManifestXMLFileInterface
$this->import_handler->path(),
$this->import_handler->file()->xml(),
$this->import_handler->file()->xsd(),
$this->import_handler->schema()->folder()->handler()
$this->schema_folder
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
use ILIAS\Export\ImportHandler\I\Parser\FactoryInterface as ParserFactoryInterface;
use ILIAS\Export\ImportHandler\I\Parser\HandlerInterface as ParserInterface;
use ILIAS\Export\ImportHandler\I\Path\FactoryInterface as PathFactoryInterface;
use ILIAS\Export\ImportHandler\I\Schema\Folder\HandlerInterface as ImportStatusSchemaFolderInterface;
use ILIAS\Export\ImportHandler\I\SchemaFolder\HandlerInterface as ImportStatusSchemaFolderInterface;
use ILIAS\Export\ImportHandler\I\Validation\HandlerInterface as ValidationInterface;
use ILIAS\Export\ImportStatus\Exception\ilException as ImportStatusException;
use ILIAS\Export\ImportStatus\I\ilCollectionInterface as ImportStatusHandlerCollectionInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use ILIAS\Export\ImportHandler\I\Parser\FactoryInterface as ParserFactoryInterface;
use ILIAS\Export\ImportHandler\I\Path\FactoryInterface as PathFactoryInterface;
use ILIAS\Export\ImportHandler\I\Schema\FactoryInterface as SchemaFactoryInterface;
use ILIAS\Export\ImportHandler\I\SchemaFolder\FactoryInterface as SchemaFolderFactoryInterface;
use ILIAS\Export\ImportHandler\I\Validation\FactoryInterface as ValidationFactoryInterface;

interface FactoryInterface
Expand All @@ -34,6 +35,8 @@ public function file(): FileFactoryInterface;

public function schema(): SchemaFactoryInterface;

public function schemaFolder(): SchemaFolderFactoryInterface;

public function path(): PathFactoryInterface;

public function validation(): ValidationFactoryInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
use ILIAS\Export\ImportHandler\I\File\XML\HandlerInterface as XMLFileInterface;
use ILIAS\Export\ImportHandler\I\Path\HandlerInterface as PathInterface;
use ILIAS\Export\ImportHandler\I\Schema\CollectionInterface as SchemaCollectionInterface;
use ILIAS\Export\ImportHandler\I\Schema\Folder\FactoryInterface as SchemaFolderFactoryInterface;
use ILIAS\Export\ImportHandler\I\Schema\HandlerInterface as SchemaInterface;
use ILIAS\Export\ImportHandler\I\Schema\Info\FactoryInterface as SchemaInfoFactoryInterface;

interface FactoryInterface
{
Expand All @@ -37,8 +35,4 @@ public function collectionFrom(
XMLFileInterface $xml_file_handler,
PathInterface $path_to_entities
): SchemaCollectionInterface;

public function folder(): SchemaFolderFactoryInterface;

public function info(): SchemaInfoFactoryInterface;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@

declare(strict_types=1);

namespace ILIAS\Export\ImportHandler\I\Schema\Folder;
namespace ILIAS\Export\ImportHandler\I\SchemaFolder;

use ILIAS\Export\ImportHandler\I\Schema\Folder\HandlerInterface as SchemaFolderInterface;
use ILIAS\Export\ImportHandler\I\SchemaFolder\HandlerInterface as SchemaFolderInterface;
use ILIAS\Export\ImportHandler\I\SchemaFolder\Info\FactoryInterface as SchemaFolderInfoFactoryInterface;

interface FactoryInterface
{
public function info(): SchemaFolderInfoFactoryInterface;

public function handler(): SchemaFolderInterface;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

declare(strict_types=1);

namespace ILIAS\Export\ImportHandler\I\Schema\Folder;
namespace ILIAS\Export\ImportHandler\I\SchemaFolder;

use ILIAS\Data\Version;
use ILIAS\Export\ImportHandler\I\Schema\Info\HandlerInterface as SchemaInfoInterface;
use ILIAS\Export\ImportHandler\I\SchemaFolder\Info\HandlerInterface as SchemaInfoInterface;
use SplFileInfo;

interface HandlerInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

declare(strict_types=1);

namespace ILIAS\Export\ImportHandler\I\Schema\Info;
namespace ILIAS\Export\ImportHandler\I\SchemaFolder\Info;

use Countable;
use ILIAS\Data\Version;
use ILIAS\Export\ImportHandler\I\Schema\Info\HandlerInterface as SchemaInfoInterface;
use ILIAS\Export\ImportHandler\I\SchemaFolder\Info\HandlerInterface as SchemaInfoInterface;
use Iterator;

interface CollectionInterface extends Iterator, Countable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

declare(strict_types=1);

namespace ILIAS\Export\ImportHandler\I\Schema\Info;
namespace ILIAS\Export\ImportHandler\I\SchemaFolder\Info;

use ILIAS\Export\ImportHandler\I\Schema\Info\CollectionInterface as SchemaInfoCollectionInterface;
use ILIAS\Export\ImportHandler\I\Schema\Info\HandlerInterface as SchemaInfoInterface;
use ILIAS\Export\ImportHandler\I\SchemaFolder\Info\CollectionInterface as SchemaInfoCollectionInterface;
use ILIAS\Export\ImportHandler\I\SchemaFolder\Info\HandlerInterface as SchemaInfoInterface;

interface FactoryInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

declare(strict_types=1);

namespace ILIAS\Export\ImportHandler\I\Schema\Info;
namespace ILIAS\Export\ImportHandler\I\SchemaFolder\Info;

use ILIAS\Data\Version;
use SplFileInfo;
Expand Down
27 changes: 7 additions & 20 deletions components/ILIAS/Export/classes/ImportHandler/Schema/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,28 @@
use ILIAS\Export\ImportHandler\I\Path\HandlerInterface as PathInterface;
use ILIAS\Export\ImportHandler\I\Schema\CollectionInterface as SchemaCollectionInterface;
use ILIAS\Export\ImportHandler\I\Schema\FactoryInterface as SchemaFactoryInterface;
use ILIAS\Export\ImportHandler\I\Schema\Folder\FactoryInterface as SchemaFolderFactoryInterface;
use ILIAS\Export\ImportHandler\I\SchemaFolder\FactoryInterface as SchemaFolderFactoryInterface;
use ILIAS\Export\ImportHandler\I\SchemaFolder\HandlerInterface as SchemaFolderInterface;
use ILIAS\Export\ImportHandler\I\Schema\HandlerInterface as SchemaInterface;
use ILIAS\Export\ImportHandler\I\Schema\Info\FactoryInterface as SchemaInfoFactoryInterface;
use ILIAS\Export\ImportHandler\Schema\Collection as SchemaCollection;
use ILIAS\Export\ImportHandler\Schema\Folder\Factory as SchemaFolderFactory;
use ILIAS\Export\ImportHandler\SchemaFolder\Factory as SchemaFolderFactory;
use ILIAS\Export\ImportHandler\Schema\Handler as Schema;
use ILIAS\Export\ImportHandler\Schema\Info\Factory as SchemaInfoFactory;
use ilLogger;

class Factory implements SchemaFactoryInterface
{
protected ImportHandlerFactoryInterface $import_handler;
protected DataFactory $data_factory;
protected ilLogger $logger;
protected SchemaFolderInterface $schema_folder;

public function __construct(
SchemaFolderInterface $schema_folder,
ImportHandlerFactoryInterface $import_handler,
DataFactory $data_factory,
ilLogger $logger
) {
$this->schema_folder = $schema_folder;
$this->import_handler = $import_handler;
$this->data_factory = $data_factory;
$this->logger = $logger;
Expand All @@ -54,7 +56,7 @@ public function __construct(
public function handler(): SchemaInterface
{
return new Schema(
$this->folder()->handler(),
$this->schema_folder,
$this->data_factory,
$this->import_handler->parser(),
$this->import_handler->file()->xsd()
Expand All @@ -66,21 +68,6 @@ public function collection(): SchemaCollectionInterface
return new SchemaCollection();
}

public function folder(): SchemaFolderFactoryInterface
{
return new SchemaFolderFactory(
$this->import_handler,
$this->logger
);
}

public function info(): SchemaInfoFactoryInterface
{
return new SchemaInfoFactory(
$this->logger
);
}

public function collectionFrom(
XMLFileInterface $xml_file_handler,
PathInterface $path_to_entities
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
use ILIAS\Export\ImportHandler\I\File\XSD\HandlerInterface as XSDFileInterface;
use ILIAS\Export\ImportHandler\I\Parser\FactoryInterface as ParserFactoryInterface;
use ILIAS\Export\ImportHandler\I\Parser\NodeInfo\HandlerInterface as XMLFileNodeInfoInterface;
use ILIAS\Export\ImportHandler\I\Schema\Folder\HandlerInterface as SchemaFolderInterface;
use ILIAS\Export\ImportHandler\I\SchemaFolder\HandlerInterface as SchemaFolderInterface;
use ILIAS\Export\ImportHandler\I\Schema\HandlerInterface as SchemaInterface;

class Handler implements SchemaInterface
Expand Down
Loading

0 comments on commit 1ed9a51

Please sign in to comment.