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.mbcategory.MBCategoryService.java

public JSONArray getCategories(long groupId, JSONArray parentCategoryIds, int status, int start, int end)
        throws Exception {
    JSONObject _command = new JSONObject();

    try {//  w w w.jav  a2 s.  co  m
        JSONObject _params = new JSONObject();

        _params.put("groupId", groupId);
        _params.put("parentCategoryIds", checkNull(parentCategoryIds));
        _params.put("status", status);
        _params.put("start", start);
        _params.put("end", end);

        _command.put("/mbcategory/get-categories", _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.mbcategory.MBCategoryService.java

public JSONArray getCategories(long groupId, JSONArray excludedCategoryIds, JSONArray parentCategoryIds,
        int status, int start, int end) throws Exception {
    JSONObject _command = new JSONObject();

    try {//from ww  w . j  a v  a2s  .c o m
        JSONObject _params = new JSONObject();

        _params.put("groupId", groupId);
        _params.put("excludedCategoryIds", checkNull(excludedCategoryIds));
        _params.put("parentCategoryIds", checkNull(parentCategoryIds));
        _params.put("status", status);
        _params.put("start", start);
        _params.put("end", end);

        _command.put("/mbcategory/get-categories", _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.mbcategory.MBCategoryService.java

public JSONArray getCategories(long groupId, int status) throws Exception {
    JSONObject _command = new JSONObject();

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

        _params.put("groupId", groupId);
        _params.put("status", status);

        _command.put("/mbcategory/get-categories", _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.mbcategory.MBCategoryService.java

public JSONArray getCategories(long groupId) throws Exception {
    JSONObject _command = new JSONObject();

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

        _params.put("groupId", groupId);

        _command.put("/mbcategory/get-categories", _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.mbcategory.MBCategoryService.java

public JSONArray getCategoryIds(long groupId, long categoryId) throws Exception {
    JSONObject _command = new JSONObject();

    try {/*from   ww  w .  j  ava  2 s.  c om*/
        JSONObject _params = new JSONObject();

        _params.put("groupId", groupId);
        _params.put("categoryId", categoryId);

        _command.put("/mbcategory/get-category-ids", _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.mbcategory.MBCategoryService.java

public JSONArray getCategoriesAndThreads(long groupId, long categoryId, int status) throws Exception {
    JSONObject _command = new JSONObject();

    try {//from   www .ja v  a2  s . c  o  m
        JSONObject _params = new JSONObject();

        _params.put("groupId", groupId);
        _params.put("categoryId", categoryId);
        _params.put("status", status);

        _command.put("/mbcategory/get-categories-and-threads", _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.mbcategory.MBCategoryService.java

public JSONArray getCategoriesAndThreads(long groupId, long categoryId) throws Exception {
    JSONObject _command = new JSONObject();

    try {//from www .j a va  2  s. c  om
        JSONObject _params = new JSONObject();

        _params.put("groupId", groupId);
        _params.put("categoryId", categoryId);

        _command.put("/mbcategory/get-categories-and-threads", _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.mbcategory.MBCategoryService.java

public JSONArray getCategoriesAndThreads(long groupId, long categoryId, int status, int start, int end)
        throws Exception {
    JSONObject _command = new JSONObject();

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

        _params.put("groupId", groupId);
        _params.put("categoryId", categoryId);
        _params.put("status", status);
        _params.put("start", start);
        _params.put("end", end);

        _command.put("/mbcategory/get-categories-and-threads", _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.mbcategory.MBCategoryService.java

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

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

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

        _command.put("/mbcategory/get-subscribed-categories", _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.mbcategory.MBCategoryService.java

public JSONArray getSubcategoryIds(JSONArray categoryIds, long groupId, long categoryId) throws Exception {
    JSONObject _command = new JSONObject();

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

        _params.put("categoryIds", checkNull(categoryIds));
        _params.put("groupId", groupId);
        _params.put("categoryId", categoryId);

        _command.put("/mbcategory/get-subcategory-ids", _params);
    } catch (JSONException _je) {
        throw new Exception(_je);
    }

    JSONArray _result = session.invoke(_command);

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

    return _result.getJSONArray(0);
}