Search in sources :

Example 6 with WebLinkInfo

use of com.google.gerrit.extensions.common.WebLinkInfo in project gerrit by GerritCodeReview.

the class ProjectJson method format.

public ProjectInfo format(Project p) {
    ProjectInfo info = new ProjectInfo();
    info.name = p.getName();
    Project.NameKey parentName = p.getParent(allProjects);
    info.parent = parentName != null ? parentName.get() : null;
    info.description = Strings.emptyToNull(p.getDescription());
    info.state = p.getState();
    info.id = Url.encode(info.name);
    List<WebLinkInfo> links = webLinks.getProjectLinks(p.getName());
    info.webLinks = links.isEmpty() ? null : links;
    return info;
}
Also used : Project(com.google.gerrit.reviewdb.client.Project) WebLinkInfo(com.google.gerrit.extensions.common.WebLinkInfo) ProjectInfo(com.google.gerrit.extensions.common.ProjectInfo)

Aggregations

WebLinkInfo (com.google.gerrit.extensions.common.WebLinkInfo)6 Project (com.google.gerrit.reviewdb.client.Project)3 CommitInfo (com.google.gerrit.extensions.common.CommitInfo)2 ProjectInfo (com.google.gerrit.extensions.common.ProjectInfo)2 RevCommit (org.eclipse.jgit.revwalk.RevCommit)2 AbstractDaemonTest (com.google.gerrit.acceptance.AbstractDaemonTest)1 PushOneCommit (com.google.gerrit.acceptance.PushOneCommit)1 WebLinkInfoCommon (com.google.gerrit.common.data.WebLinkInfoCommon)1 NoSuchGroupException (com.google.gerrit.common.errors.NoSuchGroupException)1 BranchInfo (com.google.gerrit.extensions.api.projects.BranchInfo)1 ActionInfo (com.google.gerrit.extensions.common.ActionInfo)1 DiffWebLinkInfo (com.google.gerrit.extensions.common.DiffWebLinkInfo)1 PatchSetWebLink (com.google.gerrit.extensions.webui.PatchSetWebLink)1 UiAction (com.google.gerrit.extensions.webui.UiAction)1 PermissionBackend (com.google.gerrit.server.permissions.PermissionBackend)1 BufferedWriter (java.io.BufferedWriter)1 IOException (java.io.IOException)1 OutputStreamWriter (java.io.OutputStreamWriter)1 PrintWriter (java.io.PrintWriter)1 HashMap (java.util.HashMap)1