]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8582 Deprecate old Page API and related classes
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Thu, 12 Jan 2017 07:35:07 +0000 (08:35 +0100)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Fri, 13 Jan 2017 16:58:12 +0000 (17:58 +0100)
13 files changed:
server/sonar-server/src/main/java/org/sonar/server/ui/PageDecorations.java
sonar-plugin-api/src/main/java/org/sonar/api/web/AbstractRubyTemplate.java
sonar-plugin-api/src/main/java/org/sonar/api/web/CodeColorizerFormat.java
sonar-plugin-api/src/main/java/org/sonar/api/web/DefaultTab.java
sonar-plugin-api/src/main/java/org/sonar/api/web/Description.java
sonar-plugin-api/src/main/java/org/sonar/api/web/NavigationSection.java
sonar-plugin-api/src/main/java/org/sonar/api/web/Page.java
sonar-plugin-api/src/main/java/org/sonar/api/web/PageDecoration.java
sonar-plugin-api/src/main/java/org/sonar/api/web/ResourceLanguage.java
sonar-plugin-api/src/main/java/org/sonar/api/web/ResourceQualifier.java
sonar-plugin-api/src/main/java/org/sonar/api/web/ResourceScope.java
sonar-plugin-api/src/main/java/org/sonar/api/web/RubyRailsPage.java
sonar-plugin-api/src/main/java/org/sonar/api/web/View.java

index 5b6cbd83730912599e12620ae0393f477cef80c4..35ddfff3e2c0c50624f2dfca05ecc96b09d49115 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-package org.sonar.server.ui;
 
-import org.sonar.api.server.ServerSide;
-import org.sonar.api.web.PageDecoration;
+package org.sonar.server.ui;
 
 import java.util.Collections;
 import java.util.List;
+import org.sonar.api.server.ServerSide;
+import org.sonar.api.web.PageDecoration;
 
 /**
  * @since 3.3
+ * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class has not effect.
  */
 @ServerSide
