From: Brett Porter Date: Fri, 3 Aug 2007 15:32:38 +0000 (+0000) Subject: [MRM-430] fix error display X-Git-Tag: 1.0-beta-1~13 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=83dfd74838cc58cdb8a9de6d1883f1969b811552;p=archiva.git [MRM-430] fix error display git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@562505 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnectorAction.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnectorAction.java index 2e5984fac..7d9a3e78a 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnectorAction.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnectorAction.java @@ -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; diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyAction.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyAction.java index d56ece0aa..4acc3ae14 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyAction.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyAction.java @@ -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; diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/ConfigureRepositoryAction.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/ConfigureRepositoryAction.java index d7259547e..a34c1e6d8 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/ConfigureRepositoryAction.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/ConfigureRepositoryAction.java @@ -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; diff --git a/archiva-web/archiva-webapp/src/main/resources/xwork.xml b/archiva-web/archiva-webapp/src/main/resources/xwork.xml index 214735ef2..126ae7780 100644 --- a/archiva-web/archiva-webapp/src/main/resources/xwork.xml +++ b/archiva-web/archiva-webapp/src/main/resources/xwork.xml @@ -258,7 +258,7 @@ repositories - /WEB-INF/jsp/admin/addRepository.jsp + /WEB-INF/jsp/admin/editRepository.jsp /WEB-INF/jsp/admin/editRepository.jsp diff --git a/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteNetworkProxy.jsp b/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteNetworkProxy.jsp index ff7ceadf2..c4feaa87a 100644 --- a/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteNetworkProxy.jsp +++ b/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteNetworkProxy.jsp @@ -29,6 +29,8 @@

Admin: Delete Network Proxy

+ +

Delete Network Proxy

@@ -36,9 +38,9 @@
WARNING: This operation can not be undone.
- +

- Are you sure you want to delete network proxy ${proxyid} ? + Are you sure you want to delete network proxy ${proxyid} ?

diff --git a/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteProxyConnector.jsp b/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteProxyConnector.jsp index 2535b80fb..de6937eca 100644 --- a/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteProxyConnector.jsp +++ b/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteProxyConnector.jsp @@ -29,6 +29,8 @@

Admin: Delete Proxy Connector

+ +

Delete Proxy Connector

@@ -36,14 +38,14 @@
WARNING: This operation can not be undone.
- +

- Are you sure you want to delete proxy connector [ ${source} , ${target} ] ? + Are you sure you want to delete proxy connector [ ${source} , ${target} ] ?

- +
diff --git a/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteRepository.jsp b/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteRepository.jsp index c028c1dd3..c016189b7 100644 --- a/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteRepository.jsp +++ b/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteRepository.jsp @@ -29,6 +29,8 @@

Admin: Delete Repository

+ +

Delete Repository

diff --git a/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp b/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp index 062e8e610..02119c35d 100644 --- a/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp +++ b/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp @@ -29,13 +29,15 @@

Admin: Edit Repository

+ +

Edit Repository

- + <%@ include file="/WEB-INF/jsp/admin/include/repositoryForm.jspf" %>