Example usage for org.json JSONArray getInt

List of usage examples for org.json JSONArray getInt

Introduction

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

Prototype

public int getInt(int index) throws JSONException 

Source Link

Document

Get the int value associated with an index.

Usage

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

public Integer getRelationActivitiesCount(long userId, int type) throws Exception {
    JSONObject _command = new JSONObject();

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

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

        _command.put("/socialactivity/get-relation-activities-count", _params);
    } catch (JSONException _je) {
        throw new Exception(_je);
    }

    JSONArray _result = session.invoke(_command);

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

    return _result.getInt(0);
}

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

public Integer getUserActivitiesCount(long userId) throws Exception {
    JSONObject _command = new JSONObject();

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

        _params.put("userId", userId);

        _command.put("/socialactivity/get-user-activities-count", _params);
    } catch (JSONException _je) {
        throw new Exception(_je);
    }

    JSONArray _result = session.invoke(_command);

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

    return _result.getInt(0);
}

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

public Integer getUserGroupsActivitiesCount(long userId) throws Exception {
    JSONObject _command = new JSONObject();

    try {/*from  w  w w.  ja  v a2s.c o m*/
        JSONObject _params = new JSONObject();

        _params.put("userId", userId);

        _command.put("/socialactivity/get-user-groups-activities-count", _params);
    } catch (JSONException _je) {
        throw new Exception(_je);
    }

    JSONArray _result = session.invoke(_command);

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

    return _result.getInt(0);
}

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

public Integer getUserGroupsAndOrganizationsActivitiesCount(long userId) throws Exception {
    JSONObject _command = new JSONObject();

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

        _params.put("userId", userId);

        _command.put("/socialactivity/get-user-groups-and-organizations-activities-count", _params);
    } catch (JSONException _je) {
        throw new Exception(_je);
    }

    JSONArray _result = session.invoke(_command);

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

    return _result.getInt(0);
}

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

public Integer getUserOrganizationsActivitiesCount(long userId) throws Exception {
    JSONObject _command = new JSONObject();

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

        _params.put("userId", userId);

        _command.put("/socialactivity/get-user-organizations-activities-count", _params);
    } catch (JSONException _je) {
        throw new Exception(_je);
    }

    JSONArray _result = session.invoke(_command);

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

    return _result.getInt(0);
}

From source file:com.liferay.mobile.android.v7.dlfileentry.DLFileEntryService.java

public Integer getFileEntriesCount(long groupId, long folderId) throws Exception {
    JSONObject _command = new JSONObject();

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

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

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

    JSONArray _result = session.invoke(_command);

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

    return _result.getInt(0);
}

From source file:com.liferay.mobile.android.v7.dlfileentry.DLFileEntryService.java

public Integer getFileEntriesCount(long groupId, long folderId, JSONArray mimeTypes) throws Exception {
    JSONObject _command = new JSONObject();

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

        _params.put("groupId", groupId);
        _params.put("folderId", folderId);
        _params.put("mimeTypes", checkNull(mimeTypes));

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

    JSONArray _result = session.invoke(_command);

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

    return _result.getInt(0);
}

From source file:com.liferay.mobile.android.v7.dlfileentry.DLFileEntryService.java

public Integer getFileEntriesCount(long groupId, long folderId, long fileEntryTypeId) throws Exception {
    JSONObject _command = new JSONObject();

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

        _params.put("groupId", groupId);
        _params.put("folderId", folderId);
        _params.put("fileEntryTypeId", fileEntryTypeId);

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

    JSONArray _result = session.invoke(_command);

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

    return _result.getInt(0);
}

From source file:com.liferay.mobile.android.v7.dlfileentry.DLFileEntryService.java

public Integer getFileEntriesCount(long groupId, long folderId, int status) throws Exception {
    JSONObject _command = new JSONObject();

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

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

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

    JSONArray _result = session.invoke(_command);

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

    return _result.getInt(0);
}

From source file:com.liferay.mobile.android.v7.dlfileentry.DLFileEntryService.java

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

    try {//from  w  w  w.  ja v  a  2 s  . c om
        JSONObject _params = new JSONObject();

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

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

    JSONArray _result = session.invoke(_command);

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

    return _result.getInt(0);
}