original_string: public function listJsonAction() {
          //Get the folder
          $folderUri = $this->container->get('request')->query->get('id');
  
          //Set folder uri to null to use the default if the root is requested ('#')
          if ('#' === $folderUri) {
              $folder = null;
          } else {
              $folder = $folderUri;
          }
  
          //Get the resource descriptors (not recursively)
          $resources = $this->container->get('mesd.jasper.report.client')->getResourceList($folder, false);
  
          //Convert the resources into an array to encode in json in the way jstree can read them
          $response = array();
          foreach($resources as $resource) {
              $data = array();
              $data['id'] = $resource->getUriString();
              $data['parent'] = $folderUri;
              $data['icon'] = false;
  
              if ('reportUnit' === $resource->getWsType()) {
                  //Report object specific settings
                  $data['text'] = '<i id="' . $data['id'] . '-icon" class="icon-file"></i> ' . $resource->getLabel();
                  $data['children'] = false;
                  //Set the href to the report input form
                  $data['a_attr'] = array('href' => $this->container->get('router')->generate('MesdJasperReportViewerBundle_display_report_viewer', array('reportUri' => rawurlencode($resource->getUriString()))));
                  $data['dump'] = $resource->getUriString();
              } elseif ('folder' === $resource->getWsType()) {
                  //Folder object specific settings
                  $data['text'] = '<i id="' . $data['id'] . '-icon" class="icon-folder-close"></i> ' . $resource->getLabel();
                  $data['children'] = true;
              }
  
              $response[] = $data;
          }
  
          //Get the resources
          return new JsonResponse($response);
      }
code: public function listJsonAction() {
          //Get the folder
          $folderUri = $this->container->get('request')->query->get('id');
  
          //Set folder uri to null to use the default if the root is requested ('#')
          if ('#' === $folderUri) {
              $folder = null;
          } else {
              $folder = $folderUri;
          }
  
          //Get the resource descriptors (not recursively)
          $resources = $this->container->get('mesd.jasper.report.client')->getResourceList($folder, false);
  
          //Convert the resources into an array to encode in json in the way jstree can read them
          $response = array();
          foreach($resources as $resource) {
              $data = array();
              $data['id'] = $resource->getUriString();
              $data['parent'] = $folderUri;
              $data['icon'] = false;
  
              if ('reportUnit' === $resource->getWsType()) {
                  //Report object specific settings
                  $data['text'] = '<i id="' . $data['id'] . '-icon" class="icon-file"></i> ' . $resource->getLabel();
                  $data['children'] = false;
                  //Set the href to the report input form
                  $data['a_attr'] = array('href' => $this->container->get('router')->generate('MesdJasperReportViewerBundle_display_report_viewer', array('reportUri' => rawurlencode($resource->getUriString()))));
                  $data['dump'] = $resource->getUriString();
              } elseif ('folder' === $resource->getWsType()) {
                  //Folder object specific settings
                  $data['text'] = '<i id="' . $data['id'] . '-icon" class="icon-folder-close"></i> ' . $resource->getLabel();
                  $data['children'] = true;
              }
  
              $response[] = $data;
          }
  
          //Get the resources
          return new JsonResponse($response);
      }
code_tokens: public function listJsonAction ( ) { //Get the folder $ folderUri = $ this -> container -> get ( 'request' ) -> query -> get ( 'id' ) ; //Set folder uri to null to use the default if the root is requested ('#') if ( '#' === $ folderUri ) { $ folder = null ; } else { $ folder = $ folderUri ; } //Get the resource descriptors (not recursively) $ resources = $ this -> container -> get ( 'mesd.jasper.report.client' ) -> getResourceList ( $ folder , false ) ; //Convert the resources into an array to encode in json in the way jstree can read them $ response = array ( ) ; foreach ( $ resources as $ resource ) { $ data = array ( ) ; $ data [ 'id' ] = $ resource -> getUriString ( ) ; $ data [ 'parent' ] = $ folderUri ; $ data [ 'icon' ] = false ; if ( 'reportUnit' === $ resource -> getWsType ( ) ) { //Report object specific settings $ data [ 'text' ] = '<i id="' . $ data [ 'id' ] . '-icon" class="icon-file"></i> ' . $ resource -> getLabel ( ) ; $ data [ 'children' ] = false ; //Set the href to the report input form $ data [ 'a_attr' ] = array ( 'href' => $ this -> container -> get ( 'router' ) -> generate ( 'MesdJasperReportViewerBundle_display_report_viewer' , array ( 'reportUri' => rawurlencode ( $ resource -> getUriString ( ) ) ) ) ) ; $ data [ 'dump' ] = $ resource -> getUriString ( ) ; } elseif ( 'folder' === $ resource -> getWsType ( ) ) { //Folder object specific settings $ data [ 'text' ] = '<i id="' . $ data [ 'id' ] . '-icon" class="icon-folder-close"></i> ' . $ resource -> getLabel ( ) ; $ data [ 'children' ] = true ; } $ response [ ] = $ data ; } //Get the resources return new JsonResponse ( $ response ) ; }
docstring: Gets the resources contained in the requested folder
  
  Folder name comes in via a query string parameter ('#' to use the default)
  
  @return JsonResponse   The Json Object of the returned resources
docstring_tokens: Gets the resources contained in the requested folder