[jboss-svn-commits] JBL Code SVN: r18528 - in labs/jbosslabs/labs-3.0-build/views/admin/src/main: java/org/jboss/labs/admin/action and 7 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Feb 20 10:11:56 EST 2008


Author: wrzep
Date: 2008-02-20 10:11:55 -0500 (Wed, 20 Feb 2008)
New Revision: 18528

Added:
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/AcceptProject.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/CreateProjectRequest.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/Notifier.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/ProjectManager.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/RequestProject.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/ReviewProjectRequest.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/ViewProject.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/AcceptJoin.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/JoinNotifier.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/JoinProject.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/ReviewJoinRequest.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/UserManager.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/validator/EmailValidator.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/resources/messages_en.properties
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/joinProject.jpdl.xml
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/joinProject.xhtml
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/joinTicket.xhtml
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/signCAfirst.xhtml
Removed:
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/Notifier.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/ProjectManager.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/AcceptProject.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/CreateProjectRequest.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/RequestProject.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ReviewProjectRequest.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ViewProject.java
Modified:
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/Pages.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/META-INF/persistence.xml
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/WEB-INF/components.xml
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/WEB-INF/web.xml
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/createProject.jpdl.xml
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/createProject.xhtml
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/home.xhtml
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/project.xhtml
Log:
JBLAB-913 join project views


Deleted: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/Notifier.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/Notifier.java	2008-02-20 14:31:16 UTC (rev 18527)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/Notifier.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -1,64 +0,0 @@
-/*
-* JBoss Labs. http://labs.jboss.com/jbosslabs
-*
-* Copyright © 2008  Red Hat Middleware, LLC. All rights reserved.
-*
-* This copyrighted material is made available to anyone wishing to use,
-* modify, copy, or redistribute it subject to the terms and conditions
-* of the GNU Lesser General Public License, v. 2.1.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT A WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License, v.2.1 along with this distribution; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-* 02110-1301, USA.
-*
-* Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
-*     Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
-*/
-
-package org.jboss.labs.admin;
-
-import org.jboss.labs.core.model.admin.ProjectRequest;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Logger;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.log.Log;
-
-
- at Name("notifier")
-public class Notifier {
-    
-    @In(create = true) private ProjectRequest projectRequest;
-
-    @Logger private Log log;
-
-     public void newRequest() {
-
-        log.info("New project request: " + projectRequest.getName());
-    }
-
-    public void projectApproved() {
-        
-        log.info("Project approved: " + projectRequest.getName());
-    }
-
-    public void projectRejected() {
-
-        log.info("Project rejected: " + projectRequest.getName());
-    }
-
-     public void projectCreated() {
-
-        log.info("Project created: " + projectRequest.getName());
-    }
-
-    public void createProjectFailed() {
-
-        log.info("Create project failed: " + projectRequest.getName());
-    }
-}
\ No newline at end of file

Modified: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/Pages.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/Pages.java	2008-02-20 14:31:16 UTC (rev 18527)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/Pages.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -34,4 +34,8 @@
     public static final String CREATE_PROJECT_PAGE    = "/createProject.seam";
     public static final String ERROR_PAGE        = "/error.seam";
     public static final String TICKET_PAGE       = "/ticket.seam";
+    public static final String PROJECT_PAGE      = "/project.seam";
+    public static final String JOIN_PROJECT_PAGE = "/joinProject.seam";
+    public static final String SIGN_CA_FIRST_PAGE = "/signCAfirst.seam";
+    public static final String JOIN_TICKET_PAGE  = "/joinTicket.seam";
 }

Deleted: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/ProjectManager.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/ProjectManager.java	2008-02-20 14:31:16 UTC (rev 18527)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/ProjectManager.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -1,65 +0,0 @@
-/*
-* JBoss Labs. http://labs.jboss.com/jbosslabs
-*
-* Copyright © 2008  Red Hat Middleware, LLC. All rights reserved.
-*
-* This copyrighted material is made available to anyone wishing to use,
-* modify, copy, or redistribute it subject to the terms and conditions
-* of the GNU Lesser General Public License, v. 2.1.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT A WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License, v.2.1 along with this distribution; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-* 02110-1301, USA.
-*
-* Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
-*     Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
-*/
-
-package org.jboss.labs.admin;
-
-import com.google.inject.Inject;
-import org.jboss.labs.core.model.Project;
-import org.jboss.labs.core.model.admin.ProjectRequest;
-import org.jboss.labs.core.service.ProjectService;
-import org.jboss.labs.injection.seam.Guice;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Logger;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.log.Log;
-
-import java.util.List;
-
-
- at Name("projectManager")
- at Guice
-public class ProjectManager {
-
-    @In(required = false) private ProjectRequest projectRequest;
-
-    @Inject private ProjectService projectService;
-
-    @Logger private Log log;
-
-    public boolean createProject() {
-
-        try {
-            projectService.createProject(projectRequest);
-        } catch (Exception e) {
-            log.warn(e);
-            e.printStackTrace();//DEBUG
-            return false;
-        }
-        
-        return true;
-    }
-
-    public List<Project> getProjects() {
-        return projectService.getProjects();
-    }
-}
\ No newline at end of file

Deleted: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/AcceptProject.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/AcceptProject.java	2008-02-20 14:31:16 UTC (rev 18527)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/AcceptProject.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -1,47 +0,0 @@
-/*
-* JBoss Labs. http://labs.jboss.com/jbosslabs
-*
-* Copyright © 2008  Red Hat Middleware, LLC. All rights reserved.
-*
-* This copyrighted material is made available to anyone wishing to use,
-* modify, copy, or redistribute it subject to the terms and conditions
-* of the GNU Lesser General Public License, v. 2.1.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT A WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License, v.2.1 along with this distribution; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-* 02110-1301, USA.
-*
-* Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
-*     Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
-*/
-
-package org.jboss.labs.admin.action;
-
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.bpm.EndTask;
-import org.jboss.seam.annotations.bpm.StartTask;
-import org.jboss.labs.admin.Pages;
-
-/**
- * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
- */
-
- at Name("acceptProject")
-public class AcceptProject {
-
-    @StartTask @EndTask(transition = "approve")
-    public String accept() {
-        return Pages.HOME_PAGE;
-    }
-
-    @StartTask @EndTask(transition = "reject")
-    public String reject() {
-        return Pages.HOME_PAGE;
-    }
-}
\ No newline at end of file

