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
* @return string url of the archives
*/
function getArchivesUrl() {
+ $host = util_url_prefix() . forge_get_config('lists_host');
if ($this->isPublic()) {
- return 'http://'.forge_get_config('lists_host').'/pipermail/'.$this->getName().'/';
+ return $host . '/pipermail/' . $this->getName() . '/';
} else {
- return 'http://'.forge_get_config('lists_host').'/mailman/private/'.$this->getName().'/';
+ return $host . '/mailman/private/' . $this->getName() . '/';
}
}
* @return string url of the info page
*/
function getExternalInfoUrl() {
- if (forge_get_config('use_ssl')) {
- $proto = 'https';
- } else {
- $proto = 'http';
- }
- return "$proto://".forge_get_config('lists_host').'/mailman/listinfo/'.$this->getName();
+ return util_url_prefix() . forge_get_config('lists_host') .
+ '/mailman/listinfo/' . $this->getName();
}
/**
* @return string url of the admin
*/
function getExternalAdminUrl() {
- if (forge_get_config('use_ssl')) {
- $proto = 'https';
- } else {
- $proto = 'http';
- }
- return "$proto://".forge_get_config('lists_host').'/mailman/admin/'.$this->getName();
+ return util_url_prefix() . forge_get_config('lists_host') .
+ '/mailman/admin/' . $this->getName();
}
/**
1,16,31,46 * * * * root [ -x $MWCRON/create-imagedirs.php ] && $PHP $MWCRON/create-imagedirs.php
# Create wiki XML dumps every night
-55 1 * * * root [ -x $MWCRON/dump-wikis.php ] && $PHP $MWCRON/cronjobs/dump-wikis.php
+55 1 * * * root [ -x $MWCRON/dump-wikis.php ] && $PHP $MWCRON/dump-wikis.php
'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'
),
$contextSwitch = $this->_helper->getHelper('contextSwitch');
+ // add an atom context
+ $atomContextSpec = array(
+ 'suffix' => 'atom',
+ );
+ if (! $contextSwitch->hasContext('atom')) {
+ $contextSwitch->addContext('atom', $atomContextSpec);
+ }
+
// we'll handle JSON ourselves
$contextSwitch->setAutoJsonSerialization(false);
$types = array();
$return[$identifier]['helios_bt:assigned_to'] = $at_arr[$i]->data_array['assigned_realname'];
break;
case 'dcterms:modified':
- $return[$identifier]['modified'] = $at_arr[$i]->data_array['last_modified_date'];
- break;
+ $date = '@'.$at_arr[$i]->data_array['last_modified_date'];
+ $date = DateTime($date);
+ $return[$identifier]['modified'] = $date->format(DateTime::W3C);
+ break;
case 'dcterms:created':
- $return[$identifier]['created'] = $at_arr[$i]->data_array['open_date'];
- break;
+ $date = '@'.$at_arr[$i]->data_array['open_date'];
+ $date = DateTime($date);
+ $return[$identifier]['created'] = $date->format(DateTime::W3C);
+ break;
default:
throw new ConflictException("The attribute specified ".$field." cannot be found!");
}
}
} else {
+ $modified = '@'.$at_arr[$i]->data_array['last_modified_date'];
+ $modified = new DateTime($modified);
+ $created = '@'.$at_arr[$i]->data_array['open_date'];
+ $created = new DateTime($created);
+
//return the by default set of Change request fields.
$return[$identifier]=array(
'identifier'=>$identifier,
'helios_bt:priority'=>$at_arr[$i]->data_array['priority'],
'creator' => $at_arr[$i]->data_array['submitted_realname'],
'helios_bt:assigned_to' => $at_arr[$i]->data_array['assigned_realname'],
- 'modified' => $at_arr[$i]->data_array['last_modified_date'],
- 'created' => $at_arr[$i]->data_array['open_date']
+ 'modified' => $modified->format(DateTime::W3C),
+ 'created' => $created->format(DateTime::W3C)
);
}
}
}
}
-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
require_once('_resource_xml.php');
-print createRessourceCollectionView($this);
\ No newline at end of file
+print createRessourceCollectionRdfView($this);
\ No newline at end of file