use of org.activityinfo.json.JsonValue in project activityinfo by bedatadriven.
the class FormLabel method toJsonObject.
@Override
public JsonValue toJsonObject() {
JsonValue object = createObject();
object.put("id", id.asString());
object.put("label", label);
object.put("type", "label");
object.put("visible", visible);
return object;
}
use of org.activityinfo.json.JsonValue in project activityinfo by bedatadriven.
the class FormPermissions method toJson.
public JsonValue toJson() {
JsonValue object = Json.createObject();
object.put("view", view);
object.put("createRecord", createRecord);
object.put("updateRecord", updateRecord);
object.put("deleteRecord", deleteRecord);
object.put("viewFilter", viewFilter);
object.put("updateFilter", updateFilter);
return object;
}
use of org.activityinfo.json.JsonValue in project activityinfo by bedatadriven.
the class FormRecord method fromJson.
public static FormRecord fromJson(JsonValue element) {
JsonValue jsonObject = element;
FormRecord formRecord = new FormRecord();
formRecord.recordId = jsonObject.get("recordId").asString();
formRecord.formId = jsonObject.get("formId").asString();
if (jsonObject.hasKey("parentRecordId")) {
formRecord.parentRecordId = jsonObject.get("parentRecordId").asString();
}
formRecord.fields = jsonObject.get("fields");
return formRecord;
}
use of org.activityinfo.json.JsonValue in project activityinfo by bedatadriven.
the class FormRecord method toJson.
@Override
public JsonValue toJson() {
assert recordId != null;
assert formId != null;
JsonValue jsonObject = createObject();
jsonObject.put("recordId", recordId);
jsonObject.put("formId", formId);
if (parentRecordId != null) {
jsonObject.put("parentRecordId", parentRecordId);
}
jsonObject.put("fields", fields);
return jsonObject;
}
use of org.activityinfo.json.JsonValue in project activityinfo by bedatadriven.
the class TableColumn method toJson.
@Value.Lazy
public JsonValue toJson() {
JsonValue object = Json.createObject();
object.put("id", getId());
if (getLabel().isPresent()) {
object.put("label", getLabel().get());
}
if (getWidth().isPresent()) {
object.put("width", getWidth().get());
}
object.put("formula", getFormula());
return object;
}
Aggregations