Deleted: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/CreateProjectRequest.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/CreateProjectRequest.java	2008-02-20 14:31:16 UTC (rev 18527)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/CreateProjectRequest.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -1,49 +0,0 @@
-/*
-* JBoss Labs. http://labs.jboss.com/jbosslabs
-*
-* Copyright © 2008  Red Hat Middleware, LLC. All rights reserved.
-*
-* This copyrighted material is made available to anyone wishing to use,
-* modify, copy, or redistribute it subject to the terms and conditions
-* of the GNU Lesser General Public License, v. 2.1.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT A WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License, v.2.1 along with this distribution; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-* 02110-1301, USA.
-*
-* Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
-*     Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
-*/
-
-package org.jboss.labs.admin.action;
-
-import org.jboss.labs.admin.Pages;
-import org.jboss.labs.core.model.admin.ProjectRequest;
-import org.jboss.labs.core.model.auth.User;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Out;
-
-
- at Name("createProject")
-public class CreateProjectRequest {
-
-    @Out(scope= ScopeType.SESSION) private ProjectRequest req;
-    //@In private User user; TODO uncomment after auth db is set up
-
-    public String create() {
-
-        req = new ProjectRequest();
-        req.setEmail("myemail at jboss.org");
-        //TODO change to req.setEmail(user.getEmail());
-
-        return Pages.CREATE_PROJECT_PAGE;
-    }
-}
\ No newline at end of file

Deleted: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/RequestProject.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/RequestProject.java	2008-02-20 14:31:16 UTC (rev 18527)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/RequestProject.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -1,67 +0,0 @@
-/*
-* JBoss Labs. http://labs.jboss.com/jbosslabs
-*
-* Copyright © 2008  Red Hat Middleware, LLC. All rights reserved.
-*
-* This copyrighted material is made available to anyone wishing to use,
-* modify, copy, or redistribute it subject to the terms and conditions
-* of the GNU Lesser General Public License, v. 2.1.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT A WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License, v.2.1 along with this distribution; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-* 02110-1301, USA.
-*
-* Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
-*     Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
-*/
-
-package org.jboss.labs.admin.action;
-
-import org.jboss.labs.admin.Pages;
-import org.jboss.labs.core.model.admin.ProjectRequest;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Out;
-import org.jboss.seam.annotations.bpm.CreateProcess;
-import org.jboss.seam.bpm.Actor;
-import org.jboss.seam.faces.FacesMessages;
-
-import javax.persistence.EntityManager;
-
-/**
- * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
- */
- at Name("requestProject")
-//@Scope(ScopeType.CONVERSATION)
-public class RequestProject {
-
-    @In private ProjectRequest req;
-
-    @Out(scope= ScopeType.BUSINESS_PROCESS) private Integer projectRequestId;
-
-    @In private Actor actor;
-    @In private FacesMessages facesMessages;
-
-    @In(create = true) private EntityManager entityManager;
-
-    @CreateProcess(definition = "createProject")
-    public String request() {
-
-        req.setLeadUsername(actor.getId());
-
-        entityManager.persist(req);
-
-        projectRequestId = req.getId();
-
-        facesMessages.add("Your request has been sent to BMW.");
-
-        return Pages.CONFIRMATION_PAGE;
-    }
-}
\ No newline at end of file

Deleted: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ReviewProjectRequest.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ReviewProjectRequest.java	2008-02-20 14:31:16 UTC (rev 18527)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ReviewProjectRequest.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -1,54 +0,0 @@
-/*
-* JBoss Labs. http://labs.jboss.com/jbosslabs
-*
-* Copyright © 2008  Red Hat Middleware, LLC. All rights reserved.
-*
-* This copyrighted material is made available to anyone wishing to use,
-* modify, copy, or redistribute it subject to the terms and conditions
-* of the GNU Lesser General Public License, v. 2.1.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT A WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License, v.2.1 along with this distribution; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-* 02110-1301, USA.
-*
-* Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
-*     Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
-*/
-
-package org.jboss.labs.admin.action;
-
-import org.jboss.labs.core.model.admin.ProjectRequest;
-import org.jboss.labs.admin.Pages;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Out;
-
-import javax.persistence.EntityManager;
-
-/**
- * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
- */
-
- at Name("reviewProjectRequest")
-public class ReviewProjectRequest {
-
-    @Out(required = false, scope= ScopeType.CONVERSATION) private long tId;
-    @Out(required = false, scope= ScopeType.CONVERSATION) private ProjectRequest prjRequest;
-
-    @In private EntityManager entityManager;
-
-    public String select(Long taskId, Integer projectRequestId) {
-
-        this.tId = taskId;
-        prjRequest = entityManager.find(ProjectRequest.class, projectRequestId);
-
-        return Pages.TICKET_PAGE;
-    }
-}
\ No newline at end of file

