aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-core-plugin
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2012-05-09 16:45:38 +0200
committerFabrice Bellingard <bellingard@gmail.com>2012-05-14 15:11:00 +0200
commite9475e56b36eee4b79b8b73708281426af366416 (patch)
treecc91e8c2608f2102a21aa2cab197efaba92ccf66 /plugins/sonar-core-plugin
parentf1bb3dd2a87aea499f550eee4b0f37412f91ab53 (diff)
downloadsonarqube-e9475e56b36eee4b79b8b73708281426af366416.tar.gz
sonarqube-e9475e56b36eee4b79b8b73708281426af366416.zip
SONAR-2541 Add extension point LinkReviewAction
- Draft of API - Add the review_data table - Link all this with the Ruby side - Allow to call the action from the Web UI
Diffstat (limited to 'plugins/sonar-core-plugin')
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java5
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/reviews/JiraLinkReviewAction.java31
2 files changed, 35 insertions, 1 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
index e9daf7bf788..dc4a9877d7f 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
@@ -40,6 +40,7 @@ import org.sonar.plugins.core.dashboards.DefaultDashboard;
import org.sonar.plugins.core.dashboards.HotspotsDashboard;
import org.sonar.plugins.core.dashboards.ReviewsDashboard;
import org.sonar.plugins.core.dashboards.TimeMachineDashboard;
+import org.sonar.plugins.core.reviews.JiraLinkReviewAction;
import org.sonar.plugins.core.security.ApplyProjectRolesDecorator;
import org.sonar.plugins.core.sensors.BranchCoverageDecorator;
import org.sonar.plugins.core.sensors.CheckAlertThresholds;
@@ -241,7 +242,6 @@ import java.util.List;
defaultValue = CoreProperties.TIMEMACHINE_DEFAULT_PERIOD_5,
category = CoreProperties.CATEGORY_DIFFERENTIAL_VIEWS),
-
// SERVER-SIDE TECHNICAL PROPERTIES
@Property(
@@ -385,6 +385,9 @@ public final class CorePlugin extends SonarPlugin {
extensions.add(NewItCoverageFileAnalyzer.class);
extensions.add(NewCoverageAggregator.class);
+ // reviews
+ extensions.add(JiraLinkReviewAction.class);
+
return extensions;
}
}
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/reviews/JiraLinkReviewAction.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/reviews/JiraLinkReviewAction.java
new file mode 100644
index 00000000000..7184c6ecba8
--- /dev/null
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/reviews/JiraLinkReviewAction.java
@@ -0,0 +1,31 @@
+package org.sonar.plugins.core.reviews;
+
+import org.sonar.api.reviews.LinkReviewAction;
+
+import java.util.Map;
+import java.util.Map.Entry;
+
+/**
+ * @since 3.1
+ */
+public class JiraLinkReviewAction implements LinkReviewAction {
+
+ public String getId() {
+ return "jira-link";
+ }
+
+ public String getName() {
+ return "Link to JIRA";
+ }
+
+ public void execute(Map<String, String> reviewContext) {
+ System.out.println("============>");
+
+ for (Entry<String, String> mapEntry : reviewContext.entrySet()) {
+ System.out.println(mapEntry.getKey() + " // " + mapEntry.getValue());
+ }
+
+ System.out.println("<============");
+ }
+
+}