]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1210] Dependency tree should include the artifact type
authorOlivier Lamy <olamy@apache.org>
Thu, 17 Apr 2014 05:09:15 +0000 (15:09 +1000)
committerOlivier Lamy <olamy@apache.org>
Thu, 17 Apr 2014 05:09:15 +0000 (15:09 +1000)
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java
archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/search.js
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/search.html
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/TreeDependencyNodeVisitor.java

index 066105e209f93a51270f773d7321b23d847ee138..dfbb58cc6031e1374a1130d1723482ed947eb672 100644 (file)
@@ -475,9 +475,7 @@ public class DefaultBrowseService
 
         try
         {
-
             return dependencyTreeBuilder.buildDependencyTree( selectedRepos, groupId, artifactId, version );
-
         }
         catch ( Exception e )
         {
index 37292cd56eb020f88cd4bd72cf323741238b7bab..b2254664fafa162a47083872c8210f746bc4e077 100644 (file)
@@ -331,6 +331,7 @@ browse.artifact.organization.name=Organization
 browse.artifact.organization.issueManagement=Issue Tracker
 browse.artifact.description=Description
 browse.artifact.packaging=Packaging
+browse.artifact.type=Extension
 browse.home=Home
 browse.refresh=Refresh
 browse.delete=Delete
index cc271980c664081be8a6a84125ca41338552e355..248fa4dcac5d8e229a58e1c590f964fe510f31a6 100644 (file)
@@ -1693,6 +1693,7 @@ define("archiva.search",["jquery","jquery.ui","i18n","jquery.tmpl","select2","kn
     this.artifactId=null;
     this.artifact=false;
     this.version=null;
+    this.fileExtension=null;
   }
   mapVersionsList=function(data){
     if (data){
@@ -1963,44 +1964,36 @@ define("archiva.search",["jquery","jquery.ui","i18n","jquery.tmpl","select2","kn
     this.bundleDescription=bundleDescription;
 
     // contains osgi metadata Bundle-Name if available
-    //private String bundleName;
     this.bundleName=bundleName;
 
     //contains osgi metadata Bundle-License if available
-    //private String bundleLicense;
     this.bundleLicense=bundleLicense;
 
     ///contains osgi metadata Bundle-DocURL if available
-    //private String bundleDocUrl;
     this.bundleDocUrl=bundleDocUrl;
 
     // contains osgi metadata Import-Package if available
-    //private String bundleImportPackage;
     this.bundleImportPackage=bundleImportPackage;
 
     ///contains osgi metadata Require-Bundle if available
-    //private String bundleRequireBundle;
     this.bundleRequireBundle=bundleRequireBundle;
 
-    //private String classifier;
     this.classifier=classifier;
 
-    //private String packaging;
     this.packaging=packaging;
 
     //file extension of the artifact
-    //private String fileExtension;
     this.fileExtension=fileExtension;
 
     this.size=size;
 
     this.crumbEntries=function(){
-      return calculateCrumbEntries(self.groupId,self.artifactId,self.version);
+      return calculateCrumbEntries(self.groupId,self.artifactId,self.version,self.fileExtension);
     }
 
   }
 
-  calculateCrumbEntries=function(groupId,artifactId,version){
+  calculateCrumbEntries=function(groupId,artifactId,version,fileExtension){
     var splitted = groupId.split(".");
     var breadCrumbEntries=[];
     var curGroupId="";
@@ -2012,12 +2005,14 @@ define("archiva.search",["jquery","jquery.ui","i18n","jquery.tmpl","select2","kn
     var crumbEntryArtifact=new BreadCrumbEntry(groupId,artifactId);
     crumbEntryArtifact.artifactId=artifactId;
     crumbEntryArtifact.artifact=true;
+    crumbEntryArtifact.fileExtension=fileExtension;
     breadCrumbEntries.push(crumbEntryArtifact);
 
     var crumbEntryVersion=new BreadCrumbEntry(groupId,version);
     crumbEntryVersion.artifactId=artifactId;
     crumbEntryVersion.artifact=false;
     crumbEntryVersion.version=version;
+    crumbEntryVersion.fileExtension=fileExtension;
     breadCrumbEntries.push(crumbEntryVersion);
 
     return breadCrumbEntries;
index 821ca5b84eb77cf9c2dfe0130a91aeaaee365afa..749be02499889935818fd1b4bdbae23c59d99941 100644 (file)
       &nbsp;|&nbsp;<b>${$.i18n.prop('browse.artifact.version')}:</b>&nbsp;
       <a class="cursor-hand"
          onclick="generalDisplayArtifactVersionDetailViewModel(encodeURIComponent('${crumbEntry.groupId}'),encodeURIComponent('${crumbEntry.artifactId}'),encodeURIComponent('${crumbEntry.version}'))">${crumbEntry.version}</a>&nbsp;
+      |&nbsp;<b>${$.i18n.prop('browse.artifact.type')}:</b>&nbsp;${crumbEntry.fileExtension}
       {{/if}}
       {{if j < entries.length - 2}}
       &nbsp;/&nbsp;
index bcff976b47535fbe43f843cdc6348946476b2e6b..7dda3972d89afb8f9df0c979f4a6ba1973536fe5 100644 (file)
@@ -52,6 +52,7 @@ public class TreeDependencyNodeVisitor
     {
         TreeEntry entry =
             new TreeEntry( getModelMapper().map( dependencyNode.getDependency().getArtifact(), Artifact.class ) );
+        entry.getArtifact().setFileExtension( dependencyNode.getDependency().getArtifact().getExtension() );
         entry.getArtifact().setScope( dependencyNode.getDependency().getScope() );
         entry.setParent( currentEntry );
         currentEntry = entry;