Deleted: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ViewProject.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ViewProject.java	2008-02-20 14:31:16 UTC (rev 18527)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ViewProject.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -1,54 +0,0 @@
-/*
-* JBoss Labs. http://labs.jboss.com/jbosslabs
-*
-* Copyright © 2008  Red Hat Middleware, LLC. All rights reserved.
-*
-* This copyrighted material is made available to anyone wishing to use,
-* modify, copy, or redistribute it subject to the terms and conditions
-* of the GNU Lesser General Public License, v. 2.1.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT A WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License, v.2.1 along with this distribution; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-* 02110-1301, USA.
-*
-* Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
-*     Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
-*/
-
-package org.jboss.labs.admin.action;
-
-import com.google.inject.Inject;
-import org.jboss.labs.core.model.Project;
-import org.jboss.labs.core.service.ProjectService;
-import org.jboss.labs.injection.seam.Guice;
-import org.jboss.labs.exception.admin.ProjectNotFoundException;
-import org.jboss.seam.annotations.Logger;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.web.RequestParameter;
-import org.jboss.seam.log.Log;
-
-
- at Name("viewProject")
- at Guice
-public class ViewProject {
-
-    @RequestParameter private String projectId;
-    
-    @Inject private ProjectService projectService;
-
-    @Logger private Log log;
-
-    public Project getProject() throws ProjectNotFoundException {
-
-        log.info("Project Id: " + projectId);
-
-        return projectService.getProject(projectId);
-    }
-
-}
\ No newline at end of file

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/AcceptProject.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/AcceptProject.java	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/AcceptProject.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -0,0 +1,47 @@
+/*
+* JBoss Labs. http://labs.jboss.com/jbosslabs
+*
+* Copyright © 2008  Red Hat Middleware, LLC. All rights reserved.
+*
+* This copyrighted material is made available to anyone wishing to use,
+* modify, copy, or redistribute it subject to the terms and conditions
+* of the GNU Lesser General Public License, v. 2.1.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT A WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License, v.2.1 along with this distribution; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+* 02110-1301, USA.
+*
+* Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
+*     Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
+*/
+
+package org.jboss.labs.admin.action.project;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.bpm.EndTask;
+import org.jboss.seam.annotations.bpm.StartTask;
+import org.jboss.labs.admin.Pages;
+
+/**
+ * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
+ */
+
+ at Name("acceptProject")
+public class AcceptProject {
+
+    @StartTask @EndTask(transition = "approve")
+    public String accept() {
+        return Pages.HOME_PAGE;
+    }
+
+    @StartTask @EndTask(transition = "reject")
+    public String reject() {
+        return Pages.HOME_PAGE;
+    }
+}
\ No newline at end of file

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/CreateProjectRequest.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/CreateProjectRequest.java	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/CreateProjectRequest.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -0,0 +1,49 @@
+/*
+* JBoss Labs. http://labs.jboss.com/jbosslabs
+*
+* Copyright © 2008  Red Hat Middleware, LLC. All rights reserved.
+*
+* This copyrighted material is made available to anyone wishing to use,
+* modify, copy, or redistribute it subject to the terms and conditions
+* of the GNU Lesser General Public License, v. 2.1.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT A WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License, v.2.1 along with this distribution; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+* 02110-1301, USA.
+*
+* Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
+*     Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
+*/
+
+package org.jboss.labs.admin.action.project;
+
+import org.jboss.labs.admin.Pages;
+import org.jboss.labs.core.model.admin.ProjectRequest;
+import org.jboss.labs.core.model.auth.User;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+
+
+ at Name("createProject")
+public class CreateProjectRequest {
+
+    @Out(scope= ScopeType.SESSION) private ProjectRequest req;
+    //@In private User user; TODO uncomment after auth db is set up
+
+    public String create() {
+
+        req = new ProjectRequest();
+        req.setEmail("myemail at jboss.org");
+        //TODO change to req.setEmail(user.getEmail());
+
+        return Pages.CREATE_PROJECT_PAGE;
+    }
+}
\ No newline at end of file

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/Notifier.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/Notifier.java	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/Notifier.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -0,0 +1,64 @@
+/*
+* JBoss Labs. http://labs.jboss.com/jbosslabs
+*
+* Copyright © 2008  Red Hat Middleware, LLC. All rights reserved.
+*
+* This copyrighted material is made available to anyone wishing to use,
+* modify, copy, or redistribute it subject to the terms and conditions
+* of the GNU Lesser General Public License, v. 2.1.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT A WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License, v.2.1 along with this distribution; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+* 02110-1301, USA.
+*
+* Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
+*     Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
+*/
+
+package org.jboss.labs.admin.action.project;
+
+import org.jboss.labs.core.model.admin.ProjectRequest;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.log.Log;
+
+
+ at Name("notifier")
+public class Notifier {
+    
+    @In(create = true) private ProjectRequest projectRequest;
+
+    @Logger private Log log;
+
+     public void newRequest() {
+
+        log.info("New project request: " + projectRequest.getName());
+    }
+
+    public void projectApproved() {
+        
+        log.info("Project approved: " + projectRequest.getName());
+    }
+
+    public void projectRejected() {
+
+        log.info("Project rejected: " + projectRequest.getName());
+    }
+
+     public void projectCreated() {
+
+        log.info("Project created: " + projectRequest.getName());
+    }
+
+    public void createProjectFailed() {
+
+        log.info("Create project failed: " + projectRequest.getName());
+    }
+}
\ No newline at end of file

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/ProjectManager.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/ProjectManager.java	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/ProjectManager.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -0,0 +1,65 @@
+/*
+* JBoss Labs. http://labs.jboss.com/jbosslabs
+*
+* Copyright © 2008  Red Hat Middleware, LLC. All rights reserved.
+*
+* This copyrighted material is made available to anyone wishing to use,
+* modify, copy, or redistribute it subject to the terms and conditions
+* of the GNU Lesser General Public License, v. 2.1.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT A WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License, v.2.1 along with this distribution; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+* 02110-1301, USA.
+*
+* Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
+*     Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
+*/
+
+package org.jboss.labs.admin.action.project;
+
+import com.google.inject.Inject;
+import org.jboss.labs.core.model.Project;
+import org.jboss.labs.core.model.admin.ProjectRequest;
+import org.jboss.labs.core.service.ProjectService;
+import org.jboss.labs.injection.seam.Guice;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.log.Log;
+
+import java.util.List;
+
+
+ at Name("projectManager")
+ at Guice
+public class ProjectManager {
+
+    @In(required = false) private ProjectRequest projectRequest;
+
+    @Inject private ProjectService projectService;
+
+    @Logger private Log log;
+
+    public boolean addUserToProject() {
+
+        try {
+            projectService.createProject(projectRequest);
+        } catch (Exception e) {
+            log.warn(e);
+            e.printStackTrace();//DEBUG
+            return false;
+        }
+        
+        return true;
+    }
+
+    public List<Project> getProjects() {
+        return projectService.getProjects();
+    }
+}
\ No newline at end of file

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/RequestProject.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/RequestProject.java	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/RequestProject.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -0,0 +1,67 @@
+/*
+* JBoss Labs. http://labs.jboss.com/jbosslabs
+*
+* Copyright © 2008  Red Hat Middleware, LLC. All rights reserved.
+*
+* This copyrighted material is made available to anyone wishing to use,
+* modify, copy, or redistribute it subject to the terms and conditions
+* of the GNU Lesser General Public License, v. 2.1.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT A WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License, v.2.1 along with this distribution; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+* 02110-1301, USA.
+*
+* Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
+*     Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
+*/
+
+package org.jboss.labs.admin.action.project;
+
+import org.jboss.labs.admin.Pages;
+import org.jboss.labs.core.model.admin.ProjectRequest;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.bpm.CreateProcess;
+import org.jboss.seam.bpm.Actor;
+import org.jboss.seam.faces.FacesMessages;
+
+import javax.persistence.EntityManager;
+
+/**
+ * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
+ */
+ at Name("requestProject")
+//@Scope(ScopeType.CONVERSATION)
+public class RequestProject {
+
+    @In private ProjectRequest req;
+
+    @Out(scope= ScopeType.BUSINESS_PROCESS) private Integer projectRequestId;
+
+    @In private Actor actor;
+    @In private FacesMessages facesMessages;
+
+    @In(create = true) private EntityManager entityManager;
+
+    @CreateProcess(definition = "createProject")
+    public String request() {
+
+        req.setLeadUsername(actor.getId());
+
+        entityManager.persist(req);
+
+        projectRequestId = req.getId();
+
+        facesMessages.add("Your request has been sent to BMW.");
+
+        return Pages.CONFIRMATION_PAGE;
+    }
+}
\ No newline at end of file

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/ReviewProjectRequest.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/ReviewProjectRequest.java	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/ReviewProjectRequest.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -0,0 +1,54 @@
+/*
+* JBoss Labs. http://labs.jboss.com/jbosslabs
+*
+* Copyright © 2008  Red Hat Middleware, LLC. All rights reserved.
+*
+* This copyrighted material is made available to anyone wishing to use,
+* modify, copy, or redistribute it subject to the terms and conditions
+* of the GNU Lesser General Public License, v. 2.1.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT A WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License, v.2.1 along with this distribution; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+* 02110-1301, USA.
+*
+* Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
+*     Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
+*/
+
+package org.jboss.labs.admin.action.project;
+
+import org.jboss.labs.core.model.admin.ProjectRequest;
+import org.jboss.labs.admin.Pages;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+
+import javax.persistence.EntityManager;
+
+/**
+ * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
+ */
+
+ at Name("reviewProjectRequest")
+public class ReviewProjectRequest {
+
+    @Out(required = false, scope= ScopeType.CONVERSATION) private long tId;
+    @Out(required = false, scope= ScopeType.CONVERSATION) private ProjectRequest prjRequest;
+
+    @In private EntityManager entityManager;
+
+    public String select(Long taskId, Integer projectRequestId) {
+
+        this.tId = taskId;
+        prjRequest = entityManager.find(ProjectRequest.class, projectRequestId);
+
+        return Pages.TICKET_PAGE;
+    }
+}
\ No newline at end of file

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/ViewProject.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/ViewProject.java	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/project/ViewProject.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -0,0 +1,67 @@
+/*
+* JBoss Labs. http://labs.jboss.com/jbosslabs
+*
+* Copyright © 2008  Red Hat Middleware, LLC. All rights reserved.
+*
+* This copyrighted material is made available to anyone wishing to use,
+* modify, copy, or redistribute it subject to the terms and conditions
+* of the GNU Lesser General Public License, v. 2.1.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT A WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License, v.2.1 along with this distribution; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+* 02110-1301, USA.
+*
+* Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
+*     Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
+*/
+
+package org.jboss.labs.admin.action.project;
+
+import com.google.inject.Inject;
+import org.jboss.labs.core.model.Project;
+import org.jboss.labs.core.service.ProjectService;
+import org.jboss.labs.injection.seam.Guice;
+import org.jboss.labs.exception.admin.ProjectNotFoundException;
+import org.jboss.labs.admin.Pages;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.web.RequestParameter;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.ScopeType;
+
+
+ at Name("viewProject")
+ at Guice
+public class ViewProject {
+
+   // @RequestParameter private String projectId;
+    
+    @Inject private ProjectService projectService;
+
+    @Logger private Log log;
+
+    @Out(scope = ScopeType.SESSION) private Project project;
+
+    public String view(String projectId) throws ProjectNotFoundException {
+
+        project = projectService.getProject(projectId);
+        
+        return Pages.PROJECT_PAGE;    
+    }
+
+//    public Project getProject() throws ProjectNotFoundException {
+//
+//        log.info("Project Id: " + projectId);
+//
+//        return projectService.getProject(projectId);
+//    }
+
+}
\ No newline at end of file

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/AcceptJoin.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/AcceptJoin.java	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/AcceptJoin.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -0,0 +1,47 @@
+/*
+* JBoss Labs. http://labs.jboss.com/jbosslabs
+*
+* Copyright © 2008  Red Hat Middleware, LLC. All rights reserved.
+*
+* This copyrighted material is made available to anyone wishing to use,
+* modify, copy, or redistribute it subject to the terms and conditions
+* of the GNU Lesser General Public License, v. 2.1.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT A WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License, v.2.1 along with this distribution; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+* 02110-1301, USA.
+*
+* Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
+*     Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
+*/
+
+package org.jboss.labs.admin.action.user;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.bpm.EndTask;
+import org.jboss.seam.annotations.bpm.StartTask;
+import org.jboss.labs.admin.Pages;
+
+/**
+ * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
+ */
+
+ at Name("acceptJoin")
+public class AcceptJoin {
+
+    @StartTask @EndTask(transition = "approve")
+    public String accept() {
+        return Pages.HOME_PAGE;
+    }
+
+    @StartTask @EndTask(transition = "reject")
+    public String reject() {
+        return Pages.HOME_PAGE;
+    }
+}
\ No newline at end of file

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/JoinNotifier.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/JoinNotifier.java	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/JoinNotifier.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -0,0 +1,53 @@
+/*
+* JBoss Labs. http://labs.jboss.com/jbosslabs
+*
+* Copyright © 2008  Red Hat Middleware, LLC. All rights reserved.
+*
+* This copyrighted material is made available to anyone wishing to use,
+* modify, copy, or redistribute it subject to the terms and conditions
+* of the GNU Lesser General Public License, v. 2.1.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT A WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License, v.2.1 along with this distribution; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+* 02110-1301, USA.
+*
+* Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
+*     Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
+*/
+
+package org.jboss.labs.admin.action.user;
+
+import org.jboss.labs.core.model.admin.ProjectRequest;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.log.Log;
+
+
+ at Name("joinNotifier")
+public class JoinNotifier {
+
+    @Logger private Log log;
+
+    public void newRequest() {
+        log.info("New join request.");
+    }
+
+    public void approved() {
+        log.info("Reqest approved.");
+    }
+
+    public void rejected() {
+        log.info("Request rejected.");
+    }
+
+    public void userAdded() {
+        log.info("User added");
+    }
+}
\ No newline at end of file

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/JoinProject.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/JoinProject.java	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/JoinProject.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -0,0 +1,88 @@
+/*
+* JBoss Labs. http://labs.jboss.com/jbosslabs
+*
+* Copyright © 2008  Red Hat Middleware, LLC. All rights reserved.
+*
+* This copyrighted material is made available to anyone wishing to use,
+* modify, copy, or redistribute it subject to the terms and conditions
+* of the GNU Lesser General Public License, v. 2.1.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT A WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License, v.2.1 along with this distribution; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+* 02110-1301, USA.
+*
+* Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
+*     Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
+*/
+
+package org.jboss.labs.admin.action.user;
+
+import org.jboss.labs.admin.Pages;
+import org.jboss.labs.core.model.admin.ProjectRequest;
+import org.jboss.labs.core.model.admin.JoinRequest;
+import org.jboss.labs.core.model.auth.User;
+import org.jboss.labs.core.model.Project;
+import org.jboss.labs.core.model.ContributorAgreement;
+import org.jboss.labs.core.service.ProjectService;
+import org.jboss.labs.injection.seam.Guice;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.bpm.CreateProcess;
+import com.google.inject.Inject;
+
+import javax.persistence.EntityManager;
+import java.util.List;
+
+
+ at Name("joinProject")
+ at Guice
+public class JoinProject {
+
+    @In private Project project;
+    @In private User user;
+
+    @Inject private ProjectService projectService;
+
+    @Out(required = false) private List<ContributorAgreement> cas;
+
+    @In private FacesMessages facesMessages;
+    @Out(required = false, scope= ScopeType.BUSINESS_PROCESS) private Integer joinRequestId;
+    @In(create = true) private EntityManager entityManager;
+
+    public String join() {
+
+        if (projectService.canJoin(user.getName(), project)) {
+
+            return Pages.JOIN_PROJECT_PAGE;
+
+        } else {
+
+            cas = projectService.getCAsRequiredToJoin(user.getName(), project);
+
+            return Pages.SIGN_CA_FIRST_PAGE;
+        }
+    }
+
+
+    @CreateProcess(definition = "joinProject")
+    public String createRequest() {
+
+        facesMessages.add("Your request has been sent to the project lead.");
+
+        JoinRequest jr = new JoinRequest(project.getProjectId(), user.getName());
+        entityManager.persist(jr);
+
+        joinRequestId = jr.getId();
+
+        return Pages.CONFIRMATION_PAGE;
+    }
+}
\ No newline at end of file

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/ReviewJoinRequest.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/ReviewJoinRequest.java	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/ReviewJoinRequest.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -0,0 +1,55 @@
+/*
+* JBoss Labs. http://labs.jboss.com/jbosslabs
+*
+* Copyright © 2008  Red Hat Middleware, LLC. All rights reserved.
+*
+* This copyrighted material is made available to anyone wishing to use,
+* modify, copy, or redistribute it subject to the terms and conditions
+* of the GNU Lesser General Public License, v. 2.1.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT A WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License, v.2.1 along with this distribution; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+* 02110-1301, USA.
+*
+* Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
+*     Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
+*/
+
+package org.jboss.labs.admin.action.user;
+
+import org.jboss.labs.core.model.admin.ProjectRequest;
+import org.jboss.labs.core.model.admin.JoinRequest;
+import org.jboss.labs.admin.Pages;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+
+import javax.persistence.EntityManager;
+
+/**
+ * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
+ */
+
+ at Name("reviewJoinRequest")
+public class ReviewJoinRequest {
+
+    @Out(required = false, scope= ScopeType.CONVERSATION) private long tId;
+    @Out(required = false, scope= ScopeType.CONVERSATION) private JoinRequest jRequest;
+
+    @In private EntityManager entityManager;
+
+    public String select(Long taskId, Integer joinRequestId) {
+
+        this.tId = taskId;
+        jRequest = entityManager.find(JoinRequest.class, joinRequestId);
+
+        return Pages.JOIN_TICKET_PAGE;
+    }
+}
\ No newline at end of file

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/UserManager.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/UserManager.java	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/user/UserManager.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -0,0 +1,51 @@
+/*
+* JBoss Labs. http://labs.jboss.com/jbosslabs
+*
+* Copyright © 2008  Red Hat Middleware, LLC. All rights reserved.
+*
+* This copyrighted material is made available to anyone wishing to use,
+* modify, copy, or redistribute it subject to the terms and conditions
+* of the GNU Lesser General Public License, v. 2.1.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT A WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License, v.2.1 along with this distribution; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+* 02110-1301, USA.
+*
+* Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
+*     Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
+*/
+
+package org.jboss.labs.admin.action.user;
+
+import com.google.inject.Inject;
+import org.jboss.labs.core.model.Project;
+import org.jboss.labs.core.model.admin.ProjectRequest;
+import org.jboss.labs.core.service.ProjectService;
+import org.jboss.labs.injection.seam.Guice;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.log.Log;
+
+import java.util.List;
+
+
+ at Name("userManager")
+ at Guice
+public class UserManager {
+
+    @Logger private Log log;
+
+    public boolean addUserToProject() {
+
+        log.info("addUserToProject");
+
+        return true;
+    }
+}
\ No newline at end of file

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/validator/EmailValidator.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/validator/EmailValidator.java	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/validator/EmailValidator.java	2008-02-20 15:11:55 UTC (rev 18528)
@@ -0,0 +1,56 @@
+/*
+* JBoss Labs. http://labs.jboss.com/jbosslabs
+*
+* Copyright © 2008  Red Hat Middleware, LLC. All rights reserved.
+*
+* This copyrighted material is made available to anyone wishing to use,
+* modify, copy, or redistribute it subject to the terms and conditions
+* of the GNU Lesser General Public License, v. 2.1.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT A WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License, v.2.1 along with this distribution; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+* 02110-1301, USA.
+*
+* Red Hat Author(s): Bob McWhirter, Przemyslaw Dej, Ryszard Kozmik,
+*     Tomasz Szymanski, Adam Warski, Pawel Wrzeszcz
+*/
+
+package org.jboss.labs.admin.validator;
+
+import com.google.inject.Inject;
+import org.jboss.labs.core.service.ProjectService;
+import org.jboss.labs.exception.admin.ProjectNotFoundException;
+import org.jboss.labs.injection.seam.Guice;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.faces.Validator;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.ValidatorException;
+
+/**
+ * @author Pawel Wrzeszcz (pwrzeszcz [at] jboss . org)
+ */
+ at Name("emailValidator")
+ at Validator
+public class EmailValidator implements javax.faces.validator.Validator {
+
+    public void validate(FacesContext facesContext, UIComponent uiComponent, Object o) throws ValidatorException {
+
+        org.hibernate.validator.EmailValidator ev = new org.hibernate.validator.EmailValidator();
+
+        ev.initialize(null);
+
+        if (!ev.isValid(o)) {
+            String msg = org.jboss.seam.international.Messages.instance().get("validator.email");
+            throw new ValidatorException(new FacesMessage(msg));
+        }
+    }
+}
\ No newline at end of file

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/resources/messages_en.properties
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/resources/messages_en.properties	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/resources/messages_en.properties	2008-02-20 15:11:55 UTC (rev 18528)
@@ -0,0 +1,92 @@
+up=\u2191
+down=\u2193
+left=\u2039
+right=\u203A
+
+validator.assertFalse=validation failed
+validator.assertTrue=validation failed
+validator.future=must be a future date
+validator.length=length must be between {min} and {max}
+validator.max=must be less than or equal to {value}
+validator.min=must be greater than or equal to {value}
+validator.notNull=may not be null
+validator.past=must be a past date
+validator.pattern=must match "{regex}"
+validator.range=must be between {min} and {max}
+validator.size=size must be between {min} and {max}
+validator.email=must be a well-formed email address	
+
+org.jboss.seam.loginFailed=Login failed
+org.jboss.seam.loginSuccessful=Welcome, #0
+
+org.jboss.seam.TransactionFailed=Transaction failed
+org.jboss.seam.NoConversation=The conversation ended, timed out or was processing another request
+org.jboss.seam.IllegalNavigation=Illegal navigation
+org.jboss.seam.ProcessEnded=Process #0 already ended
+org.jboss.seam.ProcessNotFound=Process #0 not found
+org.jboss.seam.TaskEnded=Task #0 already ended
+org.jboss.seam.TaskNotFound=Task #0 not found
+org.jboss.seam.NotLoggedIn=Please log in first
+
+javax.faces.component.UIInput.CONVERSION=value could not be converted to the expected type
+javax.faces.component.UIInput.REQUIRED=value is required
+javax.faces.component.UIInput.UPDATE=an error occurred when processing your submitted information
+javax.faces.component.UISelectOne.INVALID=value is not valid
+javax.faces.component.UISelectMany.INVALID=value is not valid
+
+javax.faces.converter.BigDecimalConverter.DECIMAL=value must be a number
+javax.faces.converter.BigDecimalConverter.DECIMAL_detail=value must be a signed decimal number consisting of zero or more digits, optionally followed by a decimal point and fraction, eg. {1}
+javax.faces.converter.BigIntegerConverter.BIGINTEGER=value must be a number
+javax.faces.converter.BigIntegerConverter.BIGINTEGER_detail=value must be a signed integer number consisting of zero or more digits
+javax.faces.converter.BooleanConverter.BOOLEAN=value must be true or false
+javax.faces.converter.BooleanConverter.BOOLEAN_detail=value must be true or false (any value other than true will evaluate to false)
+javax.faces.converter.ByteConverter.BYTE=value must be a number between 0 and 255
+javax.faces.converter.ByteConverter.BYTE_detail=value must be a number between 0 and 255
+javax.faces.converter.CharacterConverter.CHARACTER=value must be a character
+javax.faces.converter.CharacterConverter.CHARACTER_detail=value must be a valid ASCII character
+javax.faces.converter.DateTimeConverter.DATE=value must be a date
+javax.faces.converter.DateTimeConverter.DATE_detail=value must be a date,  eg. {1}
+javax.faces.converter.DateTimeConverter.TIME=value must be a time
+javax.faces.converter.DateTimeConverter.TIME_detail=value must be a time,  eg. {1}
+javax.faces.converter.DateTimeConverter.DATETIME=value must be a date and time
+javax.faces.converter.DateTimeConverter.DATETIME_detail=value must be a date and time,  eg. {1}
+javax.faces.converter.DateTimeConverter.PATTERN_TYPE=a pattern or type attribute must be specified to convert the value
+javax.faces.converter.DoubleConverter.DOUBLE=value must be a number
+javax.faces.converter.DoubleConverter.DOUBLE_detail=value must be a number between 4.9E-324 and 1.7976931348623157E308
+javax.faces.converter.EnumConverter.ENUM=value must be convertible to an enum
+javax.faces.converter.EnumConverter.ENUM_detail=value must be convertible to an enum or from the enum that contains the constant {1}
+javax.faces.converter.EnumConverter.ENUM_NO_CLASS=value must be convertible to an enum or from the enum, but no enum class provided
+javax.faces.converter.EnumConverter.ENUM_NO_CLASS_detail=value must be convertible to an enum or from the enum, but no enum class provided
+javax.faces.converter.FloatConverter.FLOAT=value must be a number
+javax.faces.converter.FloatConverter.FLOAT_detail=value must be a number between 1.4E-45 and 3.4028235E38
+javax.faces.converter.IntegerConverter.INTEGER=value must be a number
+javax.faces.converter.IntegerConverter.INTEGER_detail=value must be a number between -2147483648 and 2147483647
+javax.faces.converter.LongConverter.LONG=value must be a number
+javax.faces.converter.LongConverter.LONG_detail=must be a number between -9223372036854775808 and 9223372036854775807
+javax.faces.converter.NumberConverter.CURRENCY=value must be a currency amount
+javax.faces.converter.NumberConverter.CURRENCY_detail=value must be a currency amount, eg. {1}
+javax.faces.converter.NumberConverter.PERCENT=value must be a percentage amount
+javax.faces.converter.NumberConverter.PERCENT_detail=value must be a percentage amount, eg. {1}
+javax.faces.converter.NumberConverter.NUMBER=value must be a number
+javax.faces.converter.NumberConverter.NUMBER_detail=value must be a number
+javax.faces.converter.NumberConverter.PATTERN=value must be a number
+javax.faces.converter.NumberConverter.PATTERN_detail=value must be a number
+javax.faces.converter.ShortConverter.SHORT=value must be a number
+javax.faces.converter.ShortConverter.SHORT_detail=value must be a number between -32768 and 32767
+
+javax.faces.validator.DoubleRangeValidator.MAXIMUM=value must be less than or equal to {0}
+javax.faces.validator.DoubleRangeValidator.MINIMUM=value must be greater than or equal to {0}
+javax.faces.validator.DoubleRangeValidator.NOT_IN_RANGE=value must be between {0} and {1}
+javax.faces.validator.DoubleRangeValidator.TYPE=value is not of the correct type
+javax.faces.validator.LengthValidator.MAXIMUM=value is must be shorter than or equal to {0} characters
+javax.faces.validator.LengthValidator.MINIMUM=value is must be longer than or equal to {0} characters
+javax.faces.validator.LongRangeValidator.MAXIMUM=value must be less than or equal to {0}
+javax.faces.validator.LongRangeValidator.MINIMUM=value must be greater than or equal to {0}
+javax.faces.validator.LongRangeValidator.NOT_IN_RANGE=value must be between {0} and {1}
+javax.faces.validator.LongRangeValidator.TYPE=value is not of the correct type
+
+javax.faces.validator.NOT_IN_RANGE=value must be between {0} and {1}
+javax.faces.converter.STRING=value could not be converted to a string
+
+org.apache.myfaces.Date.INVALID=Invalid date
+

