1.1 KiB
1.1 KiB
Implement import
-
Create a new importer class extending
ABoardImportService -
Create a listener for event
BoardImportGetAllowedEventto enable your importer.You can read more about listeners on Nextcloud doc.
Example:
class YourCustomImporterListener {
public function handle(Event $event): void {
if (!($event instanceof BoardImportGetAllowedEvent)) {
return;
}
$event->getService()->addAllowedImportSystem([
'name' => YourCustomImporterService::$name,
'class' => YourCustomImporterService::class,
'internalName' => 'YourCustomImporter'
]);
}
}
- Register your listener on your
Applicationclass like this:
$dispatcher = $this->getContainer()->query(IEventDispatcher::class);
$dispatcher->registerEventListener(
BoardImportGetAllowedEvent::class,
YourCustomImporterListener::class
);
- Use the
lib/Service/Importer/Systems/TrelloJsonService.phpclass as inspiration