]> source.dussan.org Git - archiva.git/commitdiff
[MRM-980] fixed variable names in action and label/messages in jsp
authorMaria Odea B. Ching <oching@apache.org>
Sun, 1 Aug 2010 04:03:00 +0000 (04:03 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Sun, 1 Aug 2010 04:03:00 +0000 (04:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-MRM-980@981136 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/MergeAction.java
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeAction.jsp
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeActionResults.jsp
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/mergeExcludeConflicts.jsp

index a1d4ceebd18e4324ab65c9a76e13ce4b71e9e74b..5c2cf7a0052883295d878a1c77f1c4c32cd6634b 100644 (file)
@@ -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<ArtifactMetadata> sourceArtifacts = metadataRepository.getArtifacts( targetRepoId );
-            repositoryMerger.merge( targetRepoId, repoid );
-            triggerAuditEvent( targetRepoId, "file-eshan", AuditEvent.MERGING_REPOSITORIES );
+            List<ArtifactMetadata> 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<ArtifactMetadata> sourceArtifacts = metadataRepository.getArtifacts( targetRepoId );
+            List<ArtifactMetadata> sourceArtifacts = metadataRepository.getArtifacts( sourceRepoId );
             sourceArtifacts.removeAll( conflictSourceArtifacts );
             Filter<ArtifactMetadata> artifactsWithOutConflicts =
                 new IncludesFilter<ArtifactMetadata>( 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<ArtifactMetadata>();
-       HashMap<String, ArtifactMetadata> map = new HashMap<String, ArtifactMetadata>();
+        HashMap<String, ArtifactMetadata> map = new HashMap<String, ArtifactMetadata>();
         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() ));
         }
-
     }
 }
 
index 2b9c4d60b92314155fd7f4754e1aa6bda3b246df..60a041e35545bac44b47e0ae774a159c7e5f10c6 100644 (file)
 
 <html>
 <head>
-  <title>Merge Repositories</title>
+  <title>Admin: Merge Staging Repository</title>
   <s:head/>
 </head>
 
 <body>
-<h1>Merge Repositories</h1>
+<h1>Admin: Merge Staging Repository</h1>
 
 <div id="contentArea">
 
index 2e400a40fb53635953f6a8714583ab0e48549db7..a6adf6ef80d219e0a26133332ce8372e965a92ff 100644 (file)
 
 <html>
 <head>
-  <title>Merge Repositories</title>
+  <title>Admin: Merge Staging Repository</title>
   <s:head/>
 </head>
 
 <body>
-<h1>Merge Repositories</h1>
+<h1>Admin: Merge Staging Repository</h1>
 
 <div id="contentArea">
 
   <s:actionerror/>
   <s:actionmessage/>
-  <h1>successfully done the merging</h1>
 </div>
 
 </body>
index 10731ffc06ac7e68b0d2b6e1a0a95616a7779e80..371368423ed16fa507012386049c196d6e2febf1 100644 (file)
@@ -44,7 +44,7 @@
         <s:form method="post" action="merge" namespace="/admin" validate="false" theme="simple">
           <s:hidden name="repoid"/>
           <div class="buttons">
-            <s:submit value="MergeAll" method="doMerge"/>
+            <s:submit value="Merge All" method="doMerge"/>
           </div>
         </s:form>
       </c:when>