Modified: labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/META-INF/persistence.xml
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/META-INF/persistence.xml	2008-02-20 14:31:16 UTC (rev 18527)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/META-INF/persistence.xml	2008-02-20 15:11:55 UTC (rev 18528)
@@ -11,6 +11,7 @@
                                   value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
                 </properties>
                <class>org.jboss.labs.core.model.admin.ProjectRequest</class>
+               <class>org.jboss.labs.core.model.admin.JoinRequest</class>
         </persistence-unit>
 </persistence>
 

Modified: labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/WEB-INF/components.xml
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/WEB-INF/components.xml	2008-02-20 14:31:16 UTC (rev 18527)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/WEB-INF/components.xml	2008-02-20 15:11:55 UTC (rev 18528)
@@ -18,12 +18,18 @@
                  http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd
                  http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.0.xsd">
 
-   <core:init debug="@debug@" jndi-pattern="@jndiPattern@"/>
+   <core:init debug="true" jndi-pattern="@jndiPattern@"/>
      
    <core:manager concurrent-request-timeout="500" 
                  conversation-timeout="120000" 
                  conversation-id-parameter="cid"/>
 
+    <core:resource-loader>
+           <core:bundle-names>
+                        <value>messages</value>
+           </core:bundle-names>
+   </core:resource-loader>
+
   <!-- <transaction:entity-transaction entity-manager="#{entityManager}"/>-->
 
   <persistence:entity-manager-factory name="admin"/>
