/**
     * Creates a new instance
     *
     * @param int $appId Localized Application Id
     * @param int $nbArticles Number of articles
     * @param int $viewMode View mode to use
     * @param int $publisherId Id of Publisher
     * @param int $selectionType Selection type to use
     **/
    public function __construct( $appId, $nbArticles, $viewMode, $publisherId, $selectionType )
    {
        $this->applicationLocalized = CacheApplicationTool::buildLocalizedApplicationByLocalizedId($appId);
        $this->applicationObject    = $this->applicationLocalized->applicationObject();
        $this->nbArticles           = $nbArticles;
        $this->viewMode             = $viewMode;
        $this->publisherId          = $publisherId;
        $this->selectionType        = $selectionType;
        $applicationName            = $this->applicationLocalized->attribute('url');

        if($applicationName)
            $this->_application = ApplicationFactory::fetchByUri( '/'.$applicationName );
    }
    /**
     * Push to the view variable about channel : channel headline, channel full url, channel part url (i.e: (channel)/131) and the icon
     */
    public function pushChannelResult()
    {
        if ($this->channel instanceof ApplicationLocalized) {
            $channelConfiguration = $this->channel->getChannelConfiguration();
            
            if ($this->channel->attribute("headline")) {
                $this->pushResult("channel_headline", $this->channel->attribute("headline"));
                $this->pushResult("channel_url", $this->channel->applicationUrl());
            }

            $this->pushResult('channel_id', $this->channel->application_id);

            $this->pushResult("channel_icon", StaticData::externalUrl(ClusterTool::clusterIdentifier(), $channelConfiguration->attribute("icon")));
            $this->pushResult("channel_color", $channelConfiguration->attribute("color"));

            if($this->channelBlockId){
                $this->pushResult("channel_part_url", "/(channel)/" . $this->channelBlockId);
            }

            $this->pushResult("channel_identifier", $this->channel->applicationObject()->identifier);
        }
    }