continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r668330 - in /continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/ resources/ resources/localization/ webapp/WEB-INF/jsp/
Date Mon, 16 Jun 2008 22:03:46 GMT
Author: olamy
Date: Mon Jun 16 15:03:45 2008
New Revision: 668330

URL: http://svn.apache.org/viewvc?rev=668330&view=rev
Log:
[CONTINUUM-1675] Improve error message when scm element is missing from a child pom


Modified:
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
    continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties
    continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_pt_BR.properties
    continuum/trunk/continuum-webapp/src/main/resources/webwork.properties
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java?rev=668330&r1=668329&r2=668330&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
Mon Jun 16 15:03:45 2008
@@ -73,6 +73,8 @@
     private List<BuildDefinitionTemplate> buildDefinitionTemplates;
 
     private int buildDefinitionTemplateId;
+    
+    private List<String> errorMessages = new ArrayList<String>();
 
     public String execute()
         throws ContinuumException, BuildDefinitionServiceException
@@ -155,11 +157,19 @@
 
         if ( result.hasErrors() )
         {
-            Iterator it = result.getErrors().iterator();
-
-            while ( it.hasNext() )
+            for ( String key : result.getErrors() )
             {
-                addActionError( (String) it.next() );
+                String cause = result.getErrorsWithCause().get( key );
+                String msg = getText( key, new String[] { cause } );
+                if ( !StringUtils.equals( msg, key ) )
+                {
+                    errorMessages.add( msg );
+                }
+                else
+                {
+                    addActionError( msg );
+                }
+                
             }
 
             return doDefault();
@@ -389,4 +399,14 @@
             return false;
         }
     }
+
+    public List<String> getErrorMessages()
+    {
+        return errorMessages;
+    }
+
+    public void setErrorMessages( List<String> errorMessages )
+    {
+        this.errorMessages = errorMessages;
+    }
 }

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=668330&r1=668329&r2=668330&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Mon Jun 16 15:03:45 2008
@@ -243,7 +243,7 @@
 add.project.missing.version.error = Missing ''version'' element in the POM.
 add.project.missing.name.error = Missing ''name'' element in the POM.
 add.project.missing.repository.error = Missing ''repository'' element in the POM.
-add.project.missing.scm.error = Missing ''scm'' element in the POM.
+add.project.missing.scm.error = Missing ''scm'' element in the POM, projet {0}
 add.project.missing.scm.connection.error = Missing ''connection'' sub-element in the ''scm''
element in the POM.
 add.project.missing.notifier.type.error = Missing ''type'' sub-element in the ''notifier''
element in the POM.
 add.project.missing.notifier.configuration.error = Missing ''configuration'' sub-element
in the ''notifier'' element in the POM.

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties?rev=668330&r1=668329&r2=668330&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties
Mon Jun 16 15:03:45 2008
@@ -245,7 +245,7 @@
 add.project.missing.version.error = L''\u00e9l\u00e9ment "version" est manquant dans le fichier
POM.
 add.project.missing.name.error = L''\u00e9l\u00e9ment "name" est manquant dans le fichier
POM.
 add.project.missing.repository.error = L''\u00e9l\u00e9ment "repository" est manquant dans
le fichier POM.
-add.project.missing.scm.error = L''\u00e9l\u00e9ment "scm" est manquant dans le fichier POM.
+add.project.missing.scm.error = L''\u00e9l\u00e9ment "scm" est manquant dans le fichier POM,
projet {0}
 add.project.missing.scm.connection.error = Le sous-\u00e9l\u00e9ment "connection est manquant
dans le fichier POM.
 add.project.missing.notifier.type.error = Le sous-\u00e9l\u00e9ment "type" dans l''\u00e9l\u00e9ment
"notifier" est manquant dans le fichier POM.
 add.project.missing.notifier.configuration.error = Le sous-\u00e9l\u00e9ment "configuration"
dans l'\u00e9l\u00e9ment "notifier" est manquant dans le fichier POM.

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_pt_BR.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_pt_BR.properties?rev=668330&r1=668329&r2=668330&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_pt_BR.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_pt_BR.properties
Mon Jun 16 15:03:45 2008
@@ -77,7 +77,7 @@
 add.project.missing.pom.error                    = Arquivo POM n\u00E3o existe. Talvez o
POM que voc\u00EA especificou ou um de seus m\u00F3dulos n\u00E3o existam.
 add.project.missing.repository.error             = Falta elemento ''repository'' no POM.
 add.project.missing.scm.connection.error         = Falta sub-elemento ''connection'' no elemento
''scm'' no POM.
-add.project.missing.scm.error                    = Falta o elemento ''scm'' no POM.
+add.project.missing.scm.error                    = Falta o elemento ''scm'' no POM, projet
{0}
 add.project.missing.version.error                = Falta o elemento ''version'' no POM.
 add.project.nogroup.error                        = Nenhum grupo de projeto foi fornecido.
 add.project.project.building.error               = Erro desconhecido ao realizar build do
POM.

Modified: continuum/trunk/continuum-webapp/src/main/resources/webwork.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/webwork.properties?rev=668330&r1=668329&r2=668330&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/webwork.properties (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/webwork.properties Mon Jun 16 15:03:45
2008
@@ -37,4 +37,4 @@
 #webwork.multipart.maxSize = 
 
 # Localization
-webwork.custom.i18n.resources=org.codehaus.plexus.redback.xwork.default,org.apache.maven.continuum.redback.custom
+webwork.custom.i18n.resources=localization,org.codehaus.plexus.redback.xwork.default,org.apache.maven.continuum.redback.custom

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp?rev=668330&r1=668329&r2=668330&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp Mon
Jun 16 15:03:45 2008
@@ -31,10 +31,15 @@
                 <h3><ww:text name="add.m2.project.section.title"/></h3>
                 <div class="axial">
                     <ww:form method="post" action="addMavenTwoProject.action" name="addMavenTwoProject"
enctype="multipart/form-data">
-                        <c:if test="${!empty actionErrors}">
+                        <c:if test="${!empty actionErrors || !empty errorMessages}">
                           <div class="errormessage">
                             <c:forEach items="${actionErrors}" var="actionError">
-                              <p><ww:text name="${actionError}"/></p>
+                              <p>
+                                <ww:text name="${actionError}">${actionError}</ww:text>
+                              </p>
+                            </c:forEach>
+                            <c:forEach items="${errorMessages}" var="errorMessage">
+                              <p>${errorMessage}</p>
                             </c:forEach>
                           </div>
                         </c:if>



Mime
View raw message