[jboss-svn-commits] JBL Code SVN: r21084 - in labs/jbosslabs/labs-3.0-build: services/project-service/src/main/java/org/jboss/labs/core/service/impl and 5 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Jul 17 08:49:54 EDT 2008


Author: dejp
Date: 2008-07-17 08:49:54 -0400 (Thu, 17 Jul 2008)
New Revision: 21084

Added:
   labs/jbosslabs/labs-3.0-build/core/core-api/src/main/java/org/jboss/labs/core/service/ContributorAgreementService.java
   labs/jbosslabs/labs-3.0-build/services/project-service/src/main/java/org/jboss/labs/core/service/impl/ContributorAgreementServiceBean.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ca/
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ca/AddContributorAgreement.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ca/DeleteContributorAgreement.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ca/EditContributorAgreement.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ca/ShowContributorAgreements.java
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/ca/
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/ca/CAs.xhtml
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/ca/addCA.xhtml
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/ca/deleteCA.xhtml
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/ca/editCA.xhtml
Modified:
   labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/Pages.java
Log:
ca

Added: labs/jbosslabs/labs-3.0-build/core/core-api/src/main/java/org/jboss/labs/core/service/ContributorAgreementService.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/core/core-api/src/main/java/org/jboss/labs/core/service/ContributorAgreementService.java	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/core/core-api/src/main/java/org/jboss/labs/core/service/ContributorAgreementService.java	2008-07-17 12:49:54 UTC (rev 21084)
@@ -0,0 +1,34 @@
+package org.jboss.labs.core.service;
+
+import java.util.List;
+
+import javax.ejb.Local;
+
+import org.jboss.labs.core.model.ContributorAgreement;
+import org.jboss.labs.core.model.Project;
+import org.jboss.labs.exception.LabsRollbackException;
+import org.jboss.labs.exception.auth.NoSuchUserException;
+
+ at Local
+public interface ContributorAgreementService {
+
+    public List<ContributorAgreement> getAllContributorAgreements();
+    
+    public List<ContributorAgreement> getVisibleContributorAgreements();
+    
+    public List<ContributorAgreement> getContributorAgreements(String projectId);
+    
+    public void addContributorAgreement(ContributorAgreement contributorAgreement);
+    
+    public void deleteContributorAgreement(ContributorAgreement contributorAgreement) throws LabsRollbackException;
+    
+    public ContributorAgreement updateContributorAgreement(ContributorAgreement contributorAgreement);
+    
+    public boolean checkIfCAExists(String name, Integer version);
+    
+    public ContributorAgreement getContributorAgreement(String name, Integer version);
+    
+    public List<ContributorAgreement> getCAsToSign(String username, Project project) 
+            throws NoSuchUserException;
+    
+}

