gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r234419 [3/10] - in /gump/branches/Gump3/presentation: ./ META-INF/ WEB-INF/ WEB-INF/class/ WEB-INF/class/org/ WEB-INF/class/org/apache/ WEB-INF/class/org/apache/gump/ WEB-INF/class/org/apache/gump/dynagump/ WEB-INF/class/org/apache/gump/dy...
Date Mon, 22 Aug 2005 02:33:50 GMT
Added: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/database/hibernate/RunsHib.hbm.xml
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/database/hibernate/RunsHib.hbm.xml?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/database/hibernate/RunsHib.hbm.xml (added)
+++ gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/database/hibernate/RunsHib.hbm.xml Sun Aug 21 19:31:37 2005
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping>
+
+   <class name="org.apache.gump.dynagump.presentation.database.hibernate.RunsHib" table="runs">
+        <id name="id" column="id" />
+
+        <property name="startTime" column="start_time"/>
+        <property name="endTime" column="end_time"/>
+        <many-to-one name="workspaceId" column="workspace_id" class="org.apache.gump.dynagump.presentation.database.hibernate.WorkspaceHib"/>
+
+        <property name="name" column="name"/>
+
+    </class>
+ 
+
+
+
+</hibernate-mapping>
\ No newline at end of file

Added: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.class
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.class?rev=234419&view=auto
==============================================================================
Binary file - no diff available.

Propchange: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.hbm.xml
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.hbm.xml?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.hbm.xml (added)
+++ gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.hbm.xml Sun Aug 21 19:31:37 2005
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping>
+
+
+  
+   <class name="org.apache.gump.dynagump.presentation.database.hibernate.WorkspaceHib" table="workspaces">
+        <id name="id" column="id" />
+
+        <property name="name" column="name"/>
+        <property name="host" column="host"/>
+        <property name="description" column="description"/>
+
+    </class>
+
+</hibernate-mapping>
\ No newline at end of file

Added: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/resources/application
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/resources/application?rev=234419&view=auto
==============================================================================
    (empty)

Added: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/Build.class
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/Build.class?rev=234419&view=auto
==============================================================================
Binary file - no diff available.

Propchange: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/Build.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/HistoryObject.class
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/HistoryObject.class?rev=234419&view=auto
==============================================================================
Binary file - no diff available.

Propchange: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/HistoryObject.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/HistoryVO.class
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/HistoryVO.class?rev=234419&view=auto
==============================================================================
Binary file - no diff available.

Propchange: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/HistoryVO.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/Host.class
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/Host.class?rev=234419&view=auto
==============================================================================
Binary file - no diff available.

Propchange: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/Host.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/ProjectBuildVO.class
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/ProjectBuildVO.class?rev=234419&view=auto
==============================================================================
Binary file - no diff available.

Propchange: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/ProjectBuildVO.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/ProjectVO.class
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/ProjectVO.class?rev=234419&view=auto
==============================================================================
Binary file - no diff available.

Propchange: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/ProjectVO.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/Run.class
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/Run.class?rev=234419&view=auto
==============================================================================
Binary file - no diff available.

Propchange: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/Run.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/RunStatusVO.class
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/RunStatusVO.class?rev=234419&view=auto
==============================================================================
Binary file - no diff available.

Propchange: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/RunStatusVO.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/StatusVO.class
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/StatusVO.class?rev=234419&view=auto
==============================================================================
Binary file - no diff available.

Propchange: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/StatusVO.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/WorkSpace.class
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/WorkSpace.class?rev=234419&view=auto
==============================================================================
Binary file - no diff available.

