continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From epunza...@apache.org
Subject svn commit: r443226 - in /maven/continuum/branches/release-integration/continuum: continuum-api/src/main/java/org/apache/maven/continuum/release/ continuum-release/src/main/java/org/apache/maven/continuum/release/ continuum-release/src/main/java/org/ap...
Date Thu, 14 Sep 2006 04:31:49 GMT
Author: epunzalan
Date: Wed Sep 13 21:31:48 2006
New Revision: 443226

URL: http://svn.apache.org/viewvc?view=rev&rev=443226
Log:
PR: CONTINUUM-727

Added View Release Output page

Added:
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ViewReleaseResultAction.java
  (with props)
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/viewReleaseResult.jsp
  (with props)
Removed:
    maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseResult.java
Modified:
    maven/continuum/branches/release-integration/continuum/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
    maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
    maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PerformReleaseAction.java
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PrepareReleaseAction.java
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/resources/xwork.xml
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performReleaseFinished.jsp
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareReleaseFinished.jsp

Modified: maven/continuum/branches/release-integration/continuum/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java?view=diff&rev=443226&r1=443225&r2=443226
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
Wed Sep 13 21:31:48 2006
@@ -66,9 +66,9 @@
                   String goals, boolean useReleaseProfile, ContinuumReleaseManagerListener
listener )
         throws ContinuumReleaseException;
 
-    void setPreparedReleases( Map preparedReleases );
-
     Map getPreparedReleases();
+
+    Map getReleaseResults();
 
     Map getListeners();
 }

Modified: maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java?view=diff&rev=443226&r1=443225&r2=443226
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
Wed Sep 13 21:31:48 2006
@@ -58,6 +58,12 @@
      */
     private static Map preparedReleases;
 
+    /**
+     * contains results
+     * @todo remove static when singleton strategy is working
+     */
+    private static Map releaseResults;
+
     public String prepare( Project project, Properties releaseProperties, Map relVersions,
                            Map devVersions, ContinuumReleaseManagerListener listener )
         throws ContinuumReleaseException
@@ -142,9 +148,14 @@
         return preparedReleases;
     }
 
-    public void setPreparedReleases( Map preparedReleases )
+    public Map getReleaseResults()
     {
-        this.preparedReleases = preparedReleases;
+        if ( releaseResults == null )
+        {
+            releaseResults = new Hashtable();
+        }
+
+        return releaseResults;
     }
 
     private ReleaseDescriptor getReleaseDescriptor( Project project, Properties releaseProperties,

Modified: maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java?view=diff&rev=443226&r1=443225&r2=443226
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java
Wed Sep 13 21:31:48 2006
@@ -18,13 +18,15 @@
 
 import org.apache.maven.continuum.release.ContinuumReleaseException;
 import org.apache.maven.continuum.release.tasks.PrepareReleaseProjectTask;
-import org.apache.maven.plugins.release.ReleaseExecutionException;
-import org.apache.maven.plugins.release.ReleaseFailureException;
 import org.apache.maven.plugins.release.ReleaseManagerListener;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
+import org.apache.maven.settings.Settings;
 import org.codehaus.plexus.taskqueue.Task;
 import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
 
+import java.util.List;
+
 /**
  * @author Edwin Punzalan
  */
@@ -34,30 +36,56 @@
     public void executeTask( Task task )
         throws TaskExecutionException
     {
+        PrepareReleaseProjectTask prepareTask = (PrepareReleaseProjectTask) task;
+
+        ReleaseManagerListener listener = prepareTask.getListener();
+
+        Settings settings;
         try
         {
-            PrepareReleaseProjectTask prepareTask = (PrepareReleaseProjectTask) task;
+            settings = getSettings();
+        }
+        catch ( ContinuumReleaseException e )
+        {
+            ReleaseResult result = new ReleaseResult();
 
-            ReleaseDescriptor descriptor = prepareTask.getDescriptor();
+            result.appendError( e );
 
-            ReleaseManagerListener listener = prepareTask.getListener();
+            continuumReleaseManager.getReleaseResults().put( prepareTask.getReleaseId(),
result );
 
-            releasePluginManager.prepare( descriptor, getSettings(), getReactorProjects(
descriptor ),
-                                          false, false, listener );
+            listener.error( e.getMessage() );
 
-            continuumReleaseManager.getPreparedReleases().put( prepareTask.getReleaseId(),
descriptor );
-        }
-        catch ( ReleaseExecutionException e )
-        {
-            throw new TaskExecutionException( "Release Manager Execution error occurred.",
e );
+            throw new TaskExecutionException( "Failed to build reactor projects.", e );
         }
-        catch ( ReleaseFailureException e )
+
+        ReleaseDescriptor descriptor = prepareTask.getDescriptor();
+
+        List reactorProjects;
+        try
         {
-            throw new TaskExecutionException( "Release Manager failure occurred.", e );
+            reactorProjects = getReactorProjects( descriptor );
         }
         catch ( ContinuumReleaseException e )
         {
+            ReleaseResult result = new ReleaseResult();
+
+            result.appendError( e );
+
+            continuumReleaseManager.getReleaseResults().put( prepareTask.getReleaseId(),
result );
+
+            listener.error( e.getMessage() );
+
             throw new TaskExecutionException( "Failed to build reactor projects.", e );
+        }
+
+        ReleaseResult result = releasePluginManager.prepareWithResult( descriptor, settings,
reactorProjects,
+                                                                       false, false, listener
);
+
+        if ( result.getResultCode() == ReleaseResult.SUCCESS )
+        {
+            continuumReleaseManager.getReleaseResults().put( prepareTask.getReleaseId(),
result );
+
+            continuumReleaseManager.getPreparedReleases().put( prepareTask.getReleaseId(),
descriptor );
         }
     }
 }

