/**
     * 
     * @param ApplicationDefault $app
     * @param string $path
     * @return ApplicationDefault
     */
    public static function initFull($app, $path)
    {
        $blockName              = $app->blockName();
        $applicationName        = $app->applicationName();
        $params                 = $app->_params;
        $outputType             = $app->_outputType;
        $applicationObject      = $app->applicationObject;
        $applicationLocalized   = $app->applicationLocalized;
        $trimedPath             = trim($path, '/ ');

        // ajax call
        if( in_array( $trimedPath, $app->ajaxAllowedCall() ) )
            return $app;

        // view parameters
        if( preg_match('#^/\([^\)]+\)/#', $path) )
            return $app;
        
        if ( $app->hasHomepage($app) && preg_match('#^/list#', $path) )
        {
            $app->setStatus('list');
            return $app;
        }
            

        $node = method_exists($app, 'findNodeFromPath') ? $app::findNodeFromPath( $path, $app ) : self::findNodeFromPath( $path, $app );

        if ( $node instanceof ApplicationDefault )
        {
            $app->setStatus('list');
            return $app;
        }
        elseif( $node )
        {
            // content list application with external content
            /* @var $applicationObject ApplicationObject */

            if( $applicationObject->configurationContentService && $applicationObject->hasExternalLinkHandler() )
                $app = new ExternalApplication( $params, $outputType, $blockName, $applicationName, $applicationObject, $applicationLocalized );

            $app->setStatus('full');
            $app->node = $node;
        }
        else
        {
            if(SolrSafeOperatorHelper::seoIsEnabled($app->applicationObject()->identifier))
                $app = $app::initSeo($app, $path);

            if(!$app->isSeo)
                $app = self::extendedFactory( $params, $outputType, $blockName, null );
        }

        return $app;
    }
    /**
     * @param eZTemplate $tpl
     * @param string $operatorName
     * @param array $operatorParameters
     * @param string $rootNamespace
     * @param string $currentNamespace
     * @param mixed $operatorValue
     * @param array $namedParameters
     */
    function modify($tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters)
    {
        switch ($operatorName)
        {
            case 'timestampToDateISO':
                $operatorValue = date('c', $namedParameters['timestamp']);
                break;
            case 'ezstr_replace':
                $operatorValue = str_replace(
                    $namedParameters['search'],
                    $namedParameters['replace'],
                    $namedParameters['text']
                );
                break;
            case 'hash_set':
                $hash                          = $namedParameters['hash'];
                $hash[$namedParameters['key']] = $namedParameters['val'];
                $operatorValue                 = $hash;
                break;
            case 'currentApplication':
                $operatorValue = ApplicationDefault::instance();
                break;
            case 'getApplicationName':
                if ($namedParameters['application'] instanceof ApplicationDefault)
                {
                    $operatorValue = $namedParameters['application']->applicationName();
                }
                break;
            case 'getTableEmbeddedName':
                $pattern = '/<td class="MMTableCellHead" ?.*>(.*)<\/td>/';
                preg_match_all($pattern, $namedParameters['htmlCode'], $matches);

                $operatorValue = $matches[1][0];
                break;
            case 'external_app_cookie_key':
                $operatorValue = ExternalApplication::createExternalApplicationCookieKey(
                    $namedParameters['localized_application']
                );
                break;
            case 'getCurrentCluster':
                $operatorValue = ClusterTool::clusterIdentifier();
                break;
            case 'checkIfSiteMatchesType':
                $contexts = array(
                    ContextTool::APP_MOBILE_DESIGN,
                    ContextTool::FRONT_DESIGN,
                    ContextTool::MOBILE_DESIGN
                );

                $operatorValue = (in_array($namedParameters['site_type'], $contexts)) ? ContextTool::instance(
                )->siteIsTypeOf($namedParameters['site_type']) : false;
                break;
            case 'import_status_xml_mdd':
                $statusXmlMdd = array(
                    1 => 'COMPLETE_SUCCESS',
                    2 => 'SUCCESS_WITH_WARNINGS',
                    3 => 'BLOCKING_ERROR',
                    4 => 'CRITICAL_ERROR',
                    5 => 'FATAL_ERROR'
                );

                $operatorValue = (isset($statusXmlMdd[$namedParameters['status']]) ? $statusXmlMdd[$namedParameters['status']] : $namedParameters['status']);
                break;
            case 'import_status_mdd_ez':
                $statusMddEz = array(
                    '-1' => 'DO_NOT_TREAT',
                    0    => 'INITIAL',
                    1    => 'SYNCHRO',
                    2    => 'ARTICLE_REF',
                    4    => 'CRITICAL_ERROR',
                    8    => 'FATAL_ERROR'
                );

                $operatorValue = (isset($statusMddEz[$namedParameters['status']]) ? $statusMddEz[$namedParameters['status']] : $namedParameters['status']);
                break;
            case 'getUserCustomerType':
                $user          = MMUsers::getCurrentUserObject();
                $operatorValue = ($user) ? $user->attribute('customer_type') : 'User not logged in';
                break;
            case 'isUserDataMissing':
                $instance      = MMUserData::instance();
                $operatorValue = $instance->isUserDataMissing($namedParameters['name']);
                break;
            case 'isMobile':
                $operatorValue = ContextTool::instance()->isMobile();
                break;
            case 'getExternalConfiguration':
                $operatorValue = ApplicationExternalConfiguration::getExternalConfiguration($namedParameters['id']);
                break;
            case 'getLocalizedApplicationByIdentifier':
                $operatorValue = CacheApplicationTool::buildLocalizedApplicationByIdentifier(
                    $namedParameters['identifier']
                );
                break;
            case 'getWebtrendsTimezone':
                $d = new DateTime('now', new DateTimeZone(eZINI::instance()->variable('TimeZoneSettings', 'TimeZone')));

                $operatorValue = ($d->getOffset() / 3600);
                break;
            case 'getChinaProvinceCity':
                $operatorValue = ChinaLocation::fetchProvincesAndCities();
                break;
            case 'isCatchUpAppNameEnabled':
                $operatorValue = MMGlobalSearch::isCatchUpAppNameEnabled();
                break;
            case 'gmdate':
                $operatorValue = gmdate($namedParameters['format'], $namedParameters['duration']);
                break;
            case 'mb_strtoupper':
                $operatorValue = mb_strtoupper($namedParameters['str']);
                break;
            case 'preg_replace':
                $operatorValue = preg_replace(
                    $namedParameters['pattern'],
                    $namedParameters['replacement'],
                    $namedParameters['subject'],
                    $namedParameters['$limit']
                );
                break;
            case 'html_entity_decode':
                $operatorValue = html_entity_decode($namedParameters['string']);
                break;
            case 'urlencode':
                $operatorValue = urlencode($namedParameters['string']);
                break;
            case 'json_encode':
                $operatorValue = json_encode($namedParameters['value']);
                break;
            case 'domain':
                $operatorValue = ContextTool::instance()->domain();
                break;
            case 'getUumpDateFormat':
                $operatorValue = SolrSafeOperatorHelper::clusterIni('EsbDateConvert', 'FormatDate', 'merck.ini' );
                break;
            case 'html_contains_image':
                $operatorValue = SolrSafeOperatorHelper::htmlContainsImage($namedParameters['string']);
                break;
            case 'preg_match':
                $operatorValue = preg_match (
                    $namedParameters['pattern'],
                    $namedParameters['subject']
                );
                break;
        }
    }