diff --git a/Documentation/dev-plugins.txt b/Documentation/dev-plugins.txt index d7bd8b3881..82a9527aa8 100644 --- a/Documentation/dev-plugins.txt +++ b/Documentation/dev-plugins.txt @@ -2102,6 +2102,16 @@ By implementing the `com.google.gerrit.server.git.ChangeReportFormatter` interface, a plugin may change the formatting of the report. +[[url-formatting]] +== URL Formatting + +URLs to various parts of Gerrit are usually formed by adding suffixes to +the canonical web URL. + +By implementing the +`com.google.gerrit.server.config.UrlFormatter` interface, a plugin may +change the format of the URL. + [[links-to-external-tools]] == Links To External Tools diff --git a/java/com/google/gerrit/server/config/DefaultUrlFormatter.java b/java/com/google/gerrit/server/config/DefaultUrlFormatter.java index 70fb46541d..060ee3f2d2 100644 --- a/java/com/google/gerrit/server/config/DefaultUrlFormatter.java +++ b/java/com/google/gerrit/server/config/DefaultUrlFormatter.java @@ -14,6 +14,7 @@ package com.google.gerrit.server.config; +import com.google.gerrit.extensions.registration.DynamicItem; import com.google.inject.AbstractModule; import com.google.inject.Inject; import com.google.inject.Provider; @@ -27,7 +28,8 @@ public class DefaultUrlFormatter implements UrlFormatter { public static class Module extends AbstractModule { @Override protected void configure() { - bind(UrlFormatter.class).to(DefaultUrlFormatter.class); + DynamicItem.itemOf(binder(), UrlFormatter.class); + DynamicItem.bind(binder(), UrlFormatter.class).to(DefaultUrlFormatter.class); } }