Skip to content

Commit

Permalink
Update open_data_schema_map.api.php (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
acouch authored and fmizzell committed Nov 4, 2018
1 parent 61e1d2d commit d721837
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions open_data_schema_map.api.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,43 @@ function hook_open_data_schema_map_args_alter(&$token, &$arg) {
$token[1] = 'nid';
}
}

/******** Use features to provide defaults *******/


/**
* Provide defaults using features module.
*
* @return array
* Exported mapping for ODSM endpoint.
*/
function hook_open_data_schema_apis_defaults() {
$open_data_schema_apis = array();
// Example endpoint:
$open_data_schema_apis['my_endpoint'] = array(
'name' => 'My Custom Endpoint',
// Is enabled by default?
'enabled' => 1,
'machine_name' => 'my_endpoint',
// Machine readbale schema.
'api_schema' => 'pod',
'description' => NULL,
'type' => 'node',
'bundle' => 'dataset',
// The schema fields and the associated tokens.
// See: https://github.com/GetDKAN/dkan/blob/7.x-1.x/modules/dkan/open_data_schema_map_dkan/open_data_schema_map_dkan.features.inc#L1273
// for example.
'mapping' => array(
),
'outputformat' => 'json',
'endpoint' => 'data.json',
'arguments' => array(
1 => array(
'field' => 'identifier',
'required' => 0,
),
),
'xml_root' => 'records',
'xml_defaulttag' => 'record',
);
}

0 comments on commit d721837

Please sign in to comment.