[Fusionforge-commits] r14302 - trunk/src/plugins/oslc/include

Olivier Berger olberger at fusionforge.org
Fri Sep 2 16:54:05 CEST 2011


Author: olberger
Date: 2011-09-02 16:54:05 +0200 (Fri, 02 Sep 2011)
New Revision: 14302

Modified:
   trunk/src/plugins/oslc/include/oslcPlugin.class.php
Log:
Use the project_rdf_metadata hook to provide a link to the project's OSLC ServiceProvider description

Modified: trunk/src/plugins/oslc/include/oslcPlugin.class.php
===================================================================
--- trunk/src/plugins/oslc/include/oslcPlugin.class.php	2011-09-02 14:54:02 UTC (rev 14301)
+++ trunk/src/plugins/oslc/include/oslcPlugin.class.php	2011-09-02 14:54:05 UTC (rev 14302)
@@ -42,10 +42,11 @@
 		$this->_addHook("script_accepted_types");
 		$this->_addHook("content_negociated_user_home");
 		$this->_addHook("content_negociated_project_home");
+		$this->_addHook("project_rdf_metadata"); // will provide some RDF metadata for the project's DOAP profile to 'doaprdf' plugin
 	}
 
 	function CallHook ($hookname, &$params) {
-		global $use_oslcplugin,$G_SESSION,$HTML;
+		global $use_oslcplugin,$G_SESSION,$HTML, $group_id;
 		if ($hookname == "usermenu") {
 			$text = $this->text; // this is what shows in the tab
 			if ($G_SESSION->usesPlugin("oslc")) {
@@ -228,6 +229,15 @@
 </rdf:RDF>';
 			}
 		}
+		elseif($hookname == "project_rdf_metadata") {
+			
+			$serviceprovider = util_make_url ("/plugins/oslc/cm/oslc-cm-services/".$group_id);
+
+			if (! $params['prefixes']['http://open-services.net/ns/core#']) {
+				$params['prefixes']['http://open-services.net/ns/core#'] = 'oslc';
+			}
+			$params['xml'][] = '<oslc:serviceProvider rdf:resource="'.$serviceprovider.'"/>';
+		}
 		elseif ($hookname == "blahblahblah") {
 			// ...
 		}




More information about the Fusionforge-commits mailing list