Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_datasource/README.txt,v
retrieving revision 1.1.2.9
diff -u -p -r1.1.2.9 README.txt
--- README.txt	8 Jun 2010 06:02:48 -0000	1.1.2.9
+++ README.txt	26 Jun 2010 15:25:20 -0000
@@ -61,14 +61,14 @@ formats allow content in a Drupal site t
 Semantic Web clients and web mash-ups. Views Datasource plugins output content 
 from node lists created in Drupal Views as:
   1)XML data documents using schemas like OPML and Atom;
-  2)RDF/XML data documents using vocabularies like FOAF and SIOC;
+  2)RDF/XML data documents using vocabularies like FOAF, SIOC and DOAP;
   3)JSON data documents in plain JSON or in a format like MIT Simile/Exhibit;
   4)XHTML data documents using microformat like hCard and hCalendar
   
 The project consists of 4 Views style plugins:
   1)views_xml - Output as raw XML, OPML, and Atom;
   2)views_json - Output as simple JSON and Simile/Exhibit JSON;
-  3)views_rdf - Output as FOAF and SIOC;
+  3)views_rdf - Output as FOAF, SIOC and DOAP;
   4)views_xhtml - Output as hCard and hCalendar.
   
 In Drupal 6.x, to use these plugins you should:
@@ -76,7 +76,7 @@ In Drupal 6.x, to use these plugins you 
 2) In the Views UI set the view style (in Basic Settings) to one of:
    i)  JSON data document (render as Simple JSON or Simile/Exhibit JSON)
    ii) XML data document (render as raw XML, OPML, or Atom)
-   iii) RDF data document (render as a FOAF or SIOC RDF/XML document)
+   iii) RDF data document (render as a FOAF, SIOC or DOAP RDF/XML document)
    iv) XHTML data document (render as hCard or hCalendar XHTML)
 3) In the view style options choose the options or vocabulary for your format 
    (like raw or the OPML or Atom vocabulary for XML rendering.)
@@ -226,15 +226,18 @@ The views_xml plugin has the following o
 The views_rdf plugin has the following options:
   1. RDF vocabulary:
      This indicates what RDF vocabulary to use in the document: either
-     FOAF or SIOC. FOAF (Friend of a Friend) is useful for sharing a list of 
+     FOAF, SIOC or DOAP. FOAF (Friend of a Friend) is useful for sharing a list of 
      users or people, while SIOC 
      (Semantically-Interlinked Online Communities Project) is most useful for 
      describing a set of pages, stories, blogs,
      or forum posts with comments from different people. SIOC itself uses
-     FOAF to describe the posts and comments from different people. See
-     these links for more info:
+     FOAF to describe the posts and comments from different people. DOAP
+     (Description of a Project) is useful for - as the name suggests - projects.
+     See these links for more info:
      http://www.foaf-project.org/
      http://sioc-project.org/
+     http://trac.usefulinc.com/doap
+
      
      The following fields are recognized when using the FOAF vocabulary 
      (fallbacks in brackets):
@@ -247,6 +250,11 @@ The views_rdf plugin has the following o
      changed (node_changed, updated/commented date) last_updated(updated date), 
      body(node_body, node_revisions_body), uid (users_uid). 
      
+     The following fields are recognized when using the DOAP vocabulary:
+     (optional fields in square brackets)
+     nid, name, homepage, [license], [shortdesc], [language], [repositories],
+     [developers]
+     
 The views_xhtml plugin has the following options:
   1. Microformat
      This specifies the microformat to be rendered: hCard is most useful for a
Index: views_plugin_style_rdf.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_datasource/Attic/views_plugin_style_rdf.inc,v
retrieving revision 1.1.2.11
diff -u -p -r1.1.2.11 views_plugin_style_rdf.inc
--- views_plugin_style_rdf.inc	8 Jun 2010 06:02:48 -0000	1.1.2.11
+++ views_plugin_style_rdf.inc	26 Jun 2010 15:25:20 -0000
@@ -41,7 +41,7 @@ class views_plugin_style_rdf extends vie
       '#type' => 'radios',
       '#title' => ('RDF vocabulary'),
       '#description' => ('The RDF vocabulary to use when rendering the view.'),    
-      '#options' => array('foaf' => ('FOAF'), 'sioc' => ('SIOC')),
+      '#options' => array('foaf' => ('FOAF'), 'sioc' => ('SIOC'), 'doap' => ('DOAP')),
       '#default_value' => $this->options['vocabulary'],
     );
    $form['field_output']  = array(
Index: views_rdf.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_datasource/Attic/views_rdf.module,v
retrieving revision 1.1.4.12
diff -u -p -r1.1.4.12 views_rdf.module
--- views_rdf.module	7 Jun 2010 03:27:08 -0000	1.1.4.12
+++ views_rdf.module	26 Jun 2010 15:25:21 -0000
@@ -36,6 +36,12 @@ function views_rdf_theme() {
        'file' => 'views_views_rdf_style.theme.inc',
        'template' => 'views-views-rdf-style-sioc',       
      ),
+     'views_views_rdf_style_doap' => array(
+       'arguments' => array('view' => NULL, 'rows' => array(), 'attachment' => NULL, 'options' => array()),  
+       'path' => $path,
+       'file' => 'views_views_rdf_style.theme.inc',
+       'template' => 'views-views-rdf-style-doap',       
+     ),
    );
 }
 
