[oslc-cm] First bits of an OSLC-CM V1 client in PHP

Olivier Berger olivier.berger at it-sudparis.eu
Wed May 12 13:17:37 EDT 2010


Hi.

FYI, I have added the first bits of an OSLC-CM client written in PHP to
a tool (formerly known as gforge-cli) that used to provide an CLI tool
for GForge's SOAP API.

It generally allows to manipulate the forge trackers (among other
artifacts available in the tools hosted on the forge) using
command-line... helpful to add comments to bugs, script actions, etc.

I "forked" a version (that should be named as planetforge-cli [1]), in
order to add it other backends, like an OSLC-CM REST client for all
OSLC-CM compatible trackers (targetting FusionForge and Codendi's some
time soon, as well as MantisBt).

Below is a log of the kind of output that we get.

It's very dirty PHP code for the moment, but somehow demonstrates how to
connect to our OSLC-CM REST server addon for MantisBt, using Zend
framework and the PHP ARC library to develop a PHP client.

Everything is Open Source licensed, and the code is available in public
repositories for the curious ones [0].

Comments and/or questions welcome :-)

 $ php gforge.php tracker/oslc/xml --help
        OSLC-CM/XML Tracker sub-module.
           
        Available functions for the tracker module:
           * discover: Displays Service Discovery document retrieved from server
           * listcollection: retrieve an (ATOM) OSLC-CM ChangeRequests collection
           * getchangerequest: displays a changerequest at URL

 $ php gforge.php tracker/oslc/xml discover http://mdv/mantis/oslc-cm/cm/oslc-services/
        Found OSLC-CM Service Provider catalog 'Change management service provider catalog' at http://mdv/mantis/oslc-cm/cm/oslc-services/ containing:
         * OSLC-CM Service provider 'Demo OSLC CM service provider' at 'http://mdv/mantis/oslc-cm/cm/oslc-cm-service'.
        Found OSLC-CM Service Provider 'Demo OSLC CM service provider' at http://mdv/mantis/oslc-cm/cm/oslc-cm-service containing:
         * OSLC-CM simpleQuery method 'Simple GET-based Bug Query' at '/mantis/oslc-cm/cm/bugs' 

 $ php gforge.php tracker/oslc/xml listcollection http://mdv/mantis/oslc-cm/cm/bugs
        [SNIP]
        ChangeRequest found at : http://mdv/mantis/oslc-cm/cm/bug/1
        Bug has : rdf:type set to http://open-services.net/xmlns/cm/1.0/ChangeRequest
        ChangeRequest found at : http://mdv/mantis/oslc-cm/cm/bug/2
        Bug has : rdf:type set to http://open-services.net/xmlns/cm/1.0/ChangeRequest

 $ php gforge.php tracker/oslc/xml getchangerequest http://mdv/mantis/oslc-cm/cm/bug/1
        Bug has : rdf:type set to http://open-services.net/xmlns/cm/1.0/ChangeRequest
        Bug has : dc:identifier set to 1
        Bug has : dc:title set to bug1
        Bug has : dc:description set to fhkjsfh
        Bug has : dc:creator set to administrator
        Bug has : mantisbt:project set to proj1
        Bug has : mantisbt:status set to new
        Bug has : mantisbt:priority set to normal
        Bug has : mantisbt:severity set to minor
        Bug has : mantisbt:version set to 
        Bug has : mantisbt:target_version set to 
        Bug has : dc:modified set to 2010-04-11T10:49:57+02:00
        Bug has : dc:created set to 2010-04-11T08:55:30+02:00
        Bug has : mantisbt:version_number set to 1


[0]: in Bzr, somewhere around here http://forge.projet-coclico.org/scm/loggerhead/wp5/oberger/planetforge-cli/files/head%3A/include/modules/tracker/oslc/
[1]: http://lists.planetforge.org/pipermail/discussions/2010-May/000141.html
-- 
Olivier BERGER <olivier.berger at it-sudparis.eu>
http://www-public.it-sudparis.eu/~berger_o/ - OpenPGP-Id: 2048R/5819D7E8
Ingénieur Recherche - Dept INF
Institut TELECOM, SudParis (http://www.it-sudparis.eu/), Evry (France)





More information about the Oslc-Cm mailing list