diff options
author | Joakim Erdfelt <joakime@apache.org> | 2007-06-21 17:41:21 +0000 |
---|---|---|
committer | Joakim Erdfelt <joakime@apache.org> | 2007-06-21 17:41:21 +0000 |
commit | 7db9b8b6936cf731ac53258f190f7c610eae7950 (patch) | |
tree | c3f872ee72627fd1f046b3291fc64221239f94ed | |
parent | 89f0d557535d889d3536fb78de9f0b1494716899 (diff) | |
download | archiva-7db9b8b6936cf731ac53258f190f7c610eae7950.tar.gz archiva-7db9b8b6936cf731ac53258f190f7c610eae7950.zip |
[MRM-357]: Update Consumers button in Repository Scanning doesn't work
Applying patch from Napoleon Ramirez.
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@549567 13f79535-47bb-0310-9956-ffa450edef68
3 files changed, 49 insertions, 11 deletions
diff --git a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java index 2ea6bf601..df08dbcf7 100644 --- a/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java +++ b/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java @@ -73,12 +73,22 @@ public class RepositoryScanningAction /** * List of {@link AdminRepositoryConsumer} objects for consumers of known content. */ - private List knownContentConsumers = new ArrayList(); + private List knownContentConsumers; + + /** + * List of enabled {@link AdminRepositoryConsumer} objects for consumers of known content. + */ + private List enabledKnownContentConsumers; /** * List of {@link AdminRepositoryConsumer} objects for consumers of invalid/unknown content. */ - private List invalidContentConsumers = new ArrayList(); + private List invalidContentConsumers; + + /** + * List of enabled {@link AdminRepositoryConsumer} objects for consumers of invalid/unknown content. + */ + private List enabledInvalidContentConsumers; private String pattern; @@ -183,14 +193,12 @@ public class RepositoryScanningAction addAdminRepoConsumer = new AddAdminRepoConsumerClosure( reposcanning.getKnownContentConsumers() ); CollectionUtils.forAllDo( repoconsumerUtil.getAvailableKnownConsumers(), addAdminRepoConsumer ); - knownContentConsumers.clear(); - knownContentConsumers.addAll( addAdminRepoConsumer.getList() ); + this.knownContentConsumers = addAdminRepoConsumer.getList(); Collections.sort( knownContentConsumers, AdminRepositoryConsumerComparator.getInstance() ); addAdminRepoConsumer = new AddAdminRepoConsumerClosure( reposcanning.getInvalidContentConsumers() ); CollectionUtils.forAllDo( repoconsumerUtil.getAvailableInvalidConsumers(), addAdminRepoConsumer ); - invalidContentConsumers.clear(); - invalidContentConsumers.addAll( addAdminRepoConsumer.getList() ); + this.invalidContentConsumers = addAdminRepoConsumer.getList(); Collections.sort( invalidContentConsumers, AdminRepositoryConsumerComparator.getInstance() ); fileTypeIds = new ArrayList(); @@ -232,13 +240,19 @@ public class RepositoryScanningAction public String updateInvalidConsumers() { addActionMessage("Update Invalid Consumers"); - return INPUT; + + archivaConfiguration.getConfiguration().getRepositoryScanning().setInvalidContentConsumers( enabledInvalidContentConsumers ); + + return saveConfiguration(); } public String updateKnownConsumers() { addActionMessage("Update Known Consumers"); - return INPUT; + + archivaConfiguration.getConfiguration().getRepositoryScanning().setKnownContentConsumers( enabledKnownContentConsumers ); + + return saveConfiguration(); } private FileType findFileType( String id ) @@ -272,8 +286,29 @@ public class RepositoryScanningAction catch ( RegistryException e ) { addActionError( "Unable to save configuration: " + e.getMessage() ); + return INPUT; } - return INPUT; + return SUCCESS; + } + + public List getEnabledInvalidContentConsumers() + { + return enabledInvalidContentConsumers; + } + + public void setEnabledInvalidContentConsumers( List enabledInvalidContentConsumers ) + { + this.enabledInvalidContentConsumers = enabledInvalidContentConsumers; + } + + public List getEnabledKnownContentConsumers() + { + return enabledKnownContentConsumers; + } + + public void setEnabledKnownContentConsumers( List enabledKnownContentConsumers ) + { + this.enabledKnownContentConsumers = enabledKnownContentConsumers; } } diff --git a/archiva-web/archiva-webapp/src/main/resources/xwork.xml b/archiva-web/archiva-webapp/src/main/resources/xwork.xml index ad6781a1f..8bd76ea2c 100644 --- a/archiva-web/archiva-webapp/src/main/resources/xwork.xml +++ b/archiva-web/archiva-webapp/src/main/resources/xwork.xml @@ -337,6 +337,9 @@ <action name="repositoryScanning" class="repositoryScanningAction" method="input"> <result name="input">/WEB-INF/jsp/admin/repositoryScanning.jsp</result> + <result name="success" type="redirect-action"> + <param name="actionName">repositoryScanning</param> + </result> </action> <!-- .\ DATABASE \.________________________________________________ --> diff --git a/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositoryScanning.jsp b/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositoryScanning.jsp index 16fd98470..ff5f64df9 100644 --- a/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositoryScanning.jsp +++ b/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositoryScanning.jsp @@ -175,7 +175,7 @@ <tr> <td class="${bgcolor}"> - <ww:checkbox name="enabledKnownConsumer[]" theme="simple" value="${consumer.enabled}" /> + <input type="checkbox" name="enabledKnownContentConsumers" theme="simple" value="${consumer.id}" <c:if test="${consumer.enabled}">checked</c:if> /> </td> <td class="${bgcolor}"> <c:if test="${consumer.enabled}"> @@ -231,7 +231,7 @@ <tr> <td class="${bgcolor}"> - <ww:checkbox name="enabledUnknownConsumer[]" theme="simple" value="${consumer.enabled}" /> + <input type="checkbox" name="enabledInvalidContentConsumers" theme="simple" value="${consumer.id}" <c:if test="${consumer.enabled}">checked</c:if> /> </td> <td class="${bgcolor}"> <c:if test="${consumer.enabled}"> |