@@ -48,6 +54,7 @@
    <bpm:jbpm>
       <bpm:process-definitions>
             <value>createProject.jpdl.xml</value>
+            <value>joinProject.jpdl.xml</value>
       </bpm:process-definitions>
    </bpm:jbpm>
 

Modified: labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/WEB-INF/web.xml
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/WEB-INF/web.xml	2008-02-20 14:31:16 UTC (rev 18527)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/WEB-INF/web.xml	2008-02-20 15:11:55 UTC (rev 18528)
@@ -38,11 +38,15 @@
    </servlet-mapping>
                                                                                                                               
    <!-- Facelets development mode (disable in production) -->
-   
-   <context-param>
-      <param-name>facelets.DEVELOPMENT</param-name>
-      <param-value>true</param-value>
-   </context-param>
+
+    <context-param>
+        <param-name>facelets.DEVELOPMENT</param-name>
+        <param-value>true</param-value>
+    </context-param>
+    <context-param>
+        <param-name>facelets.REFRESH_PERIOD</param-name>
+        <param-value>0</param-value>
+    </context-param>
     
    <!-- JSF -->
    

Modified: labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/createProject.jpdl.xml
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/createProject.jpdl.xml	2008-02-20 14:31:16 UTC (rev 18527)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/createProject.jpdl.xml	2008-02-20 15:11:55 UTC (rev 18528)
@@ -24,9 +24,9 @@
 
     <decision name="create" expression="#{projectManager.createProject}">
         <transition name="true" to="done">
