continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r358400 - in /maven/continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/ resources/ resources/META-INF/plexus/ resources/localization/ webapp/
Date Wed, 21 Dec 2005 22:30:04 GMT
Author: evenisse
Date: Wed Dec 21 14:29:53 2005
New Revision: 358400

URL: http://svn.apache.org/viewcvs?rev=358400&view=rev
Log:
Add delete project

Added:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java
  (with props)
    maven/continuum/trunk/continuum-webapp/src/main/webapp/deleteProject.jsp   (with props)
    maven/continuum/trunk/continuum-webapp/src/main/webapp/error.jsp   (with props)
Modified:
    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/summary.jsp

Added: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java?rev=358400&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java
(added)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java
Wed Dec 21 14:29:53 2005
@@ -0,0 +1,78 @@
+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 com.opensymphony.xwork.ActionSupport;
+
+/**
+ * @author Nick Gonzalez
+ * @version $Id$
+ */
+public class DeleteProjectAction
+    extends ActionSupport
+{
+    private Continuum continuum;
+
+    private int projectId;
+
+    private String projectName;
+
+    public String execute()
+    {
+        try
+        {
+            continuum.removeProject( projectId );
+        }
+        catch ( ContinuumException e )
+        {
+            addActionMessage( "Can't delete project (id=" + projectId + ") : " + e.getMessage()
);
+
+            e.printStackTrace();
+
+            return ERROR;
+        }
+        return SUCCESS;
+    }
+
+    public String doDefault()
+    {
+        return "delete";
+    }
+
+    public void setProjectId( int projectId )
+    {
+        this.projectId = projectId;
+    }
+
+    public int getProjectId()
+    {
+        return projectId;
+    }
+
+    public void setProjectName( String projectName )
+    {
+        this.projectName = projectName;
+    }
+
+    public String getProjectName()
+    {
+        return projectName;
+    }
+}
\ No newline at end of file

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

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

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=358400&r1=358399&r2=358400&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
Wed Dec 21 14:29:53 2005
@@ -78,6 +78,17 @@
         </requirement>
       </requirements>
     </component>
+    <component>
+      <role>com.opensymphony.xwork.Action</role>
+      <role-hint>deleteProject</role-hint>
+      <implementation>org.apache.maven.continuum.web.action.DeleteProjectAction</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=358400&r1=358399&r2=358400&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
Wed Dec 21 14:29:53 2005
@@ -6,6 +6,7 @@
 message.error = Error
 enabled = Enabled
 disabled = Disabled
+cancel = Cancel
 
 // ----------------------------------------------------------------------
 // Page: Top
@@ -122,3 +123,10 @@
 projectVersion.label = Version
 projectVersion.error = You must provide a version
 projectVersion.message = Enter the version of the project
+
+// ----------------------------------------------------------------------
+// Page: DeleteProject
+// ----------------------------------------------------------------------
+delete.page.title = Delete Continuum Project
+delete.confirmation.message = Are you sure you want to delete the project "{0}"?
+delete.submit = Delete

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=358400&r1=358399&r2=358400&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml Wed Dec 21 14:29:53
2005
@@ -23,6 +23,10 @@
 
         <default-interceptor-ref name="defaultContinuumStack"/>
 
+        <global-results>
+            <result name="error">error.jsp</result>
+        </global-results>
+
         <action name="checkConfiguration"
                 class="checkConfigurationAction">
             <result name="input">/redirectToContinuumInitialization.jsp</result>
@@ -60,6 +64,12 @@
         <action name="addProject"
                 class="addProject">
             <result name="input">addProject.jsp</result>
+            <result name="success" type="redirect">summary.action</result>
+        </action>
+
+        <action name="deleteProject"
+                class="deleteProject">
+            <result name="delete">deleteProject.jsp</result>
             <result name="success" type="redirect">summary.action</result>
         </action>
     </package>

Added: maven/continuum/trunk/continuum-webapp/src/main/webapp/deleteProject.jsp
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/webapp/deleteProject.jsp?rev=358400&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/deleteProject.jsp (added)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/deleteProject.jsp Wed Dec 21 14:29:53
2005
@@ -0,0 +1,27 @@
+<%@ taglib uri="webwork" prefix="ww" %>
+<html>
+  <ww:i18n name="localization.Continuum">
+    <head>
+        <title><ww:text name="delete.page.title"/></title>
+    </head>
+    <body>
+      <div id="axial" class="h3">
+        <h3><ww:text name="delete.page.title"/></h3>
+
+        <div class="warningmessage">
+          <p>
+            <strong>
+                <ww:text name="delete.confirmation.message">
+                    <ww:param><ww:property value="projectName"/></ww:param>
+                </ww:text>
+            </strong>
+            <ww:form action="deleteProject.action" method="post">
+                <ww:hidden name="projectId"/>
+                <ww:submit value="%{getText('delete.submit')}"/>
+            </ww:form>
+          </p>
+        </div>
+      </div>
+    </body>
+  </ww:i18n>
+</html>

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

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

Added: maven/continuum/trunk/continuum-webapp/src/main/webapp/error.jsp
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/webapp/error.jsp?rev=358400&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/error.jsp (added)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/error.jsp Wed Dec 21 14:29:53 2005
@@ -0,0 +1,16 @@
+<%@ taglib uri="webwork" prefix="ww" %>
+<html>
+  <ww:i18n name="localization.Continuum">
+    <head>
+        <title>ERROR</title>
+    </head>
+    <body>
+      <div id="axial" class="h3">
+        <h3>ERROR</h3>
+        <p>
+            TODO
+        </p>
+      </div>
+    </body>
+  </ww:i18n>
+</html>

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

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

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/summary.jsp
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/webapp/summary.jsp?rev=358400&r1=358399&r2=358400&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/summary.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/summary.jsp Wed Dec 21 14:29:53
2005
@@ -30,7 +30,7 @@
                 TODO
             </ec:column>
             <ec:column property="deleteAction" title="&nbsp;">
-                <a href="${pageContext.request.contextPath}/deleteProject.action?projectId=${pageScope.project.id}">Delete</a>
+                <a href="${pageContext.request.contextPath}/deleteProject!default.action?projectId=${pageScope.project.id}&projectName=${pageScope.project.name}">Delete</a>
             </ec:column>
           </ec:row>
         </ec:table>



Mime
View raw message