Difference between revisions of "Exporting Data"

From ARK
Jump to: navigation, search
Line 1: Line 1:
In order to allow your users to use the export functionality of ARK you need to set a few settings in the mod_settings files. An example is [http://ark.lparchaeology.com/wiki/index.php/Mod_settings.php#Export here].
+
In order to allow your users to use the export functionality of ARK you need to set a few settings in the mod_settings.php and settings.php files. An example is [http://ark.lparchaeology.com/wiki/index.php/Mod_settings.php#Export here].
  
 
You will also need to set up a couple of settings in settings.php, namely:
 
You will also need to set up a couple of settings in settings.php, namely:
 +
 +
==Settings.php==
 +
===Export Directory===
 +
The export directories are set for each case in the top of the settings file, as seen (INSERT LINK TO SETTINGS). Listed below are example directories for each case
 +
*'''ms4w''':
 +
<pre>
 +
// EXPORT
 +
$export_dir = $ark_dir.'data/tmp/';
 +
</pre>
 +
 +
*'''mac''':
 +
<pre>
 +
// EXPORT
 +
$export_dir = $doc_root.$ark_dir.'data/downloads/';
 +
</pre>
 +
 +
*'''linux''':
 +
<pre>
 +
// EXPORT
 +
$export_dir = $ark_dir.'data/tmp/';
 +
</pre>
 +
 +
===Download Tools===
 +
Each tool used in the download tools toolbar in the search page (data_view) must also be set up in the settings file (INSERT LINK TO SETTINGS).
 +
*'''CSV''':
 +
<pre>
 +
// DOWNLOADS
 +
$res = "results_mode=dl";
 +
$group_dls[] =
 +
    array(
 +
        'type' => 'text',
 +
        'href' => "overlay_holder.php?$res&amp;dl_mode=csv&amp;lboxreload=1&amp;sf_conf=conf_mac_exportdownloadcsv",
 +
        'css_class' => FALSE,
 +
        'mkname' => 'csv',
 +
        'lightbox' => 'lightbox|200'
 +
);
 +
</pre>
  
 
   // EXPORTS
 
   // EXPORTS

Revision as of 11:04, 23 February 2011

In order to allow your users to use the export functionality of ARK you need to set a few settings in the mod_settings.php and settings.php files. An example is here.

You will also need to set up a couple of settings in settings.php, namely:

Settings.php

Export Directory

The export directories are set for each case in the top of the settings file, as seen (INSERT LINK TO SETTINGS). Listed below are example directories for each case

  • ms4w:
// EXPORT
$export_dir = $ark_dir.'data/tmp/';
  • mac:
// EXPORT
$export_dir = $doc_root.$ark_dir.'data/downloads/';
  • linux:
// EXPORT
$export_dir = $ark_dir.'data/tmp/';

Download Tools

Each tool used in the download tools toolbar in the search page (data_view) must also be set up in the settings file (INSERT LINK TO SETTINGS).

  • CSV:
// DOWNLOADS
$res = "results_mode=dl";
$group_dls[] =
    array(
        'type' => 'text',
        'href' => "overlay_holder.php?$res&dl_mode=csv&lboxreload=1&sf_conf=conf_mac_exportdownloadcsv",
        'css_class' => FALSE,
        'mkname' => 'csv',
        'lightbox' => 'lightbox|200'
);
 // EXPORTS
 //export file location (where ARK exports will be saved - needs to be an absolute path)
 $export_dir = "C:/ms4w/Apache/htdocs/$ark_dir/tmp"; absolute path on server to save the export file(s)
 $web_export_dir = "$ark_dir/tmp/"; RELATIVE path where the export files(s) are saved.


If you want to add new export types - then you will need to write handlers for both the export itself (a function called exportCSV() and then a function that handles the elements named elemCSV()). It may be better to get a Developer to do this.