Added: labs/jbosslabs/labs-3.0-build/services/project-service/src/main/java/org/jboss/labs/core/service/impl/ContributorAgreementServiceBean.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/services/project-service/src/main/java/org/jboss/labs/core/service/impl/ContributorAgreementServiceBean.java	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/services/project-service/src/main/java/org/jboss/labs/core/service/impl/ContributorAgreementServiceBean.java	2008-07-17 12:49:54 UTC (rev 21084)
@@ -0,0 +1,136 @@
+package org.jboss.labs.core.service.impl;
+
+import java.util.List;
+
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+
+import org.jboss.labs.core.model.ContributorAgreement;
+import org.jboss.labs.core.model.Project;
+import org.jboss.labs.core.model.SignedContributorAgreement;
+import org.jboss.labs.core.service.ContributorAgreementService;
+import org.jboss.labs.exception.LabsRollbackException;
+import org.jboss.labs.exception.auth.NoSuchUserException;
+
+ at Stateful(name = "ContributorAgreementService")
+public class ContributorAgreementServiceBean implements ContributorAgreementService {
+
+    @PersistenceContext(unitName = "core_model", type = PersistenceContextType.EXTENDED)
+    private EntityManager em;
+    
+    public void addContributorAgreement(
+            ContributorAgreement contributorAgreement) {
+        em.persist(contributorAgreement);
+    }
+
+    public void deleteContributorAgreement(
+            ContributorAgreement contributorAgreement) throws LabsRollbackException {
+        contributorAgreement = em.find(ContributorAgreement.class, contributorAgreement.getId());
+        
+        List<Project> projects = contributorAgreement.getProjectList(); 
+        if (!projects.isEmpty()) {
+            StringBuilder sb = new StringBuilder("Given contributor agreement is used in the following projects: ");
+
+            int size = projects.size();
+            int index = 0;
+            for (Project project : projects) {
+                sb.append(project.getName());
+                index++;
+                if (index < size) {
+                    sb.append(",");
+                }
+            }
+            sb.append(".");
+            
+            throw new LabsRollbackException(sb.toString());
+        }
+            
+        em.remove(contributorAgreement);
+    }
+
+    @SuppressWarnings("unchecked")
+    public List<ContributorAgreement> getAllContributorAgreements() {
+        Query query = em.createQuery("from ContributorAgreement ca");
+        
+        return query.getResultList();
+    }
+    
+    @SuppressWarnings("unchecked")
+    public List<ContributorAgreement> getContributorAgreements(String projectId) {
+        Query query = em.createQuery("from ContributorAgreement ca " +
+        		"left join ca.projectList p " +
+        		"where p.projectId = :projectId");
+        query.setParameter("projectId", projectId);
+        
+        return query.getResultList();
+    }
+    
+    public ContributorAgreement updateContributorAgreement(
+            ContributorAgreement contributorAgreement) {
+        return em.merge(contributorAgreement);
+    }
+    
+    @SuppressWarnings("unchecked")
+    public List<ContributorAgreement> getVisibleContributorAgreements() {
+        Query query = em.createQuery("from ContributorAgreement ca where ca.visible = 1");
+        
+        return query.getResultList();
+    }
+
+    public boolean checkIfCAExists(String name,
+            Integer version) {
+        Query query = em.createQuery("from ContributorAgreement ca where ca.name = :name " +
+        		"and ca.version = :version");
+        query.setParameter("name", name);
+        query.setParameter("version", version);
+        
+        return !query.getResultList().isEmpty();
+    }
+
+    @SuppressWarnings("unchecked")
+    public ContributorAgreement getContributorAgreement(String name,
+            Integer version) {
+        Query query = em.createQuery("from ContributorAgreement ca where ca.name = :name " +
+                "and ca.version = :version");
+        query.setParameter("name", name);
+        query.setParameter("version", version);
+
+        ContributorAgreement contributorAgreement = null;
+        
+        try {
+            contributorAgreement = (ContributorAgreement) query.getSingleResult();
+        } catch (NoResultException e) {
+            return null;
+        }
+        
+        return contributorAgreement;
+    }
+
+    @SuppressWarnings("unchecked")
+    public List<ContributorAgreement> getCAsToSign(String username,
+            Project project) throws NoSuchUserException {
+        List<ContributorAgreement> cas = project.getRequiredContributorAgreementList();
+
+        if (cas.isEmpty()) {
+            return cas;
+        }
+        
+        Query query = em.createQuery("from SignedContributorAgreement sca where sca.username.username = :username");
+        List<SignedContributorAgreement> scas = query.getResultList();
+        
+        for (SignedContributorAgreement sca : scas) {
+            ContributorAgreement ca = sca.getContributorAgreement();
+            cas.remove(ca);
+        }
+        
+        return cas;
+    }
+    
+}
+
+
+

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-07-17 12:26:13 UTC (rev 21083)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/Pages.java	2008-07-17 12:49:54 UTC (rev 21084)
@@ -62,4 +62,10 @@
     public static final String EMAIL_PROJECT_REJECTED = EMAIL_PREFIX + "/projectRequestRejected.xhtml";
     public static final String EMAIL_JOIN_ACCEPTED = EMAIL_PREFIX + "/joinRequestAccepted.xhtml";
     public static final String EMAIL_JOIN_REJECTED = EMAIL_PREFIX + "/joinRequestRejected.xhtml";
