Project

General

Profile

« Previous | Next » 

Revision 489

Added by berkley over 24 years ago

added functionality to return the doctype of a relation in a relationdoctype tag. This information is now returned automatically in the resultset under the path resultset/relation/relationdoctype.

View differences:

src/edu/ucsb/nceas/metacat/QuerySpecification.java
335 335
  public static String printRelationSQL(String docid)
336 336
  {
337 337
    StringBuffer self = new StringBuffer();
338
    self.append("select subject, relationship, object from xml_relation ");
338
    self.append("select subject, relationship, object, subdoctype, ");
339
    self.append("objdoctype from xml_relation ");
339 340
    self.append("where subject like '").append(docid).append("'");
340 341
    return self.toString();
341 342
  }
......
655 656

  
656 657
/**
657 658
 * '$Log$
659
 * 'Revision 1.16  2000/09/26 22:06:52  berkley
660
 * 'Added backtrack functionality.  Backtracking works by passing a returndoc parameter.  There can be more than one.  If a document that is hit by a query is not of type returndoc then it searches the database for a related file of type returndoc.  If one is found it is displayed, if no relation is found, the original is displayed.
661
 * '
662
 * 'Support was also added for an index of relations.  the table xml_relation handles the all of the relation indexing.
663
 * '
658 664
 * 'Revision 1.15  2000/09/15 19:52:12  berkley
659 665
 * '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.
660 666
 * '
src/edu/ucsb/nceas/metacat/DBQuery.java
315 315
            String sub = rs.getString(1);
316 316
            String rel = rs.getString(2);
317 317
            String obj = rs.getString(3);
318
            String subDT = rs.getString(4);
319
            String objDT = rs.getString(5);
320
            
318 321
            metacatURL murl = new metacatURL(sub);
319 322
            if(murl.getURLType().equals("metacat"))
320 323
            {//we only want to process metacat urls here.
......
327 330
                document.append("</relationtype>");
328 331
                document.append("<relationdoc>").append(obj);
329 332
                document.append("</relationdoc>");
333
                document.append("<relationdoctype>").append(objDT);
334
                document.append("</relationdoctype>");
330 335
                document.append("</relation>");
331 336
                
332 337
                String removedelement = (String)docListResult.remove(docidkey);
......
717 722

  
718 723
/**
719 724
 * '$Log$
725
 * 'Revision 1.23  2000/09/27 21:37:05  berkley
726
 * 'removed system.out.printlns
727
 * '
720 728
 * 'Revision 1.22  2000/09/27 20:11:17  berkley
721 729
 * 'added support for urls of the form "metacat://server.xyz.com?docid=XXX:yy"
722 730
 * '

Also available in: Unified diff