/**
  *
  * @param array $params
  *
  * @return Xinc_Api_Response_Object
  */
 private function _getProjects($params)
 {
     $start = isset($params['start']) ? (int) $params['start'] : 0;
     $limit = isset($params['limit']) ? (int) $params['limit'] : null;
     $projects = $this->_getProjectListing($start, $limit);
     $responseObject = new Xinc_Api_Response_Object();
     $responseObject->set($projects);
     return $responseObject;
 }
Exemple #2
0
 /**
  * get builds and return them
  *
  * @param array $params
  *
  * @return Xinc_Api_Response_Object
  */
 private function _getBuilds($params)
 {
     $project = isset($params['p']) ? $params['p'] : null;
     $start = isset($params['start']) ? (int) $params['start'] : 0;
     $limit = isset($params['limit']) ? (int) $params['limit'] : null;
     $builds = $this->_getHistoryBuilds($project, $start, $limit);
     $responseObject = new Xinc_Api_Response_Object();
     $responseObject->set($builds);
     return $responseObject;
 }
 /**
  * get logmessages and return them
  *
  * @param array $params
  *
  * @return Xinc_Api_Response_Object
  */
 private function _getLogMessages($params)
 {
     $project = isset($params['p']) ? $params['p'] : null;
     $buildtime = isset($params['buildtime']) ? $params['buildtime'] : null;
     $start = isset($params['start']) ? (int) $params['start'] : 0;
     $limit = isset($params['limit']) ? (int) $params['limit'] : null;
     $builds = $this->_getLogMessagesArr($project, $buildtime, $start, $limit);
     $responseObject = new Xinc_Api_Response_Object();
     $responseObject->set($builds);
     return $responseObject;
 }
 private function _outputDeliverable($fileName)
 {
     $responseObject = new Xinc_Api_Response_Object();
     $responseObject->set($fileName);
     return $responseObject;
 }
 /**
  * Get the list of registered artifacts
  *
  * @param array $params
  *
  * @return Xinc_Api_Response_Object
  */
 private function _getArtifacts($params)
 {
     $projectName = isset($params['p']) ? $params['p'] : null;
     $project = new Xinc_Project();
     $project->setName($projectName);
     $buildtime = isset($params['buildtime']) ? (int) $params['buildtime'] : 0;
     $node = isset($params['node']) ? $params['node'] : '';
     $node = str_replace('source', '', $node);
     $node = str_replace(',', '/', $node);
     $artifacts = array();
     try {
         $buildObject = Xinc_Build::unserialize($project, $buildtime, Xinc_Gui_Handler::getInstance()->getStatusDir());
         $artifacts = $this->_getArtifactsTree($buildObject, $node);
     } catch (Exception $e) {
     }
     $responseObject = new Xinc_Api_Response_Object();
     $responseObject->set($artifacts);
     return $responseObject;
 }
Exemple #6
0
 /**
  * Generates the output string that is going to be send to the calling party
  *
  * @param Xinc_Api_Response_Object $responseObject
  *
  * @return String
  */
 public function generate(Xinc_Api_Response_Object $responseObject)
 {
     $result = json_encode($responseObject->get());
     return $result;
 }
Exemple #7
0
 /**
  * Generates the output string that is going to be send to the calling party
  *
  * @param Xinc_Api_Response_Object $responseObject
  *
  * @return String
  */
 public function generate(Xinc_Api_Response_Object $responseObject)
 {
     $result = $this->_handleFileResponse($responseObject->get());
     return $result;
 }