public function getPluginViewData(
        $pluginName,
        $pluginInstanceId,
        $forcedAlternativeInstanceConfig = null
    ) {
        $request = ServerRequestFactory::fromGlobals();

        $blockConfig = $this->blockConfigRepository->findById($pluginName);

        if ($pluginInstanceId < 0) {
            $instanceWithData = new InstanceWithDataBasic(
                $pluginInstanceId,
                $pluginName,
                $blockConfig->getDefaultConfig(),
                null //@TODO run the dataprovider here instead of returning null
            );
        } else {
            $instanceWithData = $this->instanceWithDataService->__invoke($pluginInstanceId, $request);
        }

        if ($forcedAlternativeInstanceConfig !== null) {
            $instanceWithData = new InstanceWithDataBasic(
                $instanceWithData->getId(),
                $instanceWithData->getName(),
                $forcedAlternativeInstanceConfig,
                //@TODO we should have got the data from the data provider with the forced instance config as an input
                $instanceWithData->getData()
            );
        }

        $html = $this->blockRendererService->__invoke($instanceWithData);

        /**
         * @var $blockConfig Config
         */

        $return = [
            'html' => $html,
            'css' => [],
            'js' => [],
            'editJs' => '',
            'editCss' => '',
            'displayName' => $blockConfig->getLabel(),
            'tooltip' => $blockConfig->getDescription(),
            'icon' => $blockConfig->getIcon(),
            'siteWide' => false, // @deprecated <deprecated-site-wide-plugin>
            'md5' => '',
            'fromCache' => false,
            'canCache' => $blockConfig->getCache(),
            'pluginName' => $blockConfig->getName(),
            'pluginInstanceId' => $pluginInstanceId,
        ];

        return $return;
    }
public function getPluginViewData(
        $pluginName,
        $pluginInstanceId,
        $forcedAlternativeInstanceConfig = null
    ) {
        $request = ServerRequestFactory::fromGlobals();

        $blockConfig = $this->blockConfigRepository->findById($pluginName);

        if ($pluginInstanceId < 0) {
            $instanceWithData = new InstanceWithDataBasic(
                $pluginInstanceId,
                $pluginName,
                $blockConfig->getDefaultConfig(),
                null //@TODO run the dataprovider here instead of returning null
            );
        } else {
            $instanceWithData = $this->instanceWithDataService->__invoke($pluginInstanceId, $request);
        }

        if ($forcedAlternativeInstanceConfig !== null) {
            $instanceWithData = new InstanceWithDataBasic(
                $instanceWithData->getId(),
                $instanceWithData->getName(),
                $forcedAlternativeInstanceConfig,
                //@TODO we should have got the data from the data provider with the forced instance config as an input
                $instanceWithData->getData()
            );
        }

        $html = $this->blockRendererService->__invoke($instanceWithData);

        /**
         * @var $blockConfig Config
         */

        $return = [
            'html' => $html,
            'css' => [],
            'js' => [],
            'editJs' => '',
            'editCss' => '',
            'displayName' => $blockConfig->getLabel(),
            'tooltip' => $blockConfig->getDescription(),
            'icon' => $blockConfig->getIcon(),
            'siteWide' => false, // @deprecated <deprecated-site-wide-plugin>
            'md5' => '',
            'fromCache' => false,
            'canCache' => $blockConfig->getCache(),
            'pluginName' => $blockConfig->getName(),
            'pluginInstanceId' => $pluginInstanceId,
        ];

        return $return;
    }
public function getPluginViewData ( $ pluginName , $ pluginInstanceId , $ forcedAlternativeInstanceConfig = null ) { $ request = ServerRequestFactory :: fromGlobals ( ) ; $ blockConfig = $ this -> blockConfigRepository -> findById ( $ pluginName ) ; if ( $ pluginInstanceId < 0 ) { $ instanceWithData = new InstanceWithDataBasic ( $ pluginInstanceId , $ pluginName , $ blockConfig -> getDefaultConfig ( ) , null //@TODO run the dataprovider here instead of returning null ) ; } else { $ instanceWithData = $ this -> instanceWithDataService -> __invoke ( $ pluginInstanceId , $ request ) ; } if ( $ forcedAlternativeInstanceConfig !== null ) { $ instanceWithData = new InstanceWithDataBasic ( $ instanceWithData -> getId ( ) , $ instanceWithData -> getName ( ) , $ forcedAlternativeInstanceConfig , //@TODO we should have got the data from the data provider with the forced instance config as an input $ instanceWithData -> getData ( ) ) ; } $ html = $ this -> blockRendererService -> __invoke ( $ instanceWithData ) ; /**
         * @var $blockConfig Config
         */ $ return = [ 'html' => $ html , 'css' => [ ] , 'js' => [ ] , 'editJs' => '' , 'editCss' => '' , 'displayName' => $ blockConfig -> getLabel ( ) , 'tooltip' => $ blockConfig -> getDescription ( ) , 'icon' => $ blockConfig -> getIcon ( ) , 'siteWide' => false , // @deprecated <deprecated-site-wide-plugin> 'md5' => '' , 'fromCache' => false , 'canCache' => $ blockConfig -> getCache ( ) , 'pluginName' => $ blockConfig -> getName ( ) , 'pluginInstanceId' => $ pluginInstanceId , ] ; return $ return ; }
Get a plugin instance rendered view.

@param string $pluginName Plugin name
@param integer $pluginInstanceId Plugin Instance Id
@param null $forcedAlternativeInstanceConfig Not normally used. Useful for previewing changes

@return array
@throws \Rcm\Exception\InvalidPluginException
@throws \Rcm\Exception\PluginReturnedResponseException
Get a plugin instance rendered view .