From 3b64d5dca9b008cfc38c89775bbbda17c6aa2597 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Sun, 21 Apr 2013 22:56:28 +0000 Subject: [PATCH] fix update/add for mergedIndexPath git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1470359 13f79535-47bb-0310-9956-ffa450edef68 --- .../admin/model/beans/RepositoryGroup.java | 16 ++++++++++++++++ .../group/DefaultRepositoryGroupAdmin.java | 7 +++++-- .../services/DefaultRepositoryGroupService.java | 10 ++++++---- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RepositoryGroup.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RepositoryGroup.java index 367156132..371e7d488 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RepositoryGroup.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RepositoryGroup.java @@ -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 ) diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/group/DefaultRepositoryGroupAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/group/DefaultRepositoryGroupAdmin.java index 03b995146..047b8494b 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/group/DefaultRepositoryGroupAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/group/DefaultRepositoryGroupAdmin.java @@ -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( - 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 ); diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoryGroupService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoryGroupService.java index 3549d63bc..4b1882bb4 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoryGroupService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoryGroupService.java @@ -51,8 +51,8 @@ public class DefaultRepositoryGroupService new ArrayList( repositoryGroupAdmin.getRepositoriesGroups().size() ); for ( org.apache.archiva.admin.model.beans.RepositoryGroup repoGroup : repositoryGroupAdmin.getRepositoriesGroups() ) { - repositoriesGroups.add( - new RepositoryGroup( repoGroup.getId(), new ArrayList( repoGroup.getRepositories() ) ) ); + repositoriesGroups.add( new RepositoryGroup( repoGroup.getId(), new ArrayList( + 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( - 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( - repoGroup.getRepositories() ) ), getAuditInformation() ); + repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() ), + getAuditInformation() ); } catch ( RepositoryAdminException e ) { -- 2.39.5