]> source.dussan.org Git - archiva.git/commitdiff
fix update/add for mergedIndexPath
authorOlivier Lamy <olamy@apache.org>
Sun, 21 Apr 2013 22:56:28 +0000 (22:56 +0000)
committerOlivier Lamy <olamy@apache.org>
Sun, 21 Apr 2013 22:56:28 +0000 (22:56 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1470359 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RepositoryGroup.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/group/DefaultRepositoryGroupAdmin.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoryGroupService.java

index 367156132275a164a66ddbe87a400989633ad803..371e7d488f8bed11223297d76970699fa3837f01 100644 (file)
@@ -122,6 +122,22 @@ public class RepositoryGroup
         this.repositories = repositories;
     }
 
+    public String getMergedIndexPath()
+    {
+        return mergedIndexPath;
+    }
+
+    public void setMergedIndexPath( String mergedIndexPath )
+    {
+        this.mergedIndexPath = mergedIndexPath;
+    }
+
+    public RepositoryGroup mergedIndexPath( String mergedIndexPath )
+    {
+        this.mergedIndexPath = mergedIndexPath;
+        return this;
+    }
+
     public boolean equals( Object other )
     {
         if ( this == other )
index 03b995146f65ac26f04d8385169c071f64bb3dbd..047b8494b19a583c656048d5584411c7afadc99f 100644 (file)
@@ -45,7 +45,7 @@ import java.util.regex.Pattern;
 /**
  * @author Olivier Lamy
  */
-@Service( "repositoryGroupAdmin#default" )
+@Service("repositoryGroupAdmin#default")
 public class DefaultRepositoryGroupAdmin
     extends AbstractRepositoryAdmin
     implements RepositoryGroupAdmin
@@ -67,7 +67,8 @@ public class DefaultRepositoryGroupAdmin
         for ( RepositoryGroupConfiguration repositoryGroupConfiguration : getArchivaConfiguration().getConfiguration().getRepositoryGroups() )
         {
             repositoriesGroups.add( new RepositoryGroup( repositoryGroupConfiguration.getId(), new ArrayList<String>(
-                repositoryGroupConfiguration.getRepositories() ) ) );
+                repositoryGroupConfiguration.getRepositories() ) ).mergedIndexPath(
+                repositoryGroupConfiguration.getMergedIndexPath() ) );
         }
 
         return repositoriesGroups;
@@ -95,6 +96,7 @@ public class DefaultRepositoryGroupAdmin
         RepositoryGroupConfiguration repositoryGroupConfiguration = new RepositoryGroupConfiguration();
         repositoryGroupConfiguration.setId( repositoryGroup.getId() );
         repositoryGroupConfiguration.setRepositories( repositoryGroup.getRepositories() );
+        repositoryGroupConfiguration.setMergedIndexPath( repositoryGroup.getMergedIndexPath() );
         Configuration configuration = getArchivaConfiguration().getConfiguration();
         configuration.addRepositoryGroup( repositoryGroupConfiguration );
         saveConfiguration( configuration );
@@ -138,6 +140,7 @@ public class DefaultRepositoryGroupAdmin
         configuration.removeRepositoryGroup( repositoryGroupConfiguration );
 
         repositoryGroupConfiguration.setRepositories( repositoryGroup.getRepositories() );
+        repositoryGroupConfiguration.setMergedIndexPath( repositoryGroup.getMergedIndexPath() );
         configuration.addRepositoryGroup( repositoryGroupConfiguration );
 
         saveConfiguration( configuration );
index 3549d63bca59bf6e822c2c9d6004cd0895130fa3..4b1882bb49c032f3da355bc597f970b66c884c57 100644 (file)
@@ -51,8 +51,8 @@ public class DefaultRepositoryGroupService
                 new ArrayList<RepositoryGroup>( repositoryGroupAdmin.getRepositoriesGroups().size() );
             for ( org.apache.archiva.admin.model.beans.RepositoryGroup repoGroup : repositoryGroupAdmin.getRepositoriesGroups() )
             {
-                repositoriesGroups.add(
-                    new RepositoryGroup( repoGroup.getId(), new ArrayList<String>( repoGroup.getRepositories() ) ) );
+                repositoriesGroups.add( new RepositoryGroup( repoGroup.getId(), new ArrayList<String>(
+                    repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() ) );
             }
             return repositoriesGroups;
         }
@@ -82,7 +82,8 @@ public class DefaultRepositoryGroupService
         {
             return repositoryGroupAdmin.addRepositoryGroup(
                 new org.apache.archiva.admin.model.beans.RepositoryGroup( repoGroup.getId(), new ArrayList<String>(
-                    repoGroup.getRepositories() ) ), getAuditInformation() );
+                    repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() ),
+                getAuditInformation() );
         }
         catch ( RepositoryAdminException e )
         {
@@ -97,7 +98,8 @@ public class DefaultRepositoryGroupService
         {
             return repositoryGroupAdmin.updateRepositoryGroup(
                 new org.apache.archiva.admin.model.beans.RepositoryGroup( repoGroup.getId(), new ArrayList<String>(
-                    repoGroup.getRepositories() ) ), getAuditInformation() );
+                    repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() ),
+                getAuditInformation() );
         }
         catch ( RepositoryAdminException e )
         {