Search in sources :

Example 36 with JSONObject

use of com.google.gwt.json.client.JSONObject in project perun by CESNET.

the class AssignResourceTag method prepareJSONObject.

/**
	 * Prepares a JSON object
	 * @return JSONObject the whole query
	 */
private JSONObject prepareJSONObject() {
    JSONObject jsonQuery = new JSONObject();
    JSONObject oldTag = new JSONObject(resourceTag);
    JSONObject jsonTag = new JSONObject();
    jsonTag.put("id", oldTag.get("id"));
    jsonTag.put("tagName", oldTag.get("tagName"));
    jsonTag.put("voId", oldTag.get("voId"));
    jsonQuery.put("resourceTag", jsonTag);
    jsonQuery.put("resource", new JSONNumber(resourceId));
    return jsonQuery;
}
Also used : JSONObject(com.google.gwt.json.client.JSONObject) JSONNumber(com.google.gwt.json.client.JSONNumber)

Example 37 with JSONObject

use of com.google.gwt.json.client.JSONObject in project perun by CESNET.

the class CreateResource method prepareJSONObject.

/**
	 * Prepares a JSON object
	 *
	 * @return JSONObject the whole query
	 */
private JSONObject prepareJSONObject() {
    JSONObject resource = new JSONObject();
    resource.put("id", new JSONNumber(0));
    resource.put("name", new JSONString(resourceName));
    resource.put("description", new JSONString(resourceDescription));
    JSONObject jsonQuery = new JSONObject();
    jsonQuery.put("resource", resource);
    jsonQuery.put("facility", new JSONNumber(facilityId));
    jsonQuery.put("vo", new JSONNumber(voId));
    return jsonQuery;
}
Also used : JSONObject(com.google.gwt.json.client.JSONObject) JSONNumber(com.google.gwt.json.client.JSONNumber) JSONString(com.google.gwt.json.client.JSONString)

Example 38 with JSONObject

use of com.google.gwt.json.client.JSONObject in project perun by CESNET.

the class CreateResourceTag method prepareJSONObject.

/**
	 * Prepares a JSON object
	 * @return JSONObject the whole query
	 */
private JSONObject prepareJSONObject() {
    JSONObject jsonQuery = new JSONObject();
    JSONObject jsonTag = new JSONObject();
    jsonTag.put("id", null);
    jsonTag.put("tagName", new JSONString(tagName));
    jsonTag.put("voId", new JSONNumber(voId));
    jsonQuery.put("resourceTag", jsonTag);
    jsonQuery.put("vo", new JSONNumber(voId));
    return jsonQuery;
}
Also used : JSONObject(com.google.gwt.json.client.JSONObject) JSONNumber(com.google.gwt.json.client.JSONNumber) JSONString(com.google.gwt.json.client.JSONString)

Example 39 with JSONObject

use of com.google.gwt.json.client.JSONObject in project perun by CESNET.

the class DeleteResource method prepareJSONObject.

/**
	 * Prepares a JSON object
	 * @return JSONObject the whole query
	 */
private JSONObject prepareJSONObject() {
    JSONObject jsonQuery = new JSONObject();
    jsonQuery.put("resource", new JSONNumber(resourceId));
    return jsonQuery;
}
Also used : JSONObject(com.google.gwt.json.client.JSONObject) JSONNumber(com.google.gwt.json.client.JSONNumber)

Example 40 with JSONObject

use of com.google.gwt.json.client.JSONObject in project perun by CESNET.

the class AddUserToBlacklist method prepareJSONObject.

/**
	 * Prepares a JSON object
	 *
	 * @return JSONObject the whole query
	 */
private JSONObject prepareJSONObject() {
    JSONObject jsonQuery = new JSONObject();
    jsonQuery.put("securityTeam", new JSONNumber(securityTeamId));
    jsonQuery.put("user", new JSONNumber(userId));
    jsonQuery.put("description", new JSONString(description));
    return jsonQuery;
}
Also used : JSONObject(com.google.gwt.json.client.JSONObject) JSONNumber(com.google.gwt.json.client.JSONNumber) JSONString(com.google.gwt.json.client.JSONString)

Aggregations

JSONObject (com.google.gwt.json.client.JSONObject)227 JSONNumber (com.google.gwt.json.client.JSONNumber)109 JSONString (com.google.gwt.json.client.JSONString)74 JSONArray (com.google.gwt.json.client.JSONArray)62 PerunError (cz.metacentrum.perun.webgui.model.PerunError)55 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)54 JsonCallbackEvents (cz.metacentrum.perun.webgui.json.JsonCallbackEvents)54 JsonPostClient (cz.metacentrum.perun.webgui.json.JsonPostClient)50 JSONValue (com.google.gwt.json.client.JSONValue)13 HashMap (java.util.HashMap)12 Map (java.util.Map)8 ArrayList (java.util.ArrayList)6 JsArrayString (com.google.gwt.core.client.JsArrayString)3 User (cz.metacentrum.perun.webgui.model.User)3 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)2 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)2 Command (com.google.gwt.user.client.Command)2 Contact (com.googlecode.gwtphonegap.client.contacts.Contact)2 ContactField (com.googlecode.gwtphonegap.client.contacts.ContactField)2 StringCallback (com.gwtmobile.phonegap.client.plugins.Bluetooth.StringCallback)2