Commit aab6d086 authored by mnshantz's avatar mnshantz
Browse files

added services endpoint and service view to events

parent 09e6e9a4
......@@ -17,6 +17,10 @@ function uw_ct_event_ctools_plugin_api() {
return array("version" => "1");
}
list($module, $api) = func_get_args();
if ($module == "services" && $api == "services") {
return array("version" => "3");
}
list($module, $api) = func_get_args();
if ($module == "strongarm" && $api == "strongarm") {
return array("version" => "1");
}
......
......@@ -3,7 +3,7 @@ description = Adds events and event listing pages.
core = 7.x
package = uWaterloo Content Types
php = 5.2.4
version = 7.x-1.26-2
version = 7.x-1.26.3
project = uw_ct_event
dependencies[] = better_formats
dependencies[] = calendar
......@@ -29,7 +29,10 @@ dependencies[] = node
dependencies[] = options
dependencies[] = override_node_options
dependencies[] = rdf
dependencies[] = rest_server
dependencies[] = schemaorg
dependencies[] = services
dependencies[] = services_views
dependencies[] = strongarm
dependencies[] = taxonomy
dependencies[] = term_reference_tree
......@@ -47,6 +50,7 @@ features[context][] = event-front_page
features[context][] = event_categories
features[ctools][] = context:context:3
features[ctools][] = field_group:field_group:1
features[ctools][] = services:services:3
features[ctools][] = strongarm:strongarm:1
features[ctools][] = views:views_default:3.0
features[features_api][] = api:2
......@@ -80,6 +84,7 @@ features[field_instance][] = node-uw_event-field_image
features[field_instance][] = node-uw_event-field_uw_event_tag
features[field_instance][] = node-uw_event-field_uw_event_type
features[node][] = uw_event
features[services_endpoint][] = uwaterloo_events_v1
features[taxonomy][] = uw_event_affiliation
features[taxonomy][] = uw_event_tags
features[taxonomy][] = uw_event_type
......@@ -124,6 +129,7 @@ features[views_view][] = events
features[views_view][] = events_with_calendar
features[views_view][] = manage_events
features[views_view][] = uw_ct_event_calendar
features[views_view][] = uwaterloo_services_events
features_exclude[dependencies][uw_ct_person_profile] = uw_ct_person_profile
features_exclude[field][node-uw_event-body] = node-uw_event-body
features_exclude[field][node-uw_event-field_audience] = node-uw_event-field_audience
......
<?php
/**
* @file
* uw_ct_event.services.inc
*/
/**
* Implements hook_default_services_endpoint().
*/
function uw_ct_event_default_services_endpoint() {
$export = array();
$endpoint = new stdClass();
$endpoint->disabled = FALSE; /* Edit this to true to make a default endpoint disabled initially */
$endpoint->api_version = 3;
$endpoint->name = 'uwaterloo_events_v1';
$endpoint->server = 'rest_server';
$endpoint->path = 'api/v1/events';
$endpoint->authentication = array(
'services' => 'services',
);
$endpoint->server_settings = array();
$endpoint->resources = array(
'node' => array(
'operations' => array(
'retrieve' => array(
'enabled' => '1',
),
'update' => array(
'enabled' => '1',
),
'index' => array(
'enabled' => '1',
),
),
'relationships' => array(
'files' => array(
'enabled' => '1',
),
'comments' => array(
'enabled' => '1',
),
),
'targeted_actions' => array(
'attach_file' => array(
'enabled' => '1',
),
),
),
'user' => array(
'operations' => array(
'retrieve' => array(
'enabled' => '1',
),
'index' => array(
'enabled' => '1',
),
),
'actions' => array(
'login' => array(
'enabled' => '1',
'settings' => array(
'services' => array(
'resource_api_version' => '1.0',
),
),
),
'logout' => array(
'enabled' => '1',
'settings' => array(
'services' => array(
'resource_api_version' => '1.0',
),
),
),
'token' => array(
'enabled' => '1',
),
'register' => array(
'enabled' => '1',
),
),
),
'views' => array(
'operations' => array(
'retrieve' => array(
'enabled' => '1',
),
),
),
'all_events' => array(
'operations' => array(
'index' => array(
'enabled' => '1',
),
),
),
);
$endpoint->debug = 0;
$export['uwaterloo_events_v1'] = $endpoint;
return $export;
}
......@@ -2838,5 +2838,179 @@ echo preg_replace(\'/<(\\/?)h\\d/\', \'<$1p\', $data->field_body[0][\'rendered\'
);
$export['uw_ct_event_calendar'] = $view;
$view = new view();
$view->name = 'uwaterloo_services_events';
$view->description = 'View to give json feed for events using the services module.';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Services Events';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'role';
$handler->display->display_options['access']['role'] = array(
17 => '17',
);
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Field: Content: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['label'] = '';
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE;
$handler->display->display_options['fields']['title']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['title']['element_default_classes'] = FALSE;
/* Field: Content: Body */
$handler->display->display_options['fields']['body']['id'] = 'body';
$handler->display->display_options['fields']['body']['table'] = 'field_data_body';
$handler->display->display_options['fields']['body']['field'] = 'body';
$handler->display->display_options['fields']['body']['element_default_classes'] = FALSE;
$handler->display->display_options['fields']['body']['type'] = 'services';
$handler->display->display_options['fields']['body']['settings'] = array(
'skip_safe' => 0,
'skip_empty_values' => 0,
);
/* Field: Content: Affiliation */
$handler->display->display_options['fields']['field_event_affiliation']['id'] = 'field_event_affiliation';
$handler->display->display_options['fields']['field_event_affiliation']['table'] = 'field_data_field_event_affiliation';
$handler->display->display_options['fields']['field_event_affiliation']['field'] = 'field_event_affiliation';
$handler->display->display_options['fields']['field_event_affiliation']['element_default_classes'] = FALSE;
$handler->display->display_options['fields']['field_event_affiliation']['type'] = 'taxonomy_term_reference_plain';
$handler->display->display_options['fields']['field_event_affiliation']['settings'] = array(
'skip_safe' => 0,
'skip_empty_values' => 0,
);
$handler->display->display_options['fields']['field_event_affiliation']['delta_offset'] = '0';
/* Field: Content: Audience */
$handler->display->display_options['fields']['field_audience']['id'] = 'field_audience';
$handler->display->display_options['fields']['field_audience']['table'] = 'field_data_field_audience';
$handler->display->display_options['fields']['field_audience']['field'] = 'field_audience';
$handler->display->display_options['fields']['field_audience']['element_default_classes'] = FALSE;
$handler->display->display_options['fields']['field_audience']['type'] = 'taxonomy_term_reference_plain';
$handler->display->display_options['fields']['field_audience']['settings'] = array(
'skip_safe' => 0,
'skip_empty_values' => 0,
);
$handler->display->display_options['fields']['field_audience']['delta_offset'] = '0';
/* Field: Content: Cost */
$handler->display->display_options['fields']['field_event_cost']['id'] = 'field_event_cost';
$handler->display->display_options['fields']['field_event_cost']['table'] = 'field_data_field_event_cost';
$handler->display->display_options['fields']['field_event_cost']['field'] = 'field_event_cost';
$handler->display->display_options['fields']['field_event_cost']['element_default_classes'] = FALSE;
$handler->display->display_options['fields']['field_event_cost']['type'] = 'services';
$handler->display->display_options['fields']['field_event_cost']['settings'] = array(
'skip_safe' => 0,
'skip_empty_values' => 0,
);
/* Field: Content: Date and time */
$handler->display->display_options['fields']['field_event_date']['id'] = 'field_event_date';
$handler->display->display_options['fields']['field_event_date']['table'] = 'field_data_field_event_date';
$handler->display->display_options['fields']['field_event_date']['field'] = 'field_event_date';
$handler->display->display_options['fields']['field_event_date']['element_default_classes'] = FALSE;
$handler->display->display_options['fields']['field_event_date']['type'] = 'services';
$handler->display->display_options['fields']['field_event_date']['settings'] = array(
'skip_safe' => 0,
'skip_empty_values' => 0,
);
$handler->display->display_options['fields']['field_event_date']['delta_offset'] = '0';
/* Field: Content: Event Tags */
$handler->display->display_options['fields']['field_uw_event_tag']['id'] = 'field_uw_event_tag';
$handler->display->display_options['fields']['field_uw_event_tag']['table'] = 'field_data_field_uw_event_tag';
$handler->display->display_options['fields']['field_uw_event_tag']['field'] = 'field_uw_event_tag';
$handler->display->display_options['fields']['field_uw_event_tag']['delta_offset'] = '0';
/* Field: Content: Event website */
$handler->display->display_options['fields']['field_event_moreinfo_link']['id'] = 'field_event_moreinfo_link';
$handler->display->display_options['fields']['field_event_moreinfo_link']['table'] = 'field_data_field_event_moreinfo_link';
$handler->display->display_options['fields']['field_event_moreinfo_link']['field'] = 'field_event_moreinfo_link';
$handler->display->display_options['fields']['field_event_moreinfo_link']['element_default_classes'] = FALSE;
$handler->display->display_options['fields']['field_event_moreinfo_link']['click_sort_column'] = 'url';
$handler->display->display_options['fields']['field_event_moreinfo_link']['type'] = 'services';
$handler->display->display_options['fields']['field_event_moreinfo_link']['settings'] = array(
'skip_safe' => 0,
'skip_empty_values' => 0,
);
/* Field: Content: Host */
$handler->display->display_options['fields']['field_event_host_link']['id'] = 'field_event_host_link';
$handler->display->display_options['fields']['field_event_host_link']['table'] = 'field_data_field_event_host_link';
$handler->display->display_options['fields']['field_event_host_link']['field'] = 'field_event_host_link';
$handler->display->display_options['fields']['field_event_host_link']['element_default_classes'] = FALSE;
$handler->display->display_options['fields']['field_event_host_link']['click_sort_column'] = 'url';
$handler->display->display_options['fields']['field_event_host_link']['type'] = 'services';
$handler->display->display_options['fields']['field_event_host_link']['settings'] = array(
'skip_safe' => 0,
'skip_empty_values' => 0,
);
/* Field: Content: Listing page image */
$handler->display->display_options['fields']['field_event_image']['id'] = 'field_event_image';
$handler->display->display_options['fields']['field_event_image']['table'] = 'field_data_field_event_image';
$handler->display->display_options['fields']['field_event_image']['field'] = 'field_event_image';
$handler->display->display_options['fields']['field_event_image']['click_sort_column'] = 'fid';
$handler->display->display_options['fields']['field_event_image']['type'] = 'services';
$handler->display->display_options['fields']['field_event_image']['settings'] = array(
'skip_safe' => 0,
'skip_empty_values' => 0,
);
/* Field: Content: Location */
$handler->display->display_options['fields']['field_event_location']['id'] = 'field_event_location';
$handler->display->display_options['fields']['field_event_location']['table'] = 'field_data_field_event_location';
$handler->display->display_options['fields']['field_event_location']['field'] = 'field_event_location';
$handler->display->display_options['fields']['field_event_location']['element_default_classes'] = FALSE;
$handler->display->display_options['fields']['field_event_location']['type'] = 'services';
$handler->display->display_options['fields']['field_event_location']['settings'] = array(
'skip_safe' => 0,
'skip_empty_values' => 0,
);
/* Field: Feeds log: Log message */
$handler->display->display_options['fields']['message']['id'] = 'message';
$handler->display->display_options['fields']['message']['table'] = 'feeds_log';
$handler->display->display_options['fields']['message']['field'] = 'message';
$handler->display->display_options['fields']['message']['element_default_classes'] = FALSE;
/* Field: Feeds log: Log time */
$handler->display->display_options['fields']['log_time']['id'] = 'log_time';
$handler->display->display_options['fields']['log_time']['table'] = 'feeds_log';
$handler->display->display_options['fields']['log_time']['field'] = 'log_time';
$handler->display->display_options['fields']['log_time']['element_default_classes'] = FALSE;
$handler->display->display_options['fields']['log_time']['date_format'] = 'long';
/* Field: Feeds log: Request time */
$handler->display->display_options['fields']['request_time']['id'] = 'request_time';
$handler->display->display_options['fields']['request_time']['table'] = 'feeds_log';
$handler->display->display_options['fields']['request_time']['field'] = 'request_time';
$handler->display->display_options['fields']['request_time']['date_format'] = 'long';
/* Sort criterion: Content: Post date */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
'uw_event' => 'uw_event',
);
$handler->display->display_options['filters']['type']['group'] = 1;
/* Display: Services */
$handler = $view->new_display('services', 'Services', 'services_1');
$handler->display->display_options['path'] = 'all_events';
$export['uwaterloo_services_events'] = $view;
return $export;
}
Supports Markdown
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