OID 1.2.840.10003.9.1000.105.4.
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: client.c,v 1.283 2005-06-06 07:25:47 adam Exp $
+ * $Id: client.c,v 1.284 2005-06-06 10:29:33 adam Exp $
*/
#include <stdio.h>
}
}
}
+ if (res->taskPackage && res->taskPackage->which == Z_External_octet)
+ {
+ Odr_oct *doc = res->taskPackage->u.octet_aligned;
+ printf("%.*s\n", doc->len, doc->buf);
+ }
}
const char *get_ill_element (void *clientData, const char *element)
return 2;
}
+static int cmd_xmlupdate(const char *arg)
+{
+ Z_APDU *apdu = zget_APDU(out, Z_APDU_extendedServicesRequest);
+ Z_ExtendedServicesRequest *req = apdu->u.extendedServicesRequest;
+
+ req->packageType = yaz_oidval_to_z3950oid(out, CLASS_EXTSERV,
+ VAL_XMLUPDATE);
+ Z_External *ext = (Z_External *) odr_malloc(out, sizeof(*ext));
+ req->taskSpecificParameters = ext;
+ ext->direct_reference = req->packageType;
+ ext->descriptor = 0;
+ ext->indirect_reference = 0;
+
+ ext->which = Z_External_octet;
+ ext->u.single_ASN1_type = (Odr_oct *) odr_malloc (out, sizeof(Odr_oct));
+
+ ext->u.single_ASN1_type->buf = (unsigned char*) odr_strdup(out, arg);
+ ext->u.single_ASN1_type->size = ext->u.single_ASN1_type->len = strlen(arg);
+ send_apdu(apdu);
+
+ return 2;
+}
+
static int cmd_itemorder(const char *arg)
{
char type[12];
{"itemorder", cmd_itemorder, "ill|item <itemno>",NULL,0,NULL},
{"update", cmd_update, "<action> <recid> [<file>]",NULL,0,NULL},
{"update0", cmd_update0, "<action> <recid> [<file>]",NULL,0,NULL},
+ {"xmlupdate", cmd_xmlupdate, "<action> <doc>",NULL,0,NULL},
{"packagename", cmd_packagename, "<packagename>",NULL,0,NULL},
{"proxy", cmd_proxy, "[('tcp'|'ssl')]<host>[':'<port>]",NULL,0,NULL},
{"charset", cmd_charset, "<nego_charset> <output_charset>",NULL,0,NULL},
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*
- * $Id: oid.h,v 1.24 2005-01-15 19:47:09 adam Exp $
+ * $Id: oid.h,v 1.25 2005-06-06 10:29:33 adam Exp $
*/
/**
VAL_MARC21FIN,
VAL_CHARNEG4,
+ VAL_XMLUPDATE,
/* VAL_DYNAMIC must have highest value */
VAL_DYNAMIC,
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: oid.c,v 1.8 2005-05-26 21:46:41 adam Exp $
+ * $Id: oid.c,v 1.9 2005-06-06 10:29:33 adam Exp $
*/
/**
"ID-Charset" },
{PROTO_Z3950, CLASS_USERINFO,VAL_CQL, {16, 2, -1},
"CQL"},
- {PROTO_GENERAL, CLASS_GENERAL, VAL_UCS2, {1,0,10646,1,0,2,-1},
+ {PROTO_GENERAL, CLASS_GENERAL, VAL_UCS2, {1,0,10646,1,0,2,-1},
"UCS-2"},
- {PROTO_GENERAL, CLASS_GENERAL, VAL_UCS4, {1,0,10646,1,0,4,-1},
+ {PROTO_GENERAL, CLASS_GENERAL, VAL_UCS4, {1,0,10646,1,0,4,-1},
"UCS-4"},
- {PROTO_GENERAL, CLASS_GENERAL, VAL_UTF16, {1,0,10646,1,0,5,-1},
+ {PROTO_GENERAL, CLASS_GENERAL, VAL_UTF16, {1,0,10646,1,0,5,-1},
"UTF-16"},
- {PROTO_GENERAL, CLASS_GENERAL, VAL_UTF8, {1,0,10646,1,0,8,-1},
+ {PROTO_GENERAL, CLASS_GENERAL, VAL_UTF8, {1,0,10646,1,0,8,-1},
"UTF-8"},
- {PROTO_Z3950, CLASS_USERINFO,VAL_OCLCUI, {10, 1000, 17, 1, -1},
+ {PROTO_Z3950, CLASS_USERINFO,VAL_OCLCUI, {10, 1000, 17, 1, -1},
"OCLC-userInfo"},
- {PROTO_NOP, CLASS_NOP, VAL_NOP, {-1}, 0 }
+ {PROTO_Z3950, CLASS_EXTSERV, VAL_XMLUPDATE, {9,1000,105,4,-1},
+ "XMLUpdate-ES"},
+ {PROTO_NOP, CLASS_NOP, VAL_NOP, {-1}, 0 }
};
/* OID utilities */
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: zoom-c.c,v 1.41 2005-05-17 11:48:36 adam Exp $
+ * $Id: zoom-c.c,v 1.42 2005-06-06 10:29:33 adam Exp $
*/
/**
* \file zoom-c.c
ZOOM_options_get(c->options, "implementationName"),
odr_prepend(c->odr_out, "ZOOM-C", ireq->implementationName));
- version = odr_strdup(c->odr_out, "$Revision: 1.41 $");
+ version = odr_strdup(c->odr_out, "$Revision: 1.42 $");
if (strlen(version) > 10) /* check for unexpanded CVS strings */
version[strlen(version)-2] = '\0';
ireq->implementationVersion = odr_prepend(c->odr_out,
return apdu;
}
+static Z_APDU *create_xmlupdate_package(ZOOM_package p)
+{
+ Z_APDU *apdu = create_es_package(p, VAL_XMLUPDATE);
+ Z_ExtendedServicesRequest *req = apdu->u.extendedServicesRequest;
+ Z_External *ext = (Z_External *) odr_malloc(p->odr_out, sizeof(*ext));
+ const char *doc = ZOOM_options_get(p->options, "doc");
+
+ req->taskSpecificParameters = ext;
+ ext->direct_reference = req->packageType;
+ ext->descriptor = 0;
+ ext->indirect_reference = 0;
+
+ ext->which = Z_External_octet;
+ ext->u.single_ASN1_type = (Odr_oct *)
+ odr_malloc (p->odr_out, sizeof(Odr_oct));
+
+ if (!doc)
+ doc = "";
+ ext->u.single_ASN1_type->buf = (unsigned char*)
+ odr_strdup(p->odr_out, doc);
+ ext->u.single_ASN1_type->size = ext->u.single_ASN1_type->len = strlen(doc);
+ return apdu;
+}
+
static Z_APDU *create_update_package(ZOOM_package p)
{
Z_APDU *apdu = 0;
{
apdu = create_update_package(p);
}
+ else if (!strcmp(type, "xmlupdate"))
+ {
+ apdu = create_xmlupdate_package(p);
+ }
if (apdu)
{
if (encode_APDU(p->connection, apdu, p->odr_out) == 0)
ZOOM_options_setl (c->tasks->u.package->options,
"targetReference", (char*) id->buf, id->len);
}
+ if (res->taskPackage &&
+ res->taskPackage->which == Z_External_octet)
+ {
+ Odr_oct *doc = res->taskPackage->u.octet_aligned;
+ ZOOM_options_setl (c->tasks->u.package->options,
+ "xmlUpdateDoc", (char*) doc->buf, doc->len);
+ }
return 1;
}
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: zoomsh.c,v 1.32 2005-01-15 19:47:15 adam Exp $
+ * $Id: zoomsh.c,v 1.33 2005-06-06 10:29:35 adam Exp $
*/
/* ZOOM-C Shell */
dset, error, addinfo);
else if (p[i])
{
+ const char *v;
printf ("ok\n");
+ v = ZOOM_package_option_get (p[i], "targetReference");
+ if (v)
+ printf("targetReference: %s\n", v);
+ v = ZOOM_package_option_get (p[i], "xmlUpdateDoc");
+ if (v)
+ printf("xmlUpdateDoc: %s\n", v);
}
ZOOM_package_destroy (p[i]);
}