+    
+    public static final String AGREEMENT_PREFIX = "/ca";
+    public static final String ADD_CONTRIBUTOR_AGREEMENT_PAGE = AGREEMENT_PREFIX + "/addCA.seam";
+    public static final String CONTRIBUTOR_AGREEMENTS_PAGE = AGREEMENT_PREFIX + "/CAs.seam";
+    public static final String DELETE_CONTRIBUTOR_AGREEMENT_PAGE = AGREEMENT_PREFIX + "/deleteCA.seam";
+    public static final String EDIT_CONTRIBUTOR_AGREEMENT_PAGE = AGREEMENT_PREFIX + "/editCA.seam";
 }

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ca/AddContributorAgreement.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ca/AddContributorAgreement.java	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ca/AddContributorAgreement.java	2008-07-17 12:49:54 UTC (rev 21084)
@@ -0,0 +1,91 @@
+/*
+* 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.ca;
+
+import java.io.Serializable;
+
+import javax.naming.NamingException;
+
+import org.jboss.labs.admin.Pages;
+import org.jboss.labs.core.model.ContributorAgreement;
+import org.jboss.labs.core.service.ContributorAgreementService;
+import org.jboss.labs.seam.guice.Guice;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.End;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.faces.FacesMessages;
+
+import com.google.inject.Inject;
+
+ at Name("addContributorAgreement")
+ at Guice
+public class AddContributorAgreement implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    
+    @Out(scope = ScopeType.CONVERSATION, required = false) 
+    private ContributorAgreement contributorAgreement;
+
+    @Inject
+    private ContributorAgreementService contributorAgreementService;
+    
+    @In FacesMessages facesMessages;
+
+    public ContributorAgreement getContributorAgreement() {
+        return contributorAgreement;
+    }
+
+    public void setContributorAgreement(ContributorAgreement contributorAgreement) {
+        this.contributorAgreement = contributorAgreement;
+    }
+    
+    @Begin(nested = true)
+    public String add() {
+        contributorAgreement = new ContributorAgreement();
+        
+        return Pages.ADD_CONTRIBUTOR_AGREEMENT_PAGE;
+    }
+    
+    @End
+    public String doAdd(ContributorAgreement contributorAgreement) throws NamingException {
+    
+        if (contributorAgreementService.checkIfCAExists(contributorAgreement.getName(), 
+                contributorAgreement.getVersion())) {
+            
+            facesMessages.add("Contributor agreement '" + contributorAgreement.getName() + 
+                    " version " + contributorAgreement.getVersion() + " already exists.");
+            
+            return null;
+        }
+        
+        contributorAgreementService.addContributorAgreement(contributorAgreement);
+        facesMessages.add("Contributor agreement has been successfully added.");
+        
+        return Pages.CONTRIBUTOR_AGREEMENTS_PAGE;
+    }
+
+}
\ No newline at end of file

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ca/DeleteContributorAgreement.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ca/DeleteContributorAgreement.java	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ca/DeleteContributorAgreement.java	2008-07-17 12:49:54 UTC (rev 21084)
@@ -0,0 +1,85 @@
+/*
+* 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.ca;
+
+import javax.naming.NamingException;
+
+import org.jboss.labs.admin.Pages;
+import org.jboss.labs.core.model.ContributorAgreement;
+import org.jboss.labs.core.service.ContributorAgreementService;
+import org.jboss.labs.exception.LabsRollbackException;
+import org.jboss.labs.seam.guice.Guice;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.End;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.faces.FacesMessages;
+
+import com.google.inject.Inject;
+
+ at Name("deleteContributorAgreement")
+ at Guice
+public class DeleteContributorAgreement {
+
+    @Out(required = false, scope = ScopeType.CONVERSATION) 
+    private ContributorAgreement contributorAgreement;
+    
+    @Inject
+    private ContributorAgreementService contributorAgreementService;
+    
+    @In private FacesMessages facesMessages;
+
+    public ContributorAgreement getContributorAgreement() {
+        return contributorAgreement;
+    }
+
+    public void setContributorAgreement(ContributorAgreement contributorAgreement) {
+        this.contributorAgreement = contributorAgreement;
+    }
+    
+    @Begin(nested = true)
+    public String delete(ContributorAgreement contributorAgreement) {
+
+        this.contributorAgreement = contributorAgreement;
+        
+        return Pages.DELETE_CONTRIBUTOR_AGREEMENT_PAGE;
+    }
+
+    @End
+    public String doDelete(ContributorAgreement contributorAgreement) throws NamingException {
+        try {
+            contributorAgreementService.deleteContributorAgreement(contributorAgreement);
+        } catch (LabsRollbackException e) {
+            facesMessages.add(e.getMessage());
+            return Pages.CONTRIBUTOR_AGREEMENTS_PAGE;
+        }
+            
+        facesMessages.add("Contributor agreement has been deleted.");
+
+        return Pages.CONTRIBUTOR_AGREEMENTS_PAGE;
+    }
+
+}
\ No newline at end of file

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ca/EditContributorAgreement.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ca/EditContributorAgreement.java	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ca/EditContributorAgreement.java	2008-07-17 12:49:54 UTC (rev 21084)
@@ -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.ca;
+
+import javax.naming.NamingException;
+
+import org.jboss.labs.admin.Pages;
+import org.jboss.labs.core.model.ContributorAgreement;
+import org.jboss.labs.core.service.ContributorAgreementService;
+import org.jboss.labs.seam.guice.Guice;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.End;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.faces.FacesMessages;
+
+import com.google.inject.Inject;
+
+
+ at Name("editContributorAgreement")
+ at Guice
+public class EditContributorAgreement {
+
+    @Out(scope = ScopeType.CONVERSATION, required = false) 
+    private ContributorAgreement contributorAgreement;
+
+    @Inject
+    private ContributorAgreementService contributorAgreementService;
+    
+    @In private FacesMessages facesMessages;
+    
+    public ContributorAgreement getContributorAgreement() {
+        return contributorAgreement;
+    }
+
+    public void setContributorAgreement(ContributorAgreement contributorAgreement) {
+        this.contributorAgreement = contributorAgreement;
+    }    
+    
+    @Begin(nested = true)
+    public String edit(ContributorAgreement contributorAgreement) {
+        this.contributorAgreement = contributorAgreement;
+
+        return Pages.EDIT_CONTRIBUTOR_AGREEMENT_PAGE;
+    }
+    
+    @End
+    public String doUpdate(ContributorAgreement contributorAgreement) throws NamingException {
+        ContributorAgreement ca = contributorAgreementService.getContributorAgreement(contributorAgreement.getName(), 
+                contributorAgreement.getVersion());
+        if (ca != null && !ca.equals(contributorAgreement)) {
+            
+            facesMessages.add("Contributor agreement '" + contributorAgreement.getName() + 
+                    " version " + contributorAgreement.getVersion() + " already exists.");
+            
+            return null;
+        }
+        
+        contributorAgreementService.updateContributorAgreement(contributorAgreement);
+        facesMessages.add("Contributor agreement has been updated.");
+        
+        return Pages.CONTRIBUTOR_AGREEMENTS_PAGE;
+    }
+
+}
\ No newline at end of file

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ca/ShowContributorAgreements.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ca/ShowContributorAgreements.java	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/java/org/jboss/labs/admin/action/ca/ShowContributorAgreements.java	2008-07-17 12:49:54 UTC (rev 21084)
@@ -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.ca;
+
+
+import java.util.List;
+
+import javax.naming.NamingException;
+
+import org.jboss.labs.admin.Pages;
+import org.jboss.labs.core.model.ContributorAgreement;
+import org.jboss.labs.core.service.ContributorAgreementService;
+import org.jboss.labs.seam.guice.Guice;
+import org.jboss.seam.annotations.Name;
+
+import com.google.inject.Inject;
+
+ at Name("showContributorAgreements")
+ at Guice
+public class ShowContributorAgreements {
+
+    @Inject
+    private ContributorAgreementService contributorAgreementService;
+
+    private List<ContributorAgreement> contributorAgreements;
+
+    public List<ContributorAgreement> getContributorAgreements() throws NamingException {
+        if (contributorAgreements == null) {
+            contributorAgreements = contributorAgreementService.getAllContributorAgreements();
+        }
+        
+        return contributorAgreements;
+    }
+
+    public void setContributorAgreements(
+            List<ContributorAgreement> contributorAgreements) {
+        this.contributorAgreements = contributorAgreements;
+    }
+
+    public String show() {
+        
+        return Pages.CONTRIBUTOR_AGREEMENTS_PAGE;
+    }
+}
\ No newline at end of file

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/ca/CAs.xhtml
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/ca/CAs.xhtml	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/ca/CAs.xhtml	2008-07-17 12:49:54 UTC (rev 21084)
@@ -0,0 +1,72 @@
+<!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:c="http://java.sun.com/jstl/core"
+                template="../layout/template.xhtml">
+
+<ui:define name="body">
+    
+    <h2>Contributor agreements</h2>
+
+    <h:form>
+
+        <h:messages />
+
+        <h:commandButton value="Add contributor agreement" action="#{addContributorAgreement.add()}" />
+
+        <br />
+
+        <h:dataTable value="#{showContributorAgreements.contributorAgreements}" var="ca"
+            rendered="#{! empty showContributorAgreements.contributorAgreements}">
+            
+            <h:column>
+                <f:facet name="header">Name</f:facet>
+
+                <h:outputText value="#{ca.name}"/>
+            </h:column>
+          
+            <h:column>
+                <f:facet name="header">Version</f:facet>
+
+                <h:outputText value="#{ca.version}"/>
+            </h:column>
+
+            <h:column>
+                <f:facet name="header">Visible</f:facet>
+
+                <h:outputText value="#{ca.visible}" />
+            </h:column>
+            
+            <h:column>
+                <f:facet name="header">URL</f:facet>
+
+                <h:outputLink value="#{ca.url}">
+                    <h:outputText value="#{ca.url}" />
+                </h:outputLink>
+            </h:column>
+
+            <h:column>
+                <f:facet name="header">&#160;</f:facet>
+                
+                <h:commandLink value="Edit" action="#{editContributorAgreement.edit(ca)}" />
+                &#160;
+                <h:commandLink value="Delete" action="#{deleteContributorAgreement.delete(ca)}" />
+            </h:column>
+
+        </h:dataTable>
+
+        <h:outputText  rendered="#{empty showContributorAgreements.contributorAgreements}">
+            There are not any contributor agreements.
+        </h:outputText>
+ 
+    </h:form>
+    
+</ui:define>
+
+</ui:composition>

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/ca/addCA.xhtml
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/ca/addCA.xhtml	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/ca/addCA.xhtml	2008-07-17 12:49:54 UTC (rev 21084)
@@ -0,0 +1,71 @@
+<!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:c="http://java.sun.com/jstl/core"
+                template="../layout/template.xhtml">
+
+<ui:define name="body">
+    
+    <h2>Add contributor agreement</h2>
+    <h:form id="addCAForm">
+
+        <h:messages />
+
+        <s:validateAll>
+
+            <table>
+                <tr>
+                    <th>Name:</th>
+                    <td>
+                        <h:inputText value="#{contributorAgreement.name}" 
+                            required="true" requiredMessage="Contributor agreement name is required." />
+                    </td>
+                </tr>
+                <tr>
+                    <th>Version:</th>
+                    <td>
+                        <h:inputText value="#{contributorAgreement.version}"
+                            required="true" requiredMessage="Contributor agreement version is required." />
+                    </td>
+                </tr>
+                <tr>
+                    <th>URL:</th>
+                    <td>
+                        <h:inputText value="#{contributorAgreement.url}"
+                            required="true" requiredMessage="URL is required." />
+                    </td>
+                </tr>
+                <tr>
+                    <th>Visible:</th>
+                    <td>
+                        <h:selectBooleanCheckbox value="#{contributorAgreement.visible}" />
+                    </td>
+                </tr>
+                <tr>
+                    <th>Projects:</th>
+                    <td>
+                        <h:selectManyListbox value="#{projectIds}" size="10">
+                            <f:selectItems value="#{addContributorAgreement.projects}" />
+                        </h:selectManyListbox>
+                    </td>
+                </tr>
+            </table>
+            
+            <h:commandButton value="Add" action="#{addContributorAgreement.doAdd(contributorAgreement)}" />
+            <s:button value="Cancel" action="/ca/CAs.seam">
+                <s:conversationPropagation type="end" />
+            </s:button>
+            
+        </s:validateAll>
+
+    </h:form>
+    
+</ui:define>
+
+</ui:composition>

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/ca/deleteCA.xhtml
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/ca/deleteCA.xhtml	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/ca/deleteCA.xhtml	2008-07-17 12:49:54 UTC (rev 21084)
@@ -0,0 +1,35 @@
+<!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:c="http://java.sun.com/jstl/core"
+                template="../layout/template.xhtml">
+
+<ui:define name="body">
+    
+    <h2>Delete Contributor Agreement</h2>
+    
+    <h:form id="deleteCAForm">
+
+        <h:messages />
+
+        Are you sure that you want to delete the following contributor agreement: '#{contributorAgreement.name}'?
+
+        <br />
+        
+        <h:commandButton value="Yes" action="#{deleteContributorAgreement.doDelete(contributorAgreement)}" />
+        
+        <s:button value="No" action="/ca/CAs.seam">
+            <s:conversationPropagation type="end" />
+        </s:button>
+
+    </h:form>
+    
+</ui:define>
+
+</ui:composition>

Added: labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/ca/editCA.xhtml
===================================================================
--- labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/ca/editCA.xhtml	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/views/admin/src/main/webapp/ca/editCA.xhtml	2008-07-17 12:49:54 UTC (rev 21084)
@@ -0,0 +1,64 @@
+<!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:c="http://java.sun.com/jstl/core"
+                template="../layout/template.xhtml">
+
+<ui:define name="body">
+    
+    <h2>Edit contributor agreement</h2>
+    
+    <h:form id="editCAForm">
+
+        <h:messages />
+
+        <s:validateAll>
+
+            <table>
+                <tr>
+                    <th>Name:</th>
+                    <td>
+                        <h:inputText value="#{contributorAgreement.name}" 
+                            required="true" requiredMessage="Contributor agreement name is required." />
+                    </td>
+                </tr>
+                <tr>
+                    <th>Version:</th>
+                    <td>
+                        <h:inputText value="#{contributorAgreement.version}"
+                            required="true" requiredMessage="Contributor agreement version is required." />
+                    </td>
+                </tr>
+                <tr>
+                    <th>URL:</th>
+                    <td>
+                        <h:inputText value="#{contributorAgreement.url}"
+                            required="true" requiredMessage="URL is required." />
+                    </td>
+                </tr>
+                <tr>
+                    <th>Visible:</th>
+                    <td>
+                        <h:selectBooleanCheckbox value="#{contributorAgreement.visible}" />
+                    </td>
+                </tr>
+            </table>
+            
+            <h:commandButton value="Update" action="#{editContributorAgreement.doUpdate(contributorAgreement)}" />
+            <s:button value="Cancel" action="/ca/CAs.seam">
+                <s:conversationPropagation type="end" />
+            </s:button>
+            
+        </s:validateAll>
+
+    </h:form>
+    
+</ui:define>
+
+</ui:composition>




More information about the jboss-svn-commits mailing list