View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.portals.gems.browser;
18  
19  import java.util.List;
20  
21  import javax.portlet.PortletRequest;
22  
23  
24  import org.apache.velocity.context.Context;
25  
26  /***
27   * Browser Query Fetch Interface
28   *
29   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
30   * @version $Id: BrowserQuery.java 516448 2007-03-09 16:25:47Z ate $
31   *
32  */
33  public interface BrowserQuery
34  {
35  
36      /***
37       * This method returns the query to be executed to get the results which will
38       * be opened in the browser.
39       *
40       */
41      public String getQueryString(PortletRequest request, Context context);
42  
43      /***
44       * Filter the row programmatically on a query.
45       * By returning true, instruct the database browser to filter the row.
46       * By returning false, instruct the database browser to keep the row.
47       * (Filtering means removing the row from the final result set).
48       *
49       * @param row The row being inspected for filtration.
50       * @return True to filter the row, false to keep it.
51       */
52      public boolean filter(List row, PortletRequest request);
53  
54      /*
55       * Set a list of JDBC query parameters.
56       * All members of this list must be java objects (not primitives)
57       * Should be called from derived classes.
58       *
59       */
60      public void setSQLParameters(List parameters);
61  
62      public List getSQLParameters();
63  
64  
65  }