-<!-- $Id: zoom.xml,v 1.13 2001-11-22 09:45:31 adam Exp $ -->
+<!-- $Id: zoom.xml,v 1.14 2001-11-30 08:24:06 adam Exp $ -->
<chapter id="zoom"><title>Building clients with ZOOM</title>
<para>
<literal>USMARC</literal>, <literal>SUTRS</literal>, etc.
</entry><entry>none</entry></row>
<row><entry>
+ schema</entry><entry>Schema for retrieval, such as
+ <literal>Gils-schema</literal>, <literal>Geo-schema</literal>, etc.
+ </entry><entry>none</entry></row>
+ <row><entry>
smallSetUpperBound</entry><entry>If hits is less than or equal to this
value, then target will return all records using small element set name
</entry><entry>0</entry></row>
/*
- * $Id: zoom-c.c,v 1.13 2001-11-28 23:00:19 adam Exp $
+ * $Id: zoom-c.c,v 1.14 2001-11-30 08:24:06 adam Exp $
*
* ZOOM layer for C, connections, result sets, queries.
*/
cp = ZOOM_options_get (r->options, "setname");
if (cp)
r->setname = xstrdup (cp);
-
+
r->connection = c;
r->next = c->resultsets;
{
ZOOM_task task;
ZOOM_connection c;
+ const char *cp;
if (!r)
return;
const char *elementSetName;
const char *smallSetElementSetName;
const char *mediumSetElementSetName;
+ const char *schema;
assert (c->tasks);
assert (c->tasks->which == ZOOM_TASK_SEARCH);
ZOOM_options_get (r->options, "smallSetElementSetName");
mediumSetElementSetName =
ZOOM_options_get (r->options, "mediumSetElementSetName");
+ schema =
+ ZOOM_options_get (r->options, "schema");
if (!smallSetElementSetName)
smallSetElementSetName = elementSetName;
*search_req->mediumSetPresentNumber = mspn;
}
else if (r->start == 0 && r->count > 0
- && r->piggyback && !r->r_sort_spec)
+ && r->piggyback && !r->r_sort_spec && !schema)
{
/* Regular piggyback - do it unless we're going to do sort */
*search_req->largeSetLowerBound = 2000000000;
ZOOM_options_get (c->options, "preferredRecordSyntax");
const char *element =
ZOOM_options_get (c->options, "elementSetName");
+ const char *schema =
+ ZOOM_options_get (c->options, "schema");
ZOOM_resultset resultset;
if (!c->tasks)
req->preferredRecordSyntax =
yaz_str_to_z3950oid (c->odr_out, CLASS_RECSYN, syntax);
- if (element && *element)
+ if (schema && *schema)
+ {
+ Z_RecordComposition *compo = odr_malloc (c->odr_out, sizeof(*compo));
+
+ req->recordComposition = compo;
+ compo->which = Z_RecordComp_complex;
+ compo->u.complex = (Z_CompSpec *)
+ odr_malloc(c->odr_out, sizeof(*compo->u.complex));
+ compo->u.complex->selectAlternativeSyntax = (bool_t *)
+ odr_malloc(c->odr_out, sizeof(bool_t));
+ *compo->u.complex->selectAlternativeSyntax = 0;
+
+ compo->u.complex->generic = (Z_Specification *)
+ odr_malloc(c->odr_out, sizeof(*compo->u.complex->generic));
+
+ compo->u.complex->generic->schema = (Odr_oid *)
+ yaz_str_to_z3950oid (c->odr_out, CLASS_SCHEMA, schema);
+
+ if (!compo->u.complex->generic->schema)
+ {
+ /* OID wasn't a schema! Try record syntax instead. */
+
+ compo->u.complex->generic->schema = (Odr_oid *)
+ yaz_str_to_z3950oid (c->odr_out, CLASS_RECSYN, schema);
+ }
+ if (element && *element)
+ {
+ compo->u.complex->generic->elementSpec = (Z_ElementSpec *)
+ odr_malloc(c->odr_out, sizeof(Z_ElementSpec));
+ compo->u.complex->generic->elementSpec->which =
+ Z_ElementSpec_elementSetName;
+ compo->u.complex->generic->elementSpec->u.elementSetName =
+ odr_strdup (c->odr_out, element);
+ }
+ else
+ compo->u.complex->generic->elementSpec = 0;
+ compo->u.complex->num_dbSpecific = 0;
+ compo->u.complex->dbSpecific = 0;
+ compo->u.complex->num_recordSyntax = 0;
+ compo->u.complex->recordSyntax = 0;
+ }
+ else if (element && *element)
{
Z_ElementSetNames *esn = odr_malloc (c->odr_out, sizeof(*esn));
Z_RecordComposition *compo = odr_malloc (c->odr_out, sizeof(*compo));
/*
- * $Id: zoomtst4.c,v 1.6 2001-11-22 09:45:31 adam Exp $
+ * $Id: zoomtst4.c,v 1.7 2001-11-30 08:24:06 adam Exp $
*
* Asynchronous multi-target going through proxy doing search and retrieve
* using present.
/* get 20 (at most) records from offset 5 */
ZOOM_options_set (o, "start", "5");
ZOOM_options_set (o, "count", "20");
+ ZOOM_options_set (o, "schema", "gils-schema");
+ ZOOM_options_set (o, "elementSetName", "F");
/* set proxy */
ZOOM_options_set (o, "proxy", argv[1]);