[Fusionforge-commits] r15981 - in trunk/src: common/include plugins/doaprdf/include plugins/oslc/include

Olivier Berger olberger at fusionforge.org
Wed Jul 11 10:03:52 CEST 2012


Author: olberger
Date: 2012-07-11 10:03:51 +0200 (Wed, 11 Jul 2012)
New Revision: 15981

Modified:
   trunk/src/common/include/rdfutils.php
   trunk/src/plugins/doaprdf/include/doaprdfPlugin.class.php
   trunk/src/plugins/oslc/include/oslcPlugin.class.php
Log:
Fix line endings and other syntactic issues to make unit tests happy

Modified: trunk/src/common/include/rdfutils.php
===================================================================
--- trunk/src/common/include/rdfutils.php	2012-07-11 06:44:56 UTC (rev 15980)
+++ trunk/src/common/include/rdfutils.php	2012-07-11 08:03:51 UTC (rev 15981)
@@ -20,33 +20,32 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-require_once 'arc/ARC2.php';
+require_once 'arc/ARC2.php';
 
-/**
- * rdfutils_setPropToUri() - Add a relation (a link to a URI) to an ARC2_Resource
+/**
+ * rdfutils_setPropToUri() - Add a relation (a link to a URI) to an ARC2_Resource
  * 
  * example : $res->setRel('rdf:type', 'doap:Project');
- * 
- * @param	ARC2_Resource	$res
- * @param	string	$prop
- * @param	string	$value
+ * 
+ * @param	ARC2_Resource	$res
+ * @param	string	$prop
+ * @param	string	$value
  */
 function rdfutils_setPropToUri($res, $prop, $value) {
 	// ARC2_Resource may not yet have a setRel() method
 	if (method_exists('ARC2_Resource','setRel')) {
 		$res->setRel($prop, $value);
 	}
-	else {
-		$uri = array (
-				'type' => 'uri',
-				'value' => $res->expandPName($value));
+	else {
+		$uri = array (
+				'type' => 'uri',
+				'value' => $res->expandPName($value));
 		$res->setProp($prop, $uri);
-	}
-}
-
+	}
+}
 
+
 // Local Variables:
 // mode: php
 // c-file-style: "bsd"
-// End:
-
+// End:
\ No newline at end of file

Modified: trunk/src/plugins/doaprdf/include/doaprdfPlugin.class.php
===================================================================
--- trunk/src/plugins/doaprdf/include/doaprdfPlugin.class.php	2012-07-11 06:44:56 UTC (rev 15980)
+++ trunk/src/plugins/doaprdf/include/doaprdfPlugin.class.php	2012-07-11 08:03:51 UTC (rev 15981)
@@ -25,9 +25,9 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-
+
 require_once('common/include/ProjectManager.class.php');
