[evolvis-commits] r17547: - Some fixed to let the jenkins plugin work in evolvis 5.1 and to work together with dav. New configuration class added

papel at evolvis.org papel at evolvis.org
Mon Sep 12 14:18:07 CEST 2011


Author: papel
Date: 2011-09-12 14:18:06 +0200 (Mon, 12 Sep 2011)
New Revision: 17547

Added:
   trunk/gforge_base/evolvisforge/gforge/plugins/jenkins/common/JenkinsConfig.class.php
Modified:
   trunk/gforge_base/evolvisforge/gforge/plugins/jenkins/common/JenkinsPlugin.class.php
Log:
- Some fixed to let the jenkins plugin work in evolvis 5.1 and to work together with dav. New configuration class added

Added: trunk/gforge_base/evolvisforge/gforge/plugins/jenkins/common/JenkinsConfig.class.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/plugins/jenkins/common/JenkinsConfig.class.php	                        (rev 0)
+++ trunk/gforge_base/evolvisforge/gforge/plugins/jenkins/common/JenkinsConfig.class.php	2011-09-12 12:18:06 UTC (rev 17547)
@@ -0,0 +1,39 @@
+<?php
+/*
+ * Part of the Evolvis Jenkins Plugin
+ *
+ * Copyright © 2011
+ *	Patrick Apel <p.apel at tarent.de>
+ * All rights reserved.
+ *
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+ 
+ 
+class jenkinsConfig {
+
+const SYS_JENKINS_BASE = 'http://test-hudson.bonn.tarent.de:8080';
+
+	public function getSysJenkinsBase() {
+		return self::SYS_JENKINS_BASE;
+	}
+
+    function __construct() {
+    	
+    }
+}
+?>
\ No newline at end of file

Modified: trunk/gforge_base/evolvisforge/gforge/plugins/jenkins/common/JenkinsPlugin.class.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/plugins/jenkins/common/JenkinsPlugin.class.php	2011-09-12 09:22:08 UTC (rev 17546)
+++ trunk/gforge_base/evolvisforge/gforge/plugins/jenkins/common/JenkinsPlugin.class.php	2011-09-12 12:18:06 UTC (rev 17547)
@@ -1,5 +1,5 @@
 <?php
-/*-
+/*
  * Part of the Evolvis Jenkins Plugin
  *
  * Copyright © 2011
@@ -23,6 +23,7 @@
  */
 
 require_once $gfplugins.'jenkins/common/JenkinsInfo.class.php';
+require_once $gfplugins.'jenkins/common/JenkinsConfig.class.php';
 
 class JenkinsPlugin extends Plugin {
 
@@ -128,7 +129,7 @@
 		$this->gfplugins = $gfplugins;
 	}
 
-	private function getPluginPath() {
+	public function getPluginPath() {
 		return $this->gfplugins;
 	}
 
@@ -209,6 +210,11 @@
 		global $gfplugins, $gfconfig, $sys_jenkins_base,
 		    $admin_login, $admin_password;
 
+		if(empty($sys_jenkins_base)) { //New configuration file added. It is needed for the plugin to work with Evolvis 5.1
+			$objJenkinsConfig = new JenkinsConfig();
+			$sys_jenkins_base = $objJenkinsConfig->getSysJenkinsBase();
+		}
+
 		$objRefJenkinsInfo = new JenkinsInfo();
 		$this->setObjRefJenkinsInfo(&$objRefJenkinsInfo);
 
@@ -486,12 +492,13 @@
 			// includes the websites to administer jenkins
 			// if permission is granted
 			$permUser = $this->getGroup()->getPermission(session_get_user());
+			echo '<table cellpadding="0" cellspacing="0"><tr><td>'; //Added for Evolvis 5.1. Otherwise the UI would look really bad.
 			echo '<div>';
 
 			if ($permUser->isMember()) {
 				echo '<div class="mainContentBoxes">';
 
-				if ($group->userIsAdmin()) {
+				if ($group->userIsAdmin()) { //does not work in evolvis 5.1
 					// $group object in /plugins/jenkins/www/index.php
 					// or rather in /www/plugins/jenkins/index.php
 					echo '<div class="smallContentBoxes">';
@@ -544,6 +551,7 @@
 
 			echo '</div>';
 			echo "</div>\n";
+			echo '</td></tr></table>';
 		}
 	}
 
@@ -674,7 +682,15 @@
 
 			$svnPlugin = new SVNPlugin();
 
-			$svnUri = $svnPlugin->getURI($this->getGroup()->getID(), 'ssh', $svnUser);
+			$scheme = 'anon';
+			if($svnPlugin->isUsedSSH()) {
+				$scheme = 'ssh';
+			} else if($svnPlugin->isUsedDAV()) {
+				$scheme = 'dav';
+			}
+
+			$svnUri = $svnPlugin->getURI($this->getGroup()->getID(), $scheme, $svnUser);
+			
 			$description = $this->getGroup()->getDescription();
 			$purpose = $this->getGroup()->getRegisterPurpose();
 



More information about the evolvis-commits mailing list