KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > dbforms > event > classic > NavLastEvent


1 /*
2  * $Header: /cvsroot/jdbforms/dbforms/src/org/dbforms/event/classic/NavLastEvent.java,v 1.11 2004/10/20 10:51:30 hkollmann Exp $
3  * $Revision: 1.11 $
4  * $Date: 2004/10/20 10:51:30 $
5  *
6  * DbForms - a Rapid Application Development Framework
7  * Copyright (C) 2001 Joachim Peer <joepeer@excite.com>
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22  */

23
24 package org.dbforms.event.classic;
25
26 import org.apache.commons.logging.Log;
27 import org.apache.commons.logging.LogFactory;
28
29 import org.dbforms.config.*;
30
31 import org.dbforms.event.NavigationEvent;
32
33 import java.sql.*;
34
35 import javax.servlet.http.*;
36
37
38
39 /**
40  * DOCUMENT ME!
41  *
42  * @author Joe Peer
43  *
44  * @deprecated <p>
45  */

46 public class NavLastEvent extends NavigationEvent {
47    static Log logCat = LogFactory.getLog(NavLastEvent.class.getName()); // logging category for this class
48

49    /**
50     * Creates a new NavLastEvent object.
51     *
52     * @param action DOCUMENT ME!
53     * @param request DOCUMENT ME!
54     * @param config DOCUMENT ME!
55     */

56    public NavLastEvent(String JavaDoc action,
57                        HttpServletRequest request,
58                        DbFormsConfig config) {
59       super(action, request, config);
60    }
61
62
63    /**
64     * Creates a new NavLastEvent object.
65     *
66     * @param table DOCUMENT ME!
67     * @param request DOCUMENT ME!
68     * @param config DOCUMENT ME!
69     */

70    public NavLastEvent(Table table,
71                        HttpServletRequest request,
72                        DbFormsConfig config) {
73       super(table, request, config);
74    }
75
76    /**
77     * Process the current event.
78     *
79     * @param childFieldValues FieldValue array used to restrict a set of data
80     * @param orderConstraint FieldValue array used to build a cumulation of
81     * rules for ordering (sorting) and restricting fields to the actual
82     * block of data
83     * @param firstPosition DOCUMENT ME!
84     * @param sqlFilterParams a string identifying the last resultset position
85     * @param count record count
86     * @param firstPosition a string identifying the first resultset position
87     * @param lastPosition DOCUMENT ME!
88     * @param dbConnectionName name of the used db connection. Can be used to
89     * get an own db connection, e.g. to hold it during the session (see
90     * DataSourceJDBC for example!)
91     * @param con the JDBC Connection object
92     *
93     * @return a ResultSetVector object
94     *
95     * @exception SQLException if any error occurs
96     */

97    public ResultSetVector processEvent(FieldValue[] childFieldValues,
98                                        FieldValue[] orderConstraint,
99                                        String JavaDoc sqlFilter,
100                                        FieldValue[] sqlFilterParams,
101                                        int count,
102                                        String JavaDoc firstPosition,
103                                        String JavaDoc lastPosition,
104                                        DbEventInterceptorData interceptorData)
105                                 throws SQLException {
106       // select from table in inverted order
107
logCat.info("==>NavLastEvent");
108       FieldValue.invert(orderConstraint);
109
110       ResultSetVector resultSetVector = getTable()
111                                            .doConstrainedSelect(childFieldValues,
112                                                                 orderConstraint,
113                                                                 sqlFilter,
114                                                                 sqlFilterParams,
115                                                                 Constants.COMPARE_NONE,
116                                                                 count, interceptorData);
117       FieldValue.invert(orderConstraint);
118       resultSetVector.flip();
119
120       return resultSetVector;
121    }
122 }
123
Popular Tags