Java Code Examples for com.github.openjson.JSONObject#toString()

The following examples show how to use com.github.openjson.JSONObject#toString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WbWebSocketHelper.java    From openmeetings with Apache License 2.0 6 votes vote down vote up
private static JSONObject patchUrls(BaseFileItem fi, Client c, JSONObject _f) {
	JSONObject f = new JSONObject(_f.toString()); // deep copy to ensure thread safety
	switch (fi.getType()) {
		case VIDEO:
			f.put(PARAM__SRC, patchUrl(f.getString(PARAM__SRC), c));
			f.put(PARAM__POSTER, patchUrl(f.getString(PARAM__POSTER), c));
			break;
		case RECORDING:
			f.put(PARAM__SRC, patchUrl(f.getString(PARAM__SRC), c));
			f.put(PARAM__POSTER, patchUrl(f.getString(PARAM__POSTER), c));
			break;
		case PRESENTATION:
			f.put(PARAM__SRC, patchUrl(f.getString(PARAM__SRC), c));
			break;
		default:
			f.put(PARAM_SRC, patchUrl(f.getString(PARAM_SRC), c));
			break;
	}
	return f;
}
 
Example 2
Source File: WsMessageWbFile.java    From openmeetings with Apache License 2.0 5 votes vote down vote up
public WsMessageWbFile(Long roomId, long wbId, String ruid, JSONObject file, BaseFileItem fi) {
	this.roomId = roomId;
	this.wbId = wbId;
	this.ruid = ruid;
	this.file = file.toString(new NullStringer());
	this.fi = fi;
}
 
Example 3
Source File: WbWebSocketHelper.java    From openmeetings with Apache License 2.0 5 votes vote down vote up
public static JSONObject addFileUrl(String ruid, JSONObject _file, BaseFileItem fi, Client c) {
	JSONObject file = new JSONObject(_file.toString(new NullStringer()));
	final FileSystemResourceReference ref;
	final PageParameters pp = new PageParameters()
			.add("id", fi.getId())
			.add("ruid", ruid)
			.add("wuid", _file.optString("uid"));
	if (c != null) {
		pp.add("uid", c.getUid());
	}
	file.put("deleted", !fi.exists());
	switch (fi.getType()) {
		case VIDEO:
			ref = new RoomResourceReference();
			file.put(PARAM__SRC, urlFor(ref, pp));
			file.put(PARAM__POSTER, urlFor(new RoomPreviewResourceReference(), pp));
			break;
		case RECORDING:
			ref = new Mp4RecordingResourceReference();
			file.put(PARAM__SRC, urlFor(ref, pp));
			file.put(PARAM__POSTER, urlFor(new PngRecordingResourceReference(), pp));
			break;
		case PRESENTATION:
			ref = new RoomResourceReference();
			file.put(PARAM__SRC, urlFor(ref, pp));
			break;
		default:
			ref = new RoomResourceReference();
			file.put(PARAM_SRC, urlFor(ref, pp));
			break;
	}
	return file;
}
 
Example 4
Source File: WsMessageChat.java    From openmeetings with Apache License 2.0 4 votes vote down vote up
public WsMessageChat(ChatMessage m, JSONObject msg) {
	this.m = m;
	this.msg = msg.toString(new NullStringer());
}
 
Example 5
Source File: WsMessageUser.java    From openmeetings with Apache License 2.0 4 votes vote down vote up
public WsMessageUser(Long userId, JSONObject msg) {
	this.userId = userId;
	this.msg = msg.toString(new NullStringer());
}
 
Example 6
Source File: WsMessageRoom.java    From openmeetings with Apache License 2.0 4 votes vote down vote up
public WsMessageRoom(Long roomId, JSONObject msg) {
	this.roomId = roomId;
	this.msg = msg.toString(new NullStringer());
}
 
Example 7
Source File: UndoObject.java    From openmeetings with Apache License 2.0 4 votes vote down vote up
public UndoObject(Type type, JSONObject obj) {
	this.type = type;
	this.object = obj.toString(new NullStringer());
}
 
Example 8
Source File: WsMessageWb.java    From openmeetings with Apache License 2.0 4 votes vote down vote up
public WsMessageWb(Long roomId, WbAction meth, JSONObject obj, String uid) {
	this.roomId = roomId;
	this.meth = meth;
	this.obj = obj.toString(new NullStringer());
	this.uid = uid;
}
 
Example 9
Source File: ExtendedClientProperties.java    From openmeetings with Apache License 2.0 4 votes vote down vote up
public ExtendedClientProperties setSettings(JSONObject s) {
	settings = s.toString();
	return this;
}