Modified: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PerformReleaseAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PerformReleaseAction.java?view=diff&rev=443226&r1=443225&r2=443226
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PerformReleaseAction.java
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PerformReleaseAction.java
Wed Sep 13 21:31:48 2006
@@ -21,6 +21,7 @@
 import org.apache.maven.continuum.release.DefaultReleaseManagerListener;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.codehaus.plexus.util.StringUtils;
 
 import java.io.File;
@@ -56,6 +57,8 @@
 
     private ContinuumReleaseManagerListener listener;
 
+    private ReleaseResult result;
+
     public String execute()
         throws Exception
     {
@@ -141,6 +144,8 @@
         {
             releaseManager.getListeners().remove( releaseId );
 
+            result = (ReleaseResult) releaseManager.getReleaseResults().get( releaseId );
+
             status = "finished";
         }
 
@@ -247,5 +252,15 @@
     public void setListener( ContinuumReleaseManagerListener listener )
     {
         this.listener = listener;
+    }
+
+    public ReleaseResult getResult()
+    {
+        return result;
+    }
+
+    public void setResult( ReleaseResult result )
+    {
+        this.result = result;
     }
 }

Modified: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PrepareReleaseAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PrepareReleaseAction.java?view=diff&rev=443226&r1=443225&r2=443226
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PrepareReleaseAction.java
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PrepareReleaseAction.java
Wed Sep 13 21:31:48 2006
@@ -24,6 +24,7 @@
 import org.apache.maven.model.Model;
 import org.apache.maven.plugins.release.versions.VersionInfo;
 import org.apache.maven.plugins.release.versions.DefaultVersionInfo;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.codehaus.plexus.util.StringUtils;
 
 import java.util.HashMap;
@@ -67,6 +68,8 @@
 
     private List relVersions;
 
+    private ReleaseResult result;
+
     private ContinuumReleaseManagerListener listener;
 
     public String execute()
@@ -104,6 +107,14 @@
         return "initialized";
     }
 
+    public String viewResult()
+        throws Exception
+    {
+        result = (ReleaseResult) getContinuum().getReleaseManager().getReleaseResults().get(
releaseId );
+
+        return "viewResult";
+    }
+
     public String checkProgress()
         throws Exception
     {
@@ -117,6 +128,8 @@
         {
             releaseManager.getListeners().remove( releaseId );
 
+            result = (ReleaseResult) releaseManager.getReleaseResults().get( releaseId );
+
             status = "finished";
         }
         else if ( listener.getState() == ContinuumReleaseManagerListener.LISTENING )
@@ -339,5 +352,15 @@
     public void setReleaseId( String releaseId )
     {
         this.releaseId = releaseId;
+    }
+
+    public ReleaseResult getResult()
+    {
+        return result;
+    }
+
+    public void setResult( ReleaseResult result )
+    {
+        this.result = result;
     }
 }

