[Fusionforge-commits] r12096 - in trunk/src/plugins/oslc/include/oslc-zend/application: controllers models

Sabri LABBENE labbenes at libremir.placard.fr.eu.org
Fri Jan 28 16:57:21 CET 2011


Author: labbenes
Date: 2011-01-28 16:57:21 +0100 (Fri, 28 Jan 2011)
New Revision: 12096

Modified:
   trunk/src/plugins/oslc/include/oslc-zend/application/controllers/FusionForgeOSLCConnector.php
   trunk/src/plugins/oslc/include/oslc-zend/application/controllers/OSLCConnector.php
   trunk/src/plugins/oslc/include/oslc-zend/application/models/fusionforge.inc.php
Log:
Update prefixes used to describe ChangeRequests.

Modified: trunk/src/plugins/oslc/include/oslc-zend/application/controllers/FusionForgeOSLCConnector.php
===================================================================
--- trunk/src/plugins/oslc/include/oslc-zend/application/controllers/FusionForgeOSLCConnector.php	2011-01-28 15:55:24 UTC (rev 12095)
+++ trunk/src/plugins/oslc/include/oslc-zend/application/controllers/FusionForgeOSLCConnector.php	2011-01-28 15:57:21 UTC (rev 12096)
@@ -499,7 +499,7 @@
 
 		$cm_request = $changerequest->container;
 
-		$terms = array('dc:','helios_bt:');
+		$terms = array('dcterms:','helios_bt:','oslc_cm');
 		foreach($props as &$prop) {
 			$prop = str_replace($terms,"",$prop);
 			//echo $prop;

Modified: trunk/src/plugins/oslc/include/oslc-zend/application/controllers/OSLCConnector.php
===================================================================
--- trunk/src/plugins/oslc/include/oslc-zend/application/controllers/OSLCConnector.php	2011-01-28 15:55:24 UTC (rev 12095)
+++ trunk/src/plugins/oslc/include/oslc-zend/application/controllers/OSLCConnector.php	2011-01-28 15:57:21 UTC (rev 12096)
@@ -241,7 +241,7 @@
 
 			$feedentry = $this->prepareChangeRequest($changerequest);
 
-			$feedentry['title'] = 'changerequest '.$identifier.' : '.$feedentry['resource']['dc:title'];
+			$feedentry['title'] = 'changerequest '.$identifier.' : '.$feedentry['resource']['dcterms:title'];
 			$feedentry['id']= $uri.$identifier;
 
 			$returned[] = $feedentry;
@@ -283,7 +283,7 @@
 					// TODO : use real RDF triples ?
 					$tokens = explode(':', $fieldname);
 					if( (count($tokens) == 1) && (in_array($fieldname,$dc_attr))) {
-						$fieldname = 'dc:'.$fieldname;
+						$fieldname = 'dcterms:'.$fieldname;
 					}
 					$preparedChangeRequest['resource'][$fieldname] = $value;
 					break;

Modified: trunk/src/plugins/oslc/include/oslc-zend/application/models/fusionforge.inc.php
===================================================================
--- trunk/src/plugins/oslc/include/oslc-zend/application/models/fusionforge.inc.php	2011-01-28 15:55:24 UTC (rev 12095)
+++ trunk/src/plugins/oslc/include/oslc-zend/application/models/fusionforge.inc.php	2011-01-28 15:57:21 UTC (rev 12096)
@@ -172,7 +172,7 @@
 		// the dublin core elements prefix is removed
 		
 		foreach ($resource as $field => $value) {
-			$field = str_replace('dc:', '', $field);
+			$field = str_replace('dcterms:', '', $field);
 			$field = str_replace('helios_bt:', '', $field);
 			$field = str_replace('oslc_cm:', '', $field);
 			
@@ -192,6 +192,7 @@
 	function __construct($art_arr, $fields='')
 	{
 		parent::__construct();
+
 		$changerequestsdata = $this->convert_artifacts_array($art_arr, $fields);
 		foreach ($changerequestsdata as $identifier => $data) {
 			$this->_data[$identifier] = ChangeRequest::Create('fusionforge');
@@ -250,23 +251,27 @@
 					
 					// If specific fields were requested using a query
 					// we only return the requested fields data in the change request.
-					if (strlen($fields_string) > 0) {
-						$fields = explode(",", $fields_string);
+					if(is_array($fields_string)){
+						$fields = $fields_string;
+					} else {
+						if (strlen($fields_string) > 0) {
+							$fields = explode(",", $fields_string);
+						}
 					}
 					
 					if(isset($fields) && is_array($fields) && count($fields) > 0){
 						foreach ($fields as $field) {
 							switch ($field) {
-								case 'dc:identifier': 
+								case 'dcterms:identifier': 
 									$return[$identifier]['identifier'] = $identifier;
 									break;
-								case 'dc:title': 
+								case 'dcterms:title': 
 									$return[$identifier]['title'] = $at_arr[$i]->data_array['summary'];
 									break;
-								case 'dc:description': 
+								case 'dcterms:description': 
 									$return[$identifier]['description'] = $at_arr[$i]->data_array['details'];
 									break;
-								case 'dc:creator': 
+								case 'dcterms:creator': 
 									$return[$identifier]['creator'] = $at_arr[$i]->data_array['submitted_realname'];
 									break;
 								case 'oslc_cm:status': 
@@ -278,10 +283,10 @@
 								case 'helios_bt:assigned_to': 
 									$return[$identifier]['helios_bt:assigned_to'] = $at_arr[$i]->data_array['assigned_realname'];
 									break;
-								case 'dc:modified': 
+								case 'dcterms:modified': 
 									$return[$identifier]['modified'] = $at_arr[$i]->data_array['last_modified_date'];
 									break;
-								case 'dc:created': 
+								case 'dcterms:created': 
 									$return[$identifier]['created'] = $at_arr[$i]->data_array['open_date'];
 									break;
 								default: 




More information about the Fusionforge-commits mailing list