-            <!--<condition expression="#{projectRequest.jira}">-->
+            <condition expression="#{projectRequest.jira}">
                 <action expression="#{mailer.sendJiraRequest}"/>
-            <!--</condition>-->
+            </condition>
             <action expression="#{notifier.projectCreated}"/>
         </transition>
         <transition name="false" to="done">

Modified: labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/createProject.xhtml
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/createProject.xhtml	2008-02-20 14:31:16 UTC (rev 18527)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/createProject.xhtml	2008-02-20 15:11:55 UTC (rev 18528)
@@ -15,11 +15,14 @@
         <f:facet name="header">Create Project Request</f:facet>
         <h:form id="mainForm" >
             <h:messages styleClass="message" id="messages"/>
+             <s:validateAll>
              <table>
                 <tr>
-                    <th>Email:</th>
+                    <th>Email (TODO: get email from UserService):</th>
                     <td>
-                        <h:inputText value="#{req.email}" required="true" id="email" requiredMessage="Email is required"/>
+                        <h:inputText value="#{req.email}" required="true" id="email" requiredMessage="Email is required">
+                            <f:validator validatorId="emailValidator"/>
+                        </h:inputText>
                     </td>
                 </tr>
                  <tr>
@@ -57,6 +60,7 @@
                     </td>
                 </tr>
             </table>
