01: package dinamica;
02:
03: /**
04: * Sort recordset in memory, request should include two mandatory
05: * parameters: rs and colname. rs is the ID of the session attribute
06: * that contains the recordset to be sorted, and colname is the column
07: * to use for the sorting.<br>
08: * 2007-06-19 <br>
09: * @author martin.cordova@gmail.com
10: */
11: public class SortRS extends GenericTransaction {
12:
13: @Override
14: public int service(Recordset inputParams) throws Throwable {
15: super .service(inputParams);
16:
17: String rsName = getRequest().getParameter("rs");
18:
19: Recordset rs = (Recordset) getSession().getAttribute(rsName);
20: if (rs == null)
21: throw new Throwable(
22: "Recordset not found in session attribute: "
23: + rsName);
24:
25: rs.sort(getRequest().getParameter("colname"));
26:
27: return 0;
28: }
29:
30: }
|