Difference between revisions of "Exporting Data"

From ARK
Jump to: navigation, search
(Mod_Settings)
 
(15 intermediate revisions by 5 users not shown)
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.
+
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 [[env_settings.php]] files. An example is [[Mod_settings.php#Export|here]].
  
Essentially you set up an array that has elements named with the available export types. That array then contains any specific options that you may need for that export type and also the fields to be exported.
+
==Env_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>
  
Here is an example:
+
*'''mac''':
 +
<pre>
 +
// EXPORT
 +
$export_dir = $doc_root.$ark_dir.'data/downloads/';
 +
</pre>
  
  /*EXPORT STUFF
+
*'''linux''':
  * this is the array that sets up what export modes are available for this module
+
<pre>
  * and also what fields should be exported in that format.
+
// EXPORT
  * the array needs to be called mod_export_conf with each available format being
+
$export_dir = $ark_dir.'data/tmp/';
  * a named element in the array.
+
</pre>
  * e.g.
+
 
  $sfi_export_conf =
+
==Page_settings - Tools==
  array(
+
Each download and export tool used in the results toolbar in the search page (data_view) must also be set up in the [[page_settings.php]] file. These tools allow for exporting search results [[page_settings#Feeds|RSS and Atom feeds]] and exporting [[page_settings#Downloads|CSV]] files.
  'media_rss' =>
+
 
  array(
+
==Mod_settings - Subform==
  'export_fields' => array(
+
Each download mode needs to be set up as a subform within each of the mod_settings files allowing users to download data. The CSV downloader is the model for this. As the conf is a 'mac' or macro view (a.k.a data_view) subform, it should appear in the mod_settings as such. An example of the configured subform for CSV downloads can be seen in the [[Mod_settings.php#Export|mod_settings]] documentation.
  $conf_field_short_desc,
 
  $conf_field_file,
 
  ),
 
  ),
 
  'csv' =>
 
  array(
 
  'export_fields' => array(
 
  $conf_field_short_desc,
 
  $conf_field_file,
 
  ),
 
  ),
 
  );
 
    */
 
  
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 csvElem()). It may be better to get a Developer to do this.
 
 
[[category: Administrator]]
 
[[category: Administrator]]

Latest revision as of 17:57, 24 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 env_settings.php files. An example is here.

Env_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/';

Page_settings - Tools

Each download and export tool used in the results toolbar in the search page (data_view) must also be set up in the page_settings.php file. These tools allow for exporting search results RSS and Atom feeds and exporting CSV files.

Mod_settings - Subform

Each download mode needs to be set up as a subform within each of the mod_settings files allowing users to download data. The CSV downloader is the model for this. As the conf is a 'mac' or macro view (a.k.a data_view) subform, it should appear in the mod_settings as such. An example of the configured subform for CSV downloads can be seen in the mod_settings documentation.