Component rendering action.

@param ComponentInterface $component
@param ContentInterface   $content

@return Response
970191
public function renderAction(ComponentInterface $component, ContentInterface $content)
    {
        if (!$mediaData = $component->getData('medias')) {
            // @todo log
            return new Response('');
        }

        return $this->get('synapse')
            ->createDecorator($component)
            ->decorate(array(
                'content' => $content,
                'medias' => $this->container->get('synapse.image.loader')
                    ->retrieveAll(array('id' => $component->getData('medias'))),
            ))
        ;
    }
288977
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WSubMenu menu = (WSubMenu) component;
		XmlStringBuilder xml = renderContext.getWriter();

		xml.appendTagOpen("ui:submenu");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		if (isTree(menu)) {
			xml.appendAttribute("open", String.valueOf(isOpen(menu)));
		}
		xml.appendOptionalAttribute("disabled", menu.isDisabled(), "true");
		xml.appendOptionalAttribute("hidden", menu.isHidden(), "true");
		if (menu.isTopLevelMenu()) {
			xml.appendOptionalAttribute("accessKey", menu.getAccessKeyAsString());
		} else {
			xml.appendAttribute("nested", "true");
		}
		xml.appendOptionalAttribute("type", getMenuType(menu));

		switch (menu.getMode()) {
			case CLIENT:
				xml.appendAttribute("mode", "client");
				break;
			case LAZY:
				xml.appendAttribute("mode", "lazy");
				break;
			case EAGER:
				xml.appendAttribute("mode", "eager");
				break;
			case DYNAMIC:
			case SERVER:
				// mode server mapped to mode dynamic as per https://github.com/BorderTech/wcomponents/issues/687
				xml.appendAttribute("mode", "dynamic");
				break;
			default:
				throw new SystemException("Unknown menu mode: " + menu.getMode());
		}

		xml.appendClose();

		// Paint label
		menu.getDecoratedLabel().paint(renderContext);

		MenuMode mode = menu.getMode();

		// Paint submenu items
		xml.appendTagOpen("ui:content");
		xml.appendAttribute("id", component.getId() + "-content");
		xml.appendClose();

		// Render content if not EAGER Mode or is EAGER and is the current AJAX request
		if (mode != MenuMode.EAGER || AjaxHelper.isCurrentAjaxTrigger(menu)) {
			// Visibility of content set in prepare paint
			menu.paintMenuItems(renderContext);
		}

		xml.appendEndTag("ui:content");

		xml.appendEndTag("ui:submenu");
	}
1249366
public function resolve(ComponentInterface $component)
    {
        $middlewares = array($component);

        foreach ($this->components as $comp) {
            $args = $comp;
            $firstArg = array_shift($args);

            if (is_callable($firstArg)) {
                $component = $firstArg($component);
            } else {
                $class = $firstArg;
                array_unshift($args, $component);
                $reflection = new \ReflectionClass($class);
                $component = $reflection->newInstanceArgs($args);
            }

            array_unshift($middlewares, $component);
        }

        return new ServerStack($component);
    }
1113324
public function onComponentConfigure($component)
    {
        $this->onComponentsList();
        Breadcrumbs::register('component-configure', function($breadcrumbs) use($component) {
            $breadcrumbs->parent('components');
            $breadcrumbs->push('Configuration: ' . $component->getFullName());
        });
        view()->share('breadcrumbs', Breadcrumbs::render('component-configure'));
    }
769881
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WImage imageComponent = (WImage) component;
		XmlStringBuilder xml = renderContext.getWriter();

		// No image set
		if (imageComponent.getImage() == null && imageComponent.getImageUrl() == null) {
			return;
		}

		renderTagOpen(imageComponent, xml);
		xml.appendEnd();
	}
