Search in sources :

Example 41 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 42 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)

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