]> source.dussan.org Git - archiva.git/commitdiff
[MRM-430] fix error display
authorBrett Porter <brett@apache.org>
Fri, 3 Aug 2007 15:32:38 +0000 (15:32 +0000)
committerBrett Porter <brett@apache.org>
Fri, 3 Aug 2007 15:32:38 +0000 (15:32 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@562505 13f79535-47bb-0310-9956-ffa450edef68

archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnectorAction.java
archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyAction.java
archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/ConfigureRepositoryAction.java
archiva-web/archiva-webapp/src/main/resources/xwork.xml
archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteNetworkProxy.jsp
archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteProxyConnector.jsp
archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteRepository.jsp
archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp

index 2e5984faca69e624a011d172d7e7fb5f43b5ee3c..7d9a3e78ab9f28b0f4036aa9855e0356d5331d7e 100644 (file)
@@ -585,10 +585,12 @@ public class ConfigureProxyConnectorAction
         catch ( RegistryException e )
         {
             addActionError( "Unable to save configuration: " + e.getMessage() );
+            return INPUT;
         }
         catch ( IndeterminateConfigurationException e )
         {
             addActionError( e.getMessage() );
+            return INPUT;
         }
 
         return SUCCESS;
index d56ece0aa4ba609f4180a03c5a005ca969756e6a..4acc3ae144f71cc78c1f5a4dc8fd3aa30f1be209 100644 (file)
@@ -216,10 +216,12 @@ public class ConfigureNetworkProxyAction
         catch ( RegistryException e )
         {
             addActionError( "Unable to save configuration: " + e.getMessage() );
+            return INPUT;
         }
         catch ( IndeterminateConfigurationException e )
         {
             addActionError( e.getMessage() );
+            return INPUT;
         }
 
         return SUCCESS;
index d7259547e5f7432158e7502847a5acd6b8061cd9..a34c1e6d853762619825e0dc0e073e71c285fa35 100644 (file)
@@ -113,6 +113,7 @@ public class ConfigureRepositoryAction
             return ERROR;
         }
 
+        String result = SUCCESS;
         if ( StringUtils.equals( mode, "delete-entry" ) || StringUtils.equals( mode, "delete-contents" ) )
         {
             AdminRepositoryConfiguration existingRepository = getRepository();
@@ -127,33 +128,40 @@ public class ConfigureRepositoryAction
             try
             {
                 removeRepository( getRepoid() );
-                removeRepositoryRoles( existingRepository );
-                saveConfiguration();
+                result = saveConfiguration();
 
-                if ( StringUtils.equals( mode, "delete-contents" ) )
+                if ( result.equals( SUCCESS ) )
                 {
-                    removeContents( existingRepository );
+                    removeRepositoryRoles( existingRepository );
+                    if ( StringUtils.equals( mode, "delete-contents" ) )
+                    {
+                        removeContents( existingRepository );
+                    }
                 }
             }
             catch ( IOException e )
             {
                 addActionError( "Unable to delete repository: " + e.getMessage() );
+                result = INPUT;
             }
             catch ( RoleManagerException e )
             {
                 addActionError( "Unable to delete repository: " + e.getMessage() );
+                result = INPUT;
             }
             catch ( InvalidConfigurationException e )
             {
                 addActionError( "Unable to delete repository: " + e.getMessage() );
+                result = INPUT;
             }
             catch ( RegistryException e )
             {
                 addActionError( "Unable to delete repository: " + e.getMessage() );
+                result = INPUT;
             }
         }
 
-        return SUCCESS;
+        return result;
     }
 
     public String edit()
@@ -236,29 +244,34 @@ public class ConfigureRepositoryAction
             removeRepository( repoId );
         }
 
+        String result;
         try
         {
             addRepository( getRepository() );
-            saveConfiguration();
+            result = saveConfiguration();
         }
         catch ( IOException e )
         {
             addActionError( "I/O Exception: " + e.getMessage() );
+            result = INPUT;
         }
         catch ( RoleManagerException e )
         {
             addActionError( "Role Manager Exception: " + e.getMessage() );
+            result = INPUT;
         }
         catch ( InvalidConfigurationException e )
         {
             addActionError( "Invalid Configuration Exception: " + e.getMessage() );
+            result = INPUT;
         }
         catch ( RegistryException e )
         {
             addActionError( "Configuration Registry Exception: " + e.getMessage() );
+            result = INPUT;
         }
 