+@Deprecated
 public final class PageDecorations {
 
   private final PageDecoration[] decorations;
@@ -38,7 +40,7 @@ public final class PageDecorations {
   }
 
   public PageDecorations() {
-    this(Collections.<PageDecoration>emptyList());
+    this(Collections.emptyList());
   }
 
   public PageDecoration[] get() {
index 730db7c6242a8cff0276c30c93b9443703b2b1a3..9c920bd436b55f68e1011a5ee471a3207d30386d 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-package org.sonar.api.web;
 
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.IOUtils;
-import org.sonar.api.utils.SonarException;
+package org.sonar.api.web;
 
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.sonar.api.utils.SonarException;
 
 /**
- * It's useful in development environment to see browser rendering in real time while editing the template. To do that, just
- * return an absolute path in the method getTemplatePath() :<br>
- * <pre>
- * <code>
- *   protected String getTemplatePath() {
- *    return "/tmp/sample_dashboard_widget.erb";
- *   }
- * </code>
- * </pre>
- * Build and deploy the plugin in /extensions/plugins. The file /tmp/sample_dashboard_widget.erb will be reloaded on each request.
- * <br>
- * <br>
- * In production environment, you have to return the classloader path, for example "/org/sonar/myplugin/sample_dashboard_widget.erb".
- *
  * @since 1.11
+ * @deprecated since 6.3. This class is ignored.
  */
+@Deprecated
 public abstract class AbstractRubyTemplate {
 
   private String cache = null;
index 187777e7cf7db0a11d6e44dd955308066b18e6f3..b206ef32ee0794cabf6dc2bb65d0b83e9092fd3c 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+
 package org.sonar.api.web;
 
 import com.google.common.base.MoreObjects;
+import java.util.List;
+import org.sonar.api.batch.sensor.SensorContext;
 import org.sonar.api.task.TaskExtension;
 import org.sonar.colorizer.Tokenizer;
 
-import java.util.List;
-
 /**
  * Extend the library sonar-colorizer to support new languages.
  * 
  * @since 1.12
- * @deprecated since 4.5.2 use {@link org.sonar.api.source.Highlightable}
+ * @deprecated since 4.5.2 use {@link SensorContext#newHighlighting()}
  */
 @Deprecated
 public abstract class CodeColorizerFormat implements TaskExtension {
index 01ebc987bd012ad309126402858caaab844188a7..8aa954384a94b2b7e0b7db4b93b1345ed978af11 100644 (file)
@@ -17,6 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+
 package org.sonar.api.web;
 
 import java.lang.annotation.ElementType;
@@ -26,9 +27,11 @@ import java.lang.annotation.Target;
 
 /**
  * @since 2.0
+ * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class is ignored.
  */
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.TYPE)
+@Deprecated
 public @interface DefaultTab {
 
   // default value is all metrics
index 10a7e642c89db51f3fe8f5a43d794eabbb6159ef..35839a0ca7b525760d5d92d4b567af6b030fff4f 100644 (file)
@@ -17,6 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+
 package org.sonar.api.web;
 
 import java.lang.annotation.ElementType;
@@ -24,8 +25,12 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
+/**
+ * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class is ignored.
+ */
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.TYPE)
+@Deprecated
 public @interface Description {
   String value();
 }
index 49152f82568a52e10dbea3d418050899d2eeb013..51c104cebd13fad65417dbc92f3516beb508035d 100644 (file)
@@ -17,6 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+
 package org.sonar.api.web;
 
 import java.lang.annotation.ElementType;
@@ -28,9 +29,11 @@ import java.lang.annotation.Target;
  * The Page is displayed only in listed sections. This annotation is ignored on Widgets.
  * 
  * @since 1.11
+ * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class is ignored.
  */
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.TYPE)
+@Deprecated
 public @interface NavigationSection {
 
   String HOME = "home";
index 19c5a95bdf3931b0b536941ffad7ac12bc4b4b71..0134e2da1398eca6d26afa783a4fc145309b88de 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+
 package org.sonar.api.web;
 
 /**
  * @since 2.0
+ * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class is ignored.
  */
+@Deprecated
 public interface Page extends View {
   
 }
index 963759254db9db3e7406a383bf42fc334e0c92cf..35b7de0db28038ebc62f8f859b8b8d62830aba71 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+
 package org.sonar.api.web;
 
 import org.sonar.api.ExtensionPoint;
 import org.sonar.api.server.ServerSide;
 
 /**
- * Adds content to HTML pages. A PageDecoration is a Rails template (html.erb file) that executes content_for blocks on predefined locations :
- * <ul>
- *   <li><code>script</code> : javascript header</li>
- *   <li><code>style</code> : CSS header</li>
- *   <li><code>header</code> : area over the black top navigation bar</li>
- *   <li><code>footer</code> : area below the main page</li>
- *   <li><code>sidebar</code> : area in the sidebar between the menu and the sonar logo</li>
- * </ul>
- *
- * <p>Example of template: 
-<pre>
- &lt;% content_for :script do %&gt;
-   &lt;script&gt;alert('page loaded')&lt;/script&gt;
- &lt;% end %&gt;
-
- &lt;% content_for :footer do %&gt;
-  &lt;div&gt;this is &lt;b&gt;my footer&lt;/b&gt;&lt;/div&gt;
-&lt;% end %&gt;
-</pre>
- *
  * @since 3.3
+ * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class is ignored.
  */
 @ServerSide
 @ExtensionPoint
+@Deprecated
 public abstract class PageDecoration extends AbstractRubyTemplate {
 
 }
index 3fcc48fb873ffec6237f38155de3f9a3b5fe3348..58a60f8aca4ca91b446dabd1ab109bb71976509c 100644 (file)
@@ -17,6 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+
 package org.sonar.api.web;
 
 import java.lang.annotation.ElementType;
@@ -28,9 +29,11 @@ import java.lang.annotation.Target;
  * The view is displayed only if the selected resource has the same language.
  *
  * @since 1.11
+ * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class is ignored.
  */
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.TYPE)
+@Deprecated
 public @interface ResourceLanguage {
 
   /**
index 4be29dec25683e09d581b908011bf607b6992f88..87f2dd45df5cbb803fa7c957c09fd167cd8d5183 100644 (file)
@@ -17,6 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+
 package org.sonar.api.web;
 
 import java.lang.annotation.ElementType;
@@ -28,9 +29,11 @@ import java.lang.annotation.Target;
  * The view is displayed only if the selected resource has the same qualifier.
  *
  * @since 1.11
+ * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class is ignored.
  */
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.TYPE)
+@Deprecated
 public @interface ResourceQualifier {
 
   /**
index c800c1521113e5ec510a48e898cf96dab7f1a5aa..b579e13c8222a9f04cb25dcc804409431f45dca6 100644 (file)
@@ -17,6 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+
 package org.sonar.api.web;
 
 import java.lang.annotation.ElementType;
@@ -29,9 +30,11 @@ import java.lang.annotation.Target;
  * The view is displayed only if the selected resource has the same qualifier.
  *
  * @since 1.11
+ * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class is ignored.
  */
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.TYPE)
+@Deprecated
 public @interface ResourceScope {
 
   /**
index a17a1d3d56be8c1bcf931b6d429f5158a332c697..198bff6787b1c9c5ad7fba70ac861eed36e9ebdf 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+
 package org.sonar.api.web;
 
 /**
  * @since 1.11
+ * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class is ignored. 
  */
+@Deprecated
 public interface RubyRailsPage extends Page {
 
   /**
index 941185db364b74f7581e31b23d2500cd685bb418..65a070fc6a3f3682a7f370838ed06d227a94805b 100644 (file)
@@ -17,6 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
+
 package org.sonar.api.web;
 
 import org.sonar.api.ExtensionPoint;
@@ -24,9 +25,11 @@ import org.sonar.api.server.ServerSide;
 
 /**
  * @since 1.11
+ * @deprecated since 6.3 see {@link org.sonar.api.web.page.PageDefinition}. This class is ignored.
  */
 @ServerSide
 @ExtensionPoint
+@Deprecated
 public interface View {
 
   String getId();