Examples of RestApi


Examples of com.google.gerrit.client.rpc.RestApi

import com.google.gwt.http.client.URL;

/** Projects available from {@code /projects/}. */
public class ProjectMap extends NativeMap<ProjectInfo> {
  public static void all(AsyncCallback<ProjectMap> callback) {
    new RestApi("/projects/")
        .addParameterRaw("type", "ALL")
        .addParameterTrue("all")
        .addParameterTrue("d") // description
        .send(NativeMap.copyKeysIntoChildren(callback));
  }
View Full Code Here

Examples of com.google.gerrit.client.rpc.RestApi

        .addParameterTrue("d") // description
        .send(NativeMap.copyKeysIntoChildren(callback));
  }

  public static void permissions(AsyncCallback<ProjectMap> callback) {
    new RestApi("/projects/")
        .addParameterRaw("type", "PERMISSIONS")
        .addParameterTrue("all")
        .addParameterTrue("d") // description
        .send(NativeMap.copyKeysIntoChildren(callback));
  }
View Full Code Here

Examples of com.google.gerrit.client.rpc.RestApi

        .addParameterTrue("d") // description
        .send(NativeMap.copyKeysIntoChildren(callback));
  }

  public static void suggest(String prefix, int limit, AsyncCallback<ProjectMap> cb) {
    new RestApi("/projects/" + URL.encode(prefix).replaceAll("[?]", "%3F"))
        .addParameterRaw("type", "ALL")
        .addParameter("n", limit)
        .addParameterTrue("d") // description
        .send(NativeMap.copyKeysIntoChildren(cb));
  }
View Full Code Here

Examples of com.google.gerrit.client.rpc.RestApi

import com.google.gwtjsonrpc.common.AsyncCallback;

/** Plugins available from {@code /plugins/}. */
public class PluginMap extends NativeMap<PluginInfo> {
  public static void all(AsyncCallback<PluginMap> callback) {
    new RestApi("/plugins/")
        .send(NativeMap.copyKeysIntoChildren(callback));
  }
View Full Code Here

Examples of com.google.gerrit.client.rpc.RestApi

import com.google.gwtjsonrpc.common.AsyncCallback;

/** Capabilities the caller has from {@code /accounts/self/capabilities}.  */
public class AccountCapabilities extends JavaScriptObject {
  public static void all(AsyncCallback<AccountCapabilities> cb, String... filter) {
    RestApi api = new RestApi("/accounts/self/capabilities");
    for (String name : filter) {
      api.addParameter("q", name);
    }
    api.send(cb);
  }
View Full Code Here

Examples of com.google.gerrit.client.rpc.RestApi

  /** Run 2 or more queries in a single remote invocation. */
  public static void query(
      AsyncCallback<NativeList<ChangeList>> callback, String... queries) {
    assert queries.length >= 2; // At least 2 is required for correct result.
    RestApi call = new RestApi(URI);
    for (String q : queries) {
      call.addParameterRaw("q", KeyUtil.encode(q));
    }
    call.send(callback);
  }
View Full Code Here

Examples of com.google.gerrit.client.rpc.RestApi

  }

  public static void prev(String query,
      int limit, String sortkey,
      AsyncCallback<ChangeList> callback) {
    RestApi call = newQuery(query);
    if (limit > 0) {
      call.addParameter("n", limit);
    }
    if (!PagedSingleListScreen.MIN_SORTKEY.equals(sortkey)) {
      call.addParameter("P", sortkey);
    }
    call.send(callback);
  }
View Full Code Here

Examples of com.google.gerrit.client.rpc.RestApi

  }

  public static void next(String query,
      int limit, String sortkey,
      AsyncCallback<ChangeList> callback) {
    RestApi call = newQuery(query);
    if (limit > 0) {
      call.addParameter("n", limit);
    }
    if (!PagedSingleListScreen.MAX_SORTKEY.equals(sortkey)) {
      call.addParameter("N", sortkey);
    }
    call.send(callback);
  }
View Full Code Here

Examples of com.google.gerrit.client.rpc.RestApi

    }
    call.send(callback);
  }

  private static RestApi newQuery(String query) {
    RestApi call = new RestApi(URI);
    // The server default is ?q=status:open so don't repeat it.
    if (!"status:open".equals(query) && !"is:open".equals(query)) {
      call.addParameterRaw("q", KeyUtil.encode(query));
    }
    return call;
  }
View Full Code Here

Examples of org.drools.guvnor.server.files.RestAPI

        doAuthorizedAction(req,
                res,
                new Command() {
                    public void execute() throws Exception {
                        res.setContentType("text/html");
                        RestAPI api = getAPI();
                        String comment = req.getHeader("Checkin-Comment");
                        api.post(req.getRequestURI(),
                                req.getInputStream(),
                                (comment != null) ? comment : "");
                        res.getWriter().write("OK");
                    }
                });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.