Returns a shared instance of the eZCollaborationViewHandler class
pr the two input params.


@param string $viewMode
@param int $type Is self::TYPE_STANDARD by default
@return eZCollaborationViewHandler
964605
static function instance( $viewMode, $type = self::TYPE_STANDARD )
    {
        if ( $type == self::TYPE_STANDARD )
            $instance =& $GLOBALS["eZCollaborationView"][$viewMode];
        else if ( $type == self::TYPE_GROUP )
            $instance =& $GLOBALS["eZCollaborationGroupView"][$viewMode];
        else
        {
            return null;
        }
        if ( !isset( $instance ) )
        {
            $instance = new eZCollaborationViewHandler( $viewMode, $type );
        }
        return $instance;
    }
210014
public function displayAndHandle(Request $request, $locationId, $viewType, $layout = false, array $params = array())
    {
        $parameters = $this->collectInformation($request, $locationId);

        $params += $parameters;

        $response = $this->container
            ->get('ez_content')
            ->viewLocation(
                $locationId,
                $viewType,
                $layout,
                $params
            );

        $response->setPrivate();

        return $response;
    }
511292
public function showFeedbackFormAction($locationId, $viewType, $layout = false, array $params = array())
    {
        $feedback = new Feedback();

        $form = $this->getFeedbackFormProvider()->getFeedbackForm($feedback);

        return $this->get('ez_content')->viewLocation(
            $locationId,
            $viewType,
            $layout,
            $params + array('form' => $form->createView(), 'onlyMarkup' => true, 'onlyJavascript' => false)
        );
    }
409276
public function watchWithLayout($view, $args = array(), $type = null)
    {
        try {
            return $this->scopeWithLayout($view, $args, $type);
        } catch (\InvalidArgumentException $e) {
            return $this->ofWithLayout($view, $args, $type);
        }
    }
840886
public function defaultViewModeSettings($viewMode)
    {
        $handler = $this->get('handler');
        if (class_exists($handler)) {
            $handler = new $handler();

            return $handler->defaultViewModeSettings($this, $viewMode);
        }

        return [];
    }
1015139
String getDefaultView(String typeName) {

        String result = m_defaultViewRules.getViewForType(typeName);
        if (result == null) {
            result = "view_other";
            try {
                if (OpenCms.getResourceManager().hasResourceType(typeName)
                    && OpenCms.getResourceManager().getResourceType(typeName).isFolder()) {
                    result = "view_folders";
                }
            } catch (CmsLoaderException e) {
                LOG.error(e.getLocalizedMessage(), e);
            }
        }
        return result;
    }
383727
protected function view($viewOrModel = null, $model = null, $layout = null) {
        return new ViewResult($viewOrModel, $model, $layout);
    }
853597
public function getViewForResource($resource,$viewType,$context=null)
    {
        if(empty($resource)){
            return new \Tripod\Mongo\MongoGraph();
        }

        $resourceAlias = $this->labeller->uri_to_alias($resource);
        $contextAlias = $this->getContextAlias($context);

        $query = array( "_id" => array("r"=>$resourceAlias,"c"=>$contextAlias,"type"=>$viewType));
        $viewCollection = $this->config->getCollectionForView($this->storeName, $viewType, $this->readPreference);
        $graph = $this->fetchGraph($query,MONGO_VIEW,$viewCollection);
        if ($graph->is_empty())
        {
            $this->getStat()->increment(MONGO_VIEW_CACHE_MISS.".$viewType");
            $viewSpec = $this->getConfigInstance()->getViewSpecification($this->storeName, $viewType);
            if($viewSpec == null)
            {
                return new \Tripod\Mongo\MongoGraph();
            }

            $fromCollection = $this->getFromCollectionForViewSpec($viewSpec);

            $doc = $this->config->getCollectionForCBD($this->storeName, $fromCollection)
                ->findOne(array( "_id" => array("r"=>$resourceAlias,"c"=>$contextAlias)));

            if($doc == NULL)
            {
                // if you are trying to generate a view for a document that doesnt exist in the collection
                // then we can just return an empty graph
                return new \Tripod\Mongo\MongoGraph();
            }

            // generate view then try again
            $this->generateView($viewType,$resource,$context);
            return $this->fetchGraph($query,MONGO_VIEW,$viewCollection);
        }
        return $graph;
    }
1118639
@SuppressWarnings("unchecked")
    public <E> MessageHandler<? super E> getMessageHandler(Class<E> type) {
        return (MessageHandler<? super E>) receivedMessageHandlers.get(type);
    }
1197765
protected function getHandler()
    {
        $handler = resolve($this->type->handler);
        if (!$handler instanceof ContentTypeHandler) {
            throw new DomainException("Type: $this->type can't be handled");
        }
        return $handler;
    }
236568
public function viewMode($slug = null)
    {
        if ($slug === null) {
            return ViewModeRegistry::current();
        }

        return ViewModeRegistry::uses($slug);
    }
423099
public function get_view_url($exclusivemode = 0, $fromctx = 0, $ctx = 0, $rec = 1) {
        return static::make_url($this->record->tagcollid, $this->record->rawname,
            $exclusivemode, $fromctx, $ctx, $rec);
    }
158604
private function setPlayMode(string $type, bool $value): ControllerInterface
    {
        $mode = $this->getMode();
        if ($mode[$type] === $value) {
            return $this;
        }

        $mode[$type] = $value;
        $this->setMode($mode);

        return $this;
    }
735106
public function scope($view, $args = array(), $type = null)
    {
        $viewDir = $this->getConfig('containerDir.view');

        // Add namespace to find in a theme path.
        $path = $this->getThemeNamespace($viewDir.'.'.$view);

        return $this->of($path, $args, $type);
    }
655905
public function viewResponseEvent(ViewEvent $event)
    {
        /** @var \Rcm\EventListener\ViewEventListener $viewEventListener */
        $viewEventListener
            = $this->serviceLocator->get(\Rcm\EventListener\ViewEventListener::class);

        $return = $viewEventListener->processRcmResponses($event);

        if (!empty($return)) {
            return $return;
        }

        return null;
    }
407164
protected function setViewMode($viewMode)
    {
        if (!in_array($viewMode, [
            self::VIEW_MODE_GRID,
            self::VIEW_MODE_LIST,
            self::VIEW_MODE_TILES
        ])) {
            throw new ApplicationException('Invalid input data');
        }

        $this->putSession('view_mode', $viewMode);
    }
382905
protected function html($val, $mode = 's')
    {
        switch ($mode) {
            case 'e':
                return $this->htmlE($val);
            case 's':
                return $this->htmlS($val);
        }

        Throw new ViewException(sprintf('Mode "%s" is a not supported View::html() output mode.', $mode));
    }