Project

General

Profile

« Previous | Next » 

Revision b9d89ce7

Added by Lorna Morris over 10 years ago

See #2869. Zip file now contains all DwcA files directly. Set "ignoreHeaderLines" = 0 in meta.xml. Removed Page display is description views.

View differences:

7.x/modules/dwca_export/dwca_export.module
3 3
// at the moment we are using a static meta.xml file
4 4
define ("METADATA_FILE_NAME", "meta.xml");
5 5
define ("STATIC_DIR", "/static/");
6
define ("ARCHIVE_ROOT_DIR", "dwca_export/");
6
//define ("ARCHIVE_ROOT_DIR", "dwca_export/");
7 7
define ('FILE_MAP', 'dwca_export_archive_descriptor_file_map');
8 8
define ('FILE_EXTENSION', ".txt");
9 9

  
......
178 178
				$description_map = $dwca_export_archive_descriptor_file_map[$description_key];
179 179

  
180 180
				if (array_key_exists($key, $description_map)) {
181
					//drupal_set_message(t('The ooKEY is... ') . $key . t('The ooVALUE is... ') . $value);
181
					drupal_set_message(t('The ooKEY is... ') . $key . t('The ooVALUE is... ') . $value);
182 182
					$dwca_export_archive_descriptor_file_map[$description_key][$key]['view_name'] = $value;
183 183
				}
184 184
			}
......
307 307
	
308 308
	
309 309
	// add metadata
310
	$zip->addFile($module_static_dir_absolute_path.METADATA_FILE_NAME, ARCHIVE_ROOT_DIR.METADATA_FILE_NAME);
310
	$zip->addFile($module_static_dir_absolute_path.METADATA_FILE_NAME, METADATA_FILE_NAME);
311 311

  
312 312
	global $base_url;
313 313

  
......
425 425
function _dwca_export_add_files_to_zip($view_temp_file = NULL, $dwca_filename, $zip){
426 426
	
427 427
	if($view_temp_file){
428
		$zip->addFile(drupal_realpath($view_temp_file), ARCHIVE_ROOT_DIR.$dwca_filename . FILE_EXTENSION);
428
		$zip->addFile(drupal_realpath($view_temp_file), $dwca_filename . FILE_EXTENSION);
429 429
	}else{
430 430
		throw new Exception(t('Cannot create %file', array('%file' => $dwca_filename)));
431 431
	}
7.x/modules/dwca_export/dwca_export.views_default.inc
73 73
	$handler->display->display_options['relationships']['parent']['ui_name'] = 'relParent';
74 74
	$handler->display->display_options['relationships']['parent']['required'] = 0;
75 75
	/* Relationship: Taxonomy term: Taxonomy term using Associated accepted name */
76
	$handler->display->display_options['relationships']['field_aan_4_taxonomy_term']['id'] = 'field_aan_4_taxonomy_term';
77
	$handler->display->display_options['relationships']['field_aan_4_taxonomy_term']['table'] = 'taxonomy_term_data';
78
	$handler->display->display_options['relationships']['field_aan_4_taxonomy_term']['field'] = 'field_aan_4_taxonomy_term';
79
	$handler->display->display_options['relationships']['field_aan_4_taxonomy_term']['label'] = 'assoc_accept_term';
80
	$handler->display->display_options['relationships']['field_aan_4_taxonomy_term']['required'] = 0;
76
	$handler->display->display_options['relationships']['reverse_field_aan_4_taxonomy_term']['id'] = 'reverse_field_aan_4_taxonomy_term';
77
	$handler->display->display_options['relationships']['reverse_field_aan_4_taxonomy_term']['table'] = 'taxonomy_term_data';
78
	$handler->display->display_options['relationships']['reverse_field_aan_4_taxonomy_term']['field'] = 'reverse_field_aan_4_taxonomy_term';
79
	$handler->display->display_options['relationships']['reverse_field_aan_4_taxonomy_term']['label'] = 'assoc_accept_term';
80
	$handler->display->display_options['relationships']['reverse_field_aan_4_taxonomy_term']['required'] = 0;
81 81
	/* Field: Taxonomy term: Term ID */
82 82
	$handler->display->display_options['fields']['tid_2']['id'] = 'tid_2';
83 83
	$handler->display->display_options['fields']['tid_2']['table'] = 'taxonomy_term_data';
......
1801 1801
	);
1802 1802

  
1803 1803
	/* Display: Page */
1804
	$handler = $view->new_display('page', 'Page', 'page');
1805
	$handler->display->display_options['path'] = t('dwca-export/description-' . $desc_type . '/page');
1804
	/*$handler = $view->new_display('page', 'Page', 'page');
1805
	$handler->display->display_options['path'] = t('dwca-export/description-' . $desc_type . '/page');*/
1806 1806

  
1807 1807
	/* Display: Data export */
1808 1808
	$handler = $view->new_display('views_data_export', 'Data export', 'views_data_export_1');
7.x/modules/dwca_export/static/meta.xml
1 1
<?xml version="1.0"?>
2 2
<archive xmlns="http://rs.tdwg.org/dwc/text/">
3
	<core encoding="UTF-8" linesTerminatedBy="\r\n" fieldsTerminatedBy="," fieldsEnclosedBy="&quot;" ignoreHeaderLines="1" rowType="http://rs.tdwg.org/dwc/terms/Taxon">
3
	<core encoding="UTF-8" linesTerminatedBy="\r\n" fieldsTerminatedBy="," fieldsEnclosedBy="&quot;" ignoreHeaderLines="0" rowType="http://rs.tdwg.org/dwc/terms/Taxon">
4 4
		<files>
5 5
			<location>classification.txt</location>
6 6
		</files>

Also available in: Unified diff