/**
     * Returns the URL Alias to an App
     *
     * The URL will be prefixed with the BaseUrl from site.ini.
     *
     * @return string URL
     **/
    protected function appUrlAlias()
    {
        $ini     = eZINI::instance();
        $baseUrl = $ini->variable( 'SiteAccessSettings', 'BaseUrl' );
        $url     = $baseUrl . $this->applicationLocalized->attribute( 'url_alias' );
        $url     = str_replace( "//", "/", $url );

        return $url;
    }
    /**
     * 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);
        }
    }
    /**
     * @param ApplicationLocalized $localizedApp
     * @return string
     */
    public static function createExternalApplicationCookieKey( $localizedApp )
    {
        $cookieKey = array( $localizedApp->attribute('headline') );
        if( $publisherNodeId = $localizedApp->publisherNodeIds() )
        {
            $cookieKey[] = $publisherNodeId[0];
        }

        return md5(serialize( $cookieKey ));
    }