-        return SUCCESS;
+        return result;
     }
 
     private boolean validateFields( String mode )
@@ -412,6 +425,7 @@ public class ConfigureRepositoryAction
         catch ( IndeterminateConfigurationException e )
         {
             addActionError( e.getMessage() );
+            return INPUT;
         }
 
         return SUCCESS;
index 214735ef2e5b3c9c43b0a4c28551809e0803b720..126ae778077267e96b191ba3f8b2b1a6f81959a7 100644 (file)
 
     <action name="saveRepository" class="configureRepositoryAction" method="save">
       <result name="success" type="redirect-action">repositories</result>
-      <result name="input">/WEB-INF/jsp/admin/addRepository.jsp</result>
+      <result name="input">/WEB-INF/jsp/admin/editRepository.jsp</result>
       <result name="error">/WEB-INF/jsp/admin/editRepository.jsp</result>
       <interceptor-ref name="configuredPrepareParamsStack"/>
     </action>
index ff7ceadf2a551def4fcc24630b707088a782d0bf..c4feaa87aa5451908e2e81ebc38c6d61cd2612a4 100644 (file)
@@ -29,6 +29,8 @@
 
 <h1>Admin: Delete Network Proxy</h1>
 
+<ww:actionerror/>
+
 <div id="contentArea">
 
   <h2>Delete Network Proxy</h2>
@@ -36,9 +38,9 @@
   <blockquote>
     <strong><span class="statusFailed">WARNING:</span> This operation can not be undone.</strong>
   </blockquote>
-  
+
   <p>
-  Are you sure you want to delete network proxy <code>${proxyid}</code> ?
+    Are you sure you want to delete network proxy <code>${proxyid}</code> ?
   </p>
 
   <ww:form method="post" action="deleteNetworkProxy!delete" namespace="/admin" validate="true">
index 2535b80fb757b96bc600fcd05f9a04d1e6fc0552..de6937ecae0a7d27f68b2ffe22a4aa5ece88ac3c 100644 (file)
@@ -29,6 +29,8 @@
 
 <h1>Admin: Delete Proxy Connector</h1>
 
+<ww:actionerror/>
+
 <div id="contentArea">
 
   <h2>Delete Proxy Connector</h2>
   <blockquote>
     <strong><span class="statusFailed">WARNING:</span> This operation can not be undone.</strong>
   </blockquote>
-  
+
   <p>
-  Are you sure you want to delete proxy connector <code>[ ${source} , ${target} ]</code> ?
+    Are you sure you want to delete proxy connector <code>[ ${source} , ${target} ]</code> ?
   </p>
 
   <ww:form method="post" action="deleteProxyConnector!delete" namespace="/admin" validate="true">
     <ww:hidden name="target"/>
-       <ww:hidden name="source"/>
+    <ww:hidden name="source"/>
     <ww:submit value="Delete"/>
   </ww:form>
 </div>
index c028c1dd35837d3b00ba6cc05f6f13ad6c9ba5e1..c016189b7799d86c827e03ab76b691e13ccc3688 100644 (file)
@@ -29,6 +29,8 @@
 
 <h1>Admin: Delete Repository</h1>
 
+<ww:actionerror/>
+
 <div id="contentArea">
 
   <h2>Delete Repository</h2>
index 062e8e610e65c6803e9d631e1cdc08b0a7482dc2..02119c35dcafbc9747f2ab23825b466a8b757b94 100644 (file)
 
 <h1>Admin: Edit Repository</h1>
 
+<ww:actionerror/>
+
 <div id="contentArea">
 
   <h2>Edit Repository</h2>
 
   <ww:actionmessage/>
   <ww:form method="post" action="saveRepository" namespace="/admin" validate="false">
-    <ww:hidden name="mode" value="edit"/>  
+    <ww:hidden name="mode" value="edit"/>
     <ww:hidden name="repository.id"/>
     <%@ include file="/WEB-INF/jsp/admin/include/repositoryForm.jspf" %>
     <ww:submit value="Update Repository"/>