public function indexAction(Request $request, $nodeId)
    {
        $node = $this->responseHelper->getNodeOr404($nodeId);
        $textNode = $this->getTextNode($node);
        $form = $this->formFactory->create($textNode);
        $messages = new Messages();

        if ($this->formHandler->process($request, $form)) {
            $messages->addSuccess($this->formHandler->onSuccess($request->getLocale(), $node));
        }

        if ('json' === $request->getRequestFormat()) {
            $jsonContent = $this->responseHelper->createJsonContent($node);
            $jsonContent->setMessages($this->responseHelper->renderMessages($messages));
            $jsonContent->setTab($this->renderTextNode($form));

            return $this->responseHelper->getJsonResponse($jsonContent);
        }

        return new Response($this->renderTextNode($form, $messages));
    }