Project

General

Profile

« Previous | Next » 

Revision 30

Added by Matt Jones over 24 years ago

general cleanup and documentation

View differences:

DBSAXHandler.java
73 73

  
74 74
      // Create the current element representation
75 75
      currentElement = new DBSAXElement(conn, localName, parent_id);
76
      System.out.println("Element created:" + currentElement.getTagName());
77 76

  
78 77
      // Add all of the attributes
79 78
      for (int i=0; i<atts.getLength(); i++)
......
95 94
         String value = atts.getValue(qName);
96 95

  
97 96
         currentElement.setAttribute(localName, value);
98

  
99
         System.out.println(" Added ATTRIBUTE Name:" + localName);
100
         System.out.println("                 Type:" + type);
101
         System.out.println("                Value:" + value);
102
         System.out.println();
103 97
      }      
104 98

  
105 99
      // Add the element to the stack, so that any text data can be 
......
112 106
   {
113 107
      DBSAXElement currentElement = (DBSAXElement)elementStack.peek();
114 108
      currentElement.appendContent(cbuf,start,len);
115
      System.out.println("   Characters: " + new String(cbuf,start,len));
116
      System.out.println("     Appended: " + currentElement.getContent());
117 109
   }
118 110

  
119 111
   public void ignorableWhitespace(char[] cbuf, int start, int len)
120 112
   {
121
      System.out.println("IgnorableWhiteSpace");
122 113
   }
123 114

  
124 115
   public void endElement(NSName name) throws SAXException 
......
133 124
      
134 125
      // Write the content of the element to the database
135 126
      currentElement.writeContentToDB();
136

  
137
      System.out.println("Final content: " + currentElement.getContent());
138
      System.out.println("Closing element: " + expName);
139 127
   }
140 128

  
141 129
   /** Debug routine */
src/edu/ucsb/nceas/metacat/DBSAXHandler.java
73 73

  
74 74
      // Create the current element representation
75 75
      currentElement = new DBSAXElement(conn, localName, parent_id);
76
      System.out.println("Element created:" + currentElement.getTagName());
77 76

  
78 77
      // Add all of the attributes
79 78
      for (int i=0; i<atts.getLength(); i++)
......
95 94
         String value = atts.getValue(qName);
96 95

  
97 96
         currentElement.setAttribute(localName, value);
98

  
99
         System.out.println(" Added ATTRIBUTE Name:" + localName);
100
         System.out.println("                 Type:" + type);
101
         System.out.println("                Value:" + value);
102
         System.out.println();
103 97
      }      
104 98

  
105 99
      // Add the element to the stack, so that any text data can be 
......
112 106
   {
113 107
      DBSAXElement currentElement = (DBSAXElement)elementStack.peek();
114 108
      currentElement.appendContent(cbuf,start,len);
115
      System.out.println("   Characters: " + new String(cbuf,start,len));
116
      System.out.println("     Appended: " + currentElement.getContent());
117 109
   }
118 110

  
119 111
   public void ignorableWhitespace(char[] cbuf, int start, int len)
120 112
   {
121
      System.out.println("IgnorableWhiteSpace");
122 113
   }
123 114

  
124 115
   public void endElement(NSName name) throws SAXException 
......
133 124
      
134 125
      // Write the content of the element to the database
135 126
      currentElement.writeContentToDB();
136

  
137
      System.out.println("Final content: " + currentElement.getContent());
138
      System.out.println("Closing element: " + expName);
139 127
   }
140 128

  
141 129
   /** Debug routine */
src/edu/ucsb/nceas/metacat/DBWriter.java
53 53
          }
54 54

  
55 55
          new DBSAXWriter(filename, user, password, dbstring);
56
          System.out.println("Document processing finished for: " + filename);
57

  
56 58
        } catch (Exception e) {
57 59
          System.err.println("EXCEPTION HANDLING REQUIRED");
58 60
          System.err.println(e.getMessage());
src/edu/ucsb/nceas/metacat/DBSAXWriter.java
53 53
          }
54 54

  
55 55
          new DBSAXWriter(filename, user, password, dbstring);
56
          System.out.println("Document processing finished for: " + filename);
57

  
56 58
        } catch (Exception e) {
57 59
          System.err.println("EXCEPTION HANDLING REQUIRED");
58 60
          System.err.println(e.getMessage());
Makefile
5 5

  
6 6
USER=jones
7 7

  
8
PW=you-pw-goes-here
8
PW=your-pw-goes-here
9 9

  
10 10
default: all
11 11

  
DBSAXWriter.java
53 53
          }
54 54

  
55 55
          new DBSAXWriter(filename, user, password, dbstring);
56
          System.out.println("Document processing finished for: " + filename);
57

  
56 58
        } catch (Exception e) {
57 59
          System.err.println("EXCEPTION HANDLING REQUIRED");
58 60
          System.err.println(e.getMessage());

Also available in: Unified diff