예제 #1
0
파일: LSPDoc.java 프로젝트: nlalak/SDARTS
 public void toXML(XMLWriter writer) throws IOException {
   writer.indent();
   term.toXML(writer);
   writer.printEntireElement("term-freq", termFreq);
   writer.printEntireElement("term-weight", termWeight);
   writer.printEntireElement("doc-freq", docFreq);
   writer.unindent();
 }
예제 #2
0
파일: LSPDoc.java 프로젝트: nlalak/SDARTS
 public void toXML(XMLWriter writer) throws IOException {
   writer.indent();
   writer.printStartElement("doc-term");
   writer.indent();
   field.toXML(writer);
   writer.unindent();
   writer.indent();
   writer.printEntireElement("value", fieldValue);
   writer.unindent();
   writer.printEndElement("doc-term");
   writer.unindent();
 }
예제 #3
0
파일: LSPField.java 프로젝트: nlalak/SDARTS
 public void toXML(XMLWriter writer) throws IOException {
   writer.setDefaultFormat();
   writer.enterNamespace(STARTS.NAMESPACE_NAME);
   writer.printStartElement("field", true);
   writer.printAttribute("type-set", typeSet);
   writer.printAttribute("name", name);
   writer.printEmptyElementClose();
   writer.exitNamespace();
 }
예제 #4
0
  /**
   * Instantiates a <code>SDARTSBean</code> and immediately connects it to the SDARTS LSP it is
   * meant to communicate with
   *
   * @param lspURL the URL of the SDARTS LSP this bean is communicating with
   * @param startsDTDURL the URL for the STARTS DTD, which is mentioned as an external parameter
   *     entity in all outputted XML
   * @param sdlipDTDURL the URL for the SDLIP DTD, which is mentioned as the primary &lt !DOCTYPE
   *     &gt for all outputted XML
   */
  public SDARTSBean(String lspURL, String startsDTDURL, String sdlipDTDURL) throws SDLIPException {
    ClientTransportModule.register(
        sdlip.SDLIP.NameServerURISchema, "sdlip.helpers.ClientCorbaTransport");
    tm = ClientTransportModule.create(lspURL);
    // tm.setDBG(new DBG (DBG.VERBOSE));
    this.startsDTDURL = startsDTDURL;
    this.sdlipDTDURL = sdlipDTDURL;

    // INITIALIZE XMLWRITER
    XMLWriter.addSystemDocType("STARTS", startsDTDURL);
    XMLWriter.addSystemDocType(STARTS.NAMESPACE_NAME + ":smeta-attributes", startsDTDURL);
    XMLWriter.addSystemDocType(STARTS.NAMESPACE_NAME + ":scontent-summary", startsDTDURL);
    XMLWriter.addSystemDocType("SearchResult", sdlipDTDURL);
    XMLWriter.addSystemDocType("subcols", sdlipDTDURL);
    XMLWriter.addSystemDocType("subcolInfo", sdlipDTDURL);
    XMLWriter.addSystemDocType("SDLIPInterface", sdlipDTDURL);
    XMLWriter.addSystemDocType("redirect", sdlipDTDURL);
    XMLWriter.addSystemDocType("propList", sdlipDTDURL);
  }
예제 #5
0
파일: LSPDoc.java 프로젝트: nlalak/SDARTS
 public void toXML(XMLWriter writer) throws IOException {
   writer.setDefaultFormat();
   writer.enterNamespace(STARTS.NAMESPACE_NAME);
   writer.printStartElement("sqrdocument", true);
   writer.printAttribute("version", version);
   writer.printStartElementClose();
   writer.indent();
   writer.printEntireElement("rawscore", rawScore);
   for (Iterator it = sources.iterator(); it.hasNext(); ) {
     LSPSource source = (LSPSource) it.next();
     source.toXML(writer);
   }
   for (Iterator it = fieldValues.iterator(); it.hasNext(); ) {
     FieldValue fv = (FieldValue) it.next();
     fv.toXML(writer);
   }
   writer.printStartElement("term-stats-list");
   for (Iterator it = termStats.iterator(); it.hasNext(); ) {
     TermStat ts = (TermStat) it.next();
     ts.toXML(writer);
   }
   writer.printEndElement("term-stats-list");
   writer.printEntireElement("docsize", docSize);
   writer.printEntireElement("doccount", docCount);
   writer.unindent();
   writer.printEndElement("sqrdocument");
   writer.exitNamespace();
 }