return the general ContentNode Form

@param Request $request
@param ContentNode $contentNode

@return \Symfony\Component\HttpFoundation\Response
433506
public function simpleEditAction(Request $request, ContentNode $contentNode)
    {
        $contentNodeClassName = get_class($contentNode);

        $contentNodeParser = $this->get('mm_cmf_content.content_parser');
        $simpleFormData = $contentNodeParser->getSimpleForm($contentNodeClassName);

        $repository = $this->getDoctrine()->getRepository('MMCmfNodeBundle:Node');


        /**
         * load root node if set
         */
        $rootNode = null;
        if ((int)$request->get('root_node')) {
            $rootNode = $repository->find((int)$request->get('root_node'));
        }

        //set FormTemplate
        if (isset($simpleFormData['template']))
            $simpleFormTemplate = $simpleFormData['template'];
        else
            $simpleFormTemplate = '@MMCmfContent/Form/general_form.html.twig';

        $simpleFormType = $this->createSimpleEditForm($contentNode, $rootNode);

        // load icon
        $icon = $contentNodeParser->getIcon($contentNodeClassName);

        //generates html-dom-node-id
        $modal_dom_id = 'modal_content_node_' . $contentNode->getId();

        $deleteForm = $this->createDeleteForm($contentNode->getId());

        // render form
        return $this->render($simpleFormTemplate, array(
            'form' => $simpleFormType->createView(),
            'delete_form' => $deleteForm->createView(),
            'node_icon' => $icon,
            'modal_id' => $modal_dom_id
        ));
    }
323734
public function createAction(Request $request)
    {
        $contentEntityClass = $this->configurationManager->getEntityClass('content');
        $content = new $contentEntityClass;

        $form = $this->createForm(ContentCreateType::class, $content, [
            'action' => $this->generateUrl('sherlockode_acb_content_create'),
        ]);

        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $this->om->persist($content);
            $this->om->flush();

            return $this->redirectToRoute('sherlockode_acb_content_edit', ['id' => $content->getId()]);
        }

        return $this->render('@SherlockodeAdvancedContent/Content/create_content.html.twig', [
            'form' => $form->createView(),
            'data' => $content,
        ]);
    }
935197
public function updateContentTypeDraft($contentTypeId, Request $request)
    {
        $contentTypeDraft = $this->contentTypeService->loadContentTypeDraft($contentTypeId);
        $contentTypeUpdateStruct = $this->inputDispatcher->parse(
            new Message(
                array(
                    'Content-Type' => $request->headers->get('Content-Type'),
                ),
                $request->getContent()
            )
        );

        try {
            $this->contentTypeService->updateContentTypeDraft(
                $contentTypeDraft,
                $contentTypeUpdateStruct
            );
        } catch (InvalidArgumentException $e) {
            throw new ForbiddenException($e->getMessage());
        }

        return new Values\RestContentType(
            // Reload the content type draft to get the updated values
            $this->contentTypeService->loadContentTypeDraft(
                $contentTypeDraft->id
            )
        );
    }
673018
public function loadContentVersions($contentId, Request $request)
    {
        $contentInfo = $this->repository->getContentService()->loadContentInfo($contentId);

        return new Values\VersionList(
            $this->repository->getContentService()->loadVersions($contentInfo),
            $request->getPathInfo()
        );
    }
875712
public function renderForContentAction($contentId, Request $request)
    {
        return new Response(
            $this->commentsRenderer->renderForContent(
                $this->contentService->loadContentInfo($contentId),
                $request
            )
        );
    }
297113
public function loadContentInVersion($contentId, $versionNumber, Request $request)
    {
        $languages = Language::ALL;
        if ($request->query->has('languages')) {
            $languages = explode(',', $request->query->get('languages'));
        }

        $content = $this->repository->getContentService()->loadContent(
            $contentId,
            $languages,
            $versionNumber
        );
        $contentType = $this->repository->getContentTypeService()->loadContentType(
            $content->getVersionInfo()->getContentInfo()->contentTypeId
        );

        $versionValue = new Values\Version(
            $content,
            $contentType,
            $this->repository->getContentService()->loadRelations($content->getVersionInfo()),
            $request->getPathInfo()
        );

        if ($content->contentInfo->mainLocationId === null || $content->versionInfo->status === VersionInfo::STATUS_DRAFT) {
            return $versionValue;
        }

        return new Values\CachedValue(
            $versionValue,
            array('locationId' => $content->contentInfo->mainLocationId)
        );
    }
