Project

General

Profile

« Previous | Next » 

Revision 453

Added by berkley over 23 years ago

Added functionality for package specifications. metacatservlet now contains a new action called getrelateddocument that handles retrieving related documents using the metacatURL specification (metacatURL.java). DBQuery contains new code in runQuery that embeds relation tags in the returned hashtable describing the documents related to each docid. querySpecification contains a new method which prints the sql that does the relation query.

View differences:

QuerySpecification.java
296 296
   * This method prints sql based upon the <returnfield> tag in the
297 297
   * pathquery document.  This allows for customization of the 
298 298
   * returned fields
299
   * The parameters of the query are changed to upper case before the query
300
   * so that givenName is queryied the same as givenname.
301 299
   */
302 300
  public String printExtendedSQL()
303 301
  {  
......
331 329
    //System.out.println(self.toString());
332 330
    return self.toString();
333 331
  }
334

  
332
   
335 333
  /**
334
   *
335
   */
336
  public static String printPackageSQL()
337
  {
338
    StringBuffer self = new StringBuffer();
339
    self.append("select z.nodedata, x.nodedata, y.nodedata from ");
340
    self.append("(select nodeid, parentnodeid from xml_index where path like ");
341
    self.append("'package/relation/subject') s, (select nodeid, parentnodeid ");
342
    self.append("from xml_index where path like ");
343
    self.append("'package/relation/relationship') rel, ");
344
    self.append("(select nodeid, parentnodeid from xml_index where path like ");
345
    self.append("'package/relation/object') o, ");
346
    self.append("xml_nodes x, xml_nodes y, xml_nodes z ");
347
    self.append("where s.parentnodeid = rel.parentnodeid ");
348
    self.append("and rel.parentnodeid = o.parentnodeid ");
349
    self.append("and x.parentnodeid in rel.nodeid ");
350
    self.append("and y.parentnodeid in o.nodeid ");
351
    self.append("and z.parentnodeid in s.nodeid ");
352
    //self.append("and z.nodedata like '%");
353
    //self.append(docid);
354
    //self.append("%'");
355
    return self.toString();
356
  }
357
  
358
  /**
336 359
   * create a String description of the query that this instance represents.
337 360
   * This should become a way to get the XML serialization of the query.
338 361
   */
......
555 578

  
556 579
/**
557 580
 * '$Log$
581
 * 'Revision 1.14  2000/08/31 21:20:39  berkley
582
 * 'changed xslf for new returnfield scheme.  the returnfields are now returned as <param name="<returnfield>"> tags.
583
 * 'hThe sql for the returnfield query was redone to fix a previous problem with slow queries
584
 * '
558 585
 * 'Revision 1.13  2000/08/23 22:55:38  berkley
559 586
 * 'changed the field names to be case-sensitive in the returnfields
560 587
 * '

Also available in: Unified diff