continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r210045 - in /maven/continuum/trunk/continuum-web/src/main: java/org/apache/maven/continuum/web/action/ resources/META-INF/plexus/ resources/forms/ resources/templates/screens/
Date Sun, 10 Jul 2005 21:43:13 GMT
Author: jvanzyl
Date: Sun Jul 10 14:43:12 2005
New Revision: 210045

URL: http://svn.apache.org/viewcvs?rev=210045&view=rev
Log:
adding better validation

Added:
    maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProject.java
    maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProject.java
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ResultMessages.vm
Modified:
    maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-web/src/main/resources/forms/addMavenOneProject.xml
    maven/continuum/trunk/continuum-web/src/main/resources/forms/addMavenTwoProject.xml

Added: maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProject.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProject.java?rev=210045&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProject.java
(added)
+++ maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/action/AddMavenOneProject.java
Sun Jul 10 14:43:12 2005
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2005 Your Corporation. All Rights Reserved.
+ */
+package org.apache.maven.continuum.web.action;
+
+import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
+import org.codehaus.plexus.formica.Form;
+import org.codehaus.plexus.formica.action.AbstractEntityAction;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
+ * @version $Id:$
+ */
+public class AddMavenOneProject
+    extends AbstractEntityAction
+    implements Contextualizable
+{
+    protected void uponSuccessfulValidation( Form form, String entityId, Map parameters )
+        throws Exception
+    {
+        Continuum continuum = (Continuum) container.lookup( Continuum.ROLE );
+
+        ContinuumProjectBuildingResult result = continuum.addMavenOneProject( (String) parameters.get(
"m1PomUrl" ) );
+
+        if ( result.getWarnings().size() > 0 )
+        {
+            setResultMessages( result.getWarnings(), parameters );
+        }
+    }
+}

Added: maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProject.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProject.java?rev=210045&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProject.java
(added)
+++ maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProject.java
Sun Jul 10 14:43:12 2005
@@ -0,0 +1,31 @@
+package org.apache.maven.continuum.web.action;
+
+import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
+import org.codehaus.plexus.formica.Form;
+import org.codehaus.plexus.formica.action.AbstractEntityAction;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
+ * @version $Id:$
+ */
+public class AddMavenTwoProject
+    extends AbstractEntityAction
+    implements Contextualizable
+{
+    protected void uponSuccessfulValidation( Form form, String entityId, Map parameters )
+        throws Exception
+    {
+        Continuum continuum = (Continuum) container.lookup( Continuum.ROLE );
+
+        ContinuumProjectBuildingResult result = continuum.addMavenTwoProject( (String) parameters.get(
"m2PomUrl" ) );
+
+        if ( result.getWarnings().size() > 0 )
+        {
+            setResultMessages( result.getWarnings(), parameters );
+        }
+    }
+}

Modified: maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml?rev=210045&r1=210044&r2=210045&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
Sun Jul 10 14:43:12 2005
@@ -20,6 +20,7 @@
         <initial-view>Summary.vm</initial-view>
         <default-view>Default.vm</default-view>
         <error-view>Error.vm</error-view>
+        <result-messages-view>ResultMessages.vm</result-messages-view>
       </configuration>
     </component>
 
@@ -302,6 +303,28 @@
       <role>org.codehaus.plexus.action.Action</role>
       <role-hint>login</role-hint>
       <implementation>org.apache.maven.continuum.web.action.Login</implementation>
+    </component>
+
+    <component>
+      <role>org.codehaus.plexus.action.Action</role>
+      <role-hint>addMavenTwoProject</role-hint>
+      <implementation>org.apache.maven.continuum.web.action.AddMavenTwoProject</implementation>
+      <requirements>
+        <requirement>
+          <role>org.codehaus.plexus.formica.FormManager</role>
+        </requirement>
+      </requirements>
+    </component>
+
+    <component>
+      <role>org.codehaus.plexus.action.Action</role>
+      <role-hint>addMavenOneProject</role-hint>
+      <implementation>org.apache.maven.continuum.web.action.AddMavenOneProject</implementation>
+      <requirements>
+        <requirement>
+          <role>org.codehaus.plexus.formica.FormManager</role>
+        </requirement>
+      </requirements>
     </component>
 
     <component>

Modified: maven/continuum/trunk/continuum-web/src/main/resources/forms/addMavenOneProject.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/forms/addMavenOneProject.xml?rev=210045&r1=210044&r2=210045&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/forms/addMavenOneProject.xml (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/forms/addMavenOneProject.xml Sun
Jul 10 14:43:12 2005
@@ -30,7 +30,7 @@
   <!-- Add -->
   <add>
     <title-key>project.title.add</title-key>
-    <action>callMethod</action>
+    <action>addMavenOneProject</action>
     <view>Summary.vm</view>
     <view-on-failure>Add.vm</view-on-failure>
     <fid-on-failure>addMavenOneProject</fid-on-failure>    

Modified: maven/continuum/trunk/continuum-web/src/main/resources/forms/addMavenTwoProject.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/forms/addMavenTwoProject.xml?rev=210045&r1=210044&r2=210045&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/forms/addMavenTwoProject.xml (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/forms/addMavenTwoProject.xml Sun
Jul 10 14:43:12 2005
@@ -25,7 +25,7 @@
   <!-- Add -->
   <add>
     <title-key>project.title.add</title-key>
-    <action>callMethod</action>
+    <action>addMavenTwoProject</action>
     <view>Summary.vm</view>
     <view-on-failure>Add.vm</view-on-failure>
     <fid-on-failure>addMavenTwoProject</fid-on-failure>

Added: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ResultMessages.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ResultMessages.vm?rev=210045&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ResultMessages.vm
(added)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/ResultMessages.vm
Sun Jul 10 14:43:12 2005
@@ -0,0 +1,16 @@
+$page.setTitle( $i18n.getString( "continuumError" ) )
+
+<div class="app">
+  <div id="axial" class="h3">
+    <h3>$i18n.getString( "continuumError" )</h3>
+  </div>
+  #foreach ( $resultMessage in $resultMessages )
+  <ul>
+    <li>$resultMessage</li>
+  </ul>
+
+  Check the logs for more details.
+
+  #end
+</div>
+



Mime
View raw message