[Fusionforge-commits] r12136 - trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm

Sabri LABBENE labbenes at libremir.placard.fr.eu.org
Wed Feb 2 16:01:12 CET 2011


Author: labbenes
Date: 2011-02-02 16:01:11 +0100 (Wed, 02 Feb 2011)
New Revision: 12136

Modified:
   trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/oslc-cm-service-document.json.phtml
   trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/oslc-service-catalog-project.json.phtml
   trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/oslc-service-catalog.json.phtml
Log:
Update JSON catalogs to make them OSLC Core V2 compliants.

Modified: trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/oslc-cm-service-document.json.phtml
===================================================================
--- trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/oslc-cm-service-document.json.phtml	2011-02-02 14:58:52 UTC (rev 12135)
+++ trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/oslc-cm-service-document.json.phtml	2011-02-02 15:01:11 UTC (rev 12136)
@@ -7,37 +7,20 @@
 
 // 
 $json["rdf:type"]["rdf:ressource"] = "http://open-services.net/ns/core#Service";
-$json["rdf:about"] = $this->serverUrl().util_make_uri($this->baseUrl().'/cm/oslc-cm-services/'.$this->project.'/tracker/'.$this->tracker);
+$json["rdf:about"] = $this->serverUrl().util_make_uri($this->baseUrl().'/cm/oslc-cm-service/'.$this->project.'/tracker/'.$this->tracker);
 
-$json["dcterms:title"] = "OSLC CM service description document";
+$json["dcterms:title"] = "OSLC-CM V2 service description document";
 $json["dcterms:description"] = "FusionForge Tracker service";
 
-$json["dcterms:publisher"]["dcterms:title"] = "OSLC CM plugin for FusionForge";
+$json["dcterms:publisher"]["dcterms:title"] = "FusionForge OSLC V2 plugin";
 $json["dcterms:publisher"]["dcterms:identifier"] = $this->serverUrl().$this->baseUrl();
 //$json["oslc:icon"]["rdf:ressource"] = "Url of FusionForge icon if any"
 
-// prefix definitions 
-$prefix_def["oslc:prefix"] = "dc";
-$prefix_def["oslc:prefixBase"] = "http://purl.org/dc/elements/1.1/";
-$json["oslc:prefixDefinition"][] = $prefix_def;
+// Domain.
+$json["service"]["domain"]["rdf:ressource"] = "http://open-services.net/ns/cm#";
 
-$prefix_def["oslc:prefix"] = "foaf";
-$prefix_def["oslc:prefixBase"] = "http://http://xmlns.com/foaf/0.1/";
-$json["oslc:prefixDefinition"][] = $prefix_def;
-
-$prefix_def["oslc:prefix"] = "rdf";
-$prefix_def["oslc:prefixBase"] = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
-$json["oslc:prefixDefinition"][] = $prefix_def;
-
-$prefix_def["oslc:prefix"] = "oslc";
-$prefix_def["oslc:prefixBase"] = "http://open-services.net/ns/core#";
-$json["oslc:prefixDefinition"][] = $prefix_def;
-
 // Services description
 
-// Domain.
-$json["service"]["domain"]["rdf:ressource"] = "http://open-services.net/ns/core#";
-
 // Creation Factory.
 $json["service"]["creationFactory"]["dcterms:title"] = "Location for creation of change Requests with a POST HTTP request";
 $json["service"]["creationFactory"]["oslc:label"] = "New Tracker items Creation";

Modified: trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/oslc-service-catalog-project.json.phtml
===================================================================
--- trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/oslc-service-catalog-project.json.phtml	2011-02-02 14:58:52 UTC (rev 12135)
+++ trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/oslc-service-catalog-project.json.phtml	2011-02-02 15:01:11 UTC (rev 12136)
@@ -6,20 +6,20 @@
 $json["prefixes"]["foaf"] = "http://http://xmlns.com/foaf/0.1/";
 $json["prefixes"]["dcterms"] = "http://purl.org/dc/terms/";
 
-$json["rdf:type"]["rdf:ressource"] = "http://open-services.net/ns/core#Service";
+$json["rdf:type"]["rdf:ressource"] = "http://open-services.net/ns/core#ServiceProvider";
 $json["rdf:about"] = $this->serverUrl().util_make_uri($this->baseUrl().'/cm/oslc-cm-services/'.$this->project);
 
