List of usage examples for com.liferay.portal.kernel.json JSONArray getLong
public long getLong(int index);
From source file:at.graz.meduni.liferay.portlet.bibbox.service.service.impl.LogapiServiceImpl.java
License:Open Source License
/** * //from w ww . j a v a 2 s. c o m * @return */ @AccessControlled(guestAccessEnabled = true) @JSONWebService(value = "regbbs", method = "POST") public JSONArray regbbs(String data) { JSONArray jsonarray = JSONFactoryUtil.createJSONArray(); try { JSONArray array = JSONFactoryUtil.createJSONArray(data); for (int arrayindex = 0; arrayindex < array.length(); arrayindex++) { jsonarray.put(regbb(array.getLong(arrayindex))); } } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } return jsonarray; }
From source file:com.idetronic.subur.service.impl.AuthorLocalServiceImpl.java
License:Open Source License
/** * Update all author with up to date item count * @param companyId/*ww w .j a v a 2 s . co m*/ * @param groupId */ public void updateAllItemCount(long companyId, long groupId) { List authorItemCounts = AuthorFinderUtil.getItemCountByGroupCompanyScalar(companyId, groupId); String serilizeString = null; JSONArray authorJsonArray = null; for (Object elemObject : authorItemCounts) { serilizeString = JSONFactoryUtil.serialize(elemObject); try { authorJsonArray = JSONFactoryUtil.createJSONArray(serilizeString); long authorId = authorJsonArray.getLong(0); int itemCount = authorJsonArray.getInt(1); Author author = authorPersistence.fetchByPrimaryKey(authorId); author.setItemCount(itemCount); authorPersistence.update(author); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }