Index: src/edu/ucsb/nceas/metacat/FilteredSubTree.java
===================================================================
--- src/edu/ucsb/nceas/metacat/FilteredSubTree.java	(revision 3753)
+++ src/edu/ucsb/nceas/metacat/FilteredSubTree.java	(nonexistent)
@@ -1,279 +0,0 @@
-/**
- *  '$RCSfile$'
- *    Purpose: A Class that represents an XML Text node and its contents,
- *             and can build itself from a database connection
- *  Copyright: 2000 Regents of the University of California and the
- *             National Center for Ecological Analysis and Synthesis
- *    Authors: Matt Jones
- *
- *   '$Author$'
- *     '$Date$'
- * '$Revision$'
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-package edu.ucsb.nceas.metacat;
-
-import java.util.Enumeration;
-import java.util.Collections;
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.Vector;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.sql.ResultSet;
-
-import org.apache.log4j.Logger;
-
-
-/**
- * A Class that represents an Filtered XML Subtree, it means a subtree which 
- * contains another subtree has different access behavor to it.
- * for example, we have subtree A, it is not readable to user John. But in 
- * subtree A, it contains a subtree B which is readable to user John 
- */
-public class FilteredSubTree
-{
-  private String docId = null;
-  private String subTreeId = null;
-  private String startElementName = null;
-  private long   startNodeId = -1;
-  private long   endNodeId =   -1;
-  private Vector sortedFilteredSubTree = new Vector();
-  private Logger logMetacat = Logger.getLogger(FilteredSubTree.class);
-    
-    /**
-     * Constructor of filteredsubtree
-     */
-    public FilteredSubTree(String myDocId, String mySubTreeId, 
-                  long myStartNodeId, long myEndNodeId)
-                  throws McdbException
-    {
-      this.docId = myDocId;
-      logMetacat.info("Docid of FilteredSubtree: " + docId);
-      this.subTreeId = mySubTreeId;
-      logMetacat.info("id of FilteredSubtree: " + subTreeId);
-      this.startNodeId = myStartNodeId;
-      logMetacat.info("start node id of FilteredSubtree: " + 
-                                startNodeId);
-      this.endNodeId = myEndNodeId;
-      logMetacat.info("end node id of FilteredSubtree: " + endNodeId);
-     }
-    
-  
- 
-    /** Set the a docId */
-    public void setDocId(String myId)
-    {
-      logMetacat.info("set doc id: "+myId);
-      this.docId = myId;
-    }
-
-    /** Get the docId */
-    public String getDocId() 
-    {
-      return this.docId;
-    }
-
- 
-    /** Set the a subtreeId */
-    public void setSubTreeId(String myId)
-    {
-      logMetacat.info("set sub tree id: "+myId);
-      this.subTreeId = myId;
-    }
-
-    /** Get the subTreeId */
-    public String getSubTreeId() 
-    {
-      return this.subTreeId;
-    }
-
-    /** 
-     * Set a startElementName
-     */
-    public void setStartElementName(String elementName) 
-    {
-      logMetacat.info("set start elementname: "+elementName);
-      this.startElementName = elementName;
-    }
-    
-    /**
-     * Get startElementName
-     */
-    public String getStartElementName()
-    {
-      return this.startElementName;
-    }
-    
-    /** Set a start node id */
-    public void setStartNodeId(long nodeId)
-    {
-      logMetacat.info("set start node id: "+nodeId);
-      this.startNodeId = nodeId;
-    }
-    
-    /** Get start node id */
-    public long getStartNodeId()
-    {
-      return this.startNodeId;
-    }
-    
-    /** Set a end node id */
-    public void setEndNodeId(long nodeId)
-    {
-      logMetacat.info("set end node id: "+nodeId);
-      this.endNodeId = nodeId;
-    }
-    
-    /** Get end node id */
-    public long getEndNodeId()
-    {
-      return this.endNodeId;
-    }
-    
-    /** Set a filtered subtree(subtree should be merger equivlent */
-    public void setFilteredSubTree(Hashtable  tree)
-    {
-       // order the subtree vector by start node id
-       // because the subtree is mergeEquivlent, so there is no nested subtree
-       Enumeration en = tree.elements();
-       while (en.hasMoreElements())
-       {
-         SubTree sTree = (SubTree) en.nextElement();
-         sortedFilteredSubTree.add(sTree);
-       }
-       Collections.sort(sortedFilteredSubTree, new SubTree());
-    }
-    
-    /** Get the filted subtree vector*/
-    public Vector getFilteredSubTree()
-    {
-      return sortedFilteredSubTree;
-    }
-    
-   /** Get unfiltered subtree node list*/
-    public Stack getUnfilteredSubTreeNodeList() throws McdbException
-    {
-       
-       PreparedStatement pstmt = null;
-       DBConnection dbconn = null;
-       int serialNumber = -1;
-       Stack nodeRecordList = new Stack();
-       long nodeid = 0;
-       long parentnodeid = 0;
-       long nodeindex = 0;
-       String nodetype = null;
-       String nodename = null;
-       String nodeprefix = null;
-       String nodedata = null;
-       String sql = "SELECT nodeid, parentnodeid, nodeindex, " +
-                    "nodetype, nodename, nodeprefix, nodedata " +               
-                    "FROM xml_nodes WHERE docid = ? AND ((nodeid >= ? AND ";
-       for ( int i =0; i< sortedFilteredSubTree.size(); i++)
-       {
-         sql = sql + "nodeid < ? ) OR (nodeid > ? AND "; 
-       }
-       sql = sql + "nodeid <= ? )) ORDER BY nodeid DESC";
-       logMetacat.info("sql command for selecting filtere subtree is: "
-                                 +sql);
-       
-       try 
-       {
-         dbconn=DBConnectionPool.
-                    getDBConnection("SubTree.getSubTreeNodeList");
-         serialNumber=dbconn.getCheckOutSerialNumber();
-         pstmt = dbconn.prepareStatement(sql);
-
-         // Bind the values to the query
-         pstmt.setString(1, docId);
-         pstmt.setLong(2, startNodeId);
-         int i =0;
-         boolean inLoop = false;
-         for (i=0; i< sortedFilteredSubTree.size(); i++)
-         {
-           SubTree tree = (SubTree)sortedFilteredSubTree.elementAt(i);
-           long startId = tree.getStartNodeId();
-           long endId   = tree.getEndNodeId();
-           pstmt.setLong((2*i+3), startId);
-           pstmt.setLong((2*i+4), endId);
-           inLoop = true;
-         }
-         if (inLoop)
-         {
-           pstmt.setLong((2*i+5), endNodeId);
-         }
-         else
-         {
-           pstmt.setLong(3, endNodeId);
-         }
-
-         pstmt.execute();
-         ResultSet rs = pstmt.getResultSet();
-         boolean tableHasRows = rs.next();
-        
-         while (tableHasRows) 
-         {
-           nodeid = rs.getLong(1);
-           parentnodeid = rs.getLong(2);
-           nodeindex = rs.getLong(3);
-           nodetype = rs.getString(4);
-           nodename = rs.getString(5);
-           nodeprefix = rs.getString(6);
-           nodedata = rs.getString(7);
-           nodedata = MetaCatUtil.normalize(nodedata);
-           // add the data to the node record list hashtable
-           NodeRecord currentRecord = new NodeRecord(nodeid,parentnodeid,nodeindex,
-                                      nodetype, nodename, nodeprefix, nodedata);
-           nodeRecordList.push(currentRecord);
-
-           // Advance to the next node
-           tableHasRows = rs.next();
-         }//while
-         pstmt.close();
-
-      } //try
-      catch (SQLException e) 
-      {
-        throw new McdbException("Error in FilteredSubTree.getSubTreeNodeList 1 " +
-                              e.getMessage());
-      }//catch
-      finally
-      {
-        try
-        {
-          pstmt.close();
-        }
-        catch (SQLException ee)
-        {
-          logMetacat.error("error in FilteredSubTree.getSubTreeNodeList 2: "
-                                    +ee.getMessage());
-        }
-        finally
-        {
-          DBConnectionPool.returnDBConnection(dbconn, serialNumber);
-        }
-      }//finally
-  
-      return nodeRecordList;
-   
-    }//getSubtreeNodeList
-    
-    public static void main (String agus)
-    {
-      
-    }
-}

Property changes on: src/edu/ucsb/nceas/metacat/FilteredSubTree.java
___________________________________________________________________
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Author Date Id Revision
\ No newline at end of property
