[Fusionforge-commits] r12243 - branches/Branch_5_1/src/plugins/oslc/include/oslc-zend/application/models

Olivier Berger olberger at libremir.placard.fr.eu.org
Thu Feb 10 16:12:49 CET 2011


Author: olberger
Date: 2011-02-10 16:12:49 +0100 (Thu, 10 Feb 2011)
New Revision: 12243

Modified:
   branches/Branch_5_1/src/plugins/oslc/include/oslc-zend/application/models/fusionforge.inc.php
Log:
Update prefixes used to describe ChangeRequests.

Modified: branches/Branch_5_1/src/plugins/oslc/include/oslc-zend/application/models/fusionforge.inc.php
===================================================================
--- branches/Branch_5_1/src/plugins/oslc/include/oslc-zend/application/models/fusionforge.inc.php	2011-02-10 15:12:45 UTC (rev 12242)
+++ branches/Branch_5_1/src/plugins/oslc/include/oslc-zend/application/models/fusionforge.inc.php	2011-02-10 15:12:49 UTC (rev 12243)
@@ -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