diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-06-02 13:46:19 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-06-02 13:46:31 +0200 |
commit | 69feaa8ac907daff9852890d89eb9c8d03889263 (patch) | |
tree | 3aca96e584fb5df139bf4eded2998765ef97c473 /sonar-core | |
parent | 108bc7d2ee5aaeac89b0ca0fcb65216339236ca9 (diff) | |
download | sonarqube-69feaa8ac907daff9852890d89eb9c8d03889263.tar.gz sonarqube-69feaa8ac907daff9852890d89eb9c8d03889263.zip |
SONAR-5306 Add list of component viewer extensions in /api/component/app WS
Diffstat (limited to 'sonar-core')
3 files changed, 27 insertions, 0 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/component/ComponentDto.java b/sonar-core/src/main/java/org/sonar/core/component/ComponentDto.java index 71b48a6eb3f..a106603b7bf 100644 --- a/sonar-core/src/main/java/org/sonar/core/component/ComponentDto.java +++ b/sonar-core/src/main/java/org/sonar/core/component/ComponentDto.java @@ -33,6 +33,8 @@ public class ComponentDto extends Dto<String> implements Component { private String name; private String longName; private String qualifier; + private String scope; + private String language; private Long projectId; private Long subProjectId; @@ -96,6 +98,25 @@ public class ComponentDto extends Dto<String> implements Component { return this; } + public String scope() { + return scope; + } + + public ComponentDto setScope(String scope) { + this.scope = scope; + return this; + } + + @CheckForNull + public String language() { + return language; + } + + public ComponentDto setLanguage(@Nullable String language) { + this.language = language; + return this; + } + public Long projectId() { return projectId; } diff --git a/sonar-core/src/main/resources/org/sonar/core/component/db/ComponentMapper.xml b/sonar-core/src/main/resources/org/sonar/core/component/db/ComponentMapper.xml index 27ab64ac750..a604fea396b 100644 --- a/sonar-core/src/main/resources/org/sonar/core/component/db/ComponentMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/component/db/ComponentMapper.xml @@ -8,6 +8,8 @@ p.name as name, p.long_name as longName, p.qualifier as qualifier, + p.scope as scope, + p.language as language, s.root_project_id as projectId, p.root_id as subProjectId, p.path as path diff --git a/sonar-core/src/test/java/org/sonar/core/component/ComponentDtoTest.java b/sonar-core/src/test/java/org/sonar/core/component/ComponentDtoTest.java index 1b2ea6a641f..b71779f0e06 100644 --- a/sonar-core/src/test/java/org/sonar/core/component/ComponentDtoTest.java +++ b/sonar-core/src/test/java/org/sonar/core/component/ComponentDtoTest.java @@ -34,6 +34,8 @@ public class ComponentDtoTest { .setName("RequestContext.java") .setLongName("org.struts.RequestContext") .setQualifier("FIL") + .setScope("FIL") + .setLanguage("java") .setPath("src/org/struts/RequestContext.java") .setProjectId(2L) .setSubProjectId(3L); @@ -43,7 +45,9 @@ public class ComponentDtoTest { assertThat(componentDto.name()).isEqualTo("RequestContext.java"); assertThat(componentDto.longName()).isEqualTo("org.struts.RequestContext"); assertThat(componentDto.qualifier()).isEqualTo("FIL"); + assertThat(componentDto.scope()).isEqualTo("FIL"); assertThat(componentDto.path()).isEqualTo("src/org/struts/RequestContext.java"); + assertThat(componentDto.language()).isEqualTo("java"); assertThat(componentDto.projectId()).isEqualTo(2L); assertThat(componentDto.subProjectId()).isEqualTo(3L); } |