continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r695183 - in /continuum/trunk: continuum-api/src/main/java/org/apache/continuum/dao/ continuum-api/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-model/src/main/mdo/ continuum-st...
Date Sun, 14 Sep 2008 10:32:13 GMT
Author: ctan
Date: Sun Sep 14 03:32:06 2008
New Revision: 695183

URL: http://svn.apache.org/viewvc?rev=695183&view=rev
Log:
[CONTINUUM-1830] added what project was released and what goal was used

Added:
    continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/ContinuumReleaseResultDaoImpl.java
      - copied, changed from r693754, continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/ContinuumReleaseResultImpl.java
Removed:
    continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/ContinuumReleaseResultImpl.java
Modified:
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/ContinuumReleaseResultDao.java
    continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/trunk/continuum-model/src/main/mdo/continuum.xml
    continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
    continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupReleaseResults.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseFinished.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseInProgress.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseInitialized.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseRollbackWarning.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseViewResult.jsp

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/ContinuumReleaseResultDao.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/ContinuumReleaseResultDao.java?rev=695183&r1=695182&r2=695183&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/ContinuumReleaseResultDao.java
(original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/ContinuumReleaseResultDao.java
Sun Sep 14 03:32:06 2008
@@ -42,4 +42,8 @@
 
     ContinuumReleaseResult getContinuumReleaseResult( int releaseResultId )
         throws ContinuumObjectNotFoundException, ContinuumStoreException;
+    
+    ContinuumReleaseResult getContinuumReleaseResult( int projectId, String releaseGoal,
long startTime, long endTime )
+        throws ContinuumStoreException;
+        
 }

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=695183&r1=695182&r2=695183&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
(original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
Sun Sep 14 03:32:06 2008
@@ -659,4 +659,7 @@
     List<ContinuumReleaseResult> getContinuumReleaseResultsByProjectGroup( int projectGroupId
);
 
     List<ContinuumReleaseResult> getAllContinuumReleaseResults();
+
+    ContinuumReleaseResult getContinuumReleaseResult( int projectId, String releaseGoal,
long startTime, long endTime )
+        throws ContinuumException;
 }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=695183&r1=695182&r2=695183&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Sun Sep 14 03:32:06 2008
@@ -3373,4 +3373,17 @@
     {
         return releaseResultDao.getContinuumReleaseResultsByProjectGroup( projectGroupId
);
     }
+
+    public ContinuumReleaseResult getContinuumReleaseResult( int projectId, String releaseGoal,
long startTime, long endTime )
+        throws ContinuumException
+    {
+        try
+        {
+            return releaseResultDao.getContinuumReleaseResult( projectId, releaseGoal, startTime,
endTime );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new ContinuumException( "Error while retrieving continuumReleaseResult
of projectId " + projectId + " with releaseGoal: " + releaseGoal, e);
+        }
+    }
 }

Modified: continuum/trunk/continuum-model/src/main/mdo/continuum.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-model/src/main/mdo/continuum.xml?rev=695183&r1=695182&r2=695183&view=diff
==============================================================================
--- continuum/trunk/continuum-model/src/main/mdo/continuum.xml (original)
+++ continuum/trunk/continuum-model/src/main/mdo/continuum.xml Sun Sep 14 03:32:06 2008
@@ -1513,6 +1513,18 @@
             <type>ProjectGroup</type>
           </association>
         </field>
+        <field>
+          <name>project</name>
+          <version>1.1.2+</version>
+          <association xml.reference="true" stash.part="true" jpox.dependent="false">
+            <type>Project</type>
+          </association>
+        </field>
+        <field>
+          <name>releaseGoal</name>
+          <version>1.1.2+</version>
+          <type>String</type>
+        </field>
       </fields>
     </class> 
   </classes>

Copied: continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/ContinuumReleaseResultDaoImpl.java
(from r693754, continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/ContinuumReleaseResultImpl.java)
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/ContinuumReleaseResultDaoImpl.java?p2=continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/ContinuumReleaseResultDaoImpl.java&p1=continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/ContinuumReleaseResultImpl.java&r1=693754&r2=695183&rev=695183&view=diff
==============================================================================
--- continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/ContinuumReleaseResultImpl.java
(original)
+++ continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/ContinuumReleaseResultDaoImpl.java
Sun Sep 14 03:32:06 2008
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import java.util.Collection;
 import java.util.List;
 
 import javax.jdo.Extent;
@@ -34,7 +35,7 @@
  * @author <a href="mailto:ctan@apache.org">Maria Catherine Tan</a>
  * @plexus.component role="org.apache.continuum.dao.ContinuumReleaseResultDao"
  */
-public class ContinuumReleaseResultImpl
+public class ContinuumReleaseResultDaoImpl
     extends AbstractDao
     implements ContinuumReleaseResultDao
 {
@@ -55,6 +56,55 @@
         return (ContinuumReleaseResult) getObjectById( ContinuumReleaseResult.class, releaseResultId
);
     }
 
