Project

General

Profile

« Previous | Next » 

Revision 316

Added by bojilova over 24 years ago

Changes related to "getdataguide" action

View differences:

src/edu/ucsb/nceas/metacat/MetaCatServlet.java
242 242
        out.println(se.getMessage());
243 243
      }
244 244
    } else if (action.equals("insert") || action.equals("update")) {
245
      if ( username == "anonymous" ) {
245
      if ( username.equals("anonymous") ) {
246 246
        out.println("You are not authorized to use that option.");
247 247
      } else {
248 248
        handleInsertOrUpdateAction(out, params, response);
249 249
      }
250 250
    } else if (action.equals("delete")) {
251
      if ( username == "anonymous" ) {
251
      if ( username.equals("anonymous") ) {
252 252
        out.println("You are not authorized to use that option");
253 253
      } else {
254 254
        handleDeleteAction(out, params, response);
255 255
      }
256 256
    } else if (action.equals("validate")) {
257
      if ( username == "anonymous" ) {
257
      if ( username.equals("anonymous") ) {
258 258
        out.println("You are not authorized to use that option");
259 259
      } else {
260 260
        handleValidateAction(out, params, response);  
......
294 294
      out.println(e.getMessage());
295 295
    }
296 296

  
297
    if ( un == "anonymous" ) {
297
    if ( un.equals("anonymous") ) {
298 298
        try {
299
            response.sendRedirect(
300
            response.encodeRedirectUrl("/xmltodb/lib/query.html"));
299
            if (action.equals("Login Client")) {
300
                out.println("<?xml version=\"1.0\"?>");
301
                out.println("<success>");
302
                out.println("User Authentication successful.");
303
                out.println("</success>");
304
            } else {
305
                response.sendRedirect(
306
                response.encodeRedirectUrl("/xmltodb/lib/query.html"));
307
            }    
301 308
        } catch (java.io.IOException ioe) {
302 309
            sess.disconnect();            
303 310
            out.println("<?xml version=\"1.0\"?>");
......
306 313
                        "Error on redirect of HttpServletResponse: " + 
307 314
                        ioe.getMessage());
308 315
            out.println("</error>");
309
        }    
316
        }  
317
        
318
        return;
310 319
    }
311 320
    
312 321
    try { 
......
775 784
                                        HttpServletResponse response) {
776 785

  
777 786
    Connection conn = null;
787
    String doctype = null;
788
    String[] doctypeArr = (String[])params.get("doctype");
778 789

  
790
    // get only the first doctype specified in the list of doctypes
791
    // it could be done for all doctypes in that list
792
    if (doctypeArr != null) {
793
        doctype = ((String[])params.get("doctype"))[0]; 
794
    }
795

  
779 796
    try {
780 797

  
781 798
        // get connection from the pool
782 799
        conn = util.getConnection();
783 800
        DBUtil dbutil = new DBUtil(conn);
784
        String dataguide = dbutil.readDataGuide("");
801
        String dataguide = dbutil.readDataGuide(doctype);
785 802
        out.println(dataguide);
786 803

  
787 804
    } catch (Exception e) {

Also available in: Unified diff