List of usage examples for org.json JSONArray getJSONArray
public JSONArray getJSONArray(int index) throws JSONException
From source file:com.liferay.mobile.android.v7.journalfolder.JournalFolderService.java
public JSONArray getFoldersAndArticles(long groupId, long userId, long folderId, int status, int start, int end, JSONObjectWrapper obc) throws Exception { JSONObject _command = new JSONObject(); try {/*from w w w. j ava2 s . c o m*/ JSONObject _params = new JSONObject(); _params.put("groupId", groupId); _params.put("userId", userId); _params.put("folderId", folderId); _params.put("status", status); _params.put("start", start); _params.put("end", end); mangleWrapper(_params, "obc", "com.liferay.portal.kernel.util.OrderByComparator", obc); _command.put("/journal.journalfolder/get-folders-and-articles", _params); } catch (JSONException _je) { throw new Exception(_je); } JSONArray _result = session.invoke(_command); if (_result == null) { return null; } return _result.getJSONArray(0); }
From source file:com.liferay.mobile.android.v7.journalfolder.JournalFolderService.java
public JSONArray getFoldersAndArticles(long groupId, long folderId, int status, int start, int end, JSONObjectWrapper obc) throws Exception { JSONObject _command = new JSONObject(); try {/*from w w w . ja v a 2 s . co m*/ JSONObject _params = new JSONObject(); _params.put("groupId", groupId); _params.put("folderId", folderId); _params.put("status", status); _params.put("start", start); _params.put("end", end); mangleWrapper(_params, "obc", "com.liferay.portal.kernel.util.OrderByComparator", obc); _command.put("/journal.journalfolder/get-folders-and-articles", _params); } catch (JSONException _je) { throw new Exception(_je); } JSONArray _result = session.invoke(_command); if (_result == null) { return null; } return _result.getJSONArray(0); }
From source file:com.liferay.mobile.android.v7.assetentry.AssetEntryService.java
public JSONArray getEntries(JSONObjectWrapper entryQuery) throws Exception { JSONObject _command = new JSONObject(); try {/* w w w .ja v a 2 s. co m*/ JSONObject _params = new JSONObject(); mangleWrapper(_params, "entryQuery", "com.liferay.asset.kernel.service.persistence.AssetEntryQuery", entryQuery); _command.put("/assetentry/get-entries", _params); } catch (JSONException _je) { throw new Exception(_je); } JSONArray _result = session.invoke(_command); if (_result == null) { return null; } return _result.getJSONArray(0); }
From source file:com.liferay.mobile.android.v7.assetentry.AssetEntryService.java
public JSONArray getCompanyEntries(long companyId, int start, int end) throws Exception { JSONObject _command = new JSONObject(); try {// w w w. j a v a 2s .c om JSONObject _params = new JSONObject(); _params.put("companyId", companyId); _params.put("start", start); _params.put("end", end); _command.put("/assetentry/get-company-entries", _params); } catch (JSONException _je) { throw new Exception(_je); } JSONArray _result = session.invoke(_command); if (_result == null) { return null; } return _result.getJSONArray(0); }
From source file:org.acaro.graffiti.processing.GraffitiReader.java
@Override public BasicVertex<Text, IntWritable, Text, Message> getCurrentVertex() throws IOException, InterruptedException { Vertex vertex = new Vertex(); Text line = getRecordReader().getCurrentValue(); try {/*from w w w . j ava 2 s .c o m*/ JSONArray jsonVertex = new JSONArray(line.toString()); vertex.setVertexId(new Text(jsonVertex.getString(0))); vertex.setMsgList(msgList); JSONArray jsonEdgeArray = jsonVertex.getJSONArray(1); for (int i = 0; i < jsonEdgeArray.length(); ++i) { JSONArray jsonEdge = jsonEdgeArray.getJSONArray(i); vertex.addEdge(new Text(jsonEdge.getString(1)), new Text(jsonEdge.getString(0))); } } catch (JSONException e) { throw new IllegalArgumentException("next: Couldn't get vertex from line " + line, e); } return vertex; }
From source file:com.liferay.mobile.android.v7.ddmstructure.DDMStructureService.java
public JSONArray search(long companyId, JSONArray groupIds, long classNameId, String keywords, int status, int start, int end, JSONObjectWrapper orderByComparator) throws Exception { JSONObject _command = new JSONObject(); try {// ww w . jav a 2 s . c o m JSONObject _params = new JSONObject(); _params.put("companyId", companyId); _params.put("groupIds", checkNull(groupIds)); _params.put("classNameId", classNameId); _params.put("keywords", checkNull(keywords)); _params.put("status", status); _params.put("start", start); _params.put("end", end); mangleWrapper(_params, "orderByComparator", "com.liferay.portal.kernel.util.OrderByComparator<com.liferay.dynamic.data.mapping.model.DDMStructure>", orderByComparator); _command.put("/ddm.ddmstructure/search", _params); } catch (JSONException _je) { throw new Exception(_je); } JSONArray _result = session.invoke(_command); if (_result == null) { return null; } return _result.getJSONArray(0); }
From source file:com.liferay.mobile.android.v7.ddmstructure.DDMStructureService.java
public JSONArray search(long companyId, JSONArray groupIds, long classNameId, String name, String description, String storageType, int type, int status, boolean andOperator, int start, int end, JSONObjectWrapper orderByComparator) throws Exception { JSONObject _command = new JSONObject(); try {/*from ww w. j ava 2 s .c om*/ JSONObject _params = new JSONObject(); _params.put("companyId", companyId); _params.put("groupIds", checkNull(groupIds)); _params.put("classNameId", classNameId); _params.put("name", checkNull(name)); _params.put("description", checkNull(description)); _params.put("storageType", checkNull(storageType)); _params.put("type", type); _params.put("status", status); _params.put("andOperator", andOperator); _params.put("start", start); _params.put("end", end); mangleWrapper(_params, "orderByComparator", "com.liferay.portal.kernel.util.OrderByComparator<com.liferay.dynamic.data.mapping.model.DDMStructure>", orderByComparator); _command.put("/ddm.ddmstructure/search", _params); } catch (JSONException _je) { throw new Exception(_je); } JSONArray _result = session.invoke(_command); if (_result == null) { return null; } return _result.getJSONArray(0); }
From source file:com.liferay.mobile.android.v7.ddmstructure.DDMStructureService.java
public JSONArray getStructures(long companyId, JSONArray groupIds, long classNameId, int status) throws Exception { JSONObject _command = new JSONObject(); try {//from w w w. jav a 2s.c om JSONObject _params = new JSONObject(); _params.put("companyId", companyId); _params.put("groupIds", checkNull(groupIds)); _params.put("classNameId", classNameId); _params.put("status", status); _command.put("/ddm.ddmstructure/get-structures", _params); } catch (JSONException _je) { throw new Exception(_je); } JSONArray _result = session.invoke(_command); if (_result == null) { return null; } return _result.getJSONArray(0); }
From source file:com.liferay.mobile.android.v7.ddmstructure.DDMStructureService.java
public JSONArray getStructures(long companyId, JSONArray groupIds, long classNameId, int status, int start, int end, JSONObjectWrapper orderByComparator) throws Exception { JSONObject _command = new JSONObject(); try {/*from www . j a v a2s. c o m*/ JSONObject _params = new JSONObject(); _params.put("companyId", companyId); _params.put("groupIds", checkNull(groupIds)); _params.put("classNameId", classNameId); _params.put("status", status); _params.put("start", start); _params.put("end", end); mangleWrapper(_params, "orderByComparator", "com.liferay.portal.kernel.util.OrderByComparator<com.liferay.dynamic.data.mapping.model.DDMStructure>", orderByComparator); _command.put("/ddm.ddmstructure/get-structures", _params); } catch (JSONException _je) { throw new Exception(_je); } JSONArray _result = session.invoke(_command); if (_result == null) { return null; } return _result.getJSONArray(0); }
From source file:re.notifica.cordova.NotificarePlugin.java
/** * Add tags to a device/*from w w w. j a va2 s . c o m*/ * @param args * @param callbackContext */ protected void addDeviceTags(JSONArray args, final CallbackContext callbackContext) { Log.d(TAG, "ADDTAGS"); ArrayList<String> tagList = new ArrayList<String>(); try { JSONArray tags = args.getJSONArray(0); if (tags != null) { for (int i = 0; i < tags.length(); i++) { tagList.add(tags.getString(i)); } } Notificare.shared().addDeviceTags(tagList, new NotificareCallback<Boolean>() { @Override public void onSuccess(Boolean result) { if (callbackContext == null) { return; } callbackContext.success(); } @Override public void onError(NotificareError error) { if (callbackContext == null) { return; } callbackContext.error(error.getLocalizedMessage()); } }); } catch (JSONException e) { callbackContext.error("JSON parse error"); } }