-<?php
+<?php
/**
* Copyright (c) Institut TELECOM, 2010. All Rights Reserved.
*
class CodendiCmController extends CmController {
/**
* @var oslc
- *
+ *
* This will be the OSLC-CM controller managing the business logic of the application
*/
private $oslc;
-
+
/**
- * Defines accepted mime-types for queries, and corresponding
+ * Defines accepted mime-types for queries, and corresponding
* format of output
- *
- * Order is important for the XML variants :
+ *
+ * Order is important for the XML variants :
* the first one is the default returned when only basic XML is required
- *
+ *
* @var array
*/
private static $supportedAcceptMimeTypes = array();
-
+
/**
* Init Codendi REST controller.
*/
// Create an OSLC Controller for Codendi.
$this->oslc = new CodendiOSLCConnector();
}
-
+
public function getAction(){
$params = $this->getRequest()->getParams();
break;
}
}
-
+
/**
* Handles PUT action as routed by Zend_Rest_Route
- *
+ *
* Update of an existing changerequest
* Will be invoked if PUT or if POST on a path relating to resources (due to Zend REST route behaviour)
* So in case of POST, will pass the handling to postAction()
- *
+ *
* @return unknown_type
*/
public function putAction(){
}
}
}
-
+
public function postAction(){
$req = $this->getRequest();
throw new ConflictException('Need a valid tracker to create a change request');
}
} else {
- throw new ConflictException('Need a valid project and tracker to create change request !');
+ throw new ConflictException('Need a valid project and tracker to create change request !');
}
// prepare redirection
//logout the user
session_logout();
-
+
//redirect to new change request
$this->getResponse()->setRedirect($newlocation,201);
}
public function indexAction(){
-
+
}
public function deleteAction(){
-
+
}
-
+
/**
* Retrieve an individual resource and populates the view of an OSLC CM ChangeRequest
- *
+ *
* @param string $identifier
* @param string $uri
*/
public function readresourceAction() {
-
+
$params = $this->getRequest()->getParams();
$content_type = parent::checkSupportedActionMimeType(self::$supportedAcceptMimeTypes, $this->getRequest()->getActionName());
if (! $content_type) {
$this->_forward('ResNotFound','error');
}
}
-
+
public function readresourcecollectionAction() {
$content_type = parent::checkSupportedActionMimeType(self::$supportedAcceptMimeTypes, $this->getRequest()->getActionName());
//print_r($this->view);
$this->getResponse()->setHeader('Content-Type', $content_type);
}
-
+
/**
* Handle OSLC services catalog access.
*/
$this->getResponse()->setHeader('Content-Type', $content_type);
}
-
+
/**
- *
+ *
* Handles OSLC service document (service document) access.
* TODO: Implement service document details.
*/
$this->getResponse()->setHeader('Content-Type', $content_type);
}
-
+
/**
* Performs authentication according to the configured AUTH_TYPE configured
*
break;
}
}
-
+
/**
* Helper function that performs HTTP Basic authentication from request parameters/headers
*
throw new BadRequestException('Unsupported auth method : '. $auth[0] .' !');
}
}
- // Do authentication in Codendi
+ // Do authentication in Codendi
if(isset($password)) {
$user = UserManager::instance()->login($login, $password);
if($user->isLoggedIn()) {
$return = false;
}
}
-
+
return $return;
}
}