469479
public function create(Request $request)
    {
        app('soda.interface')->setHeading('New '.ucwords(trans('soda::terminology.content_type')));
        app('soda.interface')->breadcrumbs()->addLink(route('soda.content-types.index'), ucwords(trans('soda::terminology.content_type_plural')));

        try {
            $contentType = $this->contentTypes->newInstance($request);
            $contentTypes = $this->contentTypes->getList();
        } catch (Exception $e) {
            return $this->handleException($e, trans('soda::errors.create', ['object' => trans('soda::terminology.content_type')]));
        }

        return soda_cms_view('data.content.types.view', compact('contentType', 'contentTypes'));
    }
1055017
public function cgetAction(Request $request)
    {
        if (null !== $request->get('fields')) {
            return $this->cgetContent($request);
        }

        return $this->cgetNodes($request);
    }
305282
public function renderContentNode(array $contentNode, array $params = array()) {
        if (empty($contentNode)) {
            return '';
        }
        $model = strtolower($contentNode['model']);
        $type  = $contentNode['type'] ?: 'default';
        $partial = "partials/chapters/$model/$type.phtml";
        $params['contentNode'] = $contentNode;
        return $this->view->partial($partial, 'default', $params);
    }
928582
public function getElementHtml(Request $request)
    {
        $attributes = $this->repository->findMany($request->get('attribute_id'));

        $tmpString = '__RANDOM__STRING__';
        $view = view('avored-ecommerce::attribute.get-element')
            ->with('attributes', $attributes)
            ->with('tmpString', $tmpString);

        return new JsonResponse(['success' => true, 'content' => $view->render()]);
    }
825679
public function updateAction(Request $request, ContentNode $contentNode, $isSimpleForm = false)
    {
        $em = $this->getDoctrine()->getManager();
        $repository = $this->getDoctrine()->getRepository('MMCmfNodeBundle:Node');

        $rootNode = null;

        if ((int)$request->get('root_node')) {
            $rootNode = $repository->find((int)$request->get('root_node'));
        }

        //check if node need "simple" validation
        if ($isSimpleForm)
            $editForm = $this->createSimpleEditForm($contentNode, $rootNode);
        else
            $editForm = $this->createEditForm($contentNode, $rootNode);

        $editForm->handleRequest($request);

        if ($editForm->isValid()) {
            $em->flush();

            $markup = $this->get('mm_cmf_content.mm_cmf_parse_twig_extension')->cmfParse(
                $this->get('twig'),
                $contentNode
            );
            return new JsonResponse(array(
                    'success' => true,
                    'data' => array(
                        'id' => $contentNode->getId(),
                        'markup' => $markup
                    ))
            );
        }

        return new JsonResponse(array('success' => false));
    }
