From: Mike Taylor Date: Fri, 18 Jul 2003 19:53:28 +0000 (+0000) Subject: Support for the UserInformation DPU OCLC-UserInformation: X-Git-Tag: YAZ.2.0.4~22 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=d3f87757eae53fd87d2e3e48a392a9e06872f71b;p=yaz-moved-to-github.git Support for the UserInformation DPU OCLC-UserInformation: - Add VAL_OCLCUI to oid.h - #include in include/yaz/proto.h - #define Z_External_OCLCUserInfo in include/yaz/prt-ext.h - Add Z_OCLC_UserInformation *oclc branch to Z_External.u - Add "OCLC-userInfo" entry to OID database in util/oid.c - New file "oclcui.asn" in z39.50 directory - Mention "oclcui.asn" and "z-oclcui.c" in z39.50/Makefile.am - Add VAL_OCLCUI registration in z39.50/prt-ext.c - Add arm to union-database in Z_External() in z39.50/prt-ext.c - Include UserInfoFormat-oclcUserInformation in z39.50/z.tcl (This is a handy checklist next time I need to add something.) More verbose authentication-setting in command-line client. Temporary debugging code in client (for OCLC diagnostics). --- diff --git a/z39.50/Makefile.am b/z39.50/Makefile.am index a3eacfb..c98fc6b 100644 --- a/z39.50/Makefile.am +++ b/z39.50/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.13 2003-05-27 21:12:23 adam Exp $ +## $Id: Makefile.am,v 1.14 2003-07-18 19:53:28 mike Exp $ AM_CPPFLAGS=-I$(top_srcdir)/include @@ -6,7 +6,7 @@ noinst_LTLIBRARIES = libz39.50.la tabdatadir = $(pkgdatadir)/z39.50 tabdata_DATA=datetime.asn esupdate.asn univres.asn z3950v3.asn z.tcl \ - esadmin.asn charneg-3.asn mterm2.asn + esadmin.asn charneg-3.asn mterm2.asn oclcui.asn EXTRA_DIST=$(tabdata_DATA) YAZCOMP = $(top_srcdir)/util/yaz-asncomp @@ -14,7 +14,7 @@ YAZCOMPLINE = ../util/yaz-asncomp -d z.tcl -i yaz -I../include $(YCFLAGS) libz39_50_la_SOURCES = z-accdes1.c z-accform1.c z-acckrb1.c z-core.c \ z-diag1.c z-espec1.c z-estask.c z-exp.c z-grs.c z-mterm2.c z-opac.c \ - z-uifr1.c z-rrf1.c z-rrf2.c z-sum.c z-sutrs.c \ + z-uifr1.c z-rrf1.c z-rrf2.c z-sum.c z-sutrs.c z-oclcui.c\ zes-expi.c zes-exps.c zes-order.c zes-pquery.c zes-psched.c \ zes-pset.c zes-update0.c z-date.c z-univ.c zes-update.c zes-admin.c \ z-charneg.c \ @@ -78,3 +78,7 @@ $(srcdir)/z-charneg.c: $(srcdir)/z.tcl $(srcdir)/charneg-3.asn # UserInfoFormat-multipleSearchTerms-2 $(srcdir)/z-mterm2.c: $(srcdir)/z.tcl $(srcdir)/mterm2.asn cd $(srcdir); $(YAZCOMPLINE) mterm2.asn + +# UserInfoFormat-multipleSearchTerms-2 +$(srcdir)/z-oclcui.c: $(srcdir)/z.tcl $(srcdir)/oclcui.asn + cd $(srcdir); $(YAZCOMPLINE) oclcui.asn diff --git a/z39.50/oclcui.asn b/z39.50/oclcui.asn new file mode 100644 index 0000000..d60852d --- /dev/null +++ b/z39.50/oclcui.asn @@ -0,0 +1,31 @@ +UserInfoFormat-oclcUserInformation +{Z39-50-userInfoFormat OCLCUserInformation (7)} DEFINITIONS ::= +BEGIN + +-- $Id: oclcui.asn,v 1.1 2003-07-18 19:53:28 mike Exp $ +-- +-- This format is returned from the server at +-- fsz3950test.oclc.org:210 +-- I found the definition at +-- http://www.oclc.org/firstsearch/documentation/z3950/config_guide.htm +-- +-- I have added OPTIONAL modifiers to the `dblist', `diagnosticSetId' +-- and `code' elements because they appear to be admitted from the +-- APDU returned as an Init diagnostic from fsz3950test.oclc.org:210 +-- but this still doesn't work yet: I get "Decoding incoming APDU: +-- Length of constructed type different from sum of members (code +-- 10:36)" + +OCLC-UserInformation ::= SEQUENCE { + motd [1] IMPLICIT VisibleString, + dblist SEQUENCE OF DBName OPTIONAL, + failReason [3] IMPLICIT SEQUENCE { + diagnosticSetId OBJECT IDENTIFIER OPTIONAL, + code [1] IMPLICIT INTEGER OPTIONAL, + text [2] IMPLICIT VisibleString OPTIONAL } OPTIONAL +} + +DBName ::= [2] IMPLICIT VisibleString + +END + diff --git a/z39.50/prt-ext.c b/z39.50/prt-ext.c index 32de772..4884e58 100644 --- a/z39.50/prt-ext.c +++ b/z39.50/prt-ext.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2003, Index Data. * See the file LICENSE for details. * - * $Id: prt-ext.c,v 1.6 2003-06-02 12:53:28 adam Exp $ + * $Id: prt-ext.c,v 1.7 2003-07-18 19:53:28 mike Exp $ */ #include @@ -41,6 +41,7 @@ static Z_ext_typeent type_table[] = {VAL_KRB1, Z_External_acfKrb1, (Odr_fun) z_KRBObject}, {VAL_MULTISRCH2, Z_External_multisrch2, (Odr_fun) z_MultipleSearchTerms_2}, {VAL_CQL, Z_External_CQL, (Odr_fun) z_InternationalString}, + {VAL_OCLCUI, Z_External_OCLCUserInfo, (Odr_fun) z_OCLC_UserInformation}, {VAL_NONE, 0, 0} }; @@ -122,6 +123,8 @@ int z_External(ODR o, Z_External **p, int opt, const char *name) (Odr_fun)z_MultipleSearchTerms_2, 0}, {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_CQL, (Odr_fun)z_InternationalString, 0}, + {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_External_OCLCUserInfo, + (Odr_fun)z_OCLC_UserInformation, 0}, {-1, -1, -1, -1, 0, 0} }; diff --git a/z39.50/z.tcl b/z39.50/z.tcl index c0855a6..7cd0dff 100644 --- a/z39.50/z.tcl +++ b/z39.50/z.tcl @@ -1,5 +1,5 @@ # YC Sample Config File for Z39.50 -# $Id: z.tcl,v 1.11 2003-05-20 19:55:30 adam Exp $ +# $Id: z.tcl,v 1.12 2003-07-18 19:53:28 mike Exp $ # ---------------------------------------------------------- # Prefix Specifications # @@ -328,6 +328,9 @@ set filename($m) z-mterm2 set m ResourceReport-Format-Universe-1 set filename($m) z-univ # ---- +set m UserInfoFormat-oclcUserInformation +set filename($m) z-oclcui +# ---- set m ESFormat-Admin set filename($m) zes-admin set map($m,EsRequest) ESAdminRequest