Example usage for org.json JSONArray getJSONArray

List of usage examples for org.json JSONArray getJSONArray

Introduction

In this page you can find the example usage for org.json JSONArray getJSONArray.

Prototype

public JSONArray getJSONArray(int index) throws JSONException 

Source Link

Document

Get the JSONArray associated with an index.

Usage

From source file:com.liferay.mobile.android.v7.socialactivity.SocialActivityService.java

public JSONArray getRelationActivities(long userId, int start, int end) throws Exception {
    JSONObject _command = new JSONObject();

    try {/*from w  w  w  . j a  v a  2s .co  m*/
        JSONObject _params = new JSONObject();

        _params.put("userId", userId);
        _params.put("start", start);
        _params.put("end", end);

        _command.put("/socialactivity/get-relation-activities", _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.socialactivity.SocialActivityService.java

public JSONArray getRelationActivities(long userId, int type, int start, int end) throws Exception {
    JSONObject _command = new JSONObject();

    try {//from   ww w. j  a v a2  s  . co m
        JSONObject _params = new JSONObject();

        _params.put("userId", userId);
        _params.put("type", type);
        _params.put("start", start);
        _params.put("end", end);

        _command.put("/socialactivity/get-relation-activities", _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.socialactivity.SocialActivityService.java

public JSONArray getUserActivities(long userId, int start, int end) throws Exception {
    JSONObject _command = new JSONObject();

    try {//from  www  .  j av a2  s  . c  om
        JSONObject _params = new JSONObject();

        _params.put("userId", userId);
        _params.put("start", start);
        _params.put("end", end);

        _command.put("/socialactivity/get-user-activities", _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.socialactivity.SocialActivityService.java

public JSONArray getUserGroupsActivities(long userId, int start, int end) throws Exception {
    JSONObject _command = new JSONObject();

    try {/* w w w . j a  va  2  s  . com*/
        JSONObject _params = new JSONObject();

        _params.put("userId", userId);
        _params.put("start", start);
        _params.put("end", end);

        _command.put("/socialactivity/get-user-groups-activities", _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.socialactivity.SocialActivityService.java

public JSONArray getUserGroupsAndOrganizationsActivities(long userId, int start, int end) throws Exception {
    JSONObject _command = new JSONObject();

    try {//from   w  ww .  j  av a2  s. co m
        JSONObject _params = new JSONObject();

        _params.put("userId", userId);
        _params.put("start", start);
        _params.put("end", end);

        _command.put("/socialactivity/get-user-groups-and-organizations-activities", _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.socialactivity.SocialActivityService.java

public JSONArray getUserOrganizationsActivities(long userId, int start, int end) throws Exception {
    JSONObject _command = new JSONObject();

    try {// w ww . ja  v a 2s  . c  o m
        JSONObject _params = new JSONObject();

        _params.put("userId", userId);
        _params.put("start", start);
        _params.put("end", end);

        _command.put("/socialactivity/get-user-organizations-activities", _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.dlfileentry.DLFileEntryService.java

public JSONArray getFileEntries(long groupId, long folderId, int start, int end, JSONObjectWrapper obc)
        throws Exception {
    JSONObject _command = new JSONObject();

    try {//  w w w .j a  v  a 2 s  .c o  m
        JSONObject _params = new JSONObject();

        _params.put("groupId", groupId);
        _params.put("folderId", folderId);
        _params.put("start", start);
        _params.put("end", end);
        mangleWrapper(_params, "obc",
                "com.liferay.portal.kernel.util.OrderByComparator<com.liferay.document.library.kernel.model.DLFileEntry>",
                obc);

        _command.put("/dlfileentry/get-file-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.dlfileentry.DLFileEntryService.java

public JSONArray getFileEntries(long groupId, long folderId, int status, int start, int end,
        JSONObjectWrapper obc) throws Exception {
    JSONObject _command = new JSONObject();

    try {//from  w  ww.j  a  v a 2s . c  o  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<com.liferay.document.library.kernel.model.DLFileEntry>",
                obc);

        _command.put("/dlfileentry/get-file-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.dlfileentry.DLFileEntryService.java

public JSONArray getFileEntries(long groupId, long folderId, long fileEntryTypeId, int start, int end,
        JSONObjectWrapper obc) throws Exception {
    JSONObject _command = new JSONObject();

    try {/*  w w w.  j  a  va 2 s . co m*/
        JSONObject _params = new JSONObject();

        _params.put("groupId", groupId);
        _params.put("folderId", folderId);
        _params.put("fileEntryTypeId", fileEntryTypeId);
        _params.put("start", start);
        _params.put("end", end);
        mangleWrapper(_params, "obc",
                "com.liferay.portal.kernel.util.OrderByComparator<com.liferay.document.library.kernel.model.DLFileEntry>",
                obc);

        _command.put("/dlfileentry/get-file-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.dlfileentry.DLFileEntryService.java

public JSONArray getFileEntries(long groupId, long folderId, JSONArray mimeTypes, int start, int end,
        JSONObjectWrapper obc) throws Exception {
    JSONObject _command = new JSONObject();

    try {//from ww w  .j a  v a  2  s  . com
        JSONObject _params = new JSONObject();

        _params.put("groupId", groupId);
        _params.put("folderId", folderId);
        _params.put("mimeTypes", checkNull(mimeTypes));
        _params.put("start", start);
        _params.put("end", end);
        mangleWrapper(_params, "obc",
                "com.liferay.portal.kernel.util.OrderByComparator<com.liferay.document.library.kernel.model.DLFileEntry>",
                obc);

        _command.put("/dlfileentry/get-file-entries", _params);
    } catch (JSONException _je) {
        throw new Exception(_je);
    }

    JSONArray _result = session.invoke(_command);

    if (_result == null) {
        return null;
    }

    return _result.getJSONArray(0);
}