本文整理了Java中com.liferay.portal.kernel.json.JSONObject.put()
方法的一些代码示例,展示了JSONObject.put()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSONObject.put()
方法的具体详情如下:
包路径:com.liferay.portal.kernel.json.JSONObject
类名称:JSONObject
方法名:put
暂无
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
protected void populateNotificationEventJSONObject(
JSONObject notificationEventJSONObject) {
notificationEventJSONObject.put("className", _className);
notificationEventJSONObject.put("classPK", _classPK);
notificationEventJSONObject.put("entryTitle", _entryTitle);
notificationEventJSONObject.put("entryURL", _entryURL);
notificationEventJSONObject.put("notificationType", _notificationType);
notificationEventJSONObject.put("userId", currentUserId);
}
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
public JSONObject toJSONObject() {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put(_KEY_ARCHIVED, _archived);
jsonObject.put(_KEY_DELIVERY_BY, _deliverBy);
jsonObject.put(_KEY_DELIVERY_REQUIRED, _deliveryRequired);
jsonObject.put(_KEY_DELIVERY_TYPE, _deliveryType);
jsonObject.put(_KEY_PAYLOAD, _payloadJSONObject);
jsonObject.put(_KEY_TIMESTAMP, _timestamp);
jsonObject.put(_KEY_TYPE, _type);
jsonObject.put(_KEY_UUID, _uuid);
return jsonObject;
}
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
public JSONObject toJSONObject() {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put(_ADDITIONAL_INFO, _additionalInfoJSONObject);
jsonObject.put(_COMPANY_ID, _companyId);
jsonObject.put(_CLASS_PK, _classPK);
jsonObject.put(_CLASS_NAME, _className);
jsonObject.put(_CLIENT_HOST, _clientHost);
jsonObject.put(_CLIENT_IP, _clientIP);
jsonObject.put(_MESSAGE, _message);
jsonObject.put(_SERVER_PORT, _serverPort);
jsonObject.put(_SERVER_NAME, _serverName);
jsonObject.put(_SESSION_ID, _sessionID);
jsonObject.put(_TIMESTAMP, _getDateFormat().format(new Date()));
jsonObject.put(_EVENT_TYPE, _eventType);
jsonObject.put(_USER_ID, _userId);
jsonObject.put(_USER_NAME, _userName);
return jsonObject;
}
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
public void setExtraDataValue(String key, String value) {
if (_extraDataJSONObject == null) {
_extraDataJSONObject = JSONFactoryUtil.createJSONObject();
}
_extraDataJSONObject.put(key, value);
}
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
public static JSONObject put(String key, Object value) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
return jsonObject.put(key, value);
}
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
@Override
public JSONObject toJSONObject() {
JSONObject pollerResponseJSONObject =
JSONFactoryUtil.createJSONObject();
pollerResponseJSONObject.put("portletId", _portletId);
if (Validator.isNotNull(_chunkId)) {
pollerResponseJSONObject.put("chunkId", _chunkId);
}
JSONObject dataJSONObject = JSONFactoryUtil.createJSONObject();
for (Map.Entry<String, Object> entry : _parameterMap.entrySet()) {
String name = entry.getKey();
Object value = entry.getValue();
if (value instanceof JSONArray) {
dataJSONObject.put(name, (JSONArray)value);
}
else if (value instanceof JSONObject) {
dataJSONObject.put(name, (JSONObject)value);
}
else {
dataJSONObject.put(name, String.valueOf(value));
}
}
pollerResponseJSONObject.put("data", dataJSONObject);
return pollerResponseJSONObject;
}
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
protected void doSetValues(JSONArray valuesJSONArray) {
FacetConfiguration facetConfiguration = getFacetConfiguration();
JSONObject dataJSONObject = facetConfiguration.getData();
dataJSONObject.put("values", valuesJSONArray);
}
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
protected JSONObject translateJSON(JSONObject jsonObject, Locale locale) {
if (locale == null) {
return jsonObject;
}
JSONObject translatedJSONObject = JSONFactoryUtil.createJSONObject();
Iterator<String> iterator = jsonObject.keys();
while (iterator.hasNext()) {
String key = iterator.next();
Object object = jsonObject.get(key);
if (object instanceof JSONObject) {
translatedJSONObject.put(
key, translateJSON((JSONObject)object, locale));
}
else if (object instanceof JSONArray) {
translatedJSONObject.put(
key, translateJSON((JSONArray)object, locale));
}
else if (object instanceof String) {
translatedJSONObject.put(
key, LanguageUtil.get(locale, (String)object));
}
else {
translatedJSONObject.put(key, object);
}
}
return translatedJSONObject;
}
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
});
rangeObject.put("range", rangeString);
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
throws PortalException {
jsonObject.put("success", Boolean.FALSE);
errorJSONObject.put("errorType", errorType);
errorJSONObject.put("message", errorMessage);
jsonObject.put("error", errorJSONObject);
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
public String toJSON() throws PortalException {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
JSONArray rowMoverDropTargetsJSONArray =
JSONFactoryUtil.createJSONArray();
for (RowMoverDropTarget rowMoverDropTarget : _rowMoverDropTargets) {
String rowMoverDropTargetJSON = JSONFactoryUtil.looseSerialize(
rowMoverDropTarget);
JSONObject rowMoverDropTargetJSONObject =
JSONFactoryUtil.createJSONObject(rowMoverDropTargetJSON);
rowMoverDropTargetsJSONArray.put(rowMoverDropTargetJSONObject);
}
jsonObject.put("dropTargets", rowMoverDropTargetsJSONArray);
jsonObject.put("rowSelector", _rowSelector);
return jsonObject.toString();
}
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
@Override
public SystemEvent addDeletionSystemEvent(
long userId, long groupId, long classPK, String classUuid,
String referrerClassName)
throws PortalException {
JSONObject extraDataJSONObject = JSONFactoryUtil.createJSONObject();
extraDataJSONObject.put("inTrash", true);
return SystemEventLocalServiceUtil.addSystemEvent(
userId, groupId, getSystemEventClassName(), classPK, classUuid,
referrerClassName, SystemEventConstants.TYPE_DELETE,
extraDataJSONObject.toString());
}
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
public Message createMessage(LCSPortletState lcsPortletState) {
Message message = new Message();
message.setDestinationName(getDestinationName());
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("state", lcsPortletState.intValue());
jsonObject.put("type", name());
message.setPayload(jsonObject.toString());
return message;
}
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
cssJSONObject = JSONFactoryUtil.createJSONObject(css);
cssJSONObject.put("hasCssValue", true);
cssJSONObject.put("portletData", portletDataJSONObject);
portletDataJSONObject.put("titles", titlesJSONObject);
"portletSetupTitle_" + languageId, null);
titlesJSONObject.put(languageId, title);
portletSetup.getValue("portletSetupPortletDecoratorId", null));
portletDataJSONObject.put("portletDecoratorId", portletDecoratorId);
portletDataJSONObject.put("portletLinksTarget", linkToLayoutUuid);
portletDataJSONObject.put("useCustomTitle", useCustomTitle);
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
imageJSONObject.put(
"attributeDataImageId",
EditorConstants.ATTRIBUTE_DATA_IMAGE_ID);
getServiceContext(uploadPortletRequest));
imageJSONObject.put("fileEntryId", fileEntry.getFileEntryId());
imageJSONObject.put("groupId", fileEntry.getGroupId());
imageJSONObject.put("title", fileEntry.getTitle());
imageJSONObject.put("type", "document");
imageJSONObject.put("url", getURL(fileEntry, themeDisplay));
imageJSONObject.put("uuid", fileEntry.getUuid());
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
public static JSONObject merge(
JSONObject jsonObject1, JSONObject jsonObject2)
throws JSONException {
if (jsonObject1 == null) {
return JSONFactoryUtil.createJSONObject(jsonObject2.toString());
}
if (jsonObject2 == null) {
return JSONFactoryUtil.createJSONObject(jsonObject1.toString());
}
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(
jsonObject1.toString());
Iterator<String> iterator = jsonObject2.keys();
while (iterator.hasNext()) {
String key = iterator.next();
jsonObject.put(key, jsonObject2.get(key));
}
return jsonObject;
}
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
public Message createMessage() {
Message message = new Message();
message.setDestinationName(getDestinationName());
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("type", name());
message.setPayload(jsonObject.toString());
return message;
}
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
footerCssSet.toArray(new String[footerCssSet.size()]));
jsonObject.put(
"footerCssPaths", JSONFactoryUtil.createJSONArray(footerCssPaths));
new String[footerJavaScriptSet.size()]));
jsonObject.put(
"footerJavaScriptPaths",
JSONFactoryUtil.createJSONArray(footerJavaScriptPaths));
headerCssSet.toArray(new String[headerCssSet.size()]));
jsonObject.put(
"headerCssPaths", JSONFactoryUtil.createJSONArray(headerCssPaths));
new String[headerJavaScriptSet.size()]));
jsonObject.put(
"headerJavaScriptPaths",
JSONFactoryUtil.createJSONArray(headerJavaScriptPaths));
jsonObject.put(
"markupHeadElements",
StringUtil.merge(markupHeadElements, StringPool.BLANK));
jsonObject.put("portletHTML", portletHTML);
jsonObject.put("refresh", !portlet.isAjaxable());
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
uploadPortletRequest, "randomId");
imageJSONObject.put("randomId", randomId);
jsonObject.put("file", imageJSONObject);
jsonObject.put("success", Boolean.TRUE);
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
dataJSONObject.put("values", entriesJSONArray);
内容来源于网络,如有侵权,请联系作者删除!