-require_once('common/include/rdfutils.php');
+require_once('common/include/rdfutils.php');
 
 class doaprdfPlugin extends Plugin {
 	public function __construct($id=0) {
@@ -77,97 +77,97 @@
 			$params['content_type'] = 'application/rdf+xml';
 
 			// Construct an ARC2_Resource containing the project's RDF (DOAP) description
-			$ns = array(
-					'rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
-					'rdfs' => 'http://www.w3.org/2000/01/rdf-schema#',
-					'doap' => 'http://usefulinc.com/ns/doap#',
-					'dcterms' => 'http://purl.org/dc/terms/' /*,
-					'oslc' => 'http://open-services.net/ns/core#' */
-			);
-			
-			$conf = array(
-					'ns' => $ns
+			$ns = array(
+					'rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
+					'rdfs' => 'http://www.w3.org/2000/01/rdf-schema#',
+					'doap' => 'http://usefulinc.com/ns/doap#',
+					'dcterms' => 'http://purl.org/dc/terms/' /*,
+					'oslc' => 'http://open-services.net/ns/core#' */
+			);
+			
+			$conf = array(
+					'ns' => $ns
 					/*,
-					'serializer_type_nodes' => true*/
-			);
-			
-			$res = ARC2::getResource($conf);
-			$res->setURI('');
-				
-			//$res->setRel('rdf:type', 'doap:Project');
-			rdfutils_setPropToUri($res, 'rdf:type', 'doap:Project');
-				
-			$res->setProp('doap:name', $projectname);
-			$res->setProp('doap:shortdesc', $project_shortdesc);
-			if($project_description) {
-				$res->setProp('doap:description', $project_description);
-			}
-			if($tags_list) {
-				$tags = split(', ',$tags_list);
-				$res->setProp('dcterms:subject', $tags);
-			}
+					'serializer_type_nodes' => true*/
+			);
+			
+			$res = ARC2::getResource($conf);
+			$res->setURI('');
+				
+			//$res->setRel('rdf:type', 'doap:Project');
+			rdfutils_setPropToUri($res, 'rdf:type', 'doap:Project');
+				
+			$res->setProp('doap:name', $projectname);
+			$res->setProp('doap:shortdesc', $project_shortdesc);
+			if($project_description) {
+				$res->setProp('doap:description', $project_description);
+			}
+			if($tags_list) {
+				$tags = split(', ',$tags_list);
+				$res->setProp('dcterms:subject', $tags);
+			}
 
-			// Now, we need to collect complementary RDF descriptiosn of the project via other plugins 
-			// invoke the 'project_rdf_metadata' hook so as to complement the RDF description
+			// Now, we need to collect complementary RDF descriptiosn of the project via other plugins 
+			// invoke the 'project_rdf_metadata' hook so as to complement the RDF description
 			$hook_params = array();
 			
 			$hook_params['prefixes'] = array();
 			foreach($ns as $prefix => $url) {
 				$hook_params['prefixes'][$url] = $prefix;
 			}
-			/*
-			$hook_params['prefixes'] = array(
-					'http://www.w3.org/1999/02/22-rdf-syntax-ns#' => 'rdf',
-					'http://www.w3.org/2000/01/rdf-schema#' => 'rdfs',
-					'http://usefulinc.com/ns/doap#' => 'doap',
-					'http://purl.org/dc/terms/' => 'dcterms'
+			/*
+			$hook_params['prefixes'] = array(
+					'http://www.w3.org/1999/02/22-rdf-syntax-ns#' => 'rdf',
+					'http://www.w3.org/2000/01/rdf-schema#' => 'rdfs',
+					'http://usefulinc.com/ns/doap#' => 'doap',
+					'http://purl.org/dc/terms/' => 'dcterms'
 			);
-			*/
-			$hook_params['group'] = $group_id;
+			*/
+			$hook_params['group'] = $group_id;
 			
-			// pass the resource in case it could be useful (read-only in principle)
-			$hook_params['in_Resource'] = $res;
+			// pass the resource in case it could be useful (read-only in principle)
+			$hook_params['in_Resource'] = $res;
 
-			$hook_params['out_Resources'] = array();
-			
-			plugin_hook_by_reference('project_rdf_metadata', $hook_params);
+			$hook_params['out_Resources'] = array();
+			
+			plugin_hook_by_reference('project_rdf_metadata', $hook_params);
 
 			// add new prefixes to the list
 			foreach($hook_params['prefixes'] as $url => $prefix) {
-				if (!isset($ns[$prefix])) {
+				if (!isset($ns[$prefix])) {
 					$ns[$prefix] = $url;
-				}
-			}
+				}
+			}
 
-			$merged_index = $res->index;
+			$merged_index = $res->index;
 			foreach($hook_params['out_Resources'] as $out_res) {
 				$merged_index = ARC2::getMergedIndex($merged_index, $out_res->index);
-			}
+			}
 
-			$conf = array(
-					'ns' => $ns,
-					'serializer_type_nodes' => true
-			);
+			$conf = array(
+					'ns' => $ns,
+					'serializer_type_nodes' => true
+			);
 			
-			$ser = ARC2::getRDFXMLSerializer($conf);
-			
-			/* Serialize a resource index */
-			$doc = $ser->getSerializedIndex($merged_index);
+			$ser = ARC2::getRDFXMLSerializer($conf);
+			
+			/* Serialize a resource index */
+			$doc = $ser->getSerializedIndex($merged_index);
 
 			$params['content'] = $doc;
 		}
 	}
 	
-	/**
-	 * Declares a link to itself in the link+meta HTML headers
-	 * @param unknown_type $params
-	 */
-	function alt_representations (&$params) {
+	/**
+	 * Declares a link to itself in the link+meta HTML headers
+	 * @param unknown_type $params
+	 */
+	function alt_representations (&$params) {
 		$script_name = $params['script_name'];
 		if ($script_name == '/projects') {
 			$params['return'][] = '<link rel="meta" type="application/rdf+xml" title="DOAP RDF Data" href=""/>';
 		}
-	}
+	}
 	
 }
 

Modified: trunk/src/plugins/oslc/include/oslcPlugin.class.php
===================================================================
--- trunk/src/plugins/oslc/include/oslcPlugin.class.php	2012-07-11 06:44:56 UTC (rev 15980)
+++ trunk/src/plugins/oslc/include/oslcPlugin.class.php	2012-07-11 08:03:51 UTC (rev 15981)
@@ -158,9 +158,9 @@
 			# TODO : create another resource
 			$group_id=$params['group'];
 
-			if (! isset($params['prefixes']['http://open-services.net/ns/core#'])) {
-				$params['prefixes']['http://open-services.net/ns/core#'] = 'oslc';
-			}
+			if (! isset($params['prefixes']['http://open-services.net/ns/core#'])) {
+				$params['prefixes']['http://open-services.net/ns/core#'] = 'oslc';
+			}
 			
 			$serviceprovider = util_make_url ("/plugins/oslc/cm/oslc-cm-services/".$group_id);
 




More information about the Fusionforge-commits mailing list