From 6954a76b4504c15801c227227916477cfe6119e6 Mon Sep 17 00:00:00 2001 From: Sheldon Rampton Date: Sun, 17 Mar 2013 18:03:04 -0500 Subject: [PATCH] Issue #83: Restore schema.org assignments to Application content type --- .../appcat_application_content.features.inc | 168 ++++++++++++++++++ .../appcat_application_content.info | 3 + .../appcat_application_content.module | 1 + .../features/appcat_misc/appcat_misc.module | 19 ++ 4 files changed, 191 insertions(+) diff --git a/modules/features/appcat_application_content/appcat_application_content.features.inc b/modules/features/appcat_application_content/appcat_application_content.features.inc index c6e7c20..63ddc79 100644 --- a/modules/features/appcat_application_content/appcat_application_content.features.inc +++ b/modules/features/appcat_application_content/appcat_application_content.features.inc @@ -112,3 +112,171 @@ function appcat_application_content_node_info() { ); return $items; } + +/** + * Implements hook_rdf_default_mappings(). + */ +function appcat_application_content_rdf_default_mappings() { + $schemaorg = array(); + + // Exported RDF mapping: application + $schemaorg['node']['application'] = array( + 'rdftype' => array( + 0 => 'schema:SoftwareApplication', + 1 => 'sioc:Item', + 2 => 'foaf:Document', + ), + 'title' => array( + 'predicates' => array( + 0 => 'schema:name', + ), + ), + 'created' => array( + 'predicates' => array( + 0 => 'dc:date', + 1 => 'dc:created', + ), + 'datatype' => 'xsd:dateTime', + 'callback' => 'date_iso8601', + ), + 'changed' => array( + 'predicates' => array( + 0 => 'dc:modified', + ), + 'datatype' => 'xsd:dateTime', + 'callback' => 'date_iso8601', + ), + 'body' => array( + 'predicates' => array( + 0 => 'schema:text', + 1 => 'content:encoded', + ), + ), + 'uid' => array( + 'predicates' => array( + 0 => 'sioc:has_creator', + ), + 'type' => 'rel', + ), + 'name' => array( + 'predicates' => array( + 0 => 'schema:name', + ), + ), + 'comment_count' => array( + 'predicates' => array( + 0 => 'sioc:num_replies', + ), + 'datatype' => 'xsd:integer', + ), + 'last_activity' => array( + 'predicates' => array( + 0 => 'sioc:last_activity_date', + ), + 'datatype' => 'xsd:dateTime', + 'callback' => 'date_iso8601', + ), + 'url' => array( + 'predicates' => array( + 0 => 'schema:url', + ), + 'type' => 'rel', + ), + 'field_aggregate_rating' => array( + 'predicates' => array( + 0 => 'schema:aggregateRating', + ), + ), + 'field_application_category' => array( + 'predicates' => array( + 0 => 'schema:applicationSubCategory', + ), + ), + 'field_civic_category' => array( + 'predicates' => array( + 0 => 'schema:genre', + ), + ), + 'field_contributor' => array( + 'predicates' => array( + 0 => 'schema:provider', + ), + ), + 'field_creator' => array( + 'predicates' => array( + 0 => 'schema:creator', + ), + ), + 'field_description' => array( + 'predicates' => array( + 0 => 'schema:summary', + 1 => 'schema:description', + ), + ), + 'field_download_url' => array( + 'predicates' => array( + 0 => 'schema:downloadUrl', + ), + ), + 'field_feature_list' => array( + 'predicates' => array( + 0 => 'schema:featureList', + ), + ), + 'field_image' => array( + 'predicates' => array( + 0 => 'schema:image', + ), + ), + 'field_install_url' => array( + 'predicates' => array( + 0 => 'schema:installUrl', + ), + ), + 'field_keywords' => array( + 'predicates' => array( + 0 => 'schema:keywords', + ), + ), + 'field_license' => array( + 'predicates' => array( + 0 => 'schema:publishingPrinciples', + ), + ), + 'field_related_applications' => array( + 'predicates' => array(), + ), + 'field_release_notes' => array( + 'predicates' => array( + 0 => 'schema:releaseNotes', + ), + ), + 'field_requirements' => array( + 'predicates' => array( + 0 => 'schema:requirements', + ), + ), + 'field_screenshot' => array( + 'predicates' => array( + 0 => 'schema:screenshot', + ), + ), + 'field_software_type' => array( + 'predicates' => array( + 0 => 'schema:applicationCategory', + ), + ), + 'field_url' => array( + 'predicates' => array( + 0 => 'schema:url', + ), + ), + 'field_video' => array( + 'predicates' => array( + 0 => 'schema:video', + ), + ), + ); + + return $schemaorg; +} diff --git a/modules/features/appcat_application_content/appcat_application_content.info b/modules/features/appcat_application_content/appcat_application_content.info index 4f64244..9f27878 100644 --- a/modules/features/appcat_application_content/appcat_application_content.info +++ b/modules/features/appcat_application_content/appcat_application_content.info @@ -64,6 +64,9 @@ features[image][] = app_detail_logo features[image][] = screenshot features[image][] = small_square_thumbnail features[node][] = application +features[rdf_mappings][] = node-application +features[schemaorg][] = node-application +features[taxonomy][] = application_category features[variable][] = comment_anonymous_application features[variable][] = comment_application features[variable][] = comment_default_mode_application diff --git a/modules/features/appcat_application_content/appcat_application_content.module b/modules/features/appcat_application_content/appcat_application_content.module index ef74fc0..fd0ab1c 100644 --- a/modules/features/appcat_application_content/appcat_application_content.module +++ b/modules/features/appcat_application_content/appcat_application_content.module @@ -5,3 +5,4 @@ */ include_once 'appcat_application_content.features.inc'; + diff --git a/modules/features/appcat_misc/appcat_misc.module b/modules/features/appcat_misc/appcat_misc.module index 44788b0..f09e20b 100644 --- a/modules/features/appcat_misc/appcat_misc.module +++ b/modules/features/appcat_misc/appcat_misc.module @@ -3,3 +3,22 @@ * @file * Drupal needs this blank file. */ + +/** + * Implements hook_features_export_alter(). + * + * Remove the uuid vocabulary terms, which we create in a separate + * features module because the terms are used by multiple features + * in this distro. + * See http://drupal.org/node/1698290 + * (although it refers to tags rather than uuid_terms). + */ +function appcat_misc_features_export_alter(&$export, $module_name) { + $content_definition_modules = array( + 'appcat_application_content', + 'appcat_organization_content', + ); + if (in_array($module_name, $content_definition_modules) && isset($export['features']['taxonomy']) && isset($export['features']['uuid_term'])) { + unset($export['features']['uuid_term']); + } +}