From 56ea1de99bff55ce4149ea8070eabf8183d6f4fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 30 Sep 2015 11:43:25 +0200 Subject: first draft for json import, needed for wallabag v1 migration --- src/Wallabag/CoreBundle/Command/ImportCommand.php | 112 ++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 src/Wallabag/CoreBundle/Command/ImportCommand.php (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Command/ImportCommand.php b/src/Wallabag/CoreBundle/Command/ImportCommand.php new file mode 100644 index 00000000..f27aeff7 --- /dev/null +++ b/src/Wallabag/CoreBundle/Command/ImportCommand.php @@ -0,0 +1,112 @@ +setName('import:json') + ->setDescription('Import entries from JSON file'); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $now = new \DateTime(); + $output->writeln('Start : '.$now->format('d-m-Y G:i:s').' ---'); + + // Importing CSV on DB via Doctrine ORM + $this->import($input, $output); + + $now = new \DateTime(); + $output->writeln('End : '.$now->format('d-m-Y G:i:s').' ---'); + } + + protected function import(InputInterface $input, OutputInterface $output) + { + // Getting php array of data from CSV + $data = $this->get($input, $output); + + $em = $this->getContainer()->get('doctrine')->getManager(); + // Turning off doctrine default logs queries for saving memory + $em->getConnection()->getConfiguration()->setSQLLogger(null); + + // Define the size of record, the frequency for persisting the data and the current index of records + $size = count($data); + $batchSize = 20; + $i = 1; + + $progress = new ProgressBar($output, $size); + $progress->start(); + + $user = $em->getRepository('WallabagCoreBundle:User') + ->findOneById(1); + + foreach ($data as $object) { + $array = (array) $object; + $entry = $em->getRepository('WallabagCoreBundle:Entry') + ->findOneByUrl($array['url']); + + if (!is_object($entry)) { + $entry = new Entry($user); + $entry->setUrl($array['url']); + } + + $entry->setTitle($array['title']); + $entry->setArchived($array['is_read']); + $entry->setStarred($array['is_fav']); + $entry->setContent($array['content']); + $entry->setReadingTime(Utils::getReadingTime($array['content'])); + + $em->persist($entry); + + if (($i % $batchSize) === 0) { + $em->flush(); + $progress->advance($batchSize); + + $now = new \DateTime(); + $output->writeln(' of entries imported ... | '.$now->format('d-m-Y G:i:s')); + } + ++$i; + } + + $em->flush(); + $em->clear(); + $progress->finish(); + } + + protected function convert($filename) + { + if (!file_exists($filename) || !is_readable($filename)) { + return false; + } + + $header = null; + $data = array(); + + if (($handle = fopen($filename, 'r')) !== false) { + while (($row = fgets($handle)) !== false) { + $data = json_decode($row); + } + fclose($handle); + } + + return $data; + } + + protected function get(InputInterface $input, OutputInterface $output) + { + $fileName = 'web/uploads/import/import.json'; + $data = $this->convert($fileName); + + return $data; + } +} -- cgit v1.2.3 From a1bb1b3c2a0631ad41262ef92f6cce02c3d376bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 30 Sep 2015 14:22:38 +0200 Subject: userId is now set in parameters --- src/Wallabag/CoreBundle/Command/ImportCommand.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Command/ImportCommand.php b/src/Wallabag/CoreBundle/Command/ImportCommand.php index f27aeff7..4a174202 100644 --- a/src/Wallabag/CoreBundle/Command/ImportCommand.php +++ b/src/Wallabag/CoreBundle/Command/ImportCommand.php @@ -3,6 +3,7 @@ namespace Wallabag\CoreBundle\Command; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; +use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Helper\ProgressBar; @@ -15,7 +16,12 @@ class ImportCommand extends ContainerAwareCommand { $this ->setName('import:json') - ->setDescription('Import entries from JSON file'); + ->setDescription('Import entries from JSON file') + ->addArgument( + 'userId', + InputArgument::REQUIRED, + 'user ID to populate' + ); } protected function execute(InputInterface $input, OutputInterface $output) @@ -32,6 +38,8 @@ class ImportCommand extends ContainerAwareCommand protected function import(InputInterface $input, OutputInterface $output) { + $userId = $input->getArgument('userId'); + // Getting php array of data from CSV $data = $this->get($input, $output); @@ -48,7 +56,7 @@ class ImportCommand extends ContainerAwareCommand $progress->start(); $user = $em->getRepository('WallabagCoreBundle:User') - ->findOneById(1); + ->findOneById($userId); foreach ($data as $object) { $array = (array) $object; -- cgit v1.2.3 From 8c3c77c1bd5c3763c127bfea52e908e77dc751b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 30 Sep 2015 15:10:46 +0200 Subject: create controller to launch import command --- src/Wallabag/CoreBundle/Command/ImportCommand.php | 19 +++++----- .../CoreBundle/Controller/ImportController.php | 40 ++++++++++++++++++++++ .../views/themes/material/layout.html.twig | 1 + 3 files changed, 52 insertions(+), 8 deletions(-) create mode 100644 src/Wallabag/CoreBundle/Controller/ImportController.php (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Command/ImportCommand.php b/src/Wallabag/CoreBundle/Command/ImportCommand.php index 4a174202..16c84229 100644 --- a/src/Wallabag/CoreBundle/Command/ImportCommand.php +++ b/src/Wallabag/CoreBundle/Command/ImportCommand.php @@ -3,6 +3,7 @@ namespace Wallabag\CoreBundle\Command; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; +use Symfony\Component\Config\Definition\Exception\Exception; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -15,7 +16,7 @@ class ImportCommand extends ContainerAwareCommand protected function configure() { $this - ->setName('import:json') + ->setName('wallabag:import') ->setDescription('Import entries from JSON file') ->addArgument( 'userId', @@ -38,8 +39,6 @@ class ImportCommand extends ContainerAwareCommand protected function import(InputInterface $input, OutputInterface $output) { - $userId = $input->getArgument('userId'); - // Getting php array of data from CSV $data = $this->get($input, $output); @@ -52,12 +51,16 @@ class ImportCommand extends ContainerAwareCommand $batchSize = 20; $i = 1; + $user = $em->getRepository('WallabagCoreBundle:User') + ->findOneById($input->getArgument('userId')); + + if (!is_object($user)) { + throw new Exception('User not found'); + } + $progress = new ProgressBar($output, $size); $progress->start(); - $user = $em->getRepository('WallabagCoreBundle:User') - ->findOneById($userId); - foreach ($data as $object) { $array = (array) $object; $entry = $em->getRepository('WallabagCoreBundle:Entry') @@ -112,8 +115,8 @@ class ImportCommand extends ContainerAwareCommand protected function get(InputInterface $input, OutputInterface $output) { - $fileName = 'web/uploads/import/import.json'; - $data = $this->convert($fileName); + $filename = __DIR__.'/../../../../web/uploads/import/'.$input->getArgument('userId').'.json'; + $data = $this->convert($filename); return $data; } diff --git a/src/Wallabag/CoreBundle/Controller/ImportController.php b/src/Wallabag/CoreBundle/Controller/ImportController.php new file mode 100644 index 00000000..53211eec --- /dev/null +++ b/src/Wallabag/CoreBundle/Controller/ImportController.php @@ -0,0 +1,40 @@ +setContainer($this->container); + $input = new ArrayInput(array('userId' => $this->getUser()->getId())); + $return = $command->run($input, new NullOutput()); + + if ($return == 0) { + $this->get('session')->getFlashBag()->add( + 'notice', + 'Import successful' + ); + } else { + $this->get('session')->getFlashBag()->add( + 'warning', + 'Import failed' + ); + } + + return $this->redirect('/'); + } +} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig index f426e25b..6b8d7adf 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig @@ -45,6 +45,7 @@
  • {% trans %}all{% endtrans %}
  • {% trans %}tags{% endtrans %}
  • {% trans %}config{% endtrans %}
  • +
  • {% trans %}import{% endtrans %}
  • {% trans %}howto{% endtrans %}
  • {% trans %}logout{% endtrans %}
  • -- cgit v1.2.3 From d275bdf4d36f90ff61f1e6a714c9ef64d210596f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 22 Oct 2015 16:57:56 +0200 Subject: form to upload file --- src/Wallabag/CoreBundle/Command/ImportCommand.php | 3 +- .../CoreBundle/Controller/ImportController.php | 56 +++++++++++++++------- .../DependencyInjection/Configuration.php | 13 +++++ .../DependencyInjection/WallabagCoreExtension.php | 1 + .../CoreBundle/Form/Type/UploadImportType.php | 29 +++++++++++ .../views/themes/material/Import/index.html.twig | 23 +++++++++ 6 files changed, 108 insertions(+), 17 deletions(-) create mode 100644 src/Wallabag/CoreBundle/Form/Type/UploadImportType.php create mode 100644 src/Wallabag/CoreBundle/Resources/views/themes/material/Import/index.html.twig (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Command/ImportCommand.php b/src/Wallabag/CoreBundle/Command/ImportCommand.php index 16c84229..6be6f5e1 100644 --- a/src/Wallabag/CoreBundle/Command/ImportCommand.php +++ b/src/Wallabag/CoreBundle/Command/ImportCommand.php @@ -51,7 +51,7 @@ class ImportCommand extends ContainerAwareCommand $batchSize = 20; $i = 1; - $user = $em->getRepository('WallabagCoreBundle:User') + $user = $em->getRepository('WallabagUserBundle:User') ->findOneById($input->getArgument('userId')); if (!is_object($user)) { @@ -116,6 +116,7 @@ class ImportCommand extends ContainerAwareCommand protected function get(InputInterface $input, OutputInterface $output) { $filename = __DIR__.'/../../../../web/uploads/import/'.$input->getArgument('userId').'.json'; + $data = $this->convert($filename); return $data; diff --git a/src/Wallabag/CoreBundle/Controller/ImportController.php b/src/Wallabag/CoreBundle/Controller/ImportController.php index 53211eec..33087710 100644 --- a/src/Wallabag/CoreBundle/Controller/ImportController.php +++ b/src/Wallabag/CoreBundle/Controller/ImportController.php @@ -8,6 +8,7 @@ use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Output\NullOutput; use Symfony\Component\HttpFoundation\Request; use Wallabag\CoreBundle\Command\ImportCommand; +use Wallabag\CoreBundle\Form\Type\UploadImportType; class ImportController extends Controller { @@ -18,23 +19,46 @@ class ImportController extends Controller */ public function importAction(Request $request) { - $command = new ImportCommand(); - $command->setContainer($this->container); - $input = new ArrayInput(array('userId' => $this->getUser()->getId())); - $return = $command->run($input, new NullOutput()); - - if ($return == 0) { - $this->get('session')->getFlashBag()->add( - 'notice', - 'Import successful' - ); - } else { - $this->get('session')->getFlashBag()->add( - 'warning', - 'Import failed' - ); + $importForm = $this->createForm(new UploadImportType()); + $importForm->handleRequest($request); + $user = $this->getUser(); + $importConfig = $this->container->getParameter('wallabag_core.import'); + + if ($importForm->isValid()) { + $file = $importForm->get('file')->getData(); + $name = $user->getId().'.json'; + $dir = __DIR__.'/../../../../web/uploads/import'; + + if (in_array($file->getMimeType(), $importConfig['allow_mimetypes']) && $file->move($dir, $name)) { + $command = new ImportCommand(); + $command->setContainer($this->container); + $input = new ArrayInput(array('userId' => $user->getId())); + $return = $command->run($input, new NullOutput()); + + if ($return == 0) { + $this->get('session')->getFlashBag()->add( + 'notice', + 'Import successful' + ); + } else { + $this->get('session')->getFlashBag()->add( + 'notice', + 'Import failed' + ); + } + + return $this->redirect('/'); + } else { + $this->get('session')->getFlashBag()->add( + 'notice', + 'Error while processing import. Please verify your import file.' + ); + } } - return $this->redirect('/'); + return $this->render('WallabagCoreBundle:Import:index.html.twig', array( + 'form' => array( + 'import' => $importForm->createView(), ), + )); } } diff --git a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php index 32acd1f1..fb1941b8 100644 --- a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php +++ b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php @@ -4,6 +4,7 @@ namespace Wallabag\CoreBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; +use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; class Configuration implements ConfigurationInterface { @@ -17,9 +18,21 @@ class Configuration implements ConfigurationInterface ->arrayNode('languages') ->prototype('scalar')->end() ->end() + ->arrayNode('import') + ->append($this->getAllowMimetypes()) + ->end() ->end() ; return $treeBuilder; } + + private function getAllowMimetypes() + { + $node = new ArrayNodeDefinition('allow_mimetypes'); + + $node->prototype('scalar')->end(); + + return $node; + } } diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php index 330cc957..e2a3ad55 100644 --- a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php +++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php @@ -14,6 +14,7 @@ class WallabagCoreExtension extends Extension $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); $container->setParameter('wallabag_core.languages', $config['languages']); + $container->setParameter('wallabag_core.import', $config['import']); $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.yml'); diff --git a/src/Wallabag/CoreBundle/Form/Type/UploadImportType.php b/src/Wallabag/CoreBundle/Form/Type/UploadImportType.php new file mode 100644 index 00000000..b9a9c465 --- /dev/null +++ b/src/Wallabag/CoreBundle/Form/Type/UploadImportType.php @@ -0,0 +1,29 @@ +add('file', 'file') + ->add('save', 'submit') + ; + } + + public function getDefaultOptions(array $options) + { + return array( + 'csrf_protection' => false, + ); + } + + public function getName() + { + return 'upload_import_file'; + } +} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Import/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Import/index.html.twig new file mode 100644 index 00000000..2c8c158d --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Import/index.html.twig @@ -0,0 +1,23 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title %}{% trans %}import{% endtrans %}{% endblock %} + +{% block content %} + +
    +
    + {{ form_errors(form.import) }} +
    +
    + {{ form_errors(form.import.file) }} + {{ form_widget(form.import.file) }} + +
    +
    + + +
    +
    +{% endblock %} -- cgit v1.2.3 From 10b40f85d664da2b3ebcfd24d6e7145c9cd90d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 23 Oct 2015 10:14:22 +0200 Subject: add docs for Import feature --- .../views/themes/material/Import/index.html.twig | 33 +++++++++++++--------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Import/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Import/index.html.twig index 2c8c158d..47004144 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Import/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Import/index.html.twig @@ -3,21 +3,28 @@ {% block title %}{% trans %}import{% endtrans %}{% endblock %} {% block content %} - -
    -
    - {{ form_errors(form.import) }} +
    +
    +
    -
    - {{ form_errors(form.import.file) }} - {{ form_widget(form.import.file) }} - +
    + + {{ form_errors(form.import) }} +
    +
    +

    {% trans %}Please select your wallabag export and click on the below button to upload and import it.{% endtrans %}

    + {{ form_errors(form.import.file) }} + {{ form_widget(form.import.file) }} +
    +
    + + +
    - - - +
    +
    {% endblock %} -- cgit v1.2.3 From 1f4408de9ed08f3b0fda45a93f1585c80feeb21d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 20 Oct 2015 13:58:13 +0200 Subject: 1st draft for Pocket import via API --- src/Wallabag/CoreBundle/Tools/Utils.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Tools/Utils.php b/src/Wallabag/CoreBundle/Tools/Utils.php index a16baca9..b146d98b 100644 --- a/src/Wallabag/CoreBundle/Tools/Utils.php +++ b/src/Wallabag/CoreBundle/Tools/Utils.php @@ -26,6 +26,15 @@ class Utils return str_replace(array('+', '/'), '', $token); } + /** + * @param $words + * @return float + */ + public static function convertWordsToMinutes($words) + { + return floor($words / 200); + } + /** * For a given text, we calculate reading time for an article * based on 200 words per minute. @@ -36,6 +45,6 @@ class Utils */ public static function getReadingTime($text) { - return floor(str_word_count(strip_tags($text)) / 200); + return self::convertWordsToMinutes(str_word_count(strip_tags($text))); } } -- cgit v1.2.3 From ff7b031d5792f7b6fd43b508d89397775bd1433c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 23 Oct 2015 14:01:27 +0200 Subject: refactor pocket import --- src/Wallabag/CoreBundle/Tools/Utils.php | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Tools/Utils.php b/src/Wallabag/CoreBundle/Tools/Utils.php index b146d98b..b501ce65 100644 --- a/src/Wallabag/CoreBundle/Tools/Utils.php +++ b/src/Wallabag/CoreBundle/Tools/Utils.php @@ -28,6 +28,7 @@ class Utils /** * @param $words + * * @return float */ public static function convertWordsToMinutes($words) -- cgit v1.2.3 From dda57bb9443817e3a080d5d25343f5a7e15dd14f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 26 Oct 2015 14:38:24 +0100 Subject: fix #1502 avoid duplicate entry and store pocket url in config --- src/Wallabag/CoreBundle/Controller/EntryController.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index fa580133..de2eedcb 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -41,6 +41,7 @@ class EntryController extends Controller */ public function addEntryFormAction(Request $request) { + $em = $this->getDoctrine()->getManager(); $entry = new Entry($this->getUser()); $form = $this->createForm(new NewEntryType(), $entry); @@ -48,6 +49,19 @@ class EntryController extends Controller $form->handleRequest($request); if ($form->isValid()) { + $existingEntry = $em + ->getRepository('WallabagCoreBundle:Entry') + ->findOneByUrl($entry->getUrl()); + + if (!is_null($existingEntry)) { + $this->get('session')->getFlashBag()->add( + 'notice', + 'Entry already saved on '.$existingEntry->getCreatedAt()->format('d-m-Y') + ); + + return $this->redirect($this->generateUrl('view', array('id' => $existingEntry->getId()))); + } + $this->updateEntry($entry); $this->get('session')->getFlashBag()->add( 'notice', -- cgit v1.2.3 From 303768dfe9b85f87d043eb225c5c8c3a88d8c051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 26 Oct 2015 15:49:44 +0100 Subject: - remove importers configuration - add check on userId for findOneByURL for entries --- src/Wallabag/CoreBundle/Controller/EntryController.php | 8 ++++---- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index de2eedcb..9097810c 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -51,15 +51,15 @@ class EntryController extends Controller if ($form->isValid()) { $existingEntry = $em ->getRepository('WallabagCoreBundle:Entry') - ->findOneByUrl($entry->getUrl()); + ->findOneByUrlAndUserId($entry->getUrl(), $this->getUser()->getId()); - if (!is_null($existingEntry)) { + if (count($existingEntry) > 0) { $this->get('session')->getFlashBag()->add( 'notice', - 'Entry already saved on '.$existingEntry->getCreatedAt()->format('d-m-Y') + 'Entry already saved on '.$existingEntry[0]->getCreatedAt()->format('d-m-Y') ); - return $this->redirect($this->generateUrl('view', array('id' => $existingEntry->getId()))); + return $this->redirect($this->generateUrl('view', array('id' => $existingEntry[0]->getId()))); } $this->updateEntry($entry); diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index ca71970b..502e9da0 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -223,4 +223,21 @@ class EntryRepository extends EntityRepository ->getQuery() ->getResult(); } + + /** + * Find an entry by its url and its owner. + * + * @param $url + * @param $userId + * + * @return array + */ + public function findOneByUrlAndUserId($url, $userId) + { + return $this->createQueryBuilder('e') + ->where('e.url = :url')->setParameter('url', $url) + ->andWhere('e.user = :user_id')->setParameter('user_id', $userId) + ->getQuery() + ->getResult(); + } } -- cgit v1.2.3 From 5a4bbcc9a76fcdf54a6af25fcf7b26c9053a0ba3 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 24 Dec 2015 15:19:50 +0100 Subject: Change the way to check for an existing entry The repository method return the entry found or false if nothing exists. --- src/Wallabag/CoreBundle/Controller/EntryController.php | 13 ++++++------- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 14 +++++++++++--- src/Wallabag/CoreBundle/Resources/config/services.yml | 1 + 3 files changed, 18 insertions(+), 10 deletions(-) (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 9097810c..37f7ab60 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -41,7 +41,6 @@ class EntryController extends Controller */ public function addEntryFormAction(Request $request) { - $em = $this->getDoctrine()->getManager(); $entry = new Entry($this->getUser()); $form = $this->createForm(new NewEntryType(), $entry); @@ -49,17 +48,17 @@ class EntryController extends Controller $form->handleRequest($request); if ($form->isValid()) { - $existingEntry = $em - ->getRepository('WallabagCoreBundle:Entry') - ->findOneByUrlAndUserId($entry->getUrl(), $this->getUser()->getId()); + // check for existing entry, if it exists, redirect to it with a message + $existingEntry = $this->get('wallabag_core.entry_repository') + ->existByUrlAndUserId($entry->getUrl(), $this->getUser()->getId()); - if (count($existingEntry) > 0) { + if (false !== $existingEntry) { $this->get('session')->getFlashBag()->add( 'notice', - 'Entry already saved on '.$existingEntry[0]->getCreatedAt()->format('d-m-Y') + 'Entry already saved on '.$existingEntry['createdAt']->format('d-m-Y') ); - return $this->redirect($this->generateUrl('view', array('id' => $existingEntry[0]->getId()))); + return $this->redirect($this->generateUrl('view', array('id' => $existingEntry['id']))); } $this->updateEntry($entry); diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 502e9da0..b8e22eb8 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -226,18 +226,26 @@ class EntryRepository extends EntityRepository /** * Find an entry by its url and its owner. + * If it exists, return the entry otherwise return false. * * @param $url * @param $userId * - * @return array + * @return array|bool */ - public function findOneByUrlAndUserId($url, $userId) + public function existByUrlAndUserId($url, $userId) { - return $this->createQueryBuilder('e') + $res = $this->createQueryBuilder('e') + ->select('e.id, e.createdAt') ->where('e.url = :url')->setParameter('url', $url) ->andWhere('e.user = :user_id')->setParameter('user_id', $userId) ->getQuery() ->getResult(); + + if (count($res) > 1) { + return next($res); + } + + return false; } } diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml index c92b4eb3..96b1c931 100644 --- a/src/Wallabag/CoreBundle/Resources/config/services.yml +++ b/src/Wallabag/CoreBundle/Resources/config/services.yml @@ -63,6 +63,7 @@ services: - @wallabag_core.tag_repository - @wallabag_core.entry_repository + # repository as a service wallabag_core.entry_repository: class: Wallabag\CoreBundle\Repository\EntryRepository factory: [ @doctrine.orm.default_entity_manager, getRepository ] -- cgit v1.2.3 From 77a7752a592af9ac821621a34d9955533baf40a0 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 30 Dec 2015 10:06:45 +0100 Subject: Update after previous merge PR #1443 was merged into this branch to handle all import type in the same place. --- src/Wallabag/CoreBundle/Command/ImportCommand.php | 124 --------------------- .../CoreBundle/Controller/ImportController.php | 64 ----------- .../DependencyInjection/Configuration.php | 13 --- .../DependencyInjection/WallabagCoreExtension.php | 1 - .../CoreBundle/Form/Type/UploadImportType.php | 29 ----- .../views/themes/material/Import/index.html.twig | 30 ----- 6 files changed, 261 deletions(-) delete mode 100644 src/Wallabag/CoreBundle/Command/ImportCommand.php delete mode 100644 src/Wallabag/CoreBundle/Controller/ImportController.php delete mode 100644 src/Wallabag/CoreBundle/Form/Type/UploadImportType.php delete mode 100644 src/Wallabag/CoreBundle/Resources/views/themes/material/Import/index.html.twig (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Command/ImportCommand.php b/src/Wallabag/CoreBundle/Command/ImportCommand.php deleted file mode 100644 index 6be6f5e1..00000000 --- a/src/Wallabag/CoreBundle/Command/ImportCommand.php +++ /dev/null @@ -1,124 +0,0 @@ -setName('wallabag:import') - ->setDescription('Import entries from JSON file') - ->addArgument( - 'userId', - InputArgument::REQUIRED, - 'user ID to populate' - ); - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $now = new \DateTime(); - $output->writeln('Start : '.$now->format('d-m-Y G:i:s').' ---'); - - // Importing CSV on DB via Doctrine ORM - $this->import($input, $output); - - $now = new \DateTime(); - $output->writeln('End : '.$now->format('d-m-Y G:i:s').' ---'); - } - - protected function import(InputInterface $input, OutputInterface $output) - { - // Getting php array of data from CSV - $data = $this->get($input, $output); - - $em = $this->getContainer()->get('doctrine')->getManager(); - // Turning off doctrine default logs queries for saving memory - $em->getConnection()->getConfiguration()->setSQLLogger(null); - - // Define the size of record, the frequency for persisting the data and the current index of records - $size = count($data); - $batchSize = 20; - $i = 1; - - $user = $em->getRepository('WallabagUserBundle:User') - ->findOneById($input->getArgument('userId')); - - if (!is_object($user)) { - throw new Exception('User not found'); - } - - $progress = new ProgressBar($output, $size); - $progress->start(); - - foreach ($data as $object) { - $array = (array) $object; - $entry = $em->getRepository('WallabagCoreBundle:Entry') - ->findOneByUrl($array['url']); - - if (!is_object($entry)) { - $entry = new Entry($user); - $entry->setUrl($array['url']); - } - - $entry->setTitle($array['title']); - $entry->setArchived($array['is_read']); - $entry->setStarred($array['is_fav']); - $entry->setContent($array['content']); - $entry->setReadingTime(Utils::getReadingTime($array['content'])); - - $em->persist($entry); - - if (($i % $batchSize) === 0) { - $em->flush(); - $progress->advance($batchSize); - - $now = new \DateTime(); - $output->writeln(' of entries imported ... | '.$now->format('d-m-Y G:i:s')); - } - ++$i; - } - - $em->flush(); - $em->clear(); - $progress->finish(); - } - - protected function convert($filename) - { - if (!file_exists($filename) || !is_readable($filename)) { - return false; - } - - $header = null; - $data = array(); - - if (($handle = fopen($filename, 'r')) !== false) { - while (($row = fgets($handle)) !== false) { - $data = json_decode($row); - } - fclose($handle); - } - - return $data; - } - - protected function get(InputInterface $input, OutputInterface $output) - { - $filename = __DIR__.'/../../../../web/uploads/import/'.$input->getArgument('userId').'.json'; - - $data = $this->convert($filename); - - return $data; - } -} diff --git a/src/Wallabag/CoreBundle/Controller/ImportController.php b/src/Wallabag/CoreBundle/Controller/ImportController.php deleted file mode 100644 index 33087710..00000000 --- a/src/Wallabag/CoreBundle/Controller/ImportController.php +++ /dev/null @@ -1,64 +0,0 @@ -createForm(new UploadImportType()); - $importForm->handleRequest($request); - $user = $this->getUser(); - $importConfig = $this->container->getParameter('wallabag_core.import'); - - if ($importForm->isValid()) { - $file = $importForm->get('file')->getData(); - $name = $user->getId().'.json'; - $dir = __DIR__.'/../../../../web/uploads/import'; - - if (in_array($file->getMimeType(), $importConfig['allow_mimetypes']) && $file->move($dir, $name)) { - $command = new ImportCommand(); - $command->setContainer($this->container); - $input = new ArrayInput(array('userId' => $user->getId())); - $return = $command->run($input, new NullOutput()); - - if ($return == 0) { - $this->get('session')->getFlashBag()->add( - 'notice', - 'Import successful' - ); - } else { - $this->get('session')->getFlashBag()->add( - 'notice', - 'Import failed' - ); - } - - return $this->redirect('/'); - } else { - $this->get('session')->getFlashBag()->add( - 'notice', - 'Error while processing import. Please verify your import file.' - ); - } - } - - return $this->render('WallabagCoreBundle:Import:index.html.twig', array( - 'form' => array( - 'import' => $importForm->createView(), ), - )); - } -} diff --git a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php index fb1941b8..32acd1f1 100644 --- a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php +++ b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php @@ -4,7 +4,6 @@ namespace Wallabag\CoreBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; -use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; class Configuration implements ConfigurationInterface { @@ -18,21 +17,9 @@ class Configuration implements ConfigurationInterface ->arrayNode('languages') ->prototype('scalar')->end() ->end() - ->arrayNode('import') - ->append($this->getAllowMimetypes()) - ->end() ->end() ; return $treeBuilder; } - - private function getAllowMimetypes() - { - $node = new ArrayNodeDefinition('allow_mimetypes'); - - $node->prototype('scalar')->end(); - - return $node; - } } diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php index e2a3ad55..330cc957 100644 --- a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php +++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php @@ -14,7 +14,6 @@ class WallabagCoreExtension extends Extension $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); $container->setParameter('wallabag_core.languages', $config['languages']); - $container->setParameter('wallabag_core.import', $config['import']); $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.yml'); diff --git a/src/Wallabag/CoreBundle/Form/Type/UploadImportType.php b/src/Wallabag/CoreBundle/Form/Type/UploadImportType.php deleted file mode 100644 index b9a9c465..00000000 --- a/src/Wallabag/CoreBundle/Form/Type/UploadImportType.php +++ /dev/null @@ -1,29 +0,0 @@ -add('file', 'file') - ->add('save', 'submit') - ; - } - - public function getDefaultOptions(array $options) - { - return array( - 'csrf_protection' => false, - ); - } - - public function getName() - { - return 'upload_import_file'; - } -} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Import/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Import/index.html.twig deleted file mode 100644 index 47004144..00000000 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Import/index.html.twig +++ /dev/null @@ -1,30 +0,0 @@ -{% extends "WallabagCoreBundle::layout.html.twig" %} - -{% block title %}{% trans %}import{% endtrans %}{% endblock %} - -{% block content %} -
    -
    -
    -
    -
    -
    - {{ form_errors(form.import) }} -
    -
    -

    {% trans %}Please select your wallabag export and click on the below button to upload and import it.{% endtrans %}

    - {{ form_errors(form.import.file) }} - {{ form_widget(form.import.file) }} -
    -
    - - -
    -
    -
    -
    -
    -
    -{% endblock %} -- cgit v1.2.3 From b4b592a0c0ee356e81775baf8f9976288d7b686c Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 30 Dec 2015 12:19:15 +0100 Subject: Fix the way to check for an existing entry Instead of requiring more than 1 entry (> 1) we have to check for at least one entry (> 0) --- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index b8e22eb8..c6763a40 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -242,8 +242,8 @@ class EntryRepository extends EntityRepository ->getQuery() ->getResult(); - if (count($res) > 1) { - return next($res); + if (count($res)) { + return current($res); } return false; -- cgit v1.2.3 From 252ebd60719d32ec954d0519c9edf2b52b03310c Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 30 Dec 2015 12:23:51 +0100 Subject: Rewrote Pocket Import For the moment, we won't do a queue system, just a plain synchronous import. We also use ContentProxy to grab content for each article from Pocket. Error from Pocket are now logged using the logger. The ImportInterface need to be simple and not related to oAuth (not all import will use that method). --- src/Wallabag/CoreBundle/Tools/Utils.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Tools/Utils.php b/src/Wallabag/CoreBundle/Tools/Utils.php index b501ce65..a16baca9 100644 --- a/src/Wallabag/CoreBundle/Tools/Utils.php +++ b/src/Wallabag/CoreBundle/Tools/Utils.php @@ -26,16 +26,6 @@ class Utils return str_replace(array('+', '/'), '', $token); } - /** - * @param $words - * - * @return float - */ - public static function convertWordsToMinutes($words) - { - return floor($words / 200); - } - /** * For a given text, we calculate reading time for an article * based on 200 words per minute. @@ -46,6 +36,6 @@ class Utils */ public static function getReadingTime($text) { - return self::convertWordsToMinutes(str_word_count(strip_tags($text))); + return floor(str_word_count(strip_tags($text)) / 200); } } -- cgit v1.2.3 From 7019c7cf6c6af39c0f458769e20c3f9306477943 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 31 Dec 2015 11:24:46 +0100 Subject: Add tagged services for import - list services in /import - add url to import service - ImportBundle routing are now prefixed by /import - optimize flush in each import (flushing each 20 contents) - improve design of each import - add more tests --- .../CoreBundle/Resources/views/themes/material/public/css/main.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/public/css/main.css b/src/Wallabag/CoreBundle/Resources/views/themes/material/public/css/main.css index d6031530..516f6fdf 100755 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/public/css/main.css +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/public/css/main.css @@ -497,4 +497,8 @@ footer [class^="icon-"]:hover, footer [class*=" icon-"]:hover { /* force height on non-input field in the settings page */ div.settings div.input-field div, div.settings div.input-field ul { margin-top: 40px; -} \ No newline at end of file +} +/* but avoid to kill all file input */ +div.settings div.file-field div { + margin-top: inherit; +} -- cgit v1.2.3 From 8eedc8cfacc07e998f6f0bcdfe5b76496a215ea2 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 3 Jan 2016 10:59:55 +0100 Subject: Few phpDoc fix And some little mistakes --- src/Wallabag/CoreBundle/Command/InstallCommand.php | 1 - src/Wallabag/CoreBundle/Entity/Config.php | 9 +++++---- src/Wallabag/CoreBundle/Entity/Entry.php | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 85c4ee90..e791d4dd 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -11,7 +11,6 @@ use Symfony\Component\Console\Output\NullOutput; use Symfony\Component\Console\Question\Question; use Symfony\Component\Console\Question\ConfirmationQuestion; use Symfony\Component\Console\Helper\Table; -use Wallabag\UserBundle\Entity\User; use Wallabag\CoreBundle\Entity\Config; class InstallCommand extends ContainerAwareCommand diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php index 2ca4182e..d3590f35 100644 --- a/src/Wallabag/CoreBundle/Entity/Config.php +++ b/src/Wallabag/CoreBundle/Entity/Config.php @@ -5,6 +5,7 @@ namespace Wallabag\CoreBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; +use Wallabag\UserBundle\Entity\User; /** * Config. @@ -86,7 +87,7 @@ class Config /* * @param User $user */ - public function __construct(\Wallabag\UserBundle\Entity\User $user) + public function __construct(User $user) { $this->user = $user; $this->taggingRules = new ArrayCollection(); @@ -181,7 +182,7 @@ class Config * * @return Config */ - public function setUser(\Wallabag\UserBundle\Entity\User $user = null) + public function setUser(User $user = null) { $this->user = $user; @@ -225,7 +226,7 @@ class Config /** * Set rssLimit. * - * @param string $rssLimit + * @param int $rssLimit * * @return Config */ @@ -239,7 +240,7 @@ class Config /** * Get rssLimit. * - * @return string + * @return int */ public function getRssLimit() { diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index b413c489..f11a7786 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -245,7 +245,7 @@ class Entry /** * Set isArchived. * - * @param string $isArchived + * @param bool $isArchived * * @return Entry */ @@ -259,7 +259,7 @@ class Entry /** * Get isArchived. * - * @return string + * @return bool */ public function isArchived() { @@ -276,7 +276,7 @@ class Entry /** * Set isStarred. * - * @param string $isStarred + * @param bool $isStarred * * @return Entry */ @@ -290,7 +290,7 @@ class Entry /** * Get isStarred. * - * @return string + * @return bool */ public function isStarred() { -- cgit v1.2.3 From d1af8ad4dbf7f3ce5170655c2fa8403406283039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 5 Jan 2016 22:38:09 +0100 Subject: Added french translations --- .../CoreBundle/Resources/translations/messages.fr.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 7b10dea1..3140091c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -13,6 +13,7 @@ archive: 'Lus' all: 'Tous les articles' tags: 'Tags' config: 'Configuration' +import: 'Importer' howto: 'Aide' logout: 'Déconnexion' Filtered: 'Articles filtrés' @@ -128,3 +129,14 @@ Download: 'Télécharger' Does this article appear wrong?: "Est-ce que cet article s'affiche mal ?" Problems?: 'Un problème ?' Edit title: "Modifier le titre" + +# Import +Welcome on wallabag importer. Please select your previous service that you want to migrate.: "Bienvenue dans l'outil de migration de wallabag. Choisissez ci-dessous le service depuis lequel vous souhaitez migrer." +"This importer will import all your Pocket data. Pocket doesn't allow us to retrieve content from their service, so the readable content of each article will be re-fetched by wallabag.": "Cet outil va importer toutes vos données de Pocket. Pocket ne nous autorise pas à récupérer le contenu depuis leur service, donc wallabag doit reparcourir chaque article pour récupérer son contenu." +"This importer will import all your wallabag v1 articles. On your config page, click on \"JSON export\" in the \"Export your wallabag data\" section. You will have a \"wallabag-export-1-xxxx-xx-xx.json\" file.": "Cet outil va importer toutes vos données de wallabag v1. Sur votre page de configuration de wallabag v1, cliquez sur \"Export JSON\" dans la section \"Exporter vos données de wallabag\". Vous allez récupérer un fichier \"wallabag-export-1-xxxx-xx-xx.json\"." +"You can import your data from your Pocket account. You just have to click on the below button and authorize the application to connect to getpocket.com.": "Vous pouvez importer vos données depuis votre compte Pocket. Vous n'avez qu'à cliquer sur le bouton ci-dessous et à autoriser wallabag à se connecter à getpocket.com." +Connect to Pocket and import data: Se connecter à Pocket et importer les données. +Please select your wallabag export and click on the below button to upload and import it.: Choisissez le fichier de votre export wallabag v1 et cliquez sur le bouton ci-dessous pour l'importer. +File: Fichier +Upload file: Importer le fichier +Import contents: "Importer les contenus" \ No newline at end of file -- cgit v1.2.3 From b88cf91fc8371194df78e690983c61ea94f266cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 6 Jan 2016 06:34:57 +0100 Subject: updated tests --- src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 3140091c..06746584 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -132,7 +132,7 @@ Edit title: "Modifier le titre" # Import Welcome on wallabag importer. Please select your previous service that you want to migrate.: "Bienvenue dans l'outil de migration de wallabag. Choisissez ci-dessous le service depuis lequel vous souhaitez migrer." -"This importer will import all your Pocket data. Pocket doesn't allow us to retrieve content from their service, so the readable content of each article will be re-fetched by wallabag.": "Cet outil va importer toutes vos données de Pocket. Pocket ne nous autorise pas à récupérer le contenu depuis leur service, donc wallabag doit reparcourir chaque article pour récupérer son contenu." +"This importer will import all your Pocket data. Pocket doesn't allow us to retrieve content from their service, so the readable content of each article will be re-fetched by wallabag.": "Cet outil va importer toutes vos données de Pocket. Pocket ne nous autorise pas à récupérer le contenu depuis leur service, donc wallabag doit reparcourir chaque article pour récupérer son contenu." "This importer will import all your wallabag v1 articles. On your config page, click on \"JSON export\" in the \"Export your wallabag data\" section. You will have a \"wallabag-export-1-xxxx-xx-xx.json\" file.": "Cet outil va importer toutes vos données de wallabag v1. Sur votre page de configuration de wallabag v1, cliquez sur \"Export JSON\" dans la section \"Exporter vos données de wallabag\". Vous allez récupérer un fichier \"wallabag-export-1-xxxx-xx-xx.json\"." "You can import your data from your Pocket account. You just have to click on the below button and authorize the application to connect to getpocket.com.": "Vous pouvez importer vos données depuis votre compte Pocket. Vous n'avez qu'à cliquer sur le bouton ci-dessous et à autoriser wallabag à se connecter à getpocket.com." Connect to Pocket and import data: Se connecter à Pocket et importer les données. -- cgit v1.2.3