Added: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ViewReleaseResultAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ViewReleaseResultAction.java?view=auto&rev=443226
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ViewReleaseResultAction.java
(added)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ViewReleaseResultAction.java
Wed Sep 13 21:31:48 2006
@@ -0,0 +1,46 @@
+package org.apache.maven.continuum.web.action;
+
+import org.apache.maven.plugins.release.ReleaseResult;
+
+/**
+ * @author Edwin Punzalan
+ *
+ * @plexus.component
+ *   role="com.opensymphony.xwork.Action"
+ *   role-hint="viewReleaseResult"
+ */
+public class ViewReleaseResultAction
+    extends ContinuumActionSupport
+{
+    private String releaseId;
+
+    private ReleaseResult result;
+
+    public String execute()
+        throws Exception
+    {
+        result = (ReleaseResult) getContinuum().getReleaseManager().getReleaseResults().get(
releaseId );
+
+        return SUCCESS;
+    }
+
+    public String getReleaseId()
+    {
+        return releaseId;
+    }
+
+    public void setReleaseId( String releaseId )
+    {
+        this.releaseId = releaseId;
+    }
+
+    public ReleaseResult getResult()
+    {
+        return result;
+    }
+
+    public void setResult( ReleaseResult result )
+    {
+        this.result = result;
+    }
+}

Propchange: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ViewReleaseResultAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/resources/xwork.xml?view=diff&rev=443226&r1=443225&r2=443226
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/resources/xwork.xml
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/resources/xwork.xml
Wed Sep 13 21:31:48 2006
@@ -333,6 +333,10 @@
       <result name="finished">performReleaseFinished.jsp</result>
     </action>
 
+    <action name="viewReleaseResult" class="viewReleaseResult">
+      <result name="success">viewReleaseResult.jsp</result>
+    </action>
+
   </package>
 
   <package name="component" extends="default">

Modified: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performReleaseFinished.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performReleaseFinished.jsp?view=diff&rev=443226&r1=443225&r2=443226
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performReleaseFinished.jsp
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performReleaseFinished.jsp
Wed Sep 13 21:31:48 2006
@@ -38,6 +38,14 @@
             </ww:iterator>
           </table>
         </div>
+
+        <p>
+          <ww:url id="viewReleaseResultUrl" action="viewReleaseResult" namespace="/">
+            <ww:param name="releaseId" value="releaseId"/>
+          </ww:url>
+          <ww:a href="%{viewReleaseResultUrl}">View Release Output</ww:a>
+        </p>
+
         <ww:submit value="Done"/>
       </ww:form>
     </body>

Modified: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareReleaseFinished.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareReleaseFinished.jsp?view=diff&rev=443226&r1=443225&r2=443226
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareReleaseFinished.jsp
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareReleaseFinished.jsp
Wed Sep 13 21:31:48 2006
@@ -39,6 +39,14 @@
             </ww:iterator>
           </table>
         </div>
+
+        <p>
+          <ww:url id="viewReleaseResultUrl" action="viewReleaseResult" namespace="/">
+            <ww:param name="releaseId" value="releaseId"/>
+          </ww:url>
+          <ww:a href="%{viewReleaseResultUrl}">View Release Output</ww:a>
+        </p>
+
         <ww:submit value="Done"/>
       </ww:form>
     </body>

Added: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/viewReleaseResult.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/viewReleaseResult.jsp?view=auto&rev=443226
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/viewReleaseResult.jsp
(added)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/viewReleaseResult.jsp
Wed Sep 13 21:31:48 2006
@@ -0,0 +1,42 @@
+<%@ taglib uri="/webwork" prefix="ww" %>
+<%@ taglib uri="/tld/extremecomponents" prefix="ec" %>
+<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
+<%@ taglib uri="continuum" prefix="c1" %>
+<html>
+  <ww:i18n name="localization.Continuum">
+    <head>
+        <title><ww:text name="viewReleaseResult.page.title"/></title>
+    </head>
+    <body>
+      <h2>Continuum Release</h2>
+
+      <h4><ww:text name="buildResult.buildOutput"/></h4>
+      <div class="axial">
+        <table border="1" cellspacing="2" cellpadding="3" width="100%">
+          <c1:data label="%{getText('buildResult.startTime')}">
+              <ww:param name="after"><c1:date name="result.startTime"/></ww:param>
+          </c1:data>
+          <c1:data label="%{getText('buildResult.endTime')}">
+              <ww:param name="after"><c1:date name="result.endTime"/></ww:param>
+          </c1:data>
+          <c1:data label="%{getText('buildResult.state')}">
+              <ww:param name="after"><ww:property value="result.resultCode"/></ww:param>
+          </c1:data>
+        </table>
+      </div>
+
+      <h4><ww:text name="result.buildOutput"/></h4>
+      <p>
+        <ww:if test="result.output == ''">
+            <ww:text name="buildResult.noOutput"/>
+        </ww:if>
+        <ww:else>
+          <div style="width:100%; height:500px; overflow:auto; border-style: solid; border-width:
1px">
+            <code><pre><ww:property value="result.output"/></pre></code>
+          </div>
+        </ww:else>
+      </p>
+
+    </body>
+  </ww:i18n>
+</html>

Propchange: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/viewReleaseResult.jsp
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message