Package org.apache.forrest.forrestbot.webapp.util

Examples of org.apache.forrest.forrestbot.webapp.util.Project


      // set access for each project
      String currentUser = (String) request.getSession(true).getAttribute("username");
      Collection projects = Project.getAllProjects();
      for (Iterator i = projects.iterator(); i.hasNext();) {
        ProjectDTO projectDTO = (ProjectDTO)i.next();
        (new Project(projectDTO)).loadSecurity(currentUser);
      }
      request.setAttribute("projects", projects);
     
      return mapping.findForward(Constants.FORWARD_NAME_AUTHORIZED);
    }
View Full Code Here


      errors.add("execute", new ActionError("error.project.notfound", project));
      saveErrors(request, errors);
      return mapping.findForward(Constants.FORWARD_NAME_SUCCESS);
    }
   
    Project p = new Project();
    p.asDTO().setName(project);
    p.loadData();
    p.loadSecurity((String) request.getSession(true).getAttribute("username"));
    if (p.asDTO().getStatus() == Constants.STATUS_RUNNING) {
      log.warn("can't execute " + project + " while still running");
      errors.add("execute", new ActionError("error.project.stillrunning", project));
      saveErrors(request, errors);
      return mapping.findForward(Constants.FORWARD_NAME_SUCCESS);
    }

    if (build != null && !build.equals("")) {
      if (p.asDTO().isBuildable()) {
        try {
          Executor.build(project);
        } catch (Exception e) {
          log.warn("couldn't build " + project, e);
          errors.add("execute", new ActionError("error.build", project));
        }
      } else {
        errors.add("execute", new ActionError("error.authorization"));
      }
    } else if (deploy != null && !deploy.equals("")) {
      if (p.asDTO().isDeployable()) {
        try {
          Executor.deploy(project);
        } catch (Exception e) {
          log.warn("couldn't deploy " + project, e);
          errors.add("execute", new ActionError("error.deploy", project));
View Full Code Here

      errors.add("execute", new ActionError("error.project.notfound", project));
      saveErrors(request, errors);
      return mapping.findForward(Constants.FORWARD_NAME_SUCCESS);
    }
   
    Project p = new Project();
    p.asDTO().setName(project);
    p.loadData();
    p.loadSecurity((String) request.getSession(true).getAttribute("username"));
    if (p.asDTO().getStatus() == Constants.STATUS_RUNNING) {
      log.warn("can't execute " + project + " while still running");
      errors.add("execute", new ActionError("error.project.stillrunning", project));
      saveErrors(request, errors);
      return mapping.findForward(Constants.FORWARD_NAME_SUCCESS);
    }

    if (build != null && !build.equals("")) {
      if (p.asDTO().isBuildable()) {
        try {
          Executor.build(project);
        } catch (Exception e) {
          log.warn("couldn't build " + project, e);
          errors.add("execute", new ActionError("error.build", project));
        }
      } else {
        errors.add("execute", new ActionError("error.authorization"));
      }
    } else if (deploy != null && !deploy.equals("")) {
      if (p.asDTO().isDeployable()) {
        try {
          Executor.deploy(project);
        } catch (Exception e) {
          log.warn("couldn't deploy " + project, e);
          errors.add("execute", new ActionError("error.deploy", project));
View Full Code Here

      // set access for each project
      String currentUser = (String) request.getSession(true).getAttribute("username");
      Collection projects = Project.getAllProjects();
      for (Iterator i = projects.iterator(); i.hasNext();) {
        ProjectDTO projectDTO = (ProjectDTO)i.next();
        (new Project(projectDTO)).loadSecurity(currentUser);
      }
      request.setAttribute("projects", projects);
     
      return mapping.findForward(Constants.FORWARD_NAME_AUTHORIZED);
    }
View Full Code Here

      // set access for each project
      String currentUser = (String) request.getSession(true).getAttribute("username");
      Collection projects = Project.getAllProjects();
      for (Iterator i = projects.iterator(); i.hasNext();) {
        ProjectDTO projectDTO = (ProjectDTO)i.next();
        (new Project(projectDTO)).loadSecurity(currentUser);
      }
      request.setAttribute("projects", projects);
     
      return mapping.findForward(Constants.FORWARD_NAME_AUTHORIZED);
    }
View Full Code Here

      errors.add("execute", new ActionError("error.project.notfound", project));
      saveErrors(request, errors);
      return mapping.findForward(Constants.FORWARD_NAME_SUCCESS);
    }
   
    Project p = new Project();
    p.asDTO().setName(project);
    p.loadData();
    p.loadSecurity((String) request.getSession(true).getAttribute("username"));
    if (p.asDTO().getStatus() == Constants.STATUS_RUNNING) {
      log.warn("can't execute " + project + " while still running");
      errors.add("execute", new ActionError("error.project.stillrunning", project));
      saveErrors(request, errors);
      return mapping.findForward(Constants.FORWARD_NAME_SUCCESS);
    }

    if (build != null && !build.equals("")) {
      if (p.asDTO().isBuildable()) {
        try {
          Executor.build(project);
        } catch (Exception e) {
          log.warn("couldn't build " + project, e);
          errors.add("execute", new ActionError("error.build", project));
        }
      } else {
        errors.add("execute", new ActionError("error.authorization"));
      }
    } else if (deploy != null && !deploy.equals("")) {
      if (p.asDTO().isDeployable()) {
        try {
          Executor.deploy(project);
        } catch (Exception e) {
          log.warn("couldn't deploy " + project, e);
          errors.add("execute", new ActionError("error.deploy", project));
View Full Code Here

TOP

Related Classes of org.apache.forrest.forrestbot.webapp.util.Project

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.