portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/browser BrowserQuery.java DatabaseBrowserAction.java
Date Thu, 02 Oct 2003 22:34:22 GMT
taylor      2003/10/02 15:34:22

  Modified:    src/java/org/apache/jetspeed/modules/actions/portlets/browser
                        BrowserQuery.java DatabaseBrowserAction.java
  Log:
  Added filter method to database browser to filter out unwanted rows programmatically.
  The default is to not filter. Override this method in your browser to implement filtering.
  
  Revision  Changes    Path
  1.7       +12 -1     jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/browser/BrowserQuery.java
  
  Index: BrowserQuery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/browser/BrowserQuery.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- BrowserQuery.java	7 May 2002 05:02:30 -0000	1.6
  +++ BrowserQuery.java	2 Oct 2003 22:34:22 -0000	1.7
  @@ -77,6 +77,17 @@
        */
       public String getQueryString(RunData rundata, Context context);
   
  +    /**
  +     * Filter the row programmatically on a query.
  +     * By returning true, instruct the database browser to filter the row.
  +     * By returning false, instruct the database browser to keep the row.
  +     * (Filtering means removing the row from the final result set).
  +     *
  +     * @param row The row being inspected for filtration.
  +     * @return True to filter the row, false to keep it.
  +     */
  +    public boolean filter(List row);
  +
       /*
        * Set a list of JDBC query parameters.
        * All members of this list must be java objects (not primitives)
  
  
  
  1.31      +14 -1     jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/browser/DatabaseBrowserAction.java
  
  Index: DatabaseBrowserAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/browser/DatabaseBrowserAction.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- DatabaseBrowserAction.java	29 Sep 2003 18:07:52 -0000	1.30
  +++ DatabaseBrowserAction.java	2 Oct 2003 22:34:22 -0000	1.31
  @@ -309,6 +309,14 @@
           buildNormalContext(portlet, context, rundata);
       }
   
  +    /* (non-Javadoc)
  +     * @see org.apache.jetspeed.modules.actions.portlets.browser.BrowserQuery#filter(java.util.List)
  +     */
  +    public boolean filter(List row)
  +    {
  +        return false;
  +    }
  +
       /**
        * Execute the sql statement as specified by the user or the default, and store the
        * resultSet in a vector.
  @@ -404,6 +412,11 @@
               while(rs.next())
               {
                   List row = new ArrayList(columnNum);
  +                if (filter(row))
  +                {
  +                    continue;
  +                }
  +
                   for(int i = 1; i <= columnNum; i++)
                   {
                       if( columnDisplayed[i-1] )
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message