diff options
author | Olivier Lamy <olamy@apache.org> | 2014-04-17 15:09:15 +1000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2014-04-17 15:09:15 +1000 |
commit | 2b0337985265ebda05acbc688aeb192b145561dd (patch) | |
tree | 6ed47c7beedee8df6f63f555cd6b6a5741600d51 | |
parent | cc78ad2134dbf4de277acfc3455937683d50e5ca (diff) | |
download | archiva-2b0337985265ebda05acbc688aeb192b145561dd.tar.gz archiva-2b0337985265ebda05acbc688aeb192b145561dd.zip |
[MRM-1210] Dependency tree should include the artifact type
5 files changed, 8 insertions, 12 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java index 066105e20..dfbb58cc6 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java @@ -475,9 +475,7 @@ public class DefaultBrowseService try { - return dependencyTreeBuilder.buildDependencyTree( selectedRepos, groupId, artifactId, version ); - } catch ( Exception e ) { diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties index 37292cd56..b2254664f 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties @@ -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 diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/search.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/search.js index cc271980c..248fa4dca 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/search.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/search.js @@ -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; diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/search.html b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/search.html index 821ca5b84..749be0249 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/search.html +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/search.html @@ -844,6 +844,7 @@ | <b>${$.i18n.prop('browse.artifact.version')}:</b> <a class="cursor-hand" onclick="generalDisplayArtifactVersionDetailViewModel(encodeURIComponent('${crumbEntry.groupId}'),encodeURIComponent('${crumbEntry.artifactId}'),encodeURIComponent('${crumbEntry.version}'))">${crumbEntry.version}</a> + | <b>${$.i18n.prop('browse.artifact.type')}:</b> ${crumbEntry.fileExtension} {{/if}} {{if j < entries.length - 2}} / diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/TreeDependencyNodeVisitor.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/TreeDependencyNodeVisitor.java index bcff976b4..7dda3972d 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/TreeDependencyNodeVisitor.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/TreeDependencyNodeVisitor.java @@ -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; |