gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r387028 [1/2] - in /gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation: ./ actions/ database/ database/controller/ database/hibernate/ valueObjects/
Date Sun, 19 Mar 2006 20:44:31 GMT
Author: stefano
Date: Sun Mar 19 12:44:28 2006
New Revision: 387028

URL: http://svn.apache.org/viewcvs?rev=387028&view=rev
Log:
only whitespace/formatting changes

Modified:
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/ModuleController.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/StatusEvaluator.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/BuildsAction.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/ListProjectBuilds.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/ProjectListAction.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/ProjectStatusAction.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/ShowRunsAction.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/StatusRunAction.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/CouldNotFindDBException.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/DBHandler.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/controller/DBController.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/controller/HibernateController.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/controller/MySQLController.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/BuildHib.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/DependenciesHib.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/HostsHib.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/ModuleHib.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/ProjectHib.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/ProjectVersionIdHib.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/ResultHib.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/RunsHib.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/WorkspaceHib.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/Build.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/HistoryObject.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/HistoryVO.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/Host.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/ProjectBuildVO.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/ProjectVO.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/Run.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/RunStatusVO.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/StatusVO.java
    gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/valueObjects/WorkSpace.java

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/ModuleController.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/ModuleController.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/ModuleController.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/ModuleController.java Sun Mar 19 12:44:28 2006
@@ -1,4 +1,5 @@
 package org.apache.gump.dynagump.presentation;
+
 /**
  * @author hodden
  * 
@@ -17,73 +18,87 @@
 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);
-		}
-	}
+
+    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);
+        }
+    }
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/StatusEvaluator.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/StatusEvaluator.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/StatusEvaluator.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/StatusEvaluator.java Sun Mar 19 12:44:28 2006
@@ -6,34 +6,40 @@
 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.
- *
+ * 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;
-	}
+    /**
+     * 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;
+    }
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/BuildsAction.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/BuildsAction.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/BuildsAction.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/BuildsAction.java Sun Mar 19 12:44:28 2006
@@ -18,41 +18,40 @@
 
 /**
  * Action to get the workspaces from the database
+ * 
  * @author hodden
- *
+ * 
  */
-//TODO Change the name to workspaceAction
+// 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){
+    private static Log log = LogFactory.getLog(BuildsAction.class);
 
-		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");
-		}
-	}
+    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");
+        }
+    }
 
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/ListProjectBuilds.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/ListProjectBuilds.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/ListProjectBuilds.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/ListProjectBuilds.java Sun Mar 19 12:44:28 2006
@@ -17,48 +17,46 @@
 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){
+    private static Log log = LogFactory.getLog(ProjectStatusAction.class);
 
-		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");
-		}
-	}
+    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");
+        }
+    }
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/ProjectListAction.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/ProjectListAction.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/ProjectListAction.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/ProjectListAction.java Sun Mar 19 12:44:28 2006
@@ -18,41 +18,39 @@
 
 public class ProjectListAction extends Action {
 
-	private static Log log = LogFactory.getLog(ProjectStatusAction.class);
-	
-	public ActionForward execute(ActionMapping mapping,ActionForm form,
-			HttpServletRequest request,HttpServletResponse response){
+    private static Log log = LogFactory.getLog(ProjectStatusAction.class);
 
-		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");
-		}
-	}
+    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");
+        }
+    }
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/ProjectStatusAction.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/ProjectStatusAction.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/ProjectStatusAction.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/ProjectStatusAction.java Sun Mar 19 12:44:28 2006
@@ -15,61 +15,63 @@
 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.
+ * 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");
-		}
-	}
+
+    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");
+        }
+    }
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/ShowRunsAction.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/ShowRunsAction.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/ShowRunsAction.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/ShowRunsAction.java Sun Mar 19 12:44:28 2006
@@ -13,54 +13,54 @@
 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.
+ * 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");
-		}
-	}
+    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");
+        }
+    }
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/StatusRunAction.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/StatusRunAction.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/StatusRunAction.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/actions/StatusRunAction.java Sun Mar 19 12:44:28 2006
@@ -17,54 +17,53 @@
 
 /**
  * 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");
-		}
-	}
+
+    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");
+        }
+    }
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/CouldNotFindDBException.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/CouldNotFindDBException.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/CouldNotFindDBException.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/CouldNotFindDBException.java Sun Mar 19 12:44:28 2006
@@ -1,38 +1,43 @@
 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;
-	}
-	
+    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;
+    }
+
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/DBHandler.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/DBHandler.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/DBHandler.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/DBHandler.java Sun Mar 19 12:44:28 2006
@@ -1,32 +1,33 @@
 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.
+// 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);
-		}		
-	}
+    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);
+        }
+    }
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/controller/DBController.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/controller/DBController.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/controller/DBController.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/controller/DBController.java Sun Mar 19 12:44:28 2006
@@ -9,61 +9,79 @@
 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;
+    /**
+     * 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;
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/controller/HibernateController.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/controller/HibernateController.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/controller/HibernateController.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/controller/HibernateController.java Sun Mar 19 12:44:28 2006
@@ -1,6 +1,5 @@
 package org.apache.gump.dynagump.presentation.database.controller;
 
-import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -28,156 +27,138 @@
 
 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;
-	}
+    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());
+            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();
+
+            /*
+             * 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;
+    }
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/controller/MySQLController.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/controller/MySQLController.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/controller/MySQLController.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/controller/MySQLController.java Sun Mar 19 12:44:28 2006
@@ -19,189 +19,187 @@
 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;
-	}
+    private Connection con;
+
+    private Statement stm;
+
+    public MySQLController() throws ClassNotFoundException, SQLException {
+
+        // Load the 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;
+        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;
+    }
 
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/BuildHib.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/BuildHib.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/BuildHib.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/BuildHib.java Sun Mar 19 12:44:28 2006
@@ -1,69 +1,83 @@
 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;
-	}	
+    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;
+    }
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/DependenciesHib.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/DependenciesHib.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/DependenciesHib.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/DependenciesHib.java Sun Mar 19 12:44:28 2006
@@ -2,29 +2,34 @@
 
 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;
-	}
-	
-	
-	
+    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;
+    }
+
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/HostsHib.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/HostsHib.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/HostsHib.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/HostsHib.java Sun Mar 19 12:44:28 2006
@@ -2,77 +2,96 @@
 
 import java.util.Set;
 
+public class HostsHib {
 
+    private String address;
 
+    private String description;
 
+    private String cpuArch;
 
-public class HostsHib {
+    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;
+    }
 
-	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;
-	}
-		
-	
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/ModuleHib.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/ModuleHib.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/ModuleHib.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/ModuleHib.java Sun Mar 19 12:44:28 2006
@@ -4,36 +4,44 @@
 
 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;
-	}
-	
-	
-	
+    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;
+    }
+
 }

Modified: gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/ProjectHib.java
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/ProjectHib.java?rev=387028&r1=387027&r2=387028&view=diff
==============================================================================
--- gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/ProjectHib.java (original)
+++ gump/branches/Gump3/dynagump/src/main/java/org/apache/gump/dynagump/presentation/database/hibernate/ProjectHib.java Sun Mar 19 12:44:28 2006
@@ -4,44 +4,54 @@
 
 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;
-	}
+    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;
+    }
 
-	
 }



Mime
View raw message