/**
  * @Route("/book/update/module", name="book-update-module")
  */
 public function updateModule(Request $request)
 {
     $content = $request->get('content');
     $bookSlug = $request->get('book');
     $moduleSlug = $request->get('module');
     $indexTasks = $request->get('blocks');
     $book = $this->getDoctrine()->getManager()->getRepository('eTextBookLoungeBundle:Book')->findOneBySlug($bookSlug);
     $package = new BookPackage($book);
     $package->setTmpFolderPath($this->container->getParameter('book_tmp_dir'));
     $package->setBooksFolderPath($this->container->getParameter('books_dir'));
     $package->setTemplateFolderPath($this->container->getParameter('book_template_dir'));
     $package->updateBookSlug();
     $package->createBootstrapFiles();
     $package->updateModuleContent($moduleSlug, $content);
     $package->updateBookInfoSummary($moduleSlug, $indexTasks);
     $package->updateBookSummary();
     $package->pack();
     return new JsonResponse(array('status' => 'success'));
 }