Plugin support for project weblinks
Plugins can now contribute project links that will be displayed on the project list screen in the 'Repository Browser' column. Change-Id: Ia96679b249dd9677d9138e8af6239e1e5ea6f1d4
This commit is contained in:
@@ -16,6 +16,7 @@ package com.google.gerrit.extensions.common;
|
||||
|
||||
import com.google.gerrit.extensions.api.projects.ProjectState;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ProjectInfo {
|
||||
@@ -25,4 +26,5 @@ public class ProjectInfo {
|
||||
public String description;
|
||||
public ProjectState state;
|
||||
public Map<String, String> branches;
|
||||
}
|
||||
public List<WebLinkInfo> webLinks;
|
||||
}
|
||||
|
||||
@@ -27,14 +27,4 @@ public class RevisionInfo {
|
||||
public Map<String, FileInfo> files;
|
||||
public Map<String, ActionInfo> actions;
|
||||
public List<WebLinkInfo> webLinks;
|
||||
|
||||
public static class WebLinkInfo {
|
||||
public String name;
|
||||
public String url;
|
||||
|
||||
public WebLinkInfo(String name, String url) {
|
||||
this.name = name;
|
||||
this.url = url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
// Copyright (C) 2014 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package com.google.gerrit.extensions.common;
|
||||
|
||||
public class WebLinkInfo {
|
||||
public String name;
|
||||
public String url;
|
||||
|
||||
public WebLinkInfo(String name, String url) {
|
||||
this.name = name;
|
||||
this.url = url;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2014 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package com.google.gerrit.extensions.webui;
|
||||
|
||||
import com.google.gerrit.extensions.annotations.ExtensionPoint;
|
||||
|
||||
@ExtensionPoint
|
||||
public interface ProjectWebLink extends WebLink {
|
||||
|
||||
/**
|
||||
* URL to project in external service.
|
||||
*
|
||||
* @param projectName Name of the project
|
||||
* @return url to project in external service.
|
||||
*/
|
||||
String getProjectUrl(String projectName);
|
||||
}
|
||||
Reference in New Issue
Block a user