From: Maria Odea B. Ching Date: Sun, 1 Aug 2010 04:03:00 +0000 (+0000) Subject: [MRM-980] fixed variable names in action and label/messages in jsp X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b12f6e842648ed07e4bafbf6bba54bd66b18ea1c;p=archiva.git [MRM-980] fixed variable names in action and label/messages in jsp git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-MRM-980@981136 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/MergeAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/MergeAction.java index a1d4ceebd..5c2cf7a00 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/MergeAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/MergeAction.java @@ -64,7 +64,7 @@ public class MergeAction private String repoid; - private String targetRepoId; + private String sourceRepoId; private final String action = "merge"; @@ -78,9 +78,9 @@ public class MergeAction public String getConflicts() { - targetRepoId = repoid + "-stage"; + sourceRepoId = repoid + "-stage"; Configuration config = configuration.getConfiguration(); - ManagedRepositoryConfiguration targetRepoConfig = config.findManagedRepositoryById( targetRepoId ); + ManagedRepositoryConfiguration targetRepoConfig = config.findManagedRepositoryById( sourceRepoId ); if ( targetRepoConfig != null ) { @@ -98,18 +98,22 @@ public class MergeAction { try { - List sourceArtifacts = metadataRepository.getArtifacts( targetRepoId ); - repositoryMerger.merge( targetRepoId, repoid ); - triggerAuditEvent( targetRepoId, "file-eshan", AuditEvent.MERGING_REPOSITORIES ); + List sourceArtifacts = metadataRepository.getArtifacts( sourceRepoId ); + repositoryMerger.merge( sourceRepoId, repoid ); + triggerAuditEvent( sourceRepoId, "file-eshan", AuditEvent.MERGING_REPOSITORIES ); for ( ArtifactMetadata metadata : sourceArtifacts ) { triggerAuditEvent( repoid, metadata.getId(), AuditEvent.MERGING_REPOSITORIES ); } + + addActionMessage( "Repository '" + sourceRepoId + "' successfully merged to '" + repoid + "'." ); + return SUCCESS; } catch ( Exception ex ) { + addActionError( "Error occurred while merging the repositories." ); return ERROR; } } @@ -118,21 +122,24 @@ public class MergeAction { try { - List sourceArtifacts = metadataRepository.getArtifacts( targetRepoId ); + List sourceArtifacts = metadataRepository.getArtifacts( sourceRepoId ); sourceArtifacts.removeAll( conflictSourceArtifacts ); Filter artifactsWithOutConflicts = new IncludesFilter( sourceArtifacts ); - repositoryMerger.merge( targetRepoId, repoid, artifactsWithOutConflicts ); + repositoryMerger.merge( sourceRepoId, repoid, artifactsWithOutConflicts ); for ( ArtifactMetadata metadata : sourceArtifacts ) { triggerAuditEvent( repoid, metadata.getId(), AuditEvent.MERGING_REPOSITORIES ); } - return SUCCESS; + addActionMessage( "Repository '" + sourceRepoId + "' successfully merged to '" + repoid + "'." ); + + return SUCCESS; } catch ( Exception ex ) { + addActionError( "Error occurred while merging the repositories." ); return ERROR; } } @@ -140,16 +147,19 @@ public class MergeAction public String mergeWithOutConlficts() { - targetRepoId = repoid + "-stage"; + sourceRepoId = repoid + "-stage"; try { - conflictSourceArtifacts = repositoryMerger.getConflictsartifacts( targetRepoId, repoid ); + conflictSourceArtifacts = repositoryMerger.getConflictsartifacts( sourceRepoId, repoid ); } catch ( Exception e ) { + addActionError( "Error occurred while merging the repositories." ); return ERROR; } + + addActionMessage( "Repository '" + sourceRepoId + "' successfully merged to '" + repoid + "'." ); return SUCCESS; } @@ -167,20 +177,20 @@ public class MergeAction public void prepare() throws Exception { - targetRepoId = repoid + "-stage"; - conflictSourceArtifacts = repositoryMerger.getConflictsartifacts( targetRepoId, repoid ); + sourceRepoId = repoid + "-stage"; + conflictSourceArtifacts = repositoryMerger.getConflictsartifacts( sourceRepoId, repoid ); this.repository = new ManagedRepositoryConfiguration(); setConflictSourceArtifactsToBeDisplayed( conflictSourceArtifacts ); } - public String getTargetRepoId() + public String getSourceRepoId() { - return targetRepoId; + return sourceRepoId; } - public void setTargetRepoId( String targetRepoId ) + public void setSourceRepoId( String sourceRepoId ) { - this.targetRepoId = targetRepoId; + this.sourceRepoId = sourceRepoId; } public String getRepoid() @@ -212,7 +222,7 @@ public class MergeAction throws Exception { this.conflictSourceArtifactsToBeDisplayed = new ArrayList(); - HashMap map = new HashMap(); + HashMap map = new HashMap(); for ( ArtifactMetadata metadata : conflictSourceArtifacts ) { String metadataId = metadata.getNamespace() + metadata.getProject() + metadata.getProjectVersion() + metadata.getVersion(); @@ -224,7 +234,6 @@ public class MergeAction { conflictSourceArtifactsToBeDisplayed.add( map.get(iterator.next() )); } - } } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeAction.jsp b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeAction.jsp index 2b9c4d60b..60a041e35 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeAction.jsp +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeAction.jsp @@ -25,12 +25,12 @@ - Merge Repositories + Admin: Merge Staging Repository -

Merge Repositories

+

Admin: Merge Staging Repository

diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeActionResults.jsp b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeActionResults.jsp index 2e400a40f..a6adf6ef8 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeActionResults.jsp +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeActionResults.jsp @@ -25,18 +25,17 @@ - Merge Repositories + Admin: Merge Staging Repository -

Merge Repositories

+

Admin: Merge Staging Repository

-

successfully done the merging

diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeExcludeConflicts.jsp b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeExcludeConflicts.jsp index 10731ffc0..371368423 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeExcludeConflicts.jsp +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeExcludeConflicts.jsp @@ -44,7 +44,7 @@
- +