-$json["dcterms:title"] = "FusionForge Change Management service provider catalog for project " . $this->project;
+$json["dcterms:title"] = "FusionForge Change Management service provider corresponding to project " . $this->project;
 $json["dcterms:description"] = "Lists trackers inside project".$this->project;
 
 $json["dcterms:publisher"]["dcterms:title"] = "OSLC CM plugin for FusionForge";
 $json["dcterms:publisher"]["dcterms:identifier"] = $this->serverUrl().$this->baseUrl();
 
 foreach($this->trackers as $tracker) {
-	$service["oslc:service"]["dc:identifier"] = $tracker["id"];
-	$service["oslc:service"]["dc:title"] = $tracker["name"];
+	$service["oslc:service"]["dcterms:title"] = $tracker["name"];
 	$service["oslc:service"]["dc:descrption"] = $tracker["description"];
-	$service["oslc:service"]["rdf:ressource"] = $this->serverUrl() . util_make_uri($this->baseUrl().'/cm/oslc-cm-service/'.$tracker['group_id'].'/tracker/'.$tracker['id']);
+	$service["oslc:service"]["rdf:type"]["rdf:ressource"] = $this->serverUrl() . util_make_uri($this->baseUrl().'/cm/oslc-cm-service/'.$tracker['group_id'].'/tracker/'.$tracker['id']);
+	$service["oslc:service"]["oslc:domain"]["rdf:ressource"] = "http://open-services.net/ns/cm#";
 	$service["oslc:service"]["oslc:details"] = $this->serverUrl() . util_make_uri("/tracker/index.php?group_id=".$tracker['group_id'].'&atid='.$tracker['id']);
 	$catalog["oslc:serviceProvider"][] = $service;
 }

Modified: trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/oslc-service-catalog.json.phtml
===================================================================
--- trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/oslc-service-catalog.json.phtml	2011-02-02 14:58:52 UTC (rev 12135)
+++ trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/oslc-service-catalog.json.phtml	2011-02-02 15:01:11 UTC (rev 12136)
@@ -1,14 +1,32 @@
 <?php
+$json["prefixes"]["rdf"] = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+$json["prefixes"]["oslc"] = "http://open-services.net/ns/core#";
+$json["prefixes"]["dcterms"] = "http://purl.org/dc/terms/";
+$json["prefixes"]["foaf"] = "http://http://xmlns.com/foaf/0.1/";
 
-$json["dc:title"] = TRACKER_TYPE. " Change management service provider catalog";
-foreach ($this->projects as $proj)
-{
-	$service["oslc_disc:entry"]["oslc_disc:ServiceProvider"]["dc:title"] = $proj["name"];
-	$service["oslc_disc:entry"]["oslc_disc:ServiceProvider"]["oslc_disc:services"] = $this->serverUrl().util_make_uri($this->baseUrl().'/cm/oslc-cm-service/'.$proj['id']);
+$json["rdf:type"]["rdf:ressource"] = "http://open-services.net/ns/core#ServiceProviderCatalog";
+$json["rdf:about"] = $this->serverUrl().util_make_uri($this->baseUrl().'/cm/oslc-services/');
+
+$json["dcterms:title"] = "FusionForge OSLC Service Provider Catalog";
+$json["dcterms:description"] = "Lists all projects as Service (trackers) Providers";
+$json["dcterms:publisher"]["dcterms:title"] = "FusionForge OSLC V2 plugin";
+$json["dcterms:publisher"]["dcterms:identifier"] = $this->serverUrl().$this->baseUrl();
+
+foreach ($this->projects as $proj) {
+	$service["oslc:ServiceProvider"]["dcterms:title"] = "Project: ".$proj["name"];
+	$service["oslc:ServiceProvider"]["dcterms:description"] = "FusionForge project ".$proj['name']." as an OSLC-CM ServiceProvider";
+	$service["oslc:ServiceProvider"]["rdf:type"]["rdf:ressource"] = "http://open-services.net/ns/core#ServiceProvider";
+	$service["oslc:ServiceProvider"]["rdf:about"] = $this->serverUrl().util_make_uri($this->baseUrl().'/cm/oslc-cm-services/'.$proj['id']);
+	$service["oslc:ServiceProvider"]["dcterms:publisher"]["dcterms:title"] = "FusionForge OSLC V2 plugin";
+	$service["oslc:ServiceProvider"]["dcterms:publisher"]["dcterms:identifier"] = $this->serverUrl().$this->baseUrl();
+	
+	// ServiceProvider should list at least one oslc:service. 
+	// Telling about the oslc:domain of the service is mandatory. 
+	$service["oslc:ServiceProvider"]["oslc:Service"]["oslc:domain"] = "http://open-services.net/ns/core#Service";
 	$catalog[] = $service;
 }
 
-$json["oslc_disc:ServiceProviderCatalog"] = $catalog;
+$json["oslc: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