+    public ContinuumReleaseResult getContinuumReleaseResult( int projectId, String releaseGoal,
long startTime, long endTime )
+        throws ContinuumStoreException
+    {
+        PersistenceManager pm = getPersistenceManager();
+
+        Transaction tx = pm.currentTransaction();
+
+        try
+        {
+            tx.begin();
+            
+            Extent extent = pm.getExtent( ContinuumReleaseResult.class, true );
+
+            Query query = pm.newQuery( extent );
+
+            query.declareImports( "import java.lang.String" );
+            
+            query.declareParameters( "int projectId, String releaseGoal, long startTime,
long endTime" );
+            
+            query.setFilter( "this.project.id == projectId && this.releaseGoal ==
releaseGoal && this.startTime == startTime && this.endTime == endTime" );
+            
+            Object[] params = new Object[4];
+            params[0] = projectId;
+            params[1] = releaseGoal;
+            params[2] = startTime;
+            params[3] = endTime;
+
+            Collection result = (Collection) query.executeWithArray( params );
+
+            if ( result.size() == 0 )
+            {
+                tx.commit();
+
+                return null;
+            }
+
+            Object object = pm.detachCopy( result.iterator().next() );
+
+            tx.commit();
+            
+            return (ContinuumReleaseResult) object;
+        }
+        finally
+        {
+            rollback( tx );
+        }
+
+    }
+    
     public List<ContinuumReleaseResult> getContinuumReleaseResultsByProjectGroup( int
projectGroupId )
     {
         PersistenceManager pm = getPersistenceManager();

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java?rev=695183&r1=695182&r2=695183&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java
Sun Sep 14 03:32:06 2008
@@ -53,7 +53,11 @@
     private ReleaseResult result;
     
     private boolean confirmed;
-    
+
+    private String projectName;
+
+    private String releaseGoal;
+
     public String list()
         throws ContinuumException
     {
@@ -131,7 +135,10 @@
         result.setStartTime( releaseResult.getStartTime() );
         result.setEndTime( releaseResult.getEndTime() );
         result.setResultCode( releaseResult.getResultCode() );
-        
+
+        releaseGoal = releaseResult.getReleaseGoal();
+        projectName = releaseResult.getProject().getName();
+
         try
         {
             File logFile = getContinuum().getConfiguration().getReleaseOutputFile( projectGroupId,
"releases-" + releaseResult.getStartTime() );
@@ -255,4 +262,24 @@
     {
         this.confirmed = confirmed;
     }
+
+    public String getProjectName()
+    {
+        return projectName;
+    }
+
+    public void setProjectName( String projectName )
+    {
+        this.projectName = projectName;
+    }
+
+    public String getReleaseGoal()
+    {
+        return releaseGoal;
+    }
+
+    public void setReleaseGoal( String releaseGoal )
+    {
+        this.releaseGoal = releaseGoal;
+    }
 }

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java?rev=695183&r1=695182&r2=695183&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseInProgressAction.java
Sun Sep 14 03:32:06 2008
@@ -95,8 +95,11 @@
         {
             ReleaseResult result = (ReleaseResult) releaseManager.getReleaseResults().get(
releaseId );
 
-            ContinuumReleaseResult releaseResult = createContinuumReleaseResult( result );
-            getContinuum().addContinuumReleaseResult( releaseResult );
+            if ( result != null && getContinuum().getContinuumReleaseResult( projectId,
releaseGoal, result.getStartTime(), result.getEndTime() ) == null )
+            {
+                ContinuumReleaseResult releaseResult = createContinuumReleaseResult( result
);
+                getContinuum().addContinuumReleaseResult( releaseResult );
+            }
         }
 
         return status;
@@ -209,6 +212,8 @@
         Project project = getContinuum().getProject( projectId );
         ProjectGroup projectGroup = project.getProjectGroup();
         releaseResult.setProjectGroup( projectGroup );
+        releaseResult.setProject( project );
+        releaseResult.setReleaseGoal( releaseGoal );
 
         String releaseName = "releases-" + result.getStartTime();
 

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java?rev=695183&r1=695182&r2=695183&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseRollbackAction.java
Sun Sep 14 03:32:06 2008
@@ -46,6 +46,8 @@
 
     private String projectGroupName = "";
 
+    private String releaseGoal;
+
     public String execute()
         throws Exception
     {
@@ -129,4 +131,14 @@
 
         return projectGroupName;
     }
+
+    public String getReleaseGoal()
+    {
+        return releaseGoal;
+    }
+
+    public void setReleaseGoal( String releaseGoal )
+    {
+        this.releaseGoal = releaseGoal;
+    }
 }

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=695183&r1=695182&r2=695183&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Sun Sep 14 03:32:06 2008
@@ -652,6 +652,8 @@
 releaseViewResult.error=ERROR
 releaseViewResult.output=Release Execution Output
 releaseViewResult.noOutput=No Output
+releaseViewResult.projectName=Project Name
+releaseViewResult.releaseGoal=Release Goal
 
 # ----------------------------------------------------------------------
 # Page: User
@@ -906,6 +908,8 @@
 releaseResults.endTime = End Time
 releaseResults.success = SUCCESSFUL
 releaseResults.error = ERROR
+releaseResults.project = Project Name
+releaseResults.releaseGoal = Release Goal
 
 # ----------------------------------------------------------------------
 # Page: Confirm Delete Release Results

Modified: continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml?rev=695183&r1=695182&r2=695183&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/xwork.xml (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/xwork.xml Sun Sep 14 03:32:06 2008
@@ -470,6 +470,7 @@
         <param name="actionName">releaseInProgress</param>
         <param name="releaseId">${releaseId}</param>
         <param name="projectId">${projectId}</param>
+        <param name="releaseGoal">prepare</param>
       </result>
     </action>
 
@@ -483,6 +484,7 @@
         <param name="actionName">releaseInProgress</param>
         <param name="releaseId">${releaseId}</param>
         <param name="projectId">${projectId}</param>
+        <param name="releaseGoal">perform</param>
       </result>
     </action>
 
@@ -496,6 +498,7 @@
         <param name="actionName">releaseInProgress</param>
         <param name="projectId">${projectId}</param>
         <param name="releaseId">${releaseId}</param>
+        <param name="releaseGoal">perform</param>
       </result>
     </action>
 

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupReleaseResults.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupReleaseResults.jsp?rev=695183&r1=695182&r2=695183&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupReleaseResults.jsp
(original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupReleaseResults.jsp
Sun Sep 14 03:32:06 2008
@@ -54,6 +54,8 @@
                 <input type="checkbox" name="selectedReleaseResults" value="${result.id}"
/>
               </ec:column>
             </redback:ifAuthorized>
+            <ec:column property="project.name" title="releaseResults.project"/>
+            <ec:column property="releaseGoal" title="releaseResults.releaseGoal"/>
             <ec:column property="startTime" title="releaseResults.startTime" cell="date"/>
             <ec:column property="endTime" title="releaseResults.endTime" cell="date"/>
             <ec:column property="resultCode" title="releaseResults.state">

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseFinished.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseFinished.jsp?rev=695183&r1=695182&r2=695183&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseFinished.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseFinished.jsp Sun Sep
14 03:32:06 2008
@@ -69,6 +69,7 @@
             <ww:form action="releaseRollbackWarning" method="post">
               <ww:hidden name="projectId"/>
               <ww:hidden name="releaseId"/>
+              <ww:hidden name="releaseGoal"/>
               <ww:submit value="Rollback Changes"/>
             </ww:form>
           </td>

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseInProgress.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseInProgress.jsp?rev=695183&r1=695182&r2=695183&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseInProgress.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseInProgress.jsp Sun
Sep 14 03:32:06 2008
@@ -64,6 +64,7 @@
       <ww:form action="releaseInProgress" method="get">
         <ww:hidden name="projectId"/>
         <ww:hidden name="releaseId"/>
+        <ww:hidden name="releaseGoal"/>
         <ww:submit value="Refresh"/>
       </ww:form>
     </body>

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseInitialized.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseInitialized.jsp?rev=695183&r1=695182&r2=695183&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseInitialized.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseInitialized.jsp Sun
Sep 14 03:32:06 2008
@@ -36,6 +36,7 @@
       <ww:form action="releaseInProgress" method="get">
         <ww:hidden name="projectId"/>
         <ww:hidden name="releaseId"/>
+        <ww:hidden name="releaseGoal"/>
         <ww:submit value="Refresh"/>
       </ww:form>
     </body>

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseRollbackWarning.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseRollbackWarning.jsp?rev=695183&r1=695182&r2=695183&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseRollbackWarning.jsp
(original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseRollbackWarning.jsp
Sun Sep 14 03:32:06 2008
@@ -43,6 +43,7 @@
             <ww:form action="releaseInProgress" method="post">
               <ww:hidden name="projectId"/>
               <ww:hidden name="releaseId"/>
+              <ww:hidden name="releaseGoal"/>
               <ww:submit value="Cancel"/>
             </ww:form>
           </td>

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseViewResult.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseViewResult.jsp?rev=695183&r1=695182&r2=695183&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseViewResult.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releaseViewResult.jsp Sun
Sep 14 03:32:06 2008
@@ -30,6 +30,12 @@
       <h4><ww:text name="releaseViewResult.summary"/></h4>
       <div class="axial">
         <table border="1" cellspacing="2" cellpadding="3" width="100%">
+          <c1:data label="%{getText('releaseViewResult.projectName')}">
+            <ww:param name="after"><ww:property value="projectName"/></ww:param>
+          </c1:data>
+          <c1:data label="%{getText('releaseViewResult.releaseGoal')}">
+            <ww:param name="after"><ww:property value="releaseGoal"/></ww:param>
+          </c1:data>
           <c1:data label="%{getText('releaseViewResult.startTime')}">
               <ww:param name="after"><c1:date name="result.startTime"/></ww:param>
           </c1:data>



Mime
View raw message