/** * @see org.kuali.rice.kns.lookup.LookupResultsService#retrieveResultsTable(java.lang.String, * java.lang.String) */ @Override public List<ResultRow> retrieveResultsTable(String lookupResultsSequenceNumber, String personId) throws Exception { LookupResults lookupResults = retrieveLookupResults(lookupResultsSequenceNumber); if (!isAuthorizedToAccessLookupResults(lookupResults, personId)) { throw new AuthorizationException( personId, "retrieve lookup results", "lookup sequence number " + lookupResultsSequenceNumber); } List<ResultRow> resultTable = (List<ResultRow>) ObjectUtils.fromByteArray( Base64.decodeBase64(lookupResults.getSerializedLookupResults().getBytes())); return resultTable; }
/** * @see org.kuali.rice.kns.lookup.LookupResultsService#persistResultsTable(java.lang.String, * java.util.List, java.lang.String) */ @Override public void persistResultsTable( String lookupResultsSequenceNumber, List<ResultRow> resultTable, String personId) throws Exception { String resultTableString = new String(Base64.encodeBase64(ObjectUtils.toByteArray(resultTable))); Timestamp now = getDateTimeService().getCurrentTimestamp(); LookupResults lookupResults = retrieveLookupResults(lookupResultsSequenceNumber); if (lookupResults == null) { lookupResults = new LookupResults(); lookupResults.setLookupResultsSequenceNumber(lookupResultsSequenceNumber); } lookupResults.setLookupResultsSequenceNumber(lookupResultsSequenceNumber); lookupResults.setLookupPersonId(personId); lookupResults.setSerializedLookupResults(resultTableString); lookupResults.setLookupDate(now); getBusinessObjectService().save(lookupResults); LOG.debug("Wrote resultTable " + resultTable); }