original_string: public function newAction(Request $request, $alias)
      {
          // first check for ACL
          $exportManager = $this->get('chill.main.export_manager');
          $export = $exportManager->getExport($alias);
          
          if ($exportManager->isGrantedForElement($export) === FALSE) {
              throw $this->createAccessDeniedException('The user does not have access to this export');
          }
          
          $step = $request->query->getAlpha('step', 'centers');
          
          switch ($step) {
              case 'centers':
                  return $this->selectCentersStep($request, $alias);
              case 'export':
                  return $this->exportFormStep($request, $alias);
                  break;
              case 'formatter':
                  return $this->formatterFormStep($request, $alias);
                  break;
              case 'generate':
                  return $this->forwardToGenerate($request, $alias);
                  break;
              default:
                  throw $this->createNotFoundException("The given step '$step' is invalid");
          }
      }
code: public function newAction(Request $request, $alias)
      {
          // first check for ACL
          $exportManager = $this->get('chill.main.export_manager');
          $export = $exportManager->getExport($alias);
          
          if ($exportManager->isGrantedForElement($export) === FALSE) {
              throw $this->createAccessDeniedException('The user does not have access to this export');
          }
          
          $step = $request->query->getAlpha('step', 'centers');
          
          switch ($step) {
              case 'centers':
                  return $this->selectCentersStep($request, $alias);
              case 'export':
                  return $this->exportFormStep($request, $alias);
                  break;
              case 'formatter':
                  return $this->formatterFormStep($request, $alias);
                  break;
              case 'generate':
                  return $this->forwardToGenerate($request, $alias);
                  break;
              default:
                  throw $this->createNotFoundException("The given step '$step' is invalid");
          }
      }
code_tokens: public function newAction ( Request $ request , $ alias ) { // first check for ACL $ exportManager = $ this -> get ( 'chill.main.export_manager' ) ; $ export = $ exportManager -> getExport ( $ alias ) ; if ( $ exportManager -> isGrantedForElement ( $ export ) === FALSE ) { throw $ this -> createAccessDeniedException ( 'The user does not have access to this export' ) ; } $ step = $ request -> query -> getAlpha ( 'step' , 'centers' ) ; switch ( $ step ) { case 'centers' : return $ this -> selectCentersStep ( $ request , $ alias ) ; case 'export' : return $ this -> exportFormStep ( $ request , $ alias ) ; break ; case 'formatter' : return $ this -> formatterFormStep ( $ request , $ alias ) ; break ; case 'generate' : return $ this -> forwardToGenerate ( $ request , $ alias ) ; break ; default : throw $ this -> createNotFoundException ( "The given step '$step' is invalid" ) ; } }
docstring: handle the step to build a query for an export
  
  This action has three steps :
  
  1.'export', the export form. When the form is posted, the data is stored
  in the session (if valid), and then a redirection is done to next step.
  2. 'formatter', the formatter form. When the form is posted, the data is
  stored in the session (if valid), and then a redirection is done to next step.
  3. 'generate': gather data from session from the previous steps, and
  make a redirection to the "generate" action with data in query (HTTP GET)
  
  @param string $request
  @param Request $alias
  @return \Symfony\Component\HttpFoundation\Response
docstring_tokens: handle the step to build a query for an export