Project

General

Profile

« Previous | Next » 

Revision 2072

Added by Matt Jones about 20 years ago

Moved decision about whether to use xml_index for
query to the metacat.properties as "usexmlindex". Default
is now false. Still have some refactoring to do to remove a
few more uses of the xml_index table.

View differences:

MetaCatServlet.java
93 93
 * dtdtext -- XML DTD text for a new DTD to load into Metacat XML Catalog<br>
94 94
 * query -- actual query text (to go with 'action=query' or 'action=squery')<br>
95 95
 * valtext -- XML text to be validated<br>
96
 * abstractpath -- XPath in metadata document to read from<br>
97 96
 * action=getaccesscontrol -- retrieve acl info for Metacat document<br>
98 97
 * action=getdoctypes -- retrieve all doctypes (publicID)<br>
99 98
 * action=getdtdschema -- retrieve a DTD or Schema file<br>
......
1134 1133
          withInlineData = false;
1135 1134
        }
1136 1135
      }
1137
      if (params.containsKey("abstractpath")) {
1138
        abstrpath = ((String[])params.get("abstractpath"))[0];
1139
        if ( !abstrpath.equals("") && (abstrpath != null) ) {
1140
          viewAbstract(response, abstrpath, docs[0]);
1141
          return;
1142
        }
1143
      }
1144 1136
      if ( (docs.length > 1) || qformat.equals("zip") ) {
1145 1137
        zip = true;
1146 1138
        out = response.getOutputStream();
......
1540 1532
    }
1541 1533

  
1542 1534
  }
1543

  
1544
  // view abstract within document
1545
  private void viewAbstract(HttpServletResponse response,
1546
                            String abstractpath, String docid)
1547
               throws ClassNotFoundException, IOException, SQLException,
1548
                      McdbException, Exception
1549
  {
1550

  
1551
    PrintWriter out =null;
1552
    try {
1553

  
1554
      response.setContentType("text/html");  //MIME type
1555
      out = response.getWriter();
1556
      Object[] abstracts = DBQuery.getNodeContent(abstractpath, docid);
1557
      out.println("<html><head><title>Abstract</title></head>");
1558
      out.println("<body bgcolor=\"white\"><h1>Abstract</h1>");
1559
      for (int i=0; i<abstracts.length; i++) {
1560
        out.println("<p>" + (String)abstracts[i] + "</p>");
1561
      }
1562
      out.println("</body></html>");
1563

  
1564
    } catch (Exception e) {
1565
       out.println("<?xml version=\"1.0\"?>");
1566
       out.println("<error>");
1567
       out.println(e.getMessage());
1568
       out.println("</error>");
1569

  
1570

  
1571
    }
1572
  }
1535
  
1573 1536
  /**
1574 1537
   * If metacat couldn't find a data file or document locally, it will read this
1575 1538
   * docid from its home server. This is for the replication feature

Also available in: Unified diff