class FrxFiles in Forena Reports 7
Same name and namespace in other branches
- 6.2 plugins/FrxFiles.inc \FrxFiles
- 6 plugins/FrxFiles.inc \FrxFiles
- 7.2 plugins/FrxFiles.inc \FrxFiles
- 7.3 plugins/FrxFiles.inc \FrxFiles
- 7.4 plugins/FrxFiles.inc \FrxFiles
@file File class for loading raw xml files as Sample data This class is used as a reference implementation of a data engine, but is also used to provide sample data files and reports. @author metzlerd
Hierarchy
- class \FrxDataProvider
- class \FrxFiles
Expanded class hierarchy of FrxFiles
2 string references to 'FrxFiles'
- forena_forena_plugins in ./
forena.module - Self register plugins with forena.
- settings.php in repos/
forena_help/ settings.php
File
- plugins/
FrxFiles.inc, line 11 - File class for loading raw xml files as Sample data This class is used as a reference implementation of a data engine, but is also used to provide sample data files and reports. @author metzlerd
View source
class FrxFiles extends FrxDataProvider {
private $path;
public function __construct($conf, $repos_path) {
parent::__construct($conf, $repos_path);
$this->comment_prefix = '<!--';
$this->comment_suffix = '-->';
$this->block_ext = 'xml';
list($protocol, $path) = explode('://', $conf['uri'], 2);
if (!$path) {
$path = $protocol;
}
$this->path = $path;
}
public function getName() {
return 'XML File';
}
public function data($block_name, $parm_data = '', $subQuery = '') {
$block = $this
->load_block($block_name);
$xml = '';
if (isset($block['source']) && $this
->access($block['access'])) {
try {
$xmlData = $block['source'];
$xml = new SimpleXMLElement($xmlData);
} catch (Exception $e) {
forena_error("Error processing xml\n", $e
->getMessage() . "\n" . $xmlData);
}
}
//@TODO: Implment xpath subquery parameter
// Should filter returned nodes, but within the original root element?
return $xml;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FrxDataProvider:: |
public | property | ||
FrxDataProvider:: |
public | property | ||
FrxDataProvider:: |
public | property | ||
FrxDataProvider:: |
public | property | ||
FrxDataProvider:: |
public | property | ||
FrxDataProvider:: |
protected | property | ||
FrxDataProvider:: |
public | function | Implements the basic default security check of calling an access method. | |
FrxDataProvider:: |
public | function | Find all the blocks matching a provided search string | |
FrxDataProvider:: |
public | function | Default block load Loads the data block based on the block name from the file system. The classes that are derived from this will set the block_ext property, which in most cases is .sql but might be something different. The load of the block file… | |
FrxFiles:: |
private | property | ||
FrxFiles:: |
public | function | ||
FrxFiles:: |
public | function | ||
FrxFiles:: |
public | function |
Overrides FrxDataProvider:: |