Commit df46d49f authored by metzlerd's avatar metzlerd
Browse files

Readme modifications for creating repositories.

parent 5629738b
......@@ -19,6 +19,38 @@ After saving your settings, visit your my reports page to see help reports,
sample reports, as well as some useful canned drupal administration reports.
The provided sample reports also serve as documentation for the product.
Creating your own data blocks
------------------------------
If you are interested in creating data_blocks (SQL files for use in reports).
you will need to modify your sites settings.php file to create custom data
repositories. The following code should be added to your drupal sites settings.php
and modified to suite your needs:
// Always include the global line
global $_forena_repositories;
// The following data would be referenced in a report as mysite/sqlfilename
$_forena_repositories['mysite'] = array(
'path' => 'data_blocks/site_sql', //Indicate the directory that will contain the sql files. You'll need to create this directory
'title' => 'Custom data blocks', //Only used in error messages.
'data provider' => 'FrxDrupal', //Use the drupal connection to connect to the database
'debug' => @$_GET['debug'], //This is a technique I use to help debug sql. debug=true on the url will show the sql calls
'access callback' => 'user_access', //Use the internal security function to test rights to the sql data
'user callback' => 'forena_current_user_id', //Use $user->uid when specifying :current_user in sql
);
// Uncomment the following lines and modify to connect to an external databse
// The following data would be referenced in a report as externalapp/anothersqlfilename
/*
$_forena_repositories['externalapp'] = array(
'path' => 'data_blocks/external_sql', //Indicate the directory that will contain the sql files. You'll need to create this directory
'title' => 'My APP Database', //Only used in error messages if there is a db connection failure
'data provider' => 'FrxPostgres', //Use the native postgres driver
'uri' => "dbname=mydatabasename user=myusername password=mypassword";, //Database connection string used to connect to the database.
'debug' => @$_GET['debug'], //This is a technique I use to help debug sql. debug=true on the url will show the sql calls
'access callback' => 'user_access', //Use the internal security function to test rights to the sql data. You can write your own function in a module and use it here.
'user callback' => 'forena_current_user_id', //Use $user->uid when specifying :current_user in sql. You can write your own function in a custom module and use it here
);
*/
Author
------
David Metzler
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment