You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by ev...@apache.org on 2005/12/23 01:12:44 UTC

svn commit: r358661 - in /maven/continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/ resources/ resources/META-INF/plexus/ resources/localization/ webapp/

Author: evenisse
Date: Thu Dec 22 16:12:31 2005
New Revision: 358661

URL: http://svn.apache.org/viewcvs?rev=358661&view=rev
Log:
Add update project screen

Added:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java   (with props)
    maven/continuum/trunk/continuum-webapp/src/main/webapp/projectEdit.jsp   (with props)
Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java
    maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
    maven/continuum/trunk/continuum-webapp/src/main/webapp/projectView.jsp

Added: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java?rev=358661&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java (added)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java Thu Dec 22 16:12:31 2005
@@ -0,0 +1,153 @@
+package org.apache.maven.continuum.web.action;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.model.project.Project;
+
+import com.opensymphony.xwork.ActionSupport;
+import com.opensymphony.webwork.ServletActionContext;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class ProjectEditAction
+    extends ActionSupport
+{
+    private Continuum continuum;
+
+    private Project project;
+
+    private int projectId;
+
+    private String name;
+
+    private String version;
+
+    private String scmUrl;
+
+    private String scmUsername;
+
+    private String scmPassword;
+
+    private String scmTag;
+
+    public String execute()
+    {
+        Project p = new Project();
+
+        p.setId( projectId );
+
+        p.setName( name );
+
+        p.setVersion( version );
+
+        p.setScmUrl( scmUrl );
+
+        p.setScmUsername( scmUsername );
+
+        p.setScmPassword( scmPassword );
+
+        p.setScmTag( scmTag );
+
+        try
+        {
+            continuum.updateProject( p );
+        }
+        catch ( ContinuumException e )
+        {
+            addActionMessage( "Can't update project (id=" + projectId + ") : " + e.getMessage() );
+
+            e.printStackTrace();
+
+            return ERROR;
+        }
+
+        return SUCCESS;
+    }
+
+    public String doEdit()
+    {
+        try
+        {
+            project = getProject( projectId );
+        }
+        catch ( ContinuumException e )
+        {
+            addActionMessage( "Can't get project informations (id=" + projectId + ") : " + e.getMessage() );
+
+            e.printStackTrace();
+
+            return ERROR;
+        }
+
+        return INPUT;
+    }
+
+    private Project getProject( int projectId )
+        throws ContinuumException
+    {
+        return continuum.getProject( projectId );
+    }
+
+    public int getProjectId()
+    {
+        return projectId;
+    }
+
+    public void setProjectId( int projectId )
+    {
+        this.projectId = projectId;
+    }
+
+    public void setProjectName( String name )
+    {
+        this.name = name;
+    }
+
+    public void setVersion( String version )
+    {
+        this.version = version;
+    }
+
+    public void setScmUrl( String scmUrl )
+    {
+        this.scmUrl = scmUrl;
+    }
+
+    public void setScmUsername( String scmUsername )
+    {
+        this.scmUsername = scmUsername;
+    }
+
+    public void setPassword( String scmPassword )
+    {
+        this.scmPassword = scmPassword;
+    }
+
+    public void setScmTag( String scmTag )
+    {
+        this.scmTag = scmTag;
+    }
+
+    public Project getProject()
+    {
+        return project;
+    }
+}

Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectEditAction.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java?rev=358661&r1=358660&r2=358661&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectViewAction.java Thu Dec 22 16:12:31 2005
@@ -63,4 +63,4 @@
     {
         return project;
     }
-}
\ No newline at end of file
+}

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/components.xml?rev=358661&r1=358660&r2=358661&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/components.xml Thu Dec 22 16:12:31 2005
@@ -111,6 +111,17 @@
         </requirement>
       </requirements>
     </component>
+    <component>
+      <role>com.opensymphony.xwork.Action</role>
+      <role-hint>projectEdit</role-hint>
+      <implementation>org.apache.maven.continuum.web.action.ProjectEditAction</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.continuum.Continuum</role>
+        </requirement>
+      </requirements>
+    </component>
 
     <!--
      | Components

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=358661&r1=358660&r2=358661&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties Thu Dec 22 16:12:31 2005
@@ -165,3 +165,15 @@
 projectView.developers = Developers
 projectView.developer.name = Name
 projectView.developer.email = Email
+
+// ----------------------------------------------------------------------
+// Page: ProjectEdit
+// ----------------------------------------------------------------------
+projectEdit.page.title = Continuum - Update Continuum Project
+projectEdit.section.title = Update Continuum Project
+projectEdit.project.name.label = Project Name
+projectEdit.project.version.label = Version
+projectEdit.project.scmUrl.label = Scm Url
+projectEdit.project.scmUsername.label = Scm Username
+projectEdit.project.scmPassword.label = Scm Password
+projectEdit.project.scmTag.label = Scm Branch/Tag

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml?rev=358661&r1=358660&r2=358661&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml Thu Dec 22 16:12:31 2005
@@ -82,5 +82,11 @@
                 class="projectView">
             <result name="success">projectView.jsp</result>
         </action>
+
+        <action name="projectEdit"
+                class="projectEdit">
+            <result name="input">projectEdit.jsp</result>
+            <result name="success" type="chain">projectView</result>
+        </action>
     </package>
 </xwork>

Added: maven/continuum/trunk/continuum-webapp/src/main/webapp/projectEdit.jsp
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/webapp/projectEdit.jsp?rev=358661&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/projectEdit.jsp (added)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/projectEdit.jsp Thu Dec 22 16:12:31 2005
@@ -0,0 +1,26 @@
+<%@ taglib uri="webwork" prefix="ww" %>
+<html>
+  <ww:i18n name="localization.Continuum">
+    <head>
+        <title><ww:text name="projectEdit.page.title"/></title>
+    </head>
+    <body>
+      <div id="axial" class="h3">
+        <h3><ww:text name="projectEdit.section.title"/></h3>
+
+        <div class="axial">
+          <ww:form action="projectEdit.action" method="post">
+            <input type="hidden" name="projectId" value="<ww:property value="project.id"/>"/>
+            <ww:textfield label="%{getText('projectEdit.project.name.label')}" name="project.name"/>
+            <ww:textfield label="%{getText('projectEdit.project.version.label')}" name="project.version"/>
+            <ww:textfield label="%{getText('projectEdit.project.scmUrl.label')}" name="project.scmUrl"/>
+            <ww:textfield label="%{getText('projectEdit.project.scmUsername.label')}" name="project.scmUsername"/>
+            <ww:password label="%{getText('projectEdit.project.scmPassword.label')}" name="project.scmPassword"/>
+            <ww:textfield label="%{getText('projectEdit.project.scmTag.label')}" name="project.scmTag"/>
+            <ww:submit value="%{getText('save')}"/>
+          </ww:form>
+        </div>
+      </div>
+    </body>
+  </ww:i18n>
+</html>

Propchange: maven/continuum/trunk/continuum-webapp/src/main/webapp/projectEdit.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-webapp/src/main/webapp/projectEdit.jsp
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/projectView.jsp
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/webapp/projectView.jsp?rev=358661&r1=358660&r2=358661&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/projectView.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/projectView.jsp Thu Dec 22 16:12:31 2005
@@ -28,6 +28,12 @@
               <td><ww:property value="project.projectGroup.name"/></td>
             </tr>
           </table>
+          <div class="functnbar3">
+            <ww:form action="projectEdit!edit.action">
+                <input type="hidden" name="projectId" value="<ww:property value="project.id"/>"/>
+                <ww:submit value="%{getText('edit')}"/>
+            </ww:form>
+          </div>
         </div>
 
         <h3><ww:text name="projectView.buildDefinitions"/></h3>