/**
  * <p>Perform all state transitions required by the current phase of the
  * request processing {@link javax.faces.lifecycle.Lifecycle} for a
  * particular request. </p>
  *
  * @param context FacesContext for the current request being processed
  * @throws FacesException if a processing error occurred while
  *                        executing this phase
  */
 public function execute(BlazeContext $context)
 {
     $oldViewId = $context->getRequest()->getSession(true)->getAttribute('blaze.view_restore');
     if ($oldViewId != null) {
         $oldViewId = $oldViewId->getViewId();
     }
     $actViewId = $context->getViewRoot()->getViewId();
     $requestedView = $context->getViewHandler()->getRequestView($context);
     if (!$context->getDoRenderResponse() && !$context->getNavigated() && $oldViewId == $actViewId) {
         if ($requestedView == null) {
             $context->getResponse()->sendError(\blaze\netlet\http\HttpNetletResponse::SC_NOT_FOUND);
             $context->responseComplete();
         } else {
             $requestedViewId = $requestedView->getViewId();
             if ($requestedViewId != $actViewId) {
                 $context->setViewRoot($requestedView);
                 // clean up the el view scope
                 $context->getELContext()->getContext(\blaze\web\el\ELContext::SCOPE_VIEW)->resetValues($context);
             }
         }
     }
     $context->getRequest()->getSession()->setAttribute('blaze.view_restore', $context->getViewRoot());
     if (!$context->getResponseComplete()) {
         $context->getViewRoot()->processRender($context);
     }
 }
 public function getClientId(\blaze\web\application\BlazeContext $context)
 {
     if ($this->clientId != null) {
         return $this->clientId;
     }
     if ($this->getId() == null) {
         $this->id = $context->getViewRoot()->createUniqueId();
     }
     $container = $this->getParent();
     while ($container != null && !$container instanceof NamingContainer) {
         $container = $container->getParent();
     }
     if ($container == null) {
         $this->clientId = $this->id;
     } else {
         $this->clientId = $container->getClientId($context) . NamingContainer::ID_SEPARATOR . $this->id;
     }
     //        \blaze\util\Logger::get()->log('Setting Client id to '.$this->clientId);
     return $this->clientId;
 }