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.journalarticle.JournalArticleService.java

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

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

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

        _command.put("/journal.journalarticle/get-articles-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.journalarticle.JournalArticleService.java

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

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

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

        _command.put("/journal.journalarticle/get-articles-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.journalarticle.JournalArticleService.java

public Integer getArticlesCountByArticleId(long groupId, String articleId) throws Exception {
    JSONObject _command = new JSONObject();

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

        _params.put("groupId", groupId);
        _params.put("articleId", checkNull(articleId));

        _command.put("/journal.journalarticle/get-articles-count-by-article-id", _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.journalarticle.JournalArticleService.java

public Integer getArticlesCountByStructureId(long groupId, String ddmStructureKey, int status)
        throws Exception {
    JSONObject _command = new JSONObject();

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

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

        _command.put("/journal.journalarticle/get-articles-count-by-structure-id", _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.journalarticle.JournalArticleService.java

public Integer getArticlesCountByStructureId(long groupId, long classNameId, String ddmStructureKey, int status)
        throws Exception {
    JSONObject _command = new JSONObject();

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

        _params.put("groupId", groupId);
        _params.put("classNameId", classNameId);
        _params.put("ddmStructureKey", checkNull(ddmStructureKey));
        _params.put("status", status);

        _command.put("/journal.journalarticle/get-articles-count-by-structure-id", _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.journalarticle.JournalArticleService.java

public Integer getArticlesCountByStructureId(long groupId, String ddmStructureKey) throws Exception {
    JSONObject _command = new JSONObject();

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

        _params.put("groupId", groupId);
        _params.put("ddmStructureKey", checkNull(ddmStructureKey));

        _command.put("/journal.journalarticle/get-articles-count-by-structure-id", _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.journalarticle.JournalArticleService.java

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

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

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

        _command.put("/journal.journalarticle/get-folders-and-articles-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.journalarticle.JournalArticleService.java

public Integer getGroupArticlesCount(long groupId, long userId, long rootFolderId, int status)
        throws Exception {
    JSONObject _command = new JSONObject();

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

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

        _command.put("/journal.journalarticle/get-group-articles-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.journalarticle.JournalArticleService.java

public Integer getGroupArticlesCount(long groupId, long userId, long rootFolderId, int status,
        boolean includeOwner) throws Exception {
    JSONObject _command = new JSONObject();

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

        _params.put("groupId", groupId);
        _params.put("userId", userId);
        _params.put("rootFolderId", rootFolderId);
        _params.put("status", status);
        _params.put("includeOwner", includeOwner);

        _command.put("/journal.journalarticle/get-group-articles-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.journalarticle.JournalArticleService.java

public Integer getGroupArticlesCount(long groupId, long userId, long rootFolderId) throws Exception {
    JSONObject _command = new JSONObject();

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

        _params.put("groupId", groupId);
        _params.put("userId", userId);
        _params.put("rootFolderId", rootFolderId);

        _command.put("/journal.journalarticle/get-group-articles-count", _params);
    } catch (JSONException _je) {
        throw new Exception(_je);
    }

    JSONArray _result = session.invoke(_command);

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

    return _result.getInt(0);
}