+            </s:validateAll>
             <h:commandButton value="Submit" action="#{requestProject.request}" />
         </h:form>
     </rich:panel>

Modified: labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/home.xhtml
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/home.xhtml	2008-02-20 14:31:16 UTC (rev 18527)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/home.xhtml	2008-02-20 15:11:55 UTC (rev 18528)
@@ -27,8 +27,12 @@
               </h:column>
                <h:column>
                    <f:facet name="header">Description</f:facet>
-                   <h:commandLink value="#{task.description}"
-                                  action="#{reviewProjectRequest.select(task.id, task.variables['projectRequestId'])}" />
+                   <h:commandLink value="#{task.description} (CP)"
+                                  action="#{reviewProjectRequest.select(task.id, task.variables['projectRequestId'])}"
+                                  rendered="#{not empty (task.variables['projectRequestId'])}"/>
+                   <h:commandLink value="#{task.description} (JP)"
+                                  action="#{reviewJoinRequest.select(task.id, task.variables['joinRequestId'])}"
+                                  rendered="#{not empty (task.variables['joinRequestId'])}"/>
               </h:column>
           </h:dataTable>
 
@@ -42,10 +46,7 @@
                </h:column>
                <h:column>
                    <f:facet name="header">Name</f:facet>
-                   <h:outputLink value="project.seam">
-                       #{project.name}
-                       <f:param name="projectId" value="#{project.projectId}" />
-                   </h:outputLink>
+                   <h:commandLink value="#{project.name}" action="#{viewProject.view(project.projectId)}"/>
                </h:column>
            </h:dataTable>
             

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/joinProject.jpdl.xml
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/joinProject.jpdl.xml	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/joinProject.jpdl.xml	2008-02-20 15:11:55 UTC (rev 18528)
@@ -0,0 +1,36 @@
+<process-definition
+	name="joinProject"
+	xmlns="urn:jbpm.org:jpdl-3.2"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="urn:jbpm.org:jpdl-3.2 http://jbpm.org/xsd/jpdl-3.2.xsd">
+
+   <start-state name="start">
+      <transition to="decide">
+           <action expression="#{joinNotifier.newRequest}" />
+      </transition>
+   </start-state>
+
+   <task-node name="decide">
+        <task name="approve" description="Join project request from #{joinRequest.username}">
+           <assignment pooled-actors="reviewer"/>
+        </task>
+        <transition name="approve" to="add">
+             <action expression="#{joinNotifier.approved}"/>
+        </transition>
+        <transition name="reject"  to="done">
+            <action expression="#{joinNotifier.rejected}"/>
+        </transition>
+    </task-node>
+
+    <decision name="add" expression="#{userManager.addUserToProject}">
+        <transition name="true" to="done">
+            <action expression="#{joinNotifier.userAdded}"/>
+        </transition>
+        <transition name="false" to="done">
+            <action expression="#{joinNotifier.addFailed}"/>
+        </transition>
+    </decision>
+
+   <end-state name="done"/>
+
+</process-definition>
\ No newline at end of file

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/joinProject.xhtml
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/joinProject.xhtml	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/joinProject.xhtml	2008-02-20 15:11:55 UTC (rev 18528)
@@ -0,0 +1,24 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+                xmlns:s="http://jboss.com/products/seam/taglib"
+                xmlns:ui="http://java.sun.com/jsf/facelets"
+                xmlns:f="http://java.sun.com/jsf/core"
+                xmlns:h="http://java.sun.com/jsf/html"
+                xmlns:rich="http://richfaces.org/rich"
+                xmlns:a4j="http://richfaces.org/a4j"
+                template="layout/template.xhtml">
+
+<ui:define name="body">
+    
+    <rich:panel>
+        <f:facet name="header">Join Project</f:facet>
+        <h:form id="mainForm" >
+            Do you want to apply to join project #{project.name}?
+            <h:commandButton value="OK" action="#{joinProject.createRequest}"/>
+            <h:commandButton value="Cancel" action="/project.seam"/>
+        </h:form>
+    </rich:panel>
+    
+</ui:define> 
+</ui:composition>

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/joinTicket.xhtml
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/joinTicket.xhtml	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/joinTicket.xhtml	2008-02-20 15:11:55 UTC (rev 18528)
@@ -0,0 +1,32 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+                xmlns:s="http://jboss.com/products/seam/taglib"
+                xmlns:ui="http://java.sun.com/jsf/facelets"
+                xmlns:f="http://java.sun.com/jsf/core"
+                xmlns:h="http://java.sun.com/jsf/html"
+                xmlns:rich="http://richfaces.org/rich"
+                template="layout/template.xhtml">
+
+<ui:define name="body">
+
+    <h:messages globalOnly="true" styleClass="message"/>
+
+    <rich:panel>
+        <f:facet name="header">Review join project request</f:facet>
+        User #{jRequest.username} wants to join project #{jRequest.projectId}.
+        <h:form id="mainForm">
+            <h:commandLink value="Accept" action="#{acceptJoin.accept}" >
+                <f:param name="taskId" value="#{tId}" />
+            </h:commandLink>
+            <span/>
+            <h:commandLink value="Reject" action="#{acceptJoin.reject}" >
+                <f:param name="taskId" value="#{tId}" />
+            </h:commandLink>
+            <span/>
+            <h:commandLink value="Cancel" action="/home.seam" />
+        </h:form>
+    </rich:panel>
+
+</ui:define> 
+</ui:composition>

