src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/read-bugnote.json.phtml -text
src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/read-bugnote.phtml -text
src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/read-bugnote.xml.phtml -text
+src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/read-resource-collection.atom.phtml -text
src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/read-resource-collection.json.phtml -text
src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/read-resource-collection.phtml -text
src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/read-resource-collection.xml.phtml -text
'readResource'=> array(
'application/x-oslc-cm-change-request+xml' => 'xml',
+ 'application/rdf+xml' => 'xml',
'application/xml' => 'xml',
'text/xml' => 'xml',
'application/json' => 'json',
),
'readResourceCollection' => array(
- 'application/atom+xml' => 'xml',
'application/xml' => 'xml',
+ 'application/rdf+xml' => 'xml',
+ 'application/atom+xml' => 'atom',
'application/json' => 'json'
),
}
}
-function createRessourceCollectionView($view){
+function createRessourceCollectionAtomView($view){
$feedcharset = 'UTF-8';
$feedauthor = 'FusionForge OSLC-CM plugin';
return $doc->saveXML();
}
+function createRessourceCollectionRdfView($view){
+ $doc = new DOMDocument();
+ $doc->formatOutput = true;
+
+ $root = $doc->createElementNS("http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdf:RDF");
+ $root = $doc->appendChild($root);
+ $root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#');
+ $root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:rdfs', 'http://www.w3.org/2000/01/rdf-schema#');
+ $root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:dcterms', 'http://purl.org/dc/terms/');
+ $root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:oslc', 'http://open-services.net/ns/core#');
+
+ $responseInfo = $doc->createElement("oslc:ResponseInfo");
+ $responseInfo->setAttribute("rdf:about", $view->id);
+
+ $titlenode = $doc->createElement("dcterms:title", TRACKER_TYPE.' OSLC-CM ChangeRequests found in Tracker'. $view->tracker);
+ $responseInfo->appendChild($titlenode);
+
+ $root->appendChild($responseInfo);
+
+ $rdfDescription = $doc->createElement("rdf:Description");
+ $rdfDescription->setAttribute("rdf:about", $view->id);
+
+ foreach ($view->collection as $entry) {
+ $member = $doc->createElement("rdfs:member");
+ $member->setAttribute("rdf:resource", $entry['id']);
+ $rdfDescription->appendChild($member);
+ }
+ $root->appendChild($rdfDescription);
+
+ return $doc->saveXML();
+}
+
function createResourceView($view)
{
$doc = new DOMDocument();
$root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:foaf', 'http://http://xmlns.com/foaf/0.1/');
$root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:oslc', 'http://open-services.net/ns/core#');
$root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:oslc_cm', 'http://open-services.net/ns/cm#');
+ $root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:helios_bt', 'http://heliosplatform.sourceforge.net/ontologies/2010/05/helios_bt.owl#');
$child = $doc->createElement("oslc_cm:ChangeRequest");
$changerequest = $ressource->appendChild($child);
--- /dev/null
+<?php
+
+/*
+ * This file is (c) Copyright 2009 by Olivier BERGER, Institut
+ * TELECOM
+ *
+ * Use, modification, redistribution of this software are subject to
+ * the terms of the NEW BSD License, whose text can be found in the
+ * 'COPYING' file that is distributed along with the software archive.
+ *
+ * Thus you may use it at your own risk, of course !
+ *
+ * This program has been developed in the frame of the HELIOS
+ * project with financial support of its funders.
+ *
+ */
+
+/* $Id$ */
+
+require_once('_resource_xml.php');
+
+print createRessourceCollectionAtomView($this);
\ No newline at end of file