public function getResourceList($folderUri = null, $recursive = false) {
        //Set whether to use the given folderuri or the default
        $folderUri = $folderUri ?: $this->defaultFolder;

        //Get the resources in the requested folder
        $return = $this->jasperClient->getFolder($folderUri, $this->useFolderCache, $this->folderCacheDir, $this->folderCacheTimeout);

        //If security is active, filter out the reports the current user cannot see
        if ($this->useSecurity) {
            $newReturn = array();
            foreach ($return as $resource) {
                if ($this->container->get('mesd.jasper.report.security')->canView($resource->getUriString())) {
                    $newReturn[] = $resource;
                }
            }
            $return = $newReturn;
        }

        //if the recursive flag is set get the contents of each folder
        if ($recursive) {
            foreach ($return as $resource) {
                if ('folder' === $resource->getWsType()) {
                    $children = $this->getResourceList($resource->getUriString(), $recursive);
                    foreach ($children as $child) {
                        $resource->addChildResource($child);
                    }
                }
            }
        }

        //Return the resource array
        return $return;
    }
public function getResourceList($folderUri = null, $recursive = false) {
        //Set whether to use the given folderuri or the default
        $folderUri = $folderUri ?: $this->defaultFolder;

        //Get the resources in the requested folder
        $return = $this->jasperClient->getFolder($folderUri, $this->useFolderCache, $this->folderCacheDir, $this->folderCacheTimeout);

        //If security is active, filter out the reports the current user cannot see
        if ($this->useSecurity) {
            $newReturn = array();
            foreach ($return as $resource) {
                if ($this->container->get('mesd.jasper.report.security')->canView($resource->getUriString())) {
                    $newReturn[] = $resource;
                }
            }
            $return = $newReturn;
        }

        //if the recursive flag is set get the contents of each folder
        if ($recursive) {
            foreach ($return as $resource) {
                if ('folder' === $resource->getWsType()) {
                    $children = $this->getResourceList($resource->getUriString(), $recursive);
                    foreach ($children as $child) {
                        $resource->addChildResource($child);
                    }
                }
            }
        }

        //Return the resource array
        return $return;
    }
public function getResourceList ( $ folderUri = null , $ recursive = false ) { //Set whether to use the given folderuri or the default $ folderUri = $ folderUri ? : $ this -> defaultFolder ; //Get the resources in the requested folder $ return = $ this -> jasperClient -> getFolder ( $ folderUri , $ this -> useFolderCache , $ this -> folderCacheDir , $ this -> folderCacheTimeout ) ; //If security is active, filter out the reports the current user cannot see if ( $ this -> useSecurity ) { $ newReturn = array ( ) ; foreach ( $ return as $ resource ) { if ( $ this -> container -> get ( 'mesd.jasper.report.security' ) -> canView ( $ resource -> getUriString ( ) ) ) { $ newReturn [ ] = $ resource ; } } $ return = $ newReturn ; } //if the recursive flag is set get the contents of each folder if ( $ recursive ) { foreach ( $ return as $ resource ) { if ( 'folder' === $ resource -> getWsType ( ) ) { $ children = $ this -> getResourceList ( $ resource -> getUriString ( ) , $ recursive ) ; foreach ( $ children as $ child ) { $ resource -> addChildResource ( $ child ) ; } } } } //Return the resource array return $ return ; }
Gets a list of resources under the given or default folder

@param string  $folderUri The uri of the folder on the jasper server to use as the root (default if not given)
@param boolean $recursive Whether to get all the contents of the folders or just the reports in the given folder
NOTE: this can be S-L-O-W

@return array              Array of ResourceDescriptors
Gets a list of resources under the given or default folder