Index: theme/views-views-rdf-style-doap.tpl.php
===================================================================
RCS file: theme/views-views-rdf-style-doap.tpl.php
diff -N theme/views-views-rdf-style-doap.tpl.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ theme/views-views-rdf-style-doap.tpl.php	26 Jun 2010 15:25:21 -0000
@@ -0,0 +1,67 @@
+<?php
+// $Id: views-views-rdf-style-doap.tpl.php,v 1.1.2.4 2010/06/07 03:27:07 allisterbeharry Exp $
+/**
+ * @file views-views-rdf-style-doap.tpl.php
+ * Default template for the Views RDF style plugin using the DOAP vocabulary
+ *
+ * Variables
+ * - $view: The View object.
+ * - $rows: Array of row objects as rendered by _views_rdf_render_fields
+ * - $projects Array of project objects as created by template_preprocess_views_views_rdf_style_doap
+ *
+ * @ingroup views_templates
+ */
+global $base_url;
+$content_type = ($options['content_type'] == 'default') ? 'application/rdf+xml' : $options['content_type'];
+if (!$header) { //build our own header
+  $xml .= '<?xml version="1.0" encoding="UTF-8" ?>'."\n";
+  $xml .= '<!-- generator="Drupal Views_Datasource.Module" -->'."\n";
+  $xml .= '<rdf:RDF xmlns="http://usefulinc.com/ns/doap#"'."\n";
+  $xml .= '  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"'."\n";
+  $xml .= '  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"'."\n";
+  $xml .= '  xmlns:dc="http://purl.org/dc/elements/1.1/"'."\n";
+  $xml .= '  xmlns:foaf="http://xmlns.com/foaf/0.1/"'."\n";
+  $xml .= '  xmlns:doap="http://usefulinc.com/ns/doap#">'."\n";
+}
+else {
+  $xml .= "  $header\n";
+}
+foreach($projects as $nid => $project) {
+  $xml .= "<doap:Project rdf:about=\"".$project["homepage"]."\">\n";
+  if (array_key_exists("homepage", $project)) {
+    $xml .= "  <doap:homepage rdf:resource=\"".$project["homepage"]."\"/>\n";
+  }
+  if (array_key_exists("name", $project)) {
+    $xml .= "  <doap:name>".$project["name"]."</doap:name>\n";
+  }
+  if (array_key_exists("shortdesc", $project)) {
+    $xml .= "  <doap:shortdesc>".$project["shortdesc"]."</doap:shortdesc>\n";
+  }
+  if (array_key_exists("license", $project)) {
+    $xml .= "  <doap:license rdf:resource=\"http://usefulinc.com/doap/licenses/".$project["license"]."\"/>\n";
+  }
+  if (array_key_exists("language", $project)) {
+    $xml .= "  <programming-language>".$project["language"]."</programming-language>\n";
+  }
+  foreach ($project["repositories"] as $repository) {
+    $xml .= "  <repository><Repository><location rdf:resource=\"";
+    $xml .= $repository."\"/></Repository></repository>\n";
+  }
+  foreach ($project["developers"] as $developer) {
+    $xml .= "  <developer><foaf:Person><foaf:name>".$developer;
+    $xml .= "</foaf:name></foaf:Person></developer>\n";
+  }
+  $xml .= "</doap:Project>\n";
+}
+$xml .= "</rdf:RDF>\n";
+if ($view->override_path) {       // inside live preview
+  print htmlspecialchars($xml);
+}
+else if ($options['using_views_api_mode']) {     // We're in Views API mode.
+  print $xml;
+}
+else {
+  drupal_set_header("Content-Type: $content_type; charset=utf-8");
+  print $xml;
+  exit;
+}
Index: theme/views_views_rdf_style.theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_datasource/theme/Attic/views_views_rdf_style.theme.inc,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 views_views_rdf_style.theme.inc
--- theme/views_views_rdf_style.theme.inc	7 Jun 2010 03:27:07 -0000	1.1.2.4
+++ theme/views_views_rdf_style.theme.inc	26 Jun 2010 15:25:21 -0000
@@ -25,6 +25,7 @@
 function theme_views_views_rdf_style($view, $rows = array(), $attachment = NULL, $options = array()) {
 	if ($options['vocabulary'] == 'foaf') return theme('views_views_rdf_style_foaf', $view, $rows, $attachment, $options);
 	if ($options['vocabulary'] == 'sioc') return theme('views_views_rdf_style_sioc', $view, $rows, $attachment, $options);
+	if ($options['vocabulary'] == 'doap') return theme('views_views_rdf_style_doap', $view, $rows, $attachment, $options);
 }
 
 /**
@@ -508,4 +509,124 @@ function _views_rdf_sioc_xml_story_rende
 
   $xml .= "</sioc:Post>\n";
   return $xml;
+}
+
+/**
+ * Template preprocess for the DOAP vocabulary
+ * @param $vars
+ * @return unknown_type
+ */
+function template_preprocess_views_views_rdf_style_doap($vars) {
+  global $user;
+  global $base_url; 
+  $view = $vars["view"];
+  $rows = $vars["rows"];
+  $options = $vars["options"];
+  $link = $view->display_handler->get_path();
+  $url_options = array('absolute' => TRUE);
+  if (!empty($view->exposed_raw_input)) {
+    $url_options['query'] = $view->exposed_raw_input;
+  }
+  $base = $view->base_table;
+  $root = "feed";
+  $plaintext_output = $options["plaintext_output"];
+  $vars["content_type"] = ($options['content_type'] == 'default') ? 'application/atom+rdf' : $options['content_type'];
+  $header  = $options["header"];
+  if (!$vars["header"]) {
+    $vars["title"] = check_plain(($view->get_title() ? $view->get_title(): $view->name));
+    $vars["id"] = check_url($view->get_url());
+    $vars["updated"] = format_date(time(), 'custom', DATE_ATOM);
+    $vars["author"] = _views_rdf_format_author($options["author"]);
+    $vars['link'] = check_url(url($view->display_handler->get_path(), $url_options));
+  }
+  else {
+    $vars["header"] = $header;
+  }
+  $projects = array();
+  foreach($rows as $row) {
+    if (array_key_exists($row["nid"], $projects)) {
+      $project = $projects[$row["nid"]];
+    }
+    else {
+      $project = array();
+      $project["repositories"] = array();
+      $project["developers"] = array();
+      $project["nid"] = $row["nid"];
+    }
+    foreach ($row as $field) {
+      if ($options["field_output"] == "normal") {
+        if ($field->label) {
+          $label = $plaintext_output ?
+            check_plain(html_entity_decode(strip_tags($field->label))) : $field->label;
+        }
+        else {
+          $label = $plaintext_output ?
+            check_plain(html_entity_decode(strip_tags($field->id))) : $field->id;
+        }
+        if (!$field->is_multiple) {
+          $content = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->content))) : $field->content;
+        }
+        else {
+          $content = array();
+          foreach($field->content as $n=>$oc) {
+            $content[$n] = $plaintext_output ?
+              check_plain(html_entity_decode(strip_tags($oc))) : $oc;
+          }
+          $content = implode(" ", $content);
+        }
+      }
+      elseif ($options["field_output"] == "raw") {
+        $label = $plaintext_output ?
+          check_plain(html_entity_decode(strip_tags($field->id))) : $field->id;
+        if (!$field->is_multiple) {
+          $content = $plaintext_output ?
+            check_plain(html_entity_decode(strip_tags($field->content))) : $field->raw;
+        }
+        else {
+          $content = array();
+          foreach($field->raw as $n=>$oc) {
+            $content[$n] = $plaintext_output ?
+              check_plain(html_entity_decode(strip_tags($oc))) : $oc;
+          }
+          $content = implode(" ", $content);
+        }
+      }
+      if (stripos($label, 'homepage') !== FALSE) {
+        $project["homepage"] = _views_rdf_strip_illegal_xml_attribute_value_chars($content);
+        continue;
+      }
+      if (stripos($label, 'title') !== FALSE) {
+        $project["name"] = check_plain($content);
+        continue;
+      }
+      if (stripos($label, 'shortdesc') !== FALSE) {
+        $project["shortdesc"] = check_plain($content);
+        continue;
+      }
+      if (stripos($label, 'language') !== FALSE) {
+        $project["language"] = check_plain($content);
+        continue;
+      }
+      if (stripos($label, 'license') !== FALSE) {
+        $project["license"] = _views_rdf_strip_illegal_xml_attribute_value_chars($content);
+        continue;
+      }
+      if (stripos($label, 'repository') !== FALSE) {
+        $repo = _views_rdf_strip_illegal_xml_attribute_value_chars($content);
+        if (!in_array($repo, $project["repositories"])) {
+          $project["repositories"][] = $repo;
+        }
+        continue;
+      }
+      if (stripos($label, 'authors') !== FALSE) {
+        $dev = check_plain($content);
+        if (!in_array($dev, $project["developers"])) {
+          $project["developers"][] = $dev;
+        }
+        continue;
+      }
+    }
+    $projects[$project["nid"]] = $project;
+  }//for
+  $vars["projects"] = $projects;
 }
\ No newline at end of file
