[Fusionforge-commits] r12231 - in branches/Branch_5_1/src/plugins/oslc/include/oslc-zend/application: controllers views/scripts/fusionforgecm

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


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

Added:
   branches/Branch_5_1/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/oslc-service-catalog-project.json.phtml
Modified:
   branches/Branch_5_1/src/plugins/oslc/include/oslc-zend/application/controllers/CmController.php
   branches/Branch_5_1/src/plugins/oslc/include/oslc-zend/application/controllers/FusionForgeCmController.php
Log:
Add json service catalog for trackers inside a specific project.

Modified: branches/Branch_5_1/src/plugins/oslc/include/oslc-zend/application/controllers/CmController.php
===================================================================
--- branches/Branch_5_1/src/plugins/oslc/include/oslc-zend/application/controllers/CmController.php	2011-02-10 15:12:04 UTC (rev 12230)
+++ branches/Branch_5_1/src/plugins/oslc/include/oslc-zend/application/controllers/CmController.php	2011-02-10 15:12:07 UTC (rev 12231)
@@ -55,7 +55,9 @@
 								'text/xml' => 'xml',
 								'application/atom+xml' => 'xml',
 								'application/x-oslc-disc-service-provider-catalog+xml' => 'xml',
+								'application/x-oslc-disc-service-provider-catalog+json' => 'json',
 								'application/x-oslc-cm-service-description+xml' => 'xml',
+								'application/x-oslc-cm-service-description+json' => 'json',
 							 	'application/json' => 'json',
 							 	'application/x-oslc-cm-change-request+json' => 'json'
 							 	//'text/html' => '?',
@@ -100,12 +102,15 @@
 							'oslcServiceCatalog' => array(
 								'application/x-oslc-disc-service-provider-catalog+xml' => 'xml',
 							 	'application/xml' => 'xml',
+								'application/x-oslc-disc-service-provider-catalog+json' => 'json',
 								'application/json' => 'json'
 								),
 
 							'oslcCmServiceDocument' => array(
 								'application/x-oslc-cm-service-description+xml' => 'xml',
-								'application/xml' => 'xml'
+								'application/xml' => 'xml',
+								'application/x-oslc-cm-service-description+json' => 'json',
+								'application/json' => 'json'
 								)
 	);
 							 	

Modified: branches/Branch_5_1/src/plugins/oslc/include/oslc-zend/application/controllers/FusionForgeCmController.php
===================================================================
--- branches/Branch_5_1/src/plugins/oslc/include/oslc-zend/application/controllers/FusionForgeCmController.php	2011-02-10 15:12:04 UTC (rev 12230)
+++ branches/Branch_5_1/src/plugins/oslc/include/oslc-zend/application/controllers/FusionForgeCmController.php	2011-02-10 15:12:07 UTC (rev 12231)
@@ -44,6 +44,7 @@
 		'oslcServiceCatalogProject' => array(
 			'application/x-oslc-disc-service-provider-catalog+xml' => 'xml',
 		 	'application/xml' => 'xml',
+			'application/x-oslc-disc-service-provider-catalog+json' => 'json',
 			'application/json' => 'json'
 		),
 	);

Added: branches/Branch_5_1/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/oslc-service-catalog-project.json.phtml
===================================================================
--- branches/Branch_5_1/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/oslc-service-catalog-project.json.phtml	                        (rev 0)
+++ branches/Branch_5_1/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/oslc-service-catalog-project.json.phtml	2011-02-10 15:12:07 UTC (rev 12231)
@@ -0,0 +1,14 @@
+<?php 
+$json["dc:title"] = TRACKER_TYPE. " Change Management service provider catalog for project " . $this->project["name"];
+
+foreach($this->trackers as $tracker) {
+	$service["oslc_disc:entry"]["oslc_disc:ServiceProvider"]["dc:identifier"] = $tracker["id"];
+	$service["oslc_disc:entry"]["oslc_disc:ServiceProvider"]["dc:title"] = $tracker["name"];
+	$service["oslc_disc:entry"]["oslc_disc:ServiceProvider"]["dc:descrption"] = $tracker["description"];
+	$service["oslc_disc:entry"]["oslc_disc:ServiceProvider"]["oslc_disc:services"]["rdf:ressource"] = $this->base_url.'/cm/oslc-cm-service/'.$tracker['group_id'].'/tracker/'.$tracker['id'];
+	$catalog[] = $service;
+}
+$json["rdf:about"] = "";
+$json["oslc_disc:ServiceProviderCatalog"] = $catalog;
+print str_replace("\/", "/", Zend_Json::prettyPrint(Zend_Json::encode($json)));
+?>
\ No newline at end of file




More information about the Fusionforge-commits mailing list