Diff for /FM2SQL/Attic/Convert.java between versions 1.34 and 1.35

version 1.34, 2004/02/16 12:24:17 version 1.35, 2004/02/17 09:30:15
Line 432  class Convert Line 432  class Convert
     String query = null;      String query = null;
     try      try
     {      {
       //bean.setConnection("jdbc:fmpro:http://141.14.237.74:8050");      
       //bean.setConnection("jdbc:postgresql://erebos/test","postgres","rogo");  
       if(source!=null)        if(source!=null)
       bean.setConnection(source);        bean.setConnection(source);
       else        else
Line 476  class Convert Line 474  class Convert
           //result = bean.getQueryData(query, dialog, 0);            //result = bean.getQueryData(query, dialog, 0);
           bean.getConnection();            bean.getConnection();
           bean.makeQuery(query, 50);            bean.makeQuery(query, 50);
           // @TODO id Vector must be used in querys while loop over id ranges where id>=start and id<=end  
           idField = ids.get(tbIndex).toString();            idField = ids.get(tbIndex).toString();
   
         } catch (Exception e)          } catch (Exception e)
Line 484  class Convert Line 481  class Convert
           System.out.println(e);            System.out.println(e);
           continue;            continue;
         }          }
         //beanDest.setConnection("jdbc:postgresql://erebos/test3");  
         if(destination!=null)          if(destination!=null)
         beanDest.setConnection(destination);          beanDest.setConnection(destination);
         else          else
Line 1117  class Convert Line 1113  class Convert
       //   FM2SQL.fmInstance=new FM2SQL();        //   FM2SQL.fmInstance=new FM2SQL();
     } catch (Exception e)      } catch (Exception e)
     {      {
       // TODO Auto-generated catch block      
       e.printStackTrace();        e.printStackTrace();
     }      }
     /*  
     Node tempNode=root.find(rootNode,new int[] {1});  
     if(tempNode==null) return rtTag;  
     int count=1;  
     /*   
     for(int i=0;i<tempNode.contents.v.size();++i)  
     {  
       // System.out.println(((Node)tempNode.contents.v.elementAt(i)).attributes+" "+i);  
     }*/  
     /*  
        if(tempNode.contents.v.size()==0) return rtTag;  
        Node notNull=null;  
        Node rtNode=root.find(rootNode+"/rt",new int[] {1,1});  
        rtTag=(rtNode==null) ? "finished":rtNode.getCharacters();  
        System.out.println("rt tag is "+ rtTag);  
        int length=0;//(tempNode.contents.length()-1)/2;  
        for(int i=0;i<tempNode.contents.v.size();++i)    {  
          Node node=(Node)tempNode.contents.v.elementAt(i);  
          if(node.type.equals("element"))  
          if(node.name.equals("doc"))length++;  
          // System.out.println(((Node)tempNode.contents.v.elementAt(i)).attributes+" "+i);  
        }  
       if(length==0) rtTag="finished";          
        while(count<=length)  
        {  
           //System.out.println(count+" "+length);  
          tempNode=root.find(rootNode+"/doc",new int[] {1,count});  
          if(tempNode==null)  
          {  
            rtTag="finished";  
            break;  
          }      
          Bundle.Document doc = new Bundle.Document();  
          Hashtable attributes=tempNode.attributes;  
          int docID=0;  
          int ver=0;  
           if(attributes != null)  
          {  
            docID=Integer.parseInt((String)attributes.get("id"));  
            ver=Integer.parseInt((String)attributes.get("ver"));  
            doc.addData("docID",(String)attributes.get("id"));  
            doc.addData("ver",(String)attributes.get("ver"));  
          }  
          bundle.docs.put(new Integer(docID),doc);  
          bundle.documents.addElement(doc);  
          // System.out.println("id " +docID+" ver "+ver);  
          Node fileNode=root.find(rootNode+"/doc/file",new int[] {1,count,1});  
          attributes=(fileNode==null)? null:fileNode.attributes;  
          int fileID=0;  
          int fileVer=0;  
          if(attributes != null)  
          {  
            fileID=Integer.parseInt((String)attributes.get("id"));  
            fileVer=Integer.parseInt((String)attributes.get("ver"));  
            doc.addData("fileID",(String)attributes.get("id"));  
            doc.addData("fileVer",(String)attributes.get("ver"));  
            // System.out.println("fileid " +fileID+" ver "+fileVer);  
          }  
       // add all Document tags to actual Document  
          for(int i=0;i<tempNode.contents.v.size();++i)  
          {     
            Node node=(Node)tempNode.contents.v.elementAt(i);  
            if(node.type.equals("element"))  
             {  
               //System.out.println(node.name+" "+node.getCharacters()+" "+node.contents.v.size());  
               if(node.contents.v.size()>1)   
               {  
                 for(int j=0;j<node.contents.v.size();++j)  
                 {    
                   Node node2=(Node)node.contents.v.elementAt(j);  
                   if(node2.type.equals("element"))  
                    {  
                      doc.addData(node2.name,node2.getCharacters());  
                      //System.out.println(node2.name+" "+node2.getCharacters()+" "+node2.contents.v.size());  
                    }  
                 }  
               } else doc.addData(node.name,node.getCharacters());  
            }  
          }  
          bundle.docsLocator.put(doc.locator,doc);   
       
        bundle.documents.addElement(doc);  
          count++;  
        }      */  
   
     // System.out.println(bundle.docs.size());  
     // return rtTag;  
   }    }
   public static Vector getXMLConfig(String xmlFile)    public static Vector getXMLConfig(String xmlFile)
   {    {

Removed from v.1.34  
changed lines
  Added in v.1.35


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>