serverInfo.put(ID, prs.getID()); Map pageInfo = prs.getRecords(1, prs.getInitialDownloadCount()); serverInfo.put(TOTAL_COUNT, new Integer(prs.getRowCount())); serverInfo.put(SERVICE_NAME, prs.getServiceName()); serverInfo.put(COLUMN_NAMES, prs.getColumnNames()); serverInfo.put(VERSION, RECORD_SET_VERSION); value = serverInfo;
/** * Stores the PageableRowSet result in the session to act as a cache * for the legacy client RecordSet paging feature. * * @param rowset PageableRowSet to be cached for paged access. */ public static void cachePageableRowSet(PageableRowSet rowset) { if (rowset != null) { FlexSession session = FlexContext.getFlexSession(); session.setAttribute(rowset.getID(), rowset); } }
/** * Get a subset of records that are cached for the given PageableRowSet id. * * @param id The PageableRowSet's id, used to locate it in the current session. * @param startIndex The absolute position for the record set cursor. * @param count The size of the page of results to return. * @return Map The resulting sub-set of data or 'page' requested. * @see PageableRowSet#getRecords(int, int) * * @throws SQLException if an exception occurs while reading the <tt>RowSet</tt> */ public Map getRecords(String id, int startIndex, int count) throws SQLException { Map page = null; FlexSession session = FlexContext.getFlexSession(); if (session != null) { Object o = session.getAttribute(id); if (o != null && o instanceof PageableRowSet) { PageableRowSet rs = (PageableRowSet) o; page = rs.getRecords(startIndex, count); } } return page; }
/** * Stores the PageableRowSet result in the session to act as a cache * for the legacy client RecordSet paging feature. * * @param rowset PageableRowSet to be cached for paged access. */ public static void cachePageableRowSet(PageableRowSet rowset) { if (rowset != null) { FlexSession session = FlexContext.getFlexSession(); session.setAttribute(rowset.getID(), rowset); } }
/** * Get a subset of records that are cached for the given PageableRowSet id. * * @param id The PageableRowSet's id, used to locate it in the current session. * @param startIndex The absolute position for the record set cursor. * @param count The size of the page of results to return. * @return Map The resulting sub-set of data or 'page' requested. * @see PageableRowSet#getRecords(int, int) * * @throws SQLException if an exception occurs while reading the <tt>RowSet</tt> */ public Map getRecords(String id, int startIndex, int count) throws SQLException { Map page = null; FlexSession session = FlexContext.getFlexSession(); if (session != null) { Object o = session.getAttribute(id); if (o != null && o instanceof PageableRowSet) { PageableRowSet rs = (PageableRowSet) o; page = rs.getRecords(startIndex, count); } } return page; }
serverInfo.put(ID, prs.getID()); Map pageInfo = prs.getRecords(1, prs.getInitialDownloadCount()); serverInfo.put(TOTAL_COUNT, new Integer(prs.getRowCount())); serverInfo.put(SERVICE_NAME, prs.getServiceName()); serverInfo.put(COLUMN_NAMES, prs.getColumnNames()); serverInfo.put(VERSION, RECORD_SET_VERSION); value = serverInfo;
serverInfo.put(ID, prs.getID()); Map pageInfo = prs.getRecords(1, prs.getInitialDownloadCount()); serverInfo.put(TOTAL_COUNT, new Integer(prs.getRowCount())); serverInfo.put(SERVICE_NAME, prs.getServiceName()); serverInfo.put(COLUMN_NAMES, prs.getColumnNames()); serverInfo.put(VERSION, RECORD_SET_VERSION); value = serverInfo;