archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joak...@apache.org
Subject svn commit: r549567 - in /maven/archiva/trunk/archiva-web/archiva-webapp/src/main: java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java resources/xwork.xml webapp/WEB-INF/jsp/admin/repositoryScanning.jsp
Date Thu, 21 Jun 2007 17:41:22 GMT
Author: joakime
Date: Thu Jun 21 10:41:21 2007
New Revision: 549567

URL: http://svn.apache.org/viewvc?view=rev&rev=549567
Log:
[MRM-357]: Update Consumers button in Repository Scanning doesn't work 
Applying patch from Napoleon Ramirez.

Modified:
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/resources/xwork.xml
    maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositoryScanning.jsp

Modified: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java?view=diff&rev=549567&r1=549566&r2=549567
==============================================================================
--- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java
(original)
+++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java
Thu Jun 21 10:41:21 2007
@@ -73,12 +73,22 @@
     /**
      * 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 @@
 
         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 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 @@
         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;
     }
 }

Modified: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/resources/xwork.xml?view=diff&rev=549567&r1=549566&r2=549567
==============================================================================
--- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/resources/xwork.xml (original)
+++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/resources/xwork.xml Thu Jun 21
10:41:21 2007
@@ -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 \.________________________________________________ -->

Modified: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositoryScanning.jsp
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositoryScanning.jsp?view=diff&rev=549567&r1=549566&r2=549567
==============================================================================
--- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositoryScanning.jsp
(original)
+++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositoryScanning.jsp
Thu Jun 21 10:41:21 2007
@@ -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}">



Mime
View raw message