Search in sources :

Example 31 with RestApi

use of com.google.gerrit.client.rpc.RestApi in project gerrit by GerritCodeReview.

the class GroupMap method suggestAccountGroupForProject.

public static void suggestAccountGroupForProject(String project, String query, int limit, AsyncCallback<GroupMap> cb) {
    RestApi call = groups();
    if (project != null) {
        call.addParameter("p", project);
    }
    if (query != null) {
        call.addParameter("s", query);
    }
    if (limit > 0) {
        call.addParameter("n", limit);
    }
    call.get(NativeMap.copyKeysIntoChildren(cb));
}
Also used : RestApi(com.google.gerrit.client.rpc.RestApi)

Example 32 with RestApi

use of com.google.gerrit.client.rpc.RestApi in project gerrit by GerritCodeReview.

the class ProjectApi method getRestApi.

private static RestApi getRestApi(Project.NameKey name, String viewName, int limit, int start, String match) {
    RestApi call = project(name).view(viewName);
    call.addParameter("n", limit);
    call.addParameter("s", start);
    if (match != null) {
        if (match.startsWith("^")) {
            call.addParameter("r", match);
        } else {
            call.addParameter("m", match);
        }
    }
    return call;
}
Also used : RestApi(com.google.gerrit.client.rpc.RestApi)

Example 33 with RestApi

use of com.google.gerrit.client.rpc.RestApi in project gerrit by GerritCodeReview.

the class ProjectApi method setDescription.

public static void setDescription(Project.NameKey name, String description, AsyncCallback<NativeString> cb) {
    RestApi call = project(name).view("description");
    if (description != null && !description.isEmpty()) {
        DescriptionInput input = DescriptionInput.create();
        input.setDescription(description);
        call.put(input, cb);
    } else {
        call.delete(cb);
    }
}
Also used : RestApi(com.google.gerrit.client.rpc.RestApi)

Example 34 with RestApi

use of com.google.gerrit.client.rpc.RestApi in project gerrit by GerritCodeReview.

the class ProjectMap method match.

public static void match(String match, int limit, int start, AsyncCallback<ProjectMap> cb) {
    RestApi call = new RestApi("/projects/");
    if (match != null) {
        if (match.startsWith("^")) {
            call.addParameter("r", match);
        } else {
            call.addParameter("m", match);
        }
    }
    if (limit > 0) {
        call.addParameter("n", limit);
    }
    if (start > 0) {
        call.addParameter("S", start);
    }
    call.addParameterRaw("type", "ALL");
    // description
    call.addParameterTrue("d");
    call.get(NativeMap.copyKeysIntoChildren(cb));
}
Also used : RestApi(com.google.gerrit.client.rpc.RestApi)

Example 35 with RestApi

use of com.google.gerrit.client.rpc.RestApi in project gerrit by GerritCodeReview.

the class AccessMap method get.

public static void get(Set<Project.NameKey> projects, AsyncCallback<AccessMap> callback) {
    RestApi api = new RestApi("/access/");
    for (Project.NameKey p : projects) {
        api.addParameter("project", p.get());
    }
    api.get(NativeMap.copyKeysIntoChildren(callback));
}
Also used : Project(com.google.gerrit.reviewdb.client.Project) RestApi(com.google.gerrit.client.rpc.RestApi)

Aggregations

RestApi (com.google.gerrit.client.rpc.RestApi)42 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)8 ChangeInfo (com.google.gerrit.client.info.ChangeInfo)3 EditInfo (com.google.gerrit.client.info.ChangeInfo.EditInfo)2 CallbackGroup (com.google.gerrit.client.rpc.CallbackGroup)2 AsyncCallback (com.google.gwt.user.client.rpc.AsyncCallback)2 Anchor (com.google.gwt.user.client.ui.Anchor)2 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)2 InlineLabel (com.google.gwt.user.client.ui.InlineLabel)2 ArrayList (java.util.ArrayList)2 GerritUiExtensionPoint (com.google.gerrit.client.GerritUiExtensionPoint)1 ActionInfo (com.google.gerrit.client.info.ActionInfo)1 RevisionInfo (com.google.gerrit.client.info.ChangeInfo.RevisionInfo)1 GerritCallback (com.google.gerrit.client.rpc.GerritCallback)1 NativeMap (com.google.gerrit.client.rpc.NativeMap)1 NativeString (com.google.gerrit.client.rpc.NativeString)1 ListChangesOption (com.google.gerrit.extensions.client.ListChangesOption)1 Change (com.google.gerrit.reviewdb.client.Change)1 Project (com.google.gerrit.reviewdb.client.Project)1 JsArray (com.google.gwt.core.client.JsArray)1