Revision 3510 trunk/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/z3950/drivers/Z3950CatalogServiceDriver.java

View differences:

Z3950CatalogServiceDriver.java
45 45
import es.gva.cit.catalogClient.metadataXML.XMLTree;
46 46
import es.gva.cit.catalogClient.protocols.Z3950Protocol;
47 47
import es.gva.cit.catalogClient.querys.Query;
48
import es.gva.cit.catalogClient.z3950.filters.Z3950Filter;
49 48

  
50 49

  
51 50
import java.io.ByteArrayInputStream;
......
64 63
     */
65 64
    public XMLNode[] getCapabilities(URL url) {
66 65
        XMLNode[] nodos = new XMLNode[1];
66
        Z3950Messages messages = new Z3950Messages(this);
67 67

  
68
        String message = getMessageCapabilities(new Z3950Protocol().openConnection(
68
        String message = messages.getCapabilities(new Z3950Protocol().openConnection(
69 69
                    url));
70 70
        ByteArrayInputStream buffer = new ByteArrayInputStream(message.getBytes());
71 71

  
......
79 79
     */
80 80
    public XMLNode[] getRecords(URL url, Query query, int firstRecord) {
81 81
        setQuery(query);
82
        Z3950Messages messages = new Z3950Messages(this);
83
        
84
        String message = messages.getRecords(getQuery());
82 85

  
83
        String message = getMessageRecords(getQuery());
84

  
85 86
        System.out.println(message);
86 87

  
87 88
        XMLNode[] nodos = new Z3950Protocol().doQuery(url, message, firstRecord);
88 89

  
89 90
        return nodos;
90
    }
91
 
92
    /**
93
     * It creates the String for the getCapabilities request 
94
     * @return
95
     * String with the query
96
     */
97
    public String getMessageCapabilities(String message) {
98
        return "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" + "<Z3950> " +
99
        "<Servidor>" + message + "</Servidor>" + "</Z3950>";
100
    }
101
    
102
    
103
    /**
104
     * It creates the String for the getRecords request 
105
     * @return
106
     * String with the query
107
     */
108
    public String getMessageRecords(Query query) {
109
        Z3950Filter qz3950 = new Z3950Filter(query);
91
    }  
92
  
110 93

  
111
        return qz3950.getQuery(null);
112
    }
113

  
114 94
    /* (non-Javadoc)
115 95
     * @see catalogClient.ICatalogServerDriver#setParameters(java.util.Properties)
116 96
     */

Also available in: Unified diff