public function newAction(Request $request, $type, $viewReference, $slot = null, $quantum = 'a')
    {
        try {
            $view = $this->getViewByReferenceId($viewReference);

            if (!$reference = $this->get('victoire_view_reference.repository')
                ->getOneReferenceByParameters(['id' => $viewReference])) {
                $reference = new ViewReference($viewReference);
            }
            $view->setReference($reference);

            $position = $request->query->has('position') ? $request->query->get('position') : null;
            $parentWidgetMap = $request->query->has('parentWidgetMap') ? $request->query->get('parentWidgetMap') : null;
            $widgetData = $this->get('victoire_widget.widget_manager')->newWidget(
                Widget::MODE_STATIC,
                $type,
                $slot,
                $view,
                $position,
                $parentWidgetMap,
                $quantum
            );

            $response = new JsonResponse([
                'success' => true,
                'html'    => $widgetData['html'],
            ]);
        } catch (Exception $ex) {
            $response = $this->getJsonReponseFromException($ex);
        }

        return $response;
    }