Project

General

Profile

Revision 100

Added by Matt Jones over 20 years ago

fixing transform bugs

View differences:

src/edu/ucsb/nceas/metacat/DBTransform.java
74 74
    } else {
75 75
      // No stylesheet registered form this document type, so just return the 
76 76
      // XML stream we were passed
77
      pw.print(sourcetype + "\n");
78
      pw.print(targettype + "\n");
79
      pw.print(xsl_system_id + "\n");
80
      pw.print(doc + "\n");
77
      pw.print(doc);
81 78
    }
82 79
  }
83 80

  
src/edu/ucsb/nceas/metacat/MetaCatServlet.java
110 110
        dbt = new DBTransform(conn);
111 111

  
112 112
      } catch (Exception e) {
113
        System.err.println("Error opening database connection");
113 114
      }
114 115
    } catch ( ServletException ex ) {
115 116
      throw ex;
......
139 140
    HttpServletResponse response) 
140 141
    throws ServletException, IOException {
141 142

  
143
    if (conn == null) {
144
      System.err.println("Connection to database lost.  Reopening...");
145
      try {
146
        // Open a connection to the database
147
        conn = MetaCatUtil.openDBConnection(
148
                "oracle.jdbc.driver.OracleDriver",
149
                defaultDB, user, password);
150
  
151
        queryobj = new DBSimpleQuery(conn);
152
        docreader = new DBReader(conn);
153
        dbt = new DBTransform(conn);
154
  
155
      } catch (Exception e) {
156
        System.err.println("Error opening database connection");
157
      }
158
    }
159

  
142 160
    // Get a handle to the output stream back to the client
143 161
    PrintWriter out = response.getWriter();
144 162
  
DBTransform.java
74 74
    } else {
75 75
      // No stylesheet registered form this document type, so just return the 
76 76
      // XML stream we were passed
77
      pw.print(sourcetype + "\n");
78
      pw.print(targettype + "\n");
79
      pw.print(xsl_system_id + "\n");
80
      pw.print(doc + "\n");
77
      pw.print(doc);
81 78
    }
82 79
  }
83 80

  
MetaCatServlet.java
110 110
        dbt = new DBTransform(conn);
111 111

  
112 112
      } catch (Exception e) {
113
        System.err.println("Error opening database connection");
113 114
      }
114 115
    } catch ( ServletException ex ) {
115 116
      throw ex;
......
139 140
    HttpServletResponse response) 
140 141
    throws ServletException, IOException {
141 142

  
143
    if (conn == null) {
144
      System.err.println("Connection to database lost.  Reopening...");
145
      try {
146
        // Open a connection to the database
147
        conn = MetaCatUtil.openDBConnection(
148
                "oracle.jdbc.driver.OracleDriver",
149
                defaultDB, user, password);
150
  
151
        queryobj = new DBSimpleQuery(conn);
152
        docreader = new DBReader(conn);
153
        dbt = new DBTransform(conn);
154
  
155
      } catch (Exception e) {
156
        System.err.println("Error opening database connection");
157
      }
158
    }
159

  
142 160
    // Get a handle to the output stream back to the client
143 161
    PrintWriter out = response.getWriter();
144 162
  

Also available in: Unified diff