Propchange: gump/branches/Gump3/presentation/WEB-INF/classes/org/apache/gump/dynagump/presentation/valueObjects/WorkSpace.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: gump/branches/Gump3/presentation/WEB-INF/src/hibernate.cfg.xml
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/hibernate.cfg.xml?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/hibernate.cfg.xml (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/hibernate.cfg.xml Sun Aug 21 19:31:37 2005
@@ -0,0 +1,41 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-configuration PUBLIC
+        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+
+    <session-factory>
+
+        <!-- Database connection settings -->
+        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
+        <property name="connection.url">jdbc:mysql://localhost/gump</property>
+        <property name="connection.username">root</property>
+        <property name="connection.password"></property>
+
+        <!-- JDBC connection pool (use the built-in) -->
+        <property name="connection.pool_size">1</property>
+
+        <!-- SQL dialect -->
+        <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
+
+        <!-- Echo all executed SQL to stdout -->
+        <property name="show_sql">true</property>
+
+        <!-- Drop and re-create the database schema on startup 
+        <property name="hbm2ddl.auto">create</property>-->
+
+
+
+        <mapping resource="org/apache/gump/dynagump/presentation/database/hibernate/HostsHib.hbm.xml"/>
+        <mapping resource="org/apache/gump/dynagump/presentation/database/hibernate/RunsHib.hbm.xml"/>
+        <mapping resource="org/apache/gump/dynagump/presentation/database/hibernate/BuildHib.hbm.xml"/>        
+        <mapping resource="org/apache/gump/dynagump/presentation/database/hibernate/ResultHib.hbm.xml"/>
+        <mapping resource="org/apache/gump/dynagump/presentation/database/hibernate/ProjectHib.hbm.xml"/>
+        <mapping resource="org/apache/gump/dynagump/presentation/database/hibernate/ProjectVersionIdHib.hbm.xml"/>
+        <mapping resource="org/apache/gump/dynagump/presentation/database/hibernate/ModuleHib.hbm.xml"/>
+        <mapping resource="org/apache/gump/dynagump/presentation/database/hibernate/DependenciesHib.hbm.xml"/>
+        <mapping resource="org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.hbm.xml"/>
+    </session-factory>
+
+</hibernate-configuration>
\ No newline at end of file

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/ModuleController.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/ModuleController.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/ModuleController.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/ModuleController.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,89 @@
+package org.apache.gump.dynagump.presentation;
+/**
+ * @author hodden
+ * 
+ * Facade Controller against the database and data layer.
+ * The controller is static to decrese the amount of running objects. 
+ */
+import java.sql.SQLException;
+import java.util.List;
+
+import org.apache.gump.dynagump.presentation.database.CouldNotFindDBException;
+import org.apache.gump.dynagump.presentation.database.DBHandler;
+import org.apache.gump.dynagump.presentation.database.controller.DBController;
+import org.apache.gump.dynagump.presentation.valueObjects.Build;
+import org.apache.gump.dynagump.presentation.valueObjects.Host;
+import org.apache.gump.dynagump.presentation.valueObjects.Run;
+import org.apache.gump.dynagump.presentation.valueObjects.RunStatusVO;
+
+public class ModuleController {
+	
+	private static ModuleController ref;	
+	private DBController db;
+	
+	/**
+	 * Constructor intitates a db connection.
+	 * 
+	 * @throws CouldNotFindDBException
+	 */
+	private ModuleController() throws CouldNotFindDBException{
+		db = DBHandler.getController();
+	}
+	/**
+	 * static method to get the ModuleController Object.
+	 * 
+	 * @return reference to a ModuleController Object
+	 * @throws CouldNotFindDBException
+	 */
+	public static ModuleController getController() throws CouldNotFindDBException{
+		if(ref==null){
+			ref = new ModuleController();
+		}
+		return ref;
+	}
+	/**
+	 * Returns a list of all the Hosts from the db in a Host Object
+	 * @return list of Host Objects
+	 * @throws SQLException
+	 */
+	public List<Host> getHosts()throws SQLException{		
+		List<Host> li = db.getHosts();
+		db.setWorkspace(li);
+		return li;
+	}
+	/**
+	 * Returns a list of runs from a given workspace
+	 * @param workspace - name of the workspace (String)
+	 * @return A list of Run objects
+	 * @throws SQLException
+	 */
+	public List<Run> getRuns(String workspace)throws SQLException{		
+		return db.getRuns(workspace);
+	}
+	/**
+	 * Returns a Runstatus object from the run with the given id.
+	 * @param id - Run id
+	 * @return A RunStatus Value Object
+	 * @throws CouldNotFindDBException
+	 * @throws SQLException
+	 */
+	public RunStatusVO getRunStatus(String id) throws CouldNotFindDBException, SQLException{
+		RunStatusVO r = new RunStatusVO();
+		DBController db  = DBHandler.getController();
+		db.getBuilds(r, id);
+		db.setDependencies(r);
+		return r;
+	}
+	/**
+	 * Adds a history object with history to the package of its past states and statistics.
+	 * @param b The build object
+	 * @throws SQLException
+	 * @throws CouldNotFindDBException
+	 */
+	public void addProjectHistory(Build b) throws SQLException,CouldNotFindDBException{
+		if(b.getHistory() == null){
+			DBController db  = DBHandler.getController();
+			db.addHistory(b);
+		}
+	}
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/StatusEvaluator.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/StatusEvaluator.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/StatusEvaluator.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/StatusEvaluator.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,39 @@
+package org.apache.gump.dynagump.presentation;
+
+import java.sql.SQLException;
+
+import org.apache.gump.dynagump.presentation.database.CouldNotFindDBException;
+import org.apache.gump.dynagump.presentation.database.DBHandler;
+import org.apache.gump.dynagump.presentation.database.controller.DBController;
+import org.apache.gump.dynagump.presentation.valueObjects.RunStatusVO;
+/**
+ * 
+ * @author hodden
+ * 
+ * Controller for the Status evaluator. Evaluates and calculates the information retrieved from the database before presenting it for the user on a jsp.
+ *
+ */
+public class StatusEvaluator {
+
+	/**
+	 * Constructor
+	 *
+	 */
+	public StatusEvaluator(){
+		
+	}
+	/**
+	 * Calculates and evaluates the information from the db of the build for the given run by id.
+	 * @param id - repsresenting the run id (String)
+	 * @return Run Status Value Object
+	 * @throws SQLException
+	 * @throws CouldNotFindDBException
+	 */
+	public RunStatusVO getStatus(String id)throws SQLException, CouldNotFindDBException{
+		RunStatusVO r = new RunStatusVO();
+		DBController db  = DBHandler.getController();
+		db.getBuilds(r, id);
+		db.setDependencies(r);
+		return r;
+	}
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/BuildsAction.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/BuildsAction.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/BuildsAction.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/BuildsAction.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,58 @@
+package org.apache.gump.dynagump.presentation.actions;
+
+import java.sql.SQLException;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.gump.dynagump.presentation.ModuleController;
+import org.apache.gump.dynagump.presentation.database.CouldNotFindDBException;
+import org.apache.gump.dynagump.presentation.valueObjects.Host;
+import org.apache.struts.action.Action;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+
+/**
+ * Action to get the workspaces from the database
+ * @author hodden
+ *
+ */
+//TODO Change the name to workspaceAction
+public class BuildsAction extends Action {
+
+	private static Log log = LogFactory.getLog(BuildsAction.class);
+	
+	public ActionForward execute(ActionMapping mapping,ActionForm form,
+			HttpServletRequest request,HttpServletResponse response){
+
+		boolean forward = true;
+		String errorMsg = null;
+		
+		try{
+			ModuleController mc = ModuleController.getController();
+			List<Host> li = mc.getHosts();
+			request.getSession().setAttribute("workspaces", li);
+		}catch(SQLException sqle){
+			log.error(sqle.getMessage());
+			errorMsg = sqle.getMessage();
+			forward = false;
+		}catch(CouldNotFindDBException cnfdbe){
+			log.error(cnfdbe.getMessage());
+			errorMsg = cnfdbe.getMessage();
+			forward = false;
+		}
+		
+		if(forward == true){
+			return mapping.findForward("success");
+		}
+		else{
+			request.getSession().setAttribute("errorMsg",errorMsg);
+			return mapping.findForward("errorPriv");
+		}
+	}
+
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/ListProjectBuilds.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/ListProjectBuilds.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/ListProjectBuilds.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/ListProjectBuilds.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,64 @@
+package org.apache.gump.dynagump.presentation.actions;
+
+import java.sql.SQLException;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.gump.dynagump.presentation.database.CouldNotFindDBException;
+import org.apache.gump.dynagump.presentation.database.DBHandler;
+import org.apache.gump.dynagump.presentation.database.controller.DBController;
+import org.apache.struts.action.Action;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+
+public class ListProjectBuilds extends Action {
+	private static Log log = LogFactory.getLog(ProjectStatusAction.class);
+	
+	public ActionForward execute(ActionMapping mapping,ActionForm form,
+			HttpServletRequest request,HttpServletResponse response){
+
+		boolean forward = true;
+		String errorMsg = null;
+		
+		try{
+			String id = request.getParameter("id");
+			if(id == null || id.equals("")){
+				id = (String)request.getSession().getAttribute("projectId");
+			}
+			if(id == null){
+				throw new RuntimeException("No Run project slected!\n You have to select a project in order to see all its builds");
+			}
+			DBController db = DBHandler.getController();
+			List builds = db.getProjectBuildsList(id);
+			request.getSession().setAttribute("projects", builds);
+		}catch(SQLException sqle){
+			log.error(sqle.getMessage());
+			sqle.getStackTrace();
+			errorMsg = sqle.getMessage();
+			forward = false;			
+		}catch(CouldNotFindDBException cnfdbe){
+			log.error(cnfdbe.getMessage());
+			cnfdbe.getStackTrace();
+			errorMsg = cnfdbe.getMessage();
+			forward = false;			
+		}catch(RuntimeException e){
+			log.error(e.getMessage());
+			e.getStackTrace();
+			errorMsg = e.getMessage();
+			forward = false;		
+		}
+		
+		if(forward == true){
+			return mapping.findForward("success");
+		}
+		else{
+			request.getSession().setAttribute("errorMsg",errorMsg);
+			return mapping.findForward("errorPriv");
+		}
+	}
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/ProjectListAction.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/ProjectListAction.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/ProjectListAction.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/ProjectListAction.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,58 @@
+package org.apache.gump.dynagump.presentation.actions;
+
+import java.sql.SQLException;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.gump.dynagump.presentation.database.CouldNotFindDBException;
+import org.apache.gump.dynagump.presentation.database.DBHandler;
+import org.apache.gump.dynagump.presentation.database.controller.DBController;
+import org.apache.struts.action.Action;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+
+public class ProjectListAction extends Action {
+
+	private static Log log = LogFactory.getLog(ProjectStatusAction.class);
+	
+	public ActionForward execute(ActionMapping mapping,ActionForm form,
+			HttpServletRequest request,HttpServletResponse response){
+
+		boolean forward = true;
+		String errorMsg = null;
+		
+		try{
+			DBController db = DBHandler.getController();
+			List projects = db.getProjects();
+			request.getSession().setAttribute("projects", projects);
+		}catch(SQLException sqle){
+			log.error(sqle.getMessage());
+			sqle.getStackTrace();
+			errorMsg = sqle.getMessage();
+			forward = false;			
+		}catch(CouldNotFindDBException cnfdbe){
+			log.error(cnfdbe.getMessage());
+			cnfdbe.getStackTrace();
+			errorMsg = cnfdbe.getMessage();
+			forward = false;			
+		}catch(RuntimeException e){
+			log.error(e.getMessage());
+			e.getStackTrace();
+			errorMsg = e.getMessage();
+			forward = false;		
+		}
+		
+		if(forward == true){
+			return mapping.findForward("success");
+		}
+		else{
+			request.getSession().setAttribute("errorMsg",errorMsg);
+			return mapping.findForward("errorPriv");
+		}
+	}
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/ProjectStatusAction.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/ProjectStatusAction.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/ProjectStatusAction.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/ProjectStatusAction.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,75 @@
+package org.apache.gump.dynagump.presentation.actions;
+
+import java.sql.SQLException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.gump.dynagump.presentation.ModuleController;
+import org.apache.gump.dynagump.presentation.database.CouldNotFindDBException;
+import org.apache.gump.dynagump.presentation.valueObjects.Build;
+import org.apache.gump.dynagump.presentation.valueObjects.RunStatusVO;
+import org.apache.struts.action.Action;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+/**
+ * Action to list the projects indivdual statistics such as number of failures, success, duration of state and so on.
+ * @author hodden
+ *
+ */
+public class ProjectStatusAction extends Action {
+	
+	private static Log log = LogFactory.getLog(ProjectStatusAction.class);
+	
+	public ActionForward execute(ActionMapping mapping,ActionForm form,
+			HttpServletRequest request,HttpServletResponse response){
+
+		boolean forward = true;
+		String errorMsg = null;
+		
+		try{
+			String id = request.getParameter("id");
+			if(id == null || id.equals("")){
+				throw new RuntimeException("No Project Selected!\n You have to select a project from the status page (select: workspace/run/project).");
+			}
+			
+			RunStatusVO rs = (RunStatusVO)request.getSession().getAttribute("runsStatus");
+			Build build = rs.getBuild(id);
+			ModuleController mc = ModuleController.getController();
+			mc.addProjectHistory(build);
+			request.getSession().setAttribute("project", build);
+
+		}catch (CouldNotFindDBException cnfe){
+			log.error(cnfe.getMessage());
+			cnfe.getStackTrace();
+			errorMsg = cnfe.getMessage();
+			forward = false;			
+		}catch (SQLException sqle){
+			log.error(sqle.getMessage());
+			sqle.getStackTrace();
+			errorMsg = sqle.getMessage();
+			forward = false;			
+		}catch (NullPointerException nullE){
+			log.error(nullE.getMessage());
+			nullE.getStackTrace();
+			errorMsg = nullE.getMessage();
+			forward = false;			
+		}catch(RuntimeException e){
+			log.error(e.getMessage());
+			e.getStackTrace();
+			errorMsg = e.getMessage();
+			forward = false;		
+		}
+		
+		if(forward == true){
+			return mapping.findForward("success");
+		}
+		else{
+			request.getSession().setAttribute("errorMsg",errorMsg);
+			return mapping.findForward("errorPriv");
+		}
+	}
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/ShowRunsAction.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/ShowRunsAction.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/ShowRunsAction.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/ShowRunsAction.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,66 @@
+package org.apache.gump.dynagump.presentation.actions;
+
+import java.sql.SQLException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.gump.dynagump.presentation.ModuleController;
+import org.apache.gump.dynagump.presentation.database.CouldNotFindDBException;
+import org.apache.struts.action.Action;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+/**
+ * Action to get the runs for a given workspace from the database.
+ * The list of runs are stored in the session Object and later retrieved by the jsp page.
+ * @author hodden
+ *
+ */
+public class ShowRunsAction extends Action {
+
+	private static Log log = LogFactory.getLog(ShowRunsAction.class);
+	
+	public ActionForward execute(ActionMapping mapping,ActionForm form,
+			HttpServletRequest request,HttpServletResponse response){
+		
+		boolean forward = true;
+		String errorMsg = null;
+		
+		try{
+			String workspace = request.getParameter("workspace");
+			if(workspace == null || workspace.equals("")){
+				workspace = (String)request.getSession().getAttribute("currentWorkspace");
+			}
+			if(workspace == null){
+				throw new Exception("No workspace Selected!\n You have to select a workspace to see that workspace's runs.");
+			}
+			ModuleController mc = ModuleController.getController();			
+			request.getSession().setAttribute("runs", mc.getRuns(workspace));
+			request.getSession().setAttribute("currentWorkspace", workspace);
+		}catch(SQLException sqle){
+			log.error(sqle.getMessage());
+			errorMsg = sqle.getMessage();
+			forward = false;
+			
+		}catch(CouldNotFindDBException cnfdbe){
+			log.error(cnfdbe.getMessage());
+			errorMsg = cnfdbe.getMessage();
+			forward = false;
+		}catch(Exception e){
+			log.error(e.getMessage());
+			errorMsg = e.getMessage();
+			forward = false;			
+		}
+		
+		if(forward == true){
+			return mapping.findForward("success");
+		}
+		else{
+			request.getSession().setAttribute("errorMsg",errorMsg);
+			return mapping.findForward("errorPriv");
+		}
+	}
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/StatusRunAction.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/StatusRunAction.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/StatusRunAction.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/actions/StatusRunAction.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,70 @@
+package org.apache.gump.dynagump.presentation.actions;
+
+import java.sql.SQLException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.gump.dynagump.presentation.ModuleController;
+import org.apache.gump.dynagump.presentation.database.CouldNotFindDBException;
+import org.apache.gump.dynagump.presentation.valueObjects.RunStatusVO;
+import org.apache.struts.action.Action;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+
+/**
+ * Action class to get the information of all the build for a given run.
+ * @author hodden
+ *
+ */
+public class StatusRunAction extends Action {
+	
+	private static Log log = LogFactory.getLog(StatusRunAction.class);
+	
+	public ActionForward execute(ActionMapping mapping,ActionForm form,
+			HttpServletRequest request,HttpServletResponse response){
+		
+		boolean forward = true;
+		String errorMsg = null;
+		
+		try{
+			String id = request.getParameter("id");
+			if(id == null || id.equals("")){
+				id = (String)request.getSession().getAttribute("currentRun");
+			}
+			if(id == null){
+				throw new RuntimeException("No Run Selected!\n You have to select a workspace and a build to see that the builds for that workspace.");
+			}
+			
+			ModuleController mc = ModuleController.getController();
+			RunStatusVO rs = mc.getRunStatus(id);
+			request.getSession().setAttribute("runsStatus", rs);
+			request.getSession().setAttribute("currentRun", id);
+		}catch(SQLException sqle){
+			log.error(sqle.getMessage());
+			errorMsg = sqle.getMessage();
+			forward = false;
+			
+		}catch(CouldNotFindDBException cnfdbe){
+			log.error(cnfdbe.getMessage());
+			errorMsg = cnfdbe.getMessage();
+			forward = false;
+		}catch(RuntimeException e){
+			log.error(e.getMessage());
+			e.getStackTrace();
+			errorMsg = e.getMessage();
+			forward = false;			
+		}
+		
+		if(forward == true){
+			return mapping.findForward("success");
+		}
+		else{
+			request.getSession().setAttribute("errorMsg",errorMsg);
+			return mapping.findForward("errorPriv");
+		}
+	}
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/CouldNotFindDBException.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/CouldNotFindDBException.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/CouldNotFindDBException.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/CouldNotFindDBException.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,38 @@
+package org.apache.gump.dynagump.presentation.database;
+/**
+ * Exception generated when the database couldn't be initiated
+ * @author hodden
+ *
+ */
+public class CouldNotFindDBException extends Exception {
+
+	
+	
+	private Exception nestedException;
+	
+	public CouldNotFindDBException(){
+		super();
+	}
+	public CouldNotFindDBException(String s){
+		super(s);
+	}
+	public CouldNotFindDBException(Throwable t){
+		super(t);
+	}
+	public CouldNotFindDBException(String s, Throwable t){
+		super(s,t);
+	}
+	public CouldNotFindDBException(String message, Exception e){
+		super(message);
+		this.nestedException = e;
+		
+	}
+	public String getMessage(){
+		String tempStr = super.getMessage();
+		if(nestedException != null){
+			tempStr += "\n\n *** Nested Exception *** \n"+nestedException.getMessage();
+		}
+		return tempStr;
+	}
+	
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/DBHandler.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/DBHandler.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/DBHandler.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/DBHandler.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,32 @@
+package org.apache.gump.dynagump.presentation.database;
+
+import org.apache.gump.dynagump.presentation.database.controller.DBController;
+/**
+ * DBHandler Controller for the dabase settings.
+ * 
+ * @author hodden
+ *
+ */
+//TODO expand to a more dynamic way of configuration ex: xml, textfile.
+public class DBHandler {
+
+	private static String db = "Hibernate"; //"MySQL";
+/*	private static HashMap<String, DBController> dbs = load();
+	
+	private static HashMap<String, DBController> load(){
+		dbs = new HashMap<String, DBController>();
+		dbs.put("MySQL", new MySqlController());
+		return dbs;
+	}*/
+	public static DBController getController() throws CouldNotFindDBException{		
+		try{
+			return (DBController) Class.forName("org.apache.gump.dynagump.presentation.database.controller."+db+"Controller").newInstance();
+		}catch(ClassNotFoundException cnfe){
+			throw new CouldNotFindDBException("Could not initiate Database :"+db, cnfe);
+		}catch(IllegalAccessException iae){
+			throw new CouldNotFindDBException("Could not initiate Database :"+db, iae);
+		}catch(InstantiationException ie){
+			throw new CouldNotFindDBException("Could not initiate Database :"+db, ie);
+		}		
+	}
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/controller/DBController.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/controller/DBController.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/controller/DBController.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/controller/DBController.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,69 @@
+package org.apache.gump.dynagump.presentation.database.controller;
+
+import java.sql.SQLException;
+import java.util.List;
+
+import org.apache.gump.dynagump.presentation.valueObjects.Build;
+import org.apache.gump.dynagump.presentation.valueObjects.Host;
+import org.apache.gump.dynagump.presentation.valueObjects.ProjectBuildVO;
+import org.apache.gump.dynagump.presentation.valueObjects.ProjectVO;
+import org.apache.gump.dynagump.presentation.valueObjects.Run;
+import org.apache.gump.dynagump.presentation.valueObjects.RunStatusVO;
+/**
+ * Interface for the Database specific classes to connect to the database.
+ * @author hodden
+ *
+ */
+public interface DBController {
+
+	/**
+	 * Returns the information of hosts and workspaces. See the value object host for more information
+	 * @return List of Host Objects
+	 * @throws SQLException
+	 */
+	public List<Host> getHosts()throws SQLException;
+	
+	public void setWorkspace(List<Host> li)throws SQLException;
+	/**
+	 * Get the runs for a given workspace from the database.
+	 * @param workspace - The given workspace represented by a String
+	 * @return A list of Run Objects.
+	 * @throws SQLException
+	 */
+	public List<Run> getRuns(String workspace)throws SQLException;
+	/**
+	 * Takes a RunStatusVO (RunStatus Value Object) and fills it with information from the database of the builds and package information.
+	 * @param r - RunStatusVO
+	 * @param id - the id of the run 
+	 * @throws SQLException
+	 */
+	public void getBuilds(RunStatusVO r, String id)throws SQLException;
+	/**
+	 * Set dependencies for the packages in the RunStatusVO
+	 * @param r - The Run Status Value Object.
+	 * @throws SQLException
+	 */
+	public void setDependencies(RunStatusVO r)throws SQLException;
+	
+	/**
+	 * Method to add a History object to the Build object containing the build objects history.
+	 * @param b
+	 * @throws SQLException
+	 */
+	public void addHistory(Build b)throws SQLException;
+	
+	/**
+	 * Get a list of all the projects from the database.
+	 * 
+	 * @return a list of projectVO objects.
+	 * @throws SQLException
+	 */
+	public List<ProjectVO> getProjects()throws SQLException;
+	
+	/**
+	 * Returns a list with all the builds and there dependencies
+	 * @return A list a project build value objects
+	 * @throws SQLException
+	 */
+	public List<ProjectBuildVO> getProjectBuildsList(String projectID) throws SQLException;
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/controller/HibernateController.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/controller/HibernateController.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/controller/HibernateController.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/controller/HibernateController.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,183 @@
+package org.apache.gump.dynagump.presentation.database.controller;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.gump.dynagump.presentation.database.hibernate.BuildHib;
+import org.apache.gump.dynagump.presentation.database.hibernate.DependenciesHib;
+import org.apache.gump.dynagump.presentation.database.hibernate.HibernateUtil;
+import org.apache.gump.dynagump.presentation.database.hibernate.HostsHib;
+import org.apache.gump.dynagump.presentation.database.hibernate.ProjectHib;
+import org.apache.gump.dynagump.presentation.database.hibernate.ProjectVersionIdHib;
+import org.apache.gump.dynagump.presentation.database.hibernate.RunsHib;
+import org.apache.gump.dynagump.presentation.database.hibernate.WorkspaceHib;
+import org.apache.gump.dynagump.presentation.valueObjects.Build;
+import org.apache.gump.dynagump.presentation.valueObjects.HistoryVO;
+import org.apache.gump.dynagump.presentation.valueObjects.Host;
+import org.apache.gump.dynagump.presentation.valueObjects.ProjectBuildVO;
+import org.apache.gump.dynagump.presentation.valueObjects.ProjectVO;
+import org.apache.gump.dynagump.presentation.valueObjects.Run;
+import org.apache.gump.dynagump.presentation.valueObjects.RunStatusVO;
+import org.apache.gump.dynagump.presentation.valueObjects.WorkSpace;
+import org.hibernate.Session;
+
+public class HibernateController implements DBController {
+
+	
+	
+	public HibernateController(){
+		
+	}
+	public List<Host> getHosts()throws SQLException{
+		List<Host> li = new LinkedList<Host>();
+		Session session = HibernateUtil.currentSession();
+		Iterator it = session.createQuery("from HostsHib").list().iterator();
+		Host hostVO;
+		while(it.hasNext()){
+			HostsHib host = (HostsHib) it.next();
+			Iterator wit = host.getWorkspace().iterator();
+			hostVO = new Host(host.getAddress(), host.getDescription(),host.getCpuArch(), host.getCpuNumber(), host.getCpuSpeed(),host.getMemoryMb(),host.getDiskGB(),host.getName());
+			int i= 0;
+
+			while(wit.hasNext()){
+	
+
+				WorkspaceHib wh = (WorkspaceHib)wit.next();
+				hostVO.addWorkspace(new WorkSpace(wh.getId(),wh.getName(),wh.getHost(),wh.getDescription()));
+			}
+			li.add(hostVO);
+		}
+		return li;
+	}	
+	
+	public void setWorkspace(List<Host> li)throws SQLException{		
+	}
+	public List<Run> getRuns(String workspace)throws SQLException{
+		List<Run> li = new LinkedList<Run>();
+		Session session = HibernateUtil.currentSession();		
+		Iterator<RunsHib> it = session.createQuery("from RunsHib where workspaceId='"+workspace+"'").list().iterator();
+		RunsHib tempRun;
+		while(it.hasNext()){
+			tempRun = it.next();
+			li.add(new Run(tempRun.getId(),tempRun.getStartTime(),tempRun.getEndTime(),tempRun.getWorkspaceId().getId(),tempRun.getName()));
+		}
+		return li;
+	}
+	public void getBuilds(RunStatusVO r, String id)throws SQLException{
+		
+		Session session = HibernateUtil.currentSession();		
+		Iterator<BuildHib> it = session.createQuery("from BuildHib where runId='"+id+"'").list().iterator();
+		while(it.hasNext()){
+			BuildHib bh = it.next();
+			ProjectHib ph = bh.getProjectId().getProject();
+			r.addBuild(new Build(
+						bh.getBuildId(), 
+						bh.getRunId().getId(), 
+						bh.getProjectId().getId(),
+						bh.getStartTime(),
+						bh.getEndTime(),
+						bh.getResult().getId(),
+						bh.getLog(),
+						bh.getResult().getName(),
+						ph.getName(),
+						ph.getId(),
+						ph.getDescription(),
+						ph.getModule().getName()
+						));
+		}		
+	}
+	public void setDependencies(RunStatusVO r)throws SQLException{
+		HashMap<String, Build> builds = r.getBuildsMap();
+		
+		Set<String> keys = builds.keySet();
+		Iterator<String> it = keys.iterator();
+		String key = null;
+		while(it.hasNext()){
+			
+			key = it.next();
+			
+			
+			Session session = HibernateUtil.currentSession();		
+			Iterator<DependenciesHib> depIt = session.createQuery("from DependenciesHib where dependant='"+builds.get(key).getProjectVersionId()+"'").list().iterator();
+			int i=0;
+/*			while(depIt.hasNext()){
+				System.out.println(i++);
+				String Bid = depIt.next().getBuild().getRunId();
+				System.out.println("id: "+Bid+" key: "+key+" build:"+ builds.get(Bid));
+				
+				builds.get(key).addDependees(builds.get(Bid));	
+			}*/
+			
+		}		
+		
+		
+	}
+	public void addHistory(Build b)throws SQLException{
+		Session session = HibernateUtil.currentSession();		
+		ProjectHib ph = (ProjectHib) session.load(org.apache.gump.dynagump.presentation.database.hibernate.ProjectHib.class, b.getProjectId());
+		HistoryVO history = new HistoryVO();	
+		Iterator<ProjectVersionIdHib> it = ph.getProjectVersion().iterator();
+		
+		while(it.hasNext()){
+
+			BuildHib bh = it.next().getBuild();			
+			history.addValues(bh.getResult().getId(),bh.getStartTime());
+			history.setValues();
+		}		
+		b.addHistory(history);
+	}
+	public List<ProjectVO> getProjects()throws SQLException{
+		List<ProjectVO> li = new LinkedList<ProjectVO>();
+		Session session = HibernateUtil.currentSession();		
+		Iterator<ProjectHib> phIt =  session.createQuery("from ProjectHib").list().iterator();
+		while(phIt.hasNext()){
+			ProjectHib ph = phIt.next();
+			li.add(new ProjectVO(
+					ph.getId(),
+					ph.getName(),
+					ph.getDescription(),
+					ph.getModule().getId(),
+					ph.getModule().getName()));
+		}
+		
+		return li;
+	}
+	public List<ProjectBuildVO> getProjectBuildsList(String projectID) throws SQLException{
+		List<ProjectBuildVO> li = new LinkedList<ProjectBuildVO>();
+		Session session = HibernateUtil.currentSession();
+		ProjectHib ph = (ProjectHib) session.load(org.apache.gump.dynagump.presentation.database.hibernate.ProjectHib.class, projectID);
+		Iterator<ProjectVersionIdHib> it = ph.getProjectVersion().iterator();
+		while(it.hasNext()){
+		ProjectBuildVO tempVO = null;
+		ProjectVersionIdHib pvih = it.next();
+		BuildHib buildhib = pvih.getBuild();
+		
+			tempVO = new ProjectBuildVO();
+			tempVO.setId(buildhib.getBuildId());
+			tempVO.setName(ph.getName());
+			tempVO.setDescription(ph.getDescription());
+			tempVO.setModule_id(ph.getModule().getId());
+			tempVO.setModule_name(ph.getModule().getName());
+			tempVO.setBuild_id(buildhib.getBuildId());
+			tempVO.setRun_id(buildhib.getRunId().getId());
+			tempVO.setRun_name(buildhib.getRunId().getName());
+			tempVO.setResult(buildhib.getResult().getId());
+			
+			tempVO.setResultString(buildhib.getResult().getName());
+			tempVO.setEnd_time(buildhib.getEndTime());
+			tempVO.setStart_time(buildhib.getStartTime());
+			tempVO.setWorkspace_id(buildhib.getRunId().getWorkspaceId().getId());
+			tempVO.setWorkspace_name(buildhib.getRunId().getWorkspaceId().getName());
+			tempVO.setProjectVersionID(pvih.getId());
+			li.add(tempVO);
+		}
+		
+		
+		return li;
+	}
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/controller/MySQLController.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/controller/MySQLController.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/controller/MySQLController.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/controller/MySQLController.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,207 @@
+package org.apache.gump.dynagump.presentation.database.controller;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.gump.dynagump.presentation.valueObjects.Build;
+import org.apache.gump.dynagump.presentation.valueObjects.HistoryVO;
+import org.apache.gump.dynagump.presentation.valueObjects.Host;
+import org.apache.gump.dynagump.presentation.valueObjects.ProjectBuildVO;
+import org.apache.gump.dynagump.presentation.valueObjects.ProjectVO;
+import org.apache.gump.dynagump.presentation.valueObjects.Run;
+import org.apache.gump.dynagump.presentation.valueObjects.RunStatusVO;
+
+
+public class MySQLController implements DBController {
+
+	private Connection con;
+	private Statement stm;
+	
+	public MySQLController()throws ClassNotFoundException, SQLException{
+		 
+		 
+		 // Load the JDBC driver
+		 String driverName = "com.mysql.jdbc.Driver"; // MySQL MM JDBC driver
+		 Class.forName("com.mysql.jdbc.Driver"); 
+		    
+		        // Create a connection to the database
+		 String serverName = "localhost";
+		 String mydatabase = "gump";
+		 String url = "jdbc:mysql://" + serverName +  "/" + mydatabase; // a JDBC url
+		 String username = "root";
+		 String password = "";
+		 con = DriverManager.getConnection(url, username, password);
+		 stm = con.createStatement();
+	}
+	public List<Host> getHosts()throws SQLException{
+		//TODO A more Effective query, do both host and workspace in one request.
+		
+		List<Host> li = new LinkedList<Host>();
+		
+		Statement smt = con.createStatement();
+		ResultSet rs = smt.executeQuery("select * from hosts");
+		while(rs.next()){
+			li.add(new Host(rs));
+		}		
+		rs.close();		
+		return li;
+		
+	}
+	public void setWorkspace(List<Host> li)throws SQLException{
+		
+		ResultSet rs = null;
+		for(int i=0; i < li.size(); i++){
+			rs = stm.executeQuery("select * from workspaces WHERE host='"+li.get(i).getAddress()+"'");
+			li.get(i).setWorkspaces(rs);
+			rs.close();
+		}
+		
+	}
+	public List<Run> getRuns(String workspace)throws SQLException{
+		ResultSet rs = stm.executeQuery("Select * From runs Where workspace_id='"+workspace+"'");
+		LinkedList<Run> li = new LinkedList<Run>();
+		while(rs.next()){
+			li.add(new Run(rs));
+			
+		}
+		rs.close();
+		return li;
+	}
+	public void getBuilds(RunStatusVO r, String id) throws SQLException{
+		
+		ResultSet rs = stm.executeQuery("SELECT builds.*, results.name AS result_name, projects.id AS project_id, projects.*, "
+									   +"modules.description AS module_description, modules.name AS module_name FROM builds "
+									   +"LEFT JOIN results ON builds.result=results.id "
+									   +"LEFT JOIN project_versions ON builds.project_version_id=project_versions.id "
+									   +"LEFT JOIN projects ON project_versions.project_id=projects.id "
+									   +"LEFT JOIN modules ON projects.module_id = modules.id "
+									   +"WHERE builds.run_id='"+id+"'");
+		while(rs.next()){
+			r.addBuild(new Build(rs));
+			
+		}
+		rs.close();
+	}
+	public void setDependencies(RunStatusVO r)throws SQLException{
+		HashMap<String, Build> builds = r.getBuildsMap();
+		
+		Set<String> keys = builds.keySet();
+		Iterator<String> it = keys.iterator();
+		String key = null;
+		while(it.hasNext()){
+			
+			key = it.next();
+			
+			ResultSet rs = stm.executeQuery("SELECT project_dependencies.dependee, builds.id FROM project_dependencies LEFT JOIN builds ON project_dependencies.dependee=builds.project_version_id WHERE dependant='"+builds.get(key).getProjectVersionId()+"'");
+			while(rs.next()){
+				
+				builds.get(key).addDependees(builds.get(rs.getString("id")));	
+			}
+			rs.close();
+		}		
+	}
+	public void addHistory(Build b) throws SQLException{
+		String query =  "SELECT builds.start_time AS start, builds.end_time AS end, builds.result AS result " 
+		+"FROM projects " 
+		+"LEFT JOIN project_versions ON projects.id=project_versions.project_id "
+		+"LEFT JOIN builds ON project_versions.id=builds.project_version_id "
+		+"WHERE projects.id='"+b.getProjectId()+"' ORDER BY start DESC ";
+		
+		ResultSet rs = stm.executeQuery(query);
+		HistoryVO history = new HistoryVO();
+		while(rs.next()){
+			history.addValues(rs.getInt("result"),rs.getString("start"));			
+		}
+		history.setValues();
+		b.addHistory(history);
+		rs.close();
+	}
+	public List<ProjectVO> getProjects() throws SQLException{
+		List<ProjectVO> li = new LinkedList<ProjectVO>();
+		String query ="SELECT projects.*, modules.name AS module_name FROM projects "
+					 +"LEFT JOIN modules ON modules.id = projects.module_id";
+		ResultSet rs = stm.executeQuery(query);
+		
+		while(rs.next()){
+			li.add(new ProjectVO(
+					rs.getString("id"),
+					rs.getString("name"),
+					rs.getString("description"),
+					rs.getString("module_id"),
+					rs.getString("module_name")));
+		}
+		rs.close();
+		return li;
+	}
+	public List<ProjectBuildVO> getProjectBuildsList(String projectID) throws SQLException{
+		List<ProjectBuildVO> li = new LinkedList<ProjectBuildVO>();
+		String query = "SELECT projects.*, builds.id AS build_id, builds.run_id, results.name AS result_name, builds.result, builds.start_time, builds.end_time, runs.workspace_id, runs.name AS run_name, workspaces.name AS workspace_name, modules.name AS module_name,project_versions.id AS project_versions_id "
+					  +"FROM projects "
+					  +"LEFT JOIN project_versions ON project_versions.project_id=projects.id " 
+					  +"LEFT JOIN builds ON project_versions.id=builds.project_version_id "
+					  +"LEFT JOIN runs ON builds.run_id=runs.id "
+					  +"LEFT JOIN workspaces ON runs.workspace_id=workspaces.id "
+					  +"LEFT JOIN modules ON projects.module_id = modules.id "
+					  +"LEFT JOIN results ON builds.result=results.id "
+					  +"WHERE projects.id='"+projectID+"'";
+
+		ResultSet rs = stm.executeQuery(query);
+		ProjectBuildVO tempVO = null;
+		while(rs.next()){
+			tempVO = new ProjectBuildVO();
+			tempVO.setId(rs.getString("id"));
+			tempVO.setName(rs.getString("name"));
+			tempVO.setDescription(rs.getString("description"));
+			tempVO.setModule_id(rs.getString("module_id"));
+			tempVO.setModule_name(rs.getString("module_name"));
+			tempVO.setBuild_id(rs.getString("build_id"));
+			tempVO.setRun_id(rs.getString("run_id"));
+			tempVO.setRun_name(rs.getString("run_name"));
+			tempVO.setResult(rs.getInt("result"));
+			
+			tempVO.setResultString(rs.getString("result_name"));
+			tempVO.setEnd_time(rs.getString("end_time"));
+			tempVO.setStart_time(rs.getString("start_time"));
+			tempVO.setWorkspace_id(rs.getString("workspace_id"));
+			tempVO.setWorkspace_name(rs.getString("workspace_name"));
+			tempVO.setProjectVersionID(rs.getString("project_versions_id"));
+			li.add(tempVO);
+		}
+		rs.close();
+		for(int i=0; i<li.size(); i++){
+			tempVO = li.get(i);
+			tempVO.setDependees(this.dependees(tempVO.getProjectVersionID()));
+			tempVO.setDependant(this.dependant(tempVO.getProjectVersionID()));
+		}
+		return li;
+	}
+	private List<String> dependees(String s) throws SQLException{
+		List<String> li = new LinkedList<String>();
+		String query = "SELECT * FROM `project_dependencies` WHERE  dependant ='"+s+"'";
+		ResultSet rs = stm.executeQuery(query);
+		while(rs.next()){
+			li.add(rs.getString("dependee"));
+		}
+		rs.close();
+		return li;
+	}
+	private List<String> dependant(String s) throws SQLException{
+		List<String> li = new LinkedList<String>();
+		String query = "SELECT * FROM `project_dependencies` WHERE  dependee ='"+s+"'";
+		ResultSet rs = stm.executeQuery(query);
+		while(rs.next()){
+			li.add(rs.getString("dependant"));
+		}
+		rs.close();
+		return li;
+	}
+
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/BuildHib.hbm.xml
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/BuildHib.hbm.xml?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/BuildHib.hbm.xml (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/BuildHib.hbm.xml Sun Aug 21 19:31:37 2005
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+
+	<class name="org.apache.gump.dynagump.presentation.database.hibernate.BuildHib" table="builds">
+    	<id name="buildId" column="id"/>
+	    <many-to-one name="runId" column="run_id" class="org.apache.gump.dynagump.presentation.database.hibernate.RunsHib"/>
+
+
+	    <property name="startTime" column="start_time"/>
+    	<property name="endTime" column="end_time"/>
+    	
+ 		<many-to-one name="result" column="result" class="org.apache.gump.dynagump.presentation.database.hibernate.ResultHib"/>
+	    <property name="log" column="log"/>
+ 	    <many-to-one name="ProjectId" column="project_version_id" not-null="true"/>
+
+	</class>
+
+	
+</hibernate-mapping>

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/BuildHib.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/BuildHib.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/BuildHib.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/BuildHib.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,69 @@
+package org.apache.gump.dynagump.presentation.database.hibernate;
+
+import java.util.Set;
+
+public class BuildHib {
+	private String buildId;
+	private RunsHib runId;
+	private String startTime;
+	private String endTime;
+	private ResultHib result;
+	private String log;
+	private ProjectVersionIdHib projectId;
+	private ProjectHib project;
+	
+
+
+	
+	public ResultHib getResult() {
+		return result;
+	}
+	public void setResult(ResultHib result) {
+		this.result = result;
+	}
+	public ProjectHib getProject() {
+		return project;
+	}
+	public void setProject(ProjectHib project) {
+		this.project = project;
+	}
+	public ProjectVersionIdHib getProjectId() {
+		return projectId;
+	}
+	public void setProjectId(ProjectVersionIdHib projectId) {
+		this.projectId = projectId;
+	}
+	public String getEndTime() {
+		return endTime;
+	}
+	public void setEndTime(String endTime) {
+		this.endTime = endTime;
+	}
+
+	public String getBuildId() {
+		return buildId;
+	}
+	public void setBuildId(String buildId) {
+		this.buildId = buildId;
+	}
+	public String getLog() {
+		return log;
+	}
+	public void setLog(String log) {
+		this.log = log;
+	}
+
+
+	public RunsHib getRunId() {
+		return runId;
+	}
+	public void setRunId(RunsHib runId) {
+		this.runId = runId;
+	}
+	public String getStartTime() {
+		return startTime;
+	}
+	public void setStartTime(String startTime) {
+		this.startTime = startTime;
+	}	
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/DependenciesHib.hbm.xml
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/DependenciesHib.hbm.xml?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/DependenciesHib.hbm.xml (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/DependenciesHib.hbm.xml Sun Aug 21 19:31:37 2005
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping>
+
+
+    <class name="org.apache.gump.dynagump.presentation.database.hibernate.DependenciesHib" table="project_dependencies">
+        <id name="dependant" column="dependant" /> 
+
+        <many-to-one name="build" column="dependee" not-null="true"/>
+	</class>
+</hibernate-mapping>
+

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/DependenciesHib.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/DependenciesHib.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/DependenciesHib.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/DependenciesHib.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,30 @@
+package org.apache.gump.dynagump.presentation.database.hibernate;
+
+public class DependenciesHib {
+
+	private String dependee;
+	private String dependant;
+	private BuildHib build;
+	
+	public String getDependant() {
+		return dependant;
+	}
+	public void setDependant(String dependant) {
+		this.dependant = dependant;
+	}
+	public String getDependee() {
+		return dependee;
+	}
+	public void setDependee(String dependee) {
+		this.dependee = dependee;
+	}
+	public BuildHib getBuild() {
+		return build;
+	}
+	public void setBuild(BuildHib build) {
+		this.build = build;
+	}
+	
+	
+	
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/HibernateUtil.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/HibernateUtil.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/HibernateUtil.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/HibernateUtil.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,42 @@
+package org.apache.gump.dynagump.presentation.database.hibernate;
+
+import org.hibernate.HibernateException;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.cfg.Configuration;
+
+public class HibernateUtil {
+
+    public static final SessionFactory sessionFactory;
+
+    static {
+        try {
+            // Create the SessionFactory from hibernate.cfg.xml
+            sessionFactory = new Configuration().configure().buildSessionFactory();
+        } catch (Throwable ex) {
+            // Make sure you log the exception, as it might be swallowed
+            System.err.println("Initial SessionFactory creation failed." + ex);
+            throw new ExceptionInInitializerError(ex);
+        }
+    }
+
+    public static final ThreadLocal session = new ThreadLocal();
+
+    public static Session currentSession() throws HibernateException {
+        Session s = (Session) session.get();
+        // Open a new Session, if this thread has none yet
+        if (s == null) {
+            s = sessionFactory.openSession();
+            // Store it in the ThreadLocal variable
+            session.set(s);
+        }
+        return s;
+    }
+
+    public static void closeSession() throws HibernateException {
+        Session s = (Session) session.get();
+        if (s != null)
+            s.close();
+        session.set(null);
+    }
+}
\ No newline at end of file

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/HostsHib.hbm.xml
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/HostsHib.hbm.xml?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/HostsHib.hbm.xml (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/HostsHib.hbm.xml Sun Aug 21 19:31:37 2005
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping>
+
+
+    <class name="org.apache.gump.dynagump.presentation.database.hibernate.HostsHib" table="hosts">
+        <id name="address" column="address" />
+ 
+        <property name="description" column="description"/>
+        <property name="cpuArch" column="cpu_arch"/>
+        <property name="cpuNumber" column="cpu_number"/>
+        <property name="cpuSpeed" column=" cpu_speed_Mhz"/>
+        <property name="memoryMb" column="memory_Mb"/>
+        <property name="diskGB" column="disk_Gb" not-null="false"/>
+        <property name="name" column="name"/>
+        <set name="workspace" inverse="true">
+            <key column="host"/>
+            <one-to-many class="org.apache.gump.dynagump.presentation.database.hibernate.WorkspaceHib"/>
+        </set>
+    </class>
+ 
+
+</hibernate-mapping>
+

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/HostsHib.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/HostsHib.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/HostsHib.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/HostsHib.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,78 @@
+package org.apache.gump.dynagump.presentation.database.hibernate;
+
+import java.util.Set;
+
+
+
+
+
+public class HostsHib {
+
+	private String address;
+	private String description;
+	private String cpuArch;
+	private int cpuNumber;
+	private int cpuSpeed;
+	private int memoryMb;
+	private int diskGB;
+	private String name;
+	private Set workspace;
+	
+	
+	public Set getWorkspace() {
+		return workspace;
+	}
+	public void setWorkspace(Set workspace) {
+		this.workspace = workspace;
+	}
+	public String getAddress() {
+		return address;
+	}
+	public void setAddress(String address) {
+		this.address = address;
+	}
+	public String getCpuArch() {
+		return cpuArch;
+	}
+	public void setCpuArch(String cpuArch) {
+		this.cpuArch = cpuArch;
+	}
+	public int getCpuNumber() {
+		return cpuNumber;
+	}
+	public void setCpuNumber(int cpuNumber) {
+		this.cpuNumber = cpuNumber;
+	}
+	public int getCpuSpeed() {
+		return cpuSpeed;
+	}
+	public void setCpuSpeed(int cpuSpeed) {
+		this.cpuSpeed = cpuSpeed;
+	}
+	public String getDescription() {
+		return description;
+	}
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	public int getDiskGB() {
+		return diskGB;
+	}
+	public void setDiskGB(int diskGB) {
+		this.diskGB = diskGB;
+	}
+	public int getMemoryMb() {
+		return memoryMb;
+	}
+	public void setMemoryMb(int memoryMb) {
+		this.memoryMb = memoryMb;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+		
+	
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ModuleHib.hbm.xml
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ModuleHib.hbm.xml?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ModuleHib.hbm.xml (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ModuleHib.hbm.xml Sun Aug 21 19:31:37 2005
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+
+	<class name="org.apache.gump.dynagump.presentation.database.hibernate.ModuleHib" table="modules">
+    	<id name="id" column="id"/>
+	    <property name="name" column="name"/>
+	    <property name="description" column="description"/>
+<!--         <set name="project" inverse="true" >
+            <key column="module_id" />
+            <one-to-many class="org.apache.gump.dynagump.presentation.database.hibernate.ProjectHib" />
+        </set>  -->
+
+	</class>
+
+	
+</hibernate-mapping>

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ModuleHib.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ModuleHib.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ModuleHib.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ModuleHib.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,39 @@
+package org.apache.gump.dynagump.presentation.database.hibernate;
+
+import java.util.Set;
+
+public class ModuleHib {
+
+	private String id;
+	private String description;
+	private String name;
+	private Set project;
+	
+	public String getDescription() {
+		return description;
+	}
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public Set getProject() {
+		return project;
+	}
+	public void setProject(Set project) {
+		this.project = project;
+	}
+	
+	
+	
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ProjectHib.hbm.xml
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ProjectHib.hbm.xml?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ProjectHib.hbm.xml (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ProjectHib.hbm.xml Sun Aug 21 19:31:37 2005
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+
+
+
+	<class name="org.apache.gump.dynagump.presentation.database.hibernate.ProjectHib" table="projects">
+    	<id name="id" column="id" />
+    	<property name="name" column="name"/>
+    	<property name="description" column="description"/>
+    	<many-to-one name="module" column="module_id" not-null="true"/>
+        <set name="projectVersion" inverse="true" >
+            <key column="project_id" />
+            <one-to-many class="org.apache.gump.dynagump.presentation.database.hibernate.ProjectVersionIdHib" />
+        </set>
+	</class>
+	
+</hibernate-mapping>

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ProjectHib.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ProjectHib.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ProjectHib.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ProjectHib.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,47 @@
+package org.apache.gump.dynagump.presentation.database.hibernate;
+
+import java.util.Set;
+
+public class ProjectHib {
+
+	private String id;
+	private String name;
+	private String description;
+	private ModuleHib module;
+	private Set projectVersion;
+				
+	
+
+	public ModuleHib getModule() {
+		return module;
+	}
+	public void setModule(ModuleHib module) {
+		this.module = module;
+	}
+	public String getDescription() {
+		return description;
+	}
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public Set getProjectVersion() {
+		return projectVersion;
+	}
+	public void setProjectVersion(Set projectVersion) {
+		this.projectVersion = projectVersion;
+	}
+
+	
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ProjectVersionIdHib.hbm.xml
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ProjectVersionIdHib.hbm.xml?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ProjectVersionIdHib.hbm.xml (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ProjectVersionIdHib.hbm.xml Sun Aug 21 19:31:37 2005
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+
+
+
+	<class name="org.apache.gump.dynagump.presentation.database.hibernate.ProjectVersionIdHib" table="project_versions">
+    	<id name="id" column="id"/>
+	    <many-to-one name="project" column="project_id" not-null="true"/>
+	    <one-to-one name="build" class="org.apache.gump.dynagump.presentation.database.hibernate.BuildHib" property-ref="ProjectId"/>
+	</class>
+	
+</hibernate-mapping>

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ProjectVersionIdHib.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ProjectVersionIdHib.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ProjectVersionIdHib.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ProjectVersionIdHib.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,29 @@
+package org.apache.gump.dynagump.presentation.database.hibernate;
+
+public class ProjectVersionIdHib {
+
+	private String id;
+	private ProjectHib project;
+	private BuildHib build;
+	
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public ProjectHib getProject() {
+		return project;
+	}
+	public void setProject(ProjectHib project) {
+		this.project = project;
+	}
+	public BuildHib getBuild() {
+		return build;
+	}
+	public void setBuild(BuildHib build) {
+		this.build = build;
+	}
+	
+	
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ResultHib.hbm.xml
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ResultHib.hbm.xml?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ResultHib.hbm.xml (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ResultHib.hbm.xml Sun Aug 21 19:31:37 2005
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping>
+
+   <class name="org.apache.gump.dynagump.presentation.database.hibernate.ResultHib" table="results">
+        <id name="id" column="id" />
+
+        <property name="name" column="name"/>
+        <property name="description" column="description"/>
+
+    </class>
+ 
+
+
+
+</hibernate-mapping>
\ No newline at end of file

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ResultHib.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ResultHib.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ResultHib.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/ResultHib.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,40 @@
+package org.apache.gump.dynagump.presentation.database.hibernate;
+
+import java.util.Set;
+
+public class ResultHib {
+	
+	private Integer id;
+	private String name;
+	private String description;
+	private Set builds;
+	
+	
+
+	public Set getBuilds() {
+		return builds;
+	}
+	public void setBuilds(Set builds) {
+		this.builds = builds;
+	}
+	public String getDescription() {
+		return description;
+	}
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	public Integer getId() {
+		return id;
+	}
+	public void setId(Integer id) {
+		this.id = id;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/RunsHib.hbm.xml
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/RunsHib.hbm.xml?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/RunsHib.hbm.xml (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/RunsHib.hbm.xml Sun Aug 21 19:31:37 2005
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping>
+
+   <class name="org.apache.gump.dynagump.presentation.database.hibernate.RunsHib" table="runs">
+        <id name="id" column="id" />
+
+        <property name="startTime" column="start_time"/>
+        <property name="endTime" column="end_time"/>
+        <many-to-one name="workspaceId" column="workspace_id" class="org.apache.gump.dynagump.presentation.database.hibernate.WorkspaceHib"/>
+
+        <property name="name" column="name"/>
+
+    </class>
+ 
+
+
+
+</hibernate-mapping>
\ No newline at end of file

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/RunsHib.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/RunsHib.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/RunsHib.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/RunsHib.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,42 @@
+package org.apache.gump.dynagump.presentation.database.hibernate;
+
+public class RunsHib {
+	
+	private String id;
+	private String startTime;
+	private String endTime;
+	private WorkspaceHib workspaceId;
+	private String name;
+	
+	public String getEndTime() {
+		return endTime;
+	}
+	public void setEndTime(String endTime) {
+		this.endTime = endTime;
+	}
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getStartTime() {
+		return startTime;
+	}
+	public void setStartTime(String startTime) {
+		this.startTime = startTime;
+	}
+	public WorkspaceHib getWorkspaceId() {
+		return workspaceId;
+	}
+	public void setWorkspaceId(WorkspaceHib workspaceId) {
+		this.workspaceId = workspaceId;
+	}
+
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.hbm.xml
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.hbm.xml?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.hbm.xml (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.hbm.xml Sun Aug 21 19:31:37 2005
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping>
+
+
+  
+   <class name="org.apache.gump.dynagump.presentation.database.hibernate.WorkspaceHib" table="workspaces">
+        <id name="id" column="id" />
+
+        <property name="name" column="name"/>
+        <property name="host" column="host"/>
+        <property name="description" column="description"/>
+
+    </class>
+
+</hibernate-mapping>
\ No newline at end of file

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.java?rev=234419&view=auto
==============================================================================
--- gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.java (added)
+++ gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.java Sun Aug 21 19:31:37 2005
@@ -0,0 +1,36 @@
+package org.apache.gump.dynagump.presentation.database.hibernate;
+
+public class WorkspaceHib {
+
+	private String id;
+	private String name;
+	private String host;
+	private String description;
+	
+	public String getDescription() {
+		return description;
+	}
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	public String getHost() {
+		return host;
+	}
+	public void setHost(String host) {
+		this.host = host;
+	}
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	
+}

Added: gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/resources/application
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/presentation/WEB-INF/src/org/apache/gump/dynagump/presentation/resources/application?rev=234419&view=auto
==============================================================================
    (empty)



Mime
View raw message