Modified: labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/project.xhtml
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/project.xhtml	2008-02-20 14:31:16 UTC (rev 18527)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/project.xhtml	2008-02-20 15:11:55 UTC (rev 18528)
@@ -18,23 +18,23 @@
             <table>
                 <tr>
                     <th>Project Name:</th>
-                    <td>#{viewProject.project.name}</td>
+                    <td>#{project.name}</td>
                 </tr>
                 <tr>
-                    <th>JIRA:</th>
-                    <td>#{viewProject.project.jira}</td>
+                    <th>#{(empty project.issueTracker) ? '' : project.issueTracker.type} Issue Tracker:</th>
+                    <td>#{project.issueTracker.url}</td>
                 </tr>
                 <tr>
-                    <th>#{(empty viewProject.project.commiterRepository) ? '' : viewProject.project.repositoryType} repository:</th>
+                    <th>#{(empty project.commiterRepository) ? '' : project.repositoryType} Repository:</th>
                     <td>
-                        #{viewProject.project.anonymusRepository}<br/>
-                        #{viewProject.project.commiterRepository}
+                        #{project.anonymusRepository}<br/>
+                        #{project.commiterRepository}
                     </td>
                 </tr>
                 <tr>
                     <th>Leads:</th>
                     <td>
-                        <ui:repeat var="lead" value="#{viewProject.project.projectLeads}">
+                        <ui:repeat var="lead" value="#{project.projectLeads}">
                             #{lead.username}
                         </ui:repeat>
                     </td>
@@ -42,9 +42,10 @@
                 <tr>
                     <th>Contributors:</th>
                     <td>
-                        <ui:repeat var="contributor" value="#{viewProject.project.contributors}">
+                        <ui:repeat var="contributor" value="#{project.contributors}">
                             #{contributor.username}
                         </ui:repeat>
+                        <h:commandLink action="#{joinProject.join}" value="Join!" />
                     </td>
                 </tr>
             </table>

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/signCAfirst.xhtml
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/signCAfirst.xhtml	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/signCAfirst.xhtml	2008-02-20 15:11:55 UTC (rev 18528)
@@ -0,0 +1,27 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+                xmlns:s="http://jboss.com/products/seam/taglib"
+                xmlns:ui="http://java.sun.com/jsf/facelets"
+                xmlns:f="http://java.sun.com/jsf/core"
+                xmlns:h="http://java.sun.com/jsf/html"
+                xmlns:rich="http://richfaces.org/rich"
+                template="layout/template.xhtml">
+
+<ui:define name="body">
+
+     <rich:panel>
+        <f:facet name="header">Sign CAs</f:facet>
+        This project requires...
+        <br/>
+        Please sign required CAs first.
+        <h:dataTable value="#{cas}" var="ca">
+            <h:column>
+                #{ca.name}
+            </h:column>
+
+        </h:dataTable>
+    </rich:panel>
+    
+</ui:define> 
+</ui:composition>




More information about the jboss-svn-commits mailing list