480855
public function cacheAction(Request $request)
    {
        $cms = $this->cmsSelector->retrieve();

        try {
            $page = $cms->getPageById($request->get('page_id'));
        } catch (PageNotFoundException $e) {
            $page = false;
        }

        $block = $cms->getBlock($request->get('block_id'));

        if (!$page || !$block) {
            return new Response('', 404);
        }

        $options = [];

        $blockContext = $this->contextManager->get($block, $options);
        $response = $this->blockRenderer->render($blockContext);

        $response->setPrivate(); //  always set to private

        if ($this->sync) {
            return $response;
        }

        $response->setContent(sprintf('
    (function () {
        var block = document.getElementById("block-cms-%s");

        var div = document.createElement("div");
        div.innerHTML = %s;

        for (var node in div.childNodes) {
            if (div.childNodes[node] && div.childNodes[node].nodeType == 1) {
                block.parentNode.replaceChild(div.childNodes[node], block);
            }
        }
    })();
', $block->getId(), json_encode($response->getContent())));

        $response->headers->set('Content-Type', 'application/javascript');

        return $response;
    }
500839
public function attach(Request $request, $contentTypeId)
    {
        try {
            $this->content->attach($contentTypeId, $request->input('fieldable_id'), $request->only('show_in_table'));
        } catch (Exception $e) {
            return $this->handleException($e, trans('soda::errors.attach', ['object' => trans('soda::terminology.field')]));
        }

        return redirect()->route('soda.content-types.edit', [$contentTypeId, 'tab' => 'fields'])->with('success', trans('soda::messages.attached', ['object' => trans('soda::terminology.field')]));
    }
110453
private function getNodeContent( $contentNode, $prefix )
	{
		$contentType = "";
		if ( property_exists( $contentNode, 'restriction' ) )
		{
			$parent = (string) $contentNode->restriction->attributes()->base;
			$contentType = "restriction";
		}
		else if ( property_exists( $contentNode, 'extension' ) )
		{
			$parent = (string) $contentNode->extension->attributes()->base;
			$contentType = "extension";
		}
		else
		{
			return $this->getComplexType( $contentNode, $prefix );
			return false;
		}

		// BMS 2018-04-09 Test candidates changed.
		$parent = $this->normalizePrefix( strpos( $parent, ":" ) ? $parent : "xs:$parent" );

		$content = array( 'parent' => $parent );
		$content['numeric'] = isset( $this->types[ $parent ]['numeric'] ) ? $this->types[ $parent ]['numeric'] : false;

		$name = (string) $contentNode->attributes()->name;
		if ( ! empty( $name ) )
		{
			$content['name'] = $name;
		}

		foreach ( $contentNode->$contentType->children( SCHEMA_NAMESPACE ) as  $key => $node )
		{
			$x = $this->getContent( $key, $node, $prefix );
			$content = array_merge_recursive( $content, $x );
		}

		if ( property_exists( $contentNode->$contentType->attributes(), 'base' ) )
		{
			$base = $this->normalizePrefix( (string) $contentNode->$contentType->attributes()->base );
			$content['base'] = $base;
			$content['contentType'] = $contentType;
		}

		return $content;
	}
398895
public function newChildAction(Request $request, ContentNode $parent_node, $contentNode_type, $isSimpleForm = false)
    {
        $factory = $this->get('mm_cmf_content.content_node_factory');
        $repository = $this->getDoctrine()->getRepository('MMCmfNodeBundle:Node');

        //$parent_node = null;
        $entity = $factory->createContentNode($contentNode_type);

        $entity->setParent($parent_node);

        //check if node need "simple" validation
        if ($isSimpleForm)
            $form = $this->createSimpleCreateForm($entity);
        else
            $form = $this->createCreateForm($entity);

        return $this->render('@MMCmfContent/Modal/Form/content_node_new.html.twig', array(
            'entity' => $entity,
            'form' => $form->createView(),
            'modal_id' => ''
        ));
    }
691325
private function resolveContentEditForm(
        ContentUpdateData $contentUpdate,
        string $languageCode,
        Content $content
    ): FormInterface {
        return $this->formFactory->create(
            ContentEditType::class,
            $contentUpdate,
            [
                'languageCode' => $languageCode,
                'mainLanguageCode' => $content->contentInfo->mainLanguageCode,
                'drafts_enabled' => true,
            ]
        );
    }
803318
public function copyContent($contentId, Request $request)
    {
        $destination = $request->headers->get('Destination');

        $parentLocationParts = explode('/', $destination);
        $copiedContent = $this->repository->getContentService()->copyContent(
            $this->repository->getContentService()->loadContentInfo($contentId),
            $this->repository->getLocationService()->newLocationCreateStruct(array_pop($parentLocationParts))
        );

        return new Values\ResourceCreated(
            $this->router->generate(
                'ezpublish_rest_loadContent',
                array('contentId' => $copiedContent->id)
            )
        );
    }