44998
private function executeUserComponent($component, $action)
    {
        $ns = null;
        
        //
        if (!empty($this->config["classes"][$component][0])) {
            $ns = $this->config["classes"][$component][0];
        }

        //
        if (!empty($this->config["classes"][$component][1])) {
            $this->config['config'] = array_merge(
                $this->config['config'],
                $this->config["classes"][$component][1]
            );
        }

        //
        if (!empty($ns) && !file_exists($ns)) {
            $this->response = serialize([
                "error" => sprintf(Server::ERROR_USR_COMPONENT, $component),
                "code"  => 422
            ]);
            return;
        }

        //
        require($ns);

        //
        if (!class_exists($component)) {
            $this->response = serialize([
                "error" => sprintf(Server::ERROR_USR_COMPONENT, $component),
                "code"  => 422
            ]);
            return;
        }

        //
        return $this->execute($component, $action);
    }
1261695
public function setContent( Content $content )
    {
        foreach ( $this->handlers as $handler )
        {
            if ( $handler instanceof ContentAwareHandlerInterface )
            {
                $handler->setContent( $content );
            }
        }
    }
823219
public function canEdit(ContentInterface $content, array $parameters)
    {
        return $this->isContentOnSiteAllowed($content, $parameters) && !$content->getStatus()->isBlockedEdition();
    }
1028369
public function edit(Page $page, PageContent $content)
    {
        return $this->view('titan::pages.components.content')
            ->with('page', $page)
            ->with('item', $content);
    }
357915
public function showEditComponent(Component $component)
    {
        $groups = ComponentGroup::all();

        $pageTitle = sprintf('"%s" - %s - %s', $component->name, trans('dashboard.components.edit.title'), trans('dashboard.dashboard'));

        return View::make('dashboard.components.edit')
            ->withPageTitle($pageTitle)
            ->withComponent($component)
            ->withGroups($groups);
    }
330276
public function readSubscription($subscriptionId, $componentId)
    {
        $service = $this->getService();

        $response      = $service->request('subscriptions/' . (int)$subscriptionId . '/components/' . (int)$componentId, 'GET');
        $responseArray = $this->getResponseArray($response);

        if (!$this->isError()) {
            $this->_data = $responseArray['component'];
        } else {
            $this->_data = array();
        }

        return $this;
    }
1227156
public function resolve(ContentInterface $content)
    {
        $contentType = $this->contentTypeLoader->retrieveAll()
            ->filter(function (ContentTypeInterface $contentType) use ($content) {
                return is_a($content, $contentType->getContentClass());
            })
            ->first()
        ;
        if (!$contentType) {
            throw new InvalidContentException(sprintf(
                'No content type registered for "%s" content, check you configuration.',
                is_string($content) ? $content : get_class($content)
            ));
        }

        return $this->wrap($contentType, $content);
    }
400608
public function saved(ContentInterface $content)
    {
        if ($content->content_type_id !== null) {
            if (! $content->relationLoaded('type')) {
                $content->load('type');
            }

            $contentType = $content->getRelation('type');

            if ($contentType && $contentType->shouldDynamicTableExist() && ! $contentType->dynamicTableExists()) {
                $contentType->createTable();
            }
        }
    }
1027697
public function generateLink(ComponentInterface $component, ActionInterface $action = null)
    {
        try {
            return parent::generateLink($component, $action);
        } catch (\Exception $e) {
            return '';
        }
    }
1344215
public void remove(UIComponent component)
	{
		if (component.getParent() != this)
			return;

		content.components.remove(component);
		component.setParent(null);
		component.unregister(this);
		onContentUpdate();
	}
537314
public final void addComponent(ComponentRenderer component)
    {
        renderers.add(component);
        services.add(component);
        if (component instanceof HandlerListener)
        {
            addListener((HandlerListener) component);
        }
    }
389653
public function handle(ComponentContext $componentContext)
    {
        $componentContext = $this->prepareActionRequest($componentContext);
        $actionRequest = $componentContext->getParameter(DispatchComponent::class, 'actionRequest');
        $this->setDefaultControllerAndActionNameIfNoneSpecified($actionRequest);
        $actionResponse = $this->prepareActionResponse($componentContext->getHttpResponse());
        $this->dispatcher->dispatch($actionRequest, $actionResponse);
        // TODO: This should change in next major when the action response is no longer a HTTP response for backward compatibility.
        $componentContext->replaceHttpResponse($actionResponse);
    }