continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r510046 - in /maven/continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/ProjectGroupAction.java resources/localization/Continuum.properties resources/xwork.xml webapp/WEB-INF/jsp/projectGroupSummary.jsp
Date Wed, 21 Feb 2007 15:01:03 GMT
Author: evenisse
Date: Wed Feb 21 07:01:01 2007
New Revision: 510046

URL: http://svn.apache.org/viewvc?view=rev&rev=510046
Log:
o Fix NPE when user try to release an empty group
o Print release error messages instead of exception

Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
    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/WEB-INF/jsp/projectGroupSummary.jsp

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java?view=diff&rev=510046&r1=510045&r2=510046
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
Wed Feb 21 07:01:01 2007
@@ -398,13 +398,19 @@
                             {
                                 //currently, we have no provisions for releasing 2 or more
parents
                                 //at the same time, this will be implemented in the future
-                                throw new ContinuumException(
-                                    "Cannot release two or more parent projects in the same
project group at the same time." );
+                                addActionError( "projectGroup.release.error.severalParentProjects"
);
+                                return INPUT;
                             }
                         }
                     }
                 }
 
+                if ( parent == null )
+                {
+                    addActionError( "projectGroup.release.error.emptyGroup" );
+                    return INPUT;
+                }
+
                 releaseProjectId = parent.getId();
 
                 if ( allBuildsOk )
@@ -413,8 +419,8 @@
                 }
                 else
                 {
-                    throw new ContinuumException(
-                        "Cannot release project group: one or more projects in the group
were not built successfully." );
+                    addActionError( "projectGroup.release.error.projectNotInSuccess" );
+                    return INPUT;
                 }
             }
         }

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?view=diff&rev=510046&r1=510045&r2=510046
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Wed Feb 21 07:01:01 2007
@@ -138,6 +138,9 @@
 projectGroup.tab.members = Members
 projectGroup.tab.buildDefinitions = Build Definitions
 projectGroup.tab.notifiers = Notifiers
+projectGroup.release.error.emptyGroup = Cannot release an empty group.
+projectGroup.release.error.severalParentProjects = Cannot release two or more parent projects
in the same project group at the same time.
+projectGroup.release.error.projectNotInSuccess = Cannot release project group: one or more
projects in the group were not built successfully.
 
 # ----------------------------------------------------------------------
 # Page: Add Project Group

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml?view=diff&rev=510046&r1=510045&r2=510046
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml Wed Feb 21 07:01:01
2007
@@ -278,6 +278,7 @@
     </action>
     
     <action name="releaseProjectGroup" class="projectGroup" method="release">
+      <result name="input">/WEB-INF/jsp/projectGroupSummary.jsp</result>
       <result name="success" type="redirect-action">
         <param name="actionName">releasePromptGoal</param>
         <param name="projectId">${releaseProjectId}</param>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp?view=diff&rev=510046&r1=510045&r2=510046
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/projectGroupSummary.jsp
Wed Feb 21 07:01:01 2007
@@ -81,6 +81,14 @@
     <pss:ifAnyAuthorized permissions="continuum-build-group,continuum-remove-group" resource="${projectGroup.name}">
       <h3>Project Group Actions</h3>
 
+      <c:if test="${!empty actionErrors}">
+        <div class="errormessage">
+          <c:forEach items="${actionErrors}" var="actionError">
+            <p><ww:text name="${actionError}"/></p>
+          </c:forEach>
+        </div>
+      </c:if>
+
       <div class="functnbar3">
         <table>
           <tr>



Mime
View raw message