public void doRefresh(RunData rundata, Portlet portlet)
{
try
{
// Get reference to stock quote web service
StockQuoteService service = (StockQuoteService) TurbineServices.getInstance().
getService(StockQuoteService.SERVICE_NAME);
// Retrieve portlet parameters
String symbols = (String) PortletSessionState.getAttributeWithFallback(portlet, rundata, SYMBOLS);
this.sort = (String) PortletSessionState.getAttributeWithFallback(portlet, rundata, SORT);
if (this.sort != null)
{
PortletSessionState.setAttribute(portlet, rundata, SORT, sort);
rundata.getRequest().setAttribute(SORT, sort);
}
String columns = PortletConfigState.getParameter(portlet, rundata, COLUMNS,
StringUtils.arrayToString(ALL_COLUMNS, ","));
String[] selectedColumnsArray = StringUtils.stringToArray(columns, ",");
// Request stock quote(s) from the stock quote web service
String[] symbolArray = StringUtils.stringToArray(symbols, ",");
StockQuote[] quotes = service.fullQuotes(symbolArray);
// Sort the entries
if (this.sort != null)
{
QuickSort.quickSort(quotes, 0, quotes.length - 1, this);