#include <yaz/facet.h>
#include "sru-p.h"
-static void add_XML_n(xmlNodePtr ptr, const char *elem, char *val, int len,
- xmlNsPtr ns_ptr)
-{
- if (val)
- {
- xmlDocPtr doc = xmlParseMemory(val,len);
- if (doc)
- {
- xmlNodePtr c = xmlNewChild(ptr, ns_ptr, BAD_CAST elem, 0);
- xmlNodePtr t = xmlDocGetRootElement(doc);
- xmlAddChild(c, xmlCopyNode(t,1));
- xmlFreeDoc(doc);
- }
- }
-}
-
-xmlNodePtr add_xsd_string_n(xmlNodePtr ptr, const char *elem, const char *val,
- int len)
-{
- if (val)
- {
- xmlNodePtr c = xmlNewChild(ptr, 0, BAD_CAST elem, 0);
- xmlNodePtr t = xmlNewTextLen(BAD_CAST val, len);
- xmlAddChild(c, t);
- return t;
- }
- return 0;
-}
-
-xmlNodePtr add_xsd_string_ns(xmlNodePtr ptr, const char *elem, const char *val,
- xmlNsPtr ns_ptr)
-{
- if (val)
- {
- xmlNodePtr c = xmlNewChild(ptr, ns_ptr, BAD_CAST elem, 0);
- xmlNodePtr t = xmlNewText(BAD_CAST val);
- xmlAddChild(c, t);
- return t;
- }
- return 0;
-}
-
-xmlNodePtr add_xsd_string(xmlNodePtr ptr, const char *elem, const char *val)
-{
- return add_xsd_string_ns(ptr, elem, val, 0);
-}
-
-void add_xsd_integer(xmlNodePtr ptr, const char *elem,
- const Odr_int *val)
-{
- if (val)
- {
- char str[40];
- sprintf(str, ODR_INT_PRINTF, *val);
- xmlNewTextChild(ptr, 0, BAD_CAST elem, BAD_CAST str);
- }
-}
-
-int match_element(xmlNodePtr ptr, const char *elem)
-{
- if (ptr->type == XML_ELEMENT_NODE && !xmlStrcmp(ptr->name, BAD_CAST elem))
- {
- return 1;
- }
- return 0;
-}
-
-#define CHECK_TYPE 0
-
-int match_xsd_string_n(xmlNodePtr ptr, const char *elem, ODR o,
- char **val, int *len)
-{
-#if CHECK_TYPE
- struct _xmlAttr *attr;
-#endif
- if (!match_element(ptr, elem))
- return 0;
-#if CHECK_TYPE
- for (attr = ptr->properties; attr; attr = attr->next)
- if (!strcmp(attr->name, "type") &&
- attr->children && attr->children->type == XML_TEXT_NODE)
- {
- const char *t = strchr(attr->children->content, ':');
- if (t)
- t = t + 1;
- else
- t = attr->children->content;
- if (!strcmp(t, "string"))
- break;
- }
- if (!attr)
- return 0;
-#endif
- ptr = ptr->children;
- if (!ptr || ptr->type != XML_TEXT_NODE)
- {
- *val = "";
- return 1;
- }
- *val = odr_strdup(o, (const char *) ptr->content);
- if (len)
- *len = xmlStrlen(ptr->content);
- return 1;
-}
-
-
-int match_xsd_string(xmlNodePtr ptr, const char *elem, ODR o, char **val)
-{
- return match_xsd_string_n(ptr, elem, o, val, 0);
-}
-
-static int match_xsd_XML_n2(xmlNodePtr ptr, const char *elem, ODR o,
- char **val, int *len, int fixup_root)
-{
- xmlBufferPtr buf;
- int no_root_nodes = 0;
-
- if (!match_element(ptr, elem))
- return 0;
-
- buf = xmlBufferCreate();
-
- /* Copy each element nodes at top.
- In most cases there is only one root node.. At least one server
- http://www.theeuropeanlibrary.org/sru/sru.pl
- has multiple root nodes in recordData.
- */
- for (ptr = ptr->children; ptr; ptr = ptr->next)
- {
- if (ptr->type == XML_ELEMENT_NODE)
- {
- /* copy node to get NS right (bug #740). */
- xmlNode *tmp = xmlCopyNode(ptr, 1);
-
- xmlNodeDump(buf, tmp->doc, tmp, 0, 0);
-
- xmlFreeNode(tmp);
- no_root_nodes++;
- }
- }
- if (no_root_nodes != 1 && fixup_root)
- {
- /* does not appear to be an XML document. Make it so */
- xmlBufferAddHead(buf, (const xmlChar *) "<yaz_record>", -1);
- xmlBufferAdd(buf, (const xmlChar *) "</yaz_record>", -1);
- }
- *val = (char *) odr_malloc(o, buf->use + 1);
- memcpy(*val, buf->content, buf->use);
- (*val)[buf->use] = '\0';
-
- if (len)
- *len = buf->use;
-
- xmlBufferFree(buf);
-
- return 1;
-}
-
-static int match_xsd_XML_n(xmlNodePtr ptr, const char *elem, ODR o,
- char **val, int *len)
-{
- return match_xsd_XML_n2(ptr, elem, o, val, len, 0);
-}
-
-int match_xsd_integer(xmlNodePtr ptr, const char *elem, ODR o, Odr_int **val)
-{
-#if CHECK_TYPE
- struct _xmlAttr *attr;
-#endif
- if (!match_element(ptr, elem))
- return 0;
-#if CHECK_TYPE
- for (attr = ptr->properties; attr; attr = attr->next)
- if (!strcmp(attr->name, "type") &&
- attr->children && attr->children->type == XML_TEXT_NODE)
- {
- const char *t = strchr(attr->children->content, ':');
- if (t)
- t = t + 1;
- else
- t = attr->children->content;
- if (!strcmp(t, "integer"))
- break;
- }
- if (!attr)
- return 0;
-#endif
- ptr = ptr->children;
- if (!ptr || ptr->type != XML_TEXT_NODE)
- return 0;
- *val = odr_intdup(o, odr_atoi((const char *) ptr->content));
- return 1;
-}
-
char *yaz_negotiate_sru_version(char *input_ver)
{
if (!input_ver)
for (ptr = pptr->children; ptr; ptr = ptr->next)
{
- if (match_xsd_string(ptr, "recordSchema", o,
- &rec->recordSchema))
+ if (yaz_match_xsd_string(ptr, "recordSchema", o,
+ &rec->recordSchema))
;
- else if (match_xsd_string(ptr, "recordPacking", o, &spack))
+ else if (yaz_match_xsd_string(ptr, "recordPacking", o, &spack))
; /* can't rely on it: in SRU 2.0 it's different semantics */
- else if (match_xsd_integer(ptr, "recordPosition", o,
- &rec->recordPosition))
+ else if (yaz_match_xsd_integer(ptr, "recordPosition", o,
+ &rec->recordPosition))
;
- else if (match_element(ptr, "recordData"))
+ else if (yaz_match_xsd_element(ptr, "recordData"))
{
/* we assume XML packing, if any element nodes exist below
recordData. Unfortunately, in SRU 2.0 recordPacking
break;
if (p)
{
- match_xsd_XML_n2(
+ yaz_match_xsd_XML_n2(
ptr, "recordData", o,
&rec->recordData_buf, &rec->recordData_len, 1);
rec->recordPacking = Z_SRW_recordPacking_XML;
}
else
{
- match_xsd_string_n(
+ yaz_match_xsd_string_n(
ptr, "recordData", o,
&rec->recordData_buf, &rec->recordData_len);
rec->recordPacking = Z_SRW_recordPacking_string;
}
}
- else if (match_xsd_XML_n(ptr, "extraRecordData", o,
- &ex.extraRecordData_buf,
- &ex.extraRecordData_len) )
+ else if (yaz_match_xsd_XML_n(ptr, "extraRecordData", o,
+ &ex.extraRecordData_buf,
+ &ex.extraRecordData_len) )
;
else
- match_xsd_string(ptr, "recordIdentifier", o,
- &ex.recordIdentifier);
+ yaz_match_xsd_string(ptr, "recordIdentifier", o,
+ &ex.recordIdentifier);
}
if (ex.extraRecordData_buf || ex.recordIdentifier)
{
for (ptr = pptr->children; ptr; ptr = ptr->next)
{
- if (match_xsd_string(ptr, "versionType", o,
- &rec->versionType))
+ if (yaz_match_xsd_string(ptr, "versionType", o,
+ &rec->versionType))
;
else
- match_xsd_string(ptr, "versionValue", o, &rec->versionValue);
+ yaz_match_xsd_string(ptr, "versionValue", o,
+ &rec->versionValue);
}
}
else if (o->direction == ODR_ENCODE)
list = yaz_use_attribute_create(odr, name);
for (node = ptr->children; node; node = node->next) {
- if (match_element(node, "facetvalue"))
+ if (yaz_match_xsd_element(node, "facetvalue"))
num_terms++;
}
facet_field = facet_field_create(odr, list, num_terms);
index = 0;
for (node = ptr->children; node; node = node->next)
{
- if (match_element(node, "facetvalue"))
+ if (yaz_match_xsd_element(node, "facetvalue"))
{
facet_field_term_set(odr, facet_field,
yaz_sru_proxy_get_facet_term_count(odr, node),
for (ptr = root->children; ptr; ptr = ptr->next)
{
- if (match_element(ptr, "facets"))
+ if (yaz_match_xsd_element(ptr, "facets"))
{
xmlNodePtr node;
Z_FacetList *facet_list;
num_facets = 0;
for (node = ptr->children; node; node= node->next)
{
- if (match_element(node, "facet"))
+ if (yaz_match_xsd_element(node, "facet"))
{
facet_list_field_set(
o, facet_list,
(*recs)[i].message = 0;
for (rptr = ptr->children; rptr; rptr = rptr->next)
{
- if (match_xsd_string(rptr, "uri", o,
- &(*recs)[i].uri))
+ if (yaz_match_xsd_string(rptr, "uri", o, &(*recs)[i].uri))
;
- else if (match_xsd_string(rptr, "details", o,
- &(*recs)[i].details))
+ else if (yaz_match_xsd_string(rptr, "details", o,
+ &(*recs)[i].details))
;
else
- match_xsd_string(rptr, "message", o, &(*recs)[i].message);
+ yaz_match_xsd_string(rptr, "message", o,
+ &(*recs)[i].message);
}
i++;
}
term->whereInList = 0;
for (ptr = pptr->children; ptr; ptr = ptr->next)
{
- if (match_xsd_string(ptr, "value", o, &term->value))
+ if (yaz_match_xsd_string(ptr, "value", o, &term->value))
;
- else if (match_xsd_integer(ptr, "numberOfRecords", o,
- &term->numberOfRecords))
+ else if (yaz_match_xsd_integer(ptr, "numberOfRecords", o,
+ &term->numberOfRecords))
;
- else if (match_xsd_string(ptr, "displayTerm", o,
- &term->displayTerm))
+ else if (yaz_match_xsd_string(ptr, "displayTerm", o,
+ &term->displayTerm))
;
else
- match_xsd_string(ptr, "whereInList", o, &term->whereInList);
+ yaz_match_xsd_string(ptr, "whereInList", o, &term->whereInList);
}
}
else if (o->direction == ODR_ENCODE)
char *recordPacking = 0;
char *recordXMLEscaping = 0;
const char *facetLimit = 0;
+ const char *facetStart = 0;
+ const char *facetSort = 0;
(*p)->which = Z_SRW_searchRetrieve_request;
req = (*p)->u.request = (Z_SRW_searchRetrieveRequest *)
for (; ptr; ptr = ptr->next)
{
- if (match_xsd_string(ptr, "version", o,
+ if (yaz_match_xsd_string(ptr, "version", o,
&(*p)->srw_version))
;
- else if (match_xsd_string(ptr, "queryType", o,
+ else if (yaz_match_xsd_string(ptr, "queryType", o,
&req->queryType))
;
- else if (match_xsd_string(ptr, "query", o,
+ else if (yaz_match_xsd_string(ptr, "query", o,
&req->query))
;
- else if (match_xsd_string(ptr, "pQuery", o,
+ else if (yaz_match_xsd_string(ptr, "pQuery", o,
&req->query))
req->queryType = "pqf";
- else if (match_xsd_string(ptr, "xQuery", o,
+ else if (yaz_match_xsd_string(ptr, "xQuery", o,
&req->query))
req->queryType = "xcql";
- else if (match_xsd_integer(ptr, "startRecord", o,
+ else if (yaz_match_xsd_integer(ptr, "startRecord", o,
&req->startRecord))
;
- else if (match_xsd_integer(ptr, "maximumRecords", o,
+ else if (yaz_match_xsd_integer(ptr, "maximumRecords", o,
&req->maximumRecords))
;
- else if (match_xsd_string(ptr, "recordPacking", o,
+ else if (yaz_match_xsd_string(ptr, "recordPacking", o,
&recordPacking))
;
- else if (match_xsd_string(ptr, "recordXMLEscaping", o,
+ else if (yaz_match_xsd_string(ptr, "recordXMLEscaping", o,
&recordXMLEscaping))
;
- else if (match_xsd_string(ptr, "recordSchema", o,
+ else if (yaz_match_xsd_string(ptr, "recordSchema", o,
&req->recordSchema))
;
- else if (match_xsd_string(ptr, "recordXPath", o,
+ else if (yaz_match_xsd_string(ptr, "recordXPath", o,
&req->recordXPath))
;
- else if (match_xsd_integer(ptr, "resultSetTTL", o,
+ else if (yaz_match_xsd_integer(ptr, "resultSetTTL", o,
&req->resultSetTTL))
;
- else if (match_xsd_string(ptr, "sortKeys", o,
+ else if (yaz_match_xsd_string(ptr, "sortKeys", o,
&req->sort.sortKeys))
req->sort_type = Z_SRW_sort_type_sort;
- else if (match_xsd_string(ptr, "stylesheet", o,
+ else if (yaz_match_xsd_string(ptr, "stylesheet", o,
&req->stylesheet))
;
- else if (match_xsd_string(ptr, "database", o, &req->database))
+ else if (yaz_match_xsd_string(ptr, "database", o,
+ &req->database))
+ ;
+ else if (yaz_match_xsd_string(ptr, "facetLimit", o,
+ (char**) &facetLimit))
+ ;
+ else if (yaz_match_xsd_string(ptr, "facetStart", o,
+ (char**) &facetStart))
;
- else if (match_xsd_string(ptr, "facetLimit", o,
- (char**) &facetLimit))
+ else if (yaz_match_xsd_string(ptr, "facetSort", o,
+ (char**) &facetSort))
;
}
if (!req->query)
{
req->recordPacking = recordPacking;
}
- yaz_sru_facet_request(o, &req->facetList, &facetLimit);
+ yaz_sru_facet_request(o, &req->facetList, &facetLimit, &facetStart,
+ &facetSort);
}
else if (!xmlStrcmp(method->name, BAD_CAST "searchRetrieveResponse"))
{
for (; ptr; ptr = ptr->next)
{
- if (match_xsd_string(ptr, "version", o,
+ if (yaz_match_xsd_string(ptr, "version", o,
&(*p)->srw_version))
;
- else if (match_xsd_XML_n(ptr, "extraResponseData", o,
+ else if (yaz_match_xsd_XML_n(ptr, "extraResponseData", o,
&(*p)->extraResponseData_buf,
&(*p)->extraResponseData_len))
;
- else if (match_xsd_integer(ptr, "numberOfRecords", o,
+ else if (yaz_match_xsd_integer(ptr, "numberOfRecords", o,
&res->numberOfRecords))
;
- else if (match_xsd_string(ptr, "resultCountPrecision", o,
+ else if (yaz_match_xsd_string(ptr, "resultCountPrecision", o,
&res->resultCountPrecision))
;
- else if (match_xsd_string(ptr, "resultSetId", o,
+ else if (yaz_match_xsd_string(ptr, "resultSetId", o,
&res->resultSetId))
;
- else if (match_xsd_integer(ptr, "resultSetIdleTime", o,
+ else if (yaz_match_xsd_integer(ptr, "resultSetIdleTime", o,
&res->resultSetIdleTime))
;
- else if (match_xsd_integer(ptr, "resultSetTTL", o,
+ else if (yaz_match_xsd_integer(ptr, "resultSetTTL", o,
&res->resultSetIdleTime))
;
- else if (match_element(ptr, "records"))
+ else if (yaz_match_xsd_element(ptr, "records"))
yaz_srw_records(o, ptr, &res->records,
&res->extra_records,
&res->num_records, client_data, 0);
- else if (match_xsd_integer(ptr, "nextRecordPosition", o,
+ else if (yaz_match_xsd_integer(ptr, "nextRecordPosition", o,
&res->nextRecordPosition))
;
- else if (match_element(ptr, "diagnostics"))
+ else if (yaz_match_xsd_element(ptr, "diagnostics"))
yaz_srw_diagnostics(o, ptr, &res->diagnostics,
&res->num_diagnostics,
client_data, ns);
- else if (match_element(ptr, "facet_analysis"))
+ else if (yaz_match_xsd_element(ptr, "facet_analysis"))
yaz_sru_proxy_decode_facets(o, ptr, &res->facetList);
- else if (match_element(ptr, "facetedResults"))
+ else if (yaz_match_xsd_element(ptr, "facetedResults"))
yaz_sru_facet_response(o, &res->facetList, ptr);
}
}
req->stylesheet = 0;
for (; ptr; ptr = ptr->next)
{
- if (match_xsd_string(ptr, "version", o,
+ if (yaz_match_xsd_string(ptr, "version", o,
&(*p)->srw_version))
;
- else if (match_xsd_XML_n(ptr, "extraResponseData", o,
+ else if (yaz_match_xsd_XML_n(ptr, "extraResponseData", o,
&(*p)->extraResponseData_buf,
&(*p)->extraResponseData_len))
;
- else if (match_xsd_string(ptr, "stylesheet", o,
+ else if (yaz_match_xsd_string(ptr, "stylesheet", o,
&req->stylesheet))
;
- else if (match_xsd_string(ptr, "recordPacking", o,
+ else if (yaz_match_xsd_string(ptr, "recordPacking", o,
&req->recordPacking))
;
else
- match_xsd_string(ptr, "database", o, &req->database);
+ yaz_match_xsd_string(ptr, "database", o, &req->database);
}
}
else if (!xmlStrcmp(method->name, BAD_CAST "explainResponse"))
for (; ptr; ptr = ptr->next)
{
- if (match_xsd_string(ptr, "version", o,
+ if (yaz_match_xsd_string(ptr, "version", o,
&(*p)->srw_version))
;
- else if (match_xsd_XML_n(ptr, "extraResponseData", o,
+ else if (yaz_match_xsd_XML_n(ptr, "extraResponseData", o,
&(*p)->extraResponseData_buf,
&(*p)->extraResponseData_len))
;
- else if (match_element(ptr, "record"))
+ else if (yaz_match_xsd_element(ptr, "record"))
yaz_srw_record(o, ptr, &res->record, &res->extra_record,
client_data, 0);
- else if (match_element(ptr, "diagnostics"))
+ else if (yaz_match_xsd_element(ptr, "diagnostics"))
yaz_srw_diagnostics(o, ptr, &res->diagnostics,
&res->num_diagnostics,
client_data, ns);
for (; ptr; ptr = ptr->next)
{
- if (match_xsd_string(ptr, "version", o,
+ if (yaz_match_xsd_string(ptr, "version", o,
&(*p)->srw_version))
;
- else if (match_xsd_XML_n(ptr, "extraResponseData", o,
+ else if (yaz_match_xsd_XML_n(ptr, "extraResponseData", o,
&(*p)->extraResponseData_buf,
&(*p)->extraResponseData_len))
;
- else if (match_xsd_string(ptr, "scanClause", o,
+ else if (yaz_match_xsd_string(ptr, "scanClause", o,
&req->scanClause))
;
- else if (match_xsd_string(ptr, "pScanClause", o,
+ else if (yaz_match_xsd_string(ptr, "pScanClause", o,
&req->scanClause))
{
req->queryType = "pqf";
}
- else if (match_xsd_integer(ptr, "responsePosition", o,
+ else if (yaz_match_xsd_integer(ptr, "responsePosition", o,
&req->responsePosition))
;
- else if (match_xsd_integer(ptr, "maximumTerms", o,
+ else if (yaz_match_xsd_integer(ptr, "maximumTerms", o,
&req->maximumTerms))
;
- else if (match_xsd_string(ptr, "stylesheet", o,
+ else if (yaz_match_xsd_string(ptr, "stylesheet", o,
&req->stylesheet))
;
else
- match_xsd_string(ptr, "database", o, &req->database);
+ yaz_match_xsd_string(ptr, "database", o, &req->database);
}
}
else if (!xmlStrcmp(method->name, BAD_CAST "scanResponse"))
for (; ptr; ptr = ptr->next)
{
- if (match_xsd_string(ptr, "version", o,
+ if (yaz_match_xsd_string(ptr, "version", o,
&(*p)->srw_version))
;
- else if (match_xsd_XML_n(ptr, "extraResponseData", o,
+ else if (yaz_match_xsd_XML_n(ptr, "extraResponseData", o,
&(*p)->extraResponseData_buf,
&(*p)->extraResponseData_len))
;
- else if (match_element(ptr, "terms"))
+ else if (yaz_match_xsd_element(ptr, "terms"))
yaz_srw_terms(o, ptr, &res->terms,
&res->num_terms, client_data,
ns);
- else if (match_element(ptr, "diagnostics"))
+ else if (yaz_match_xsd_element(ptr, "diagnostics"))
yaz_srw_diagnostics(o, ptr, &res->diagnostics,
&res->num_diagnostics,
client_data, ns);
add_xsd_string(ptr, "database", req->database);
{
const char *limit = 0;
- yaz_sru_facet_request(o, &req->facetList, &limit);
+ const char *start = 0;
+ const char *sort = 0;
+ yaz_sru_facet_request(o, &req->facetList, &limit, &start,
+ &sort);
add_xsd_string(ptr, "facetLimit", limit);
+ add_xsd_string(ptr, "facetStart", start);
+ add_xsd_string(ptr, "facetSort", sort);
}
}
else if ((*p)->which == Z_SRW_searchRetrieve_response)
for (; ptr; ptr = ptr->next)
{
- if (match_xsd_string(ptr, "version", o,
+ if (yaz_match_xsd_string(ptr, "version", o,
&(*p)->srw_version))
;
- else if (match_xsd_string(ptr, "action", o,
+ else if (yaz_match_xsd_string(ptr, "action", o,
&oper)){
if (oper)
{
req->operation = "insert";
}
}
- else if (match_xsd_string(ptr, "recordIdentifier", o,
+ else if (yaz_match_xsd_string(ptr, "recordIdentifier", o,
&req->recordId))
;
- else if (match_element(ptr, "recordVersions" ) )
+ else if (yaz_match_xsd_element(ptr, "recordVersions" ) )
yaz_srw_versions( o, ptr, &req->recordVersions,
&req->num_recordVersions, client_data,
ns_ucp_str);
- else if (match_element(ptr, "record"))
+ else if (yaz_match_xsd_element(ptr, "record"))
{
req->record = yaz_srw_get_record(o);
yaz_srw_record(o, ptr, req->record, &req->extra_record,
client_data, 0);
}
- else if (match_xsd_string(ptr, "stylesheet", o,
+ else if (yaz_match_xsd_string(ptr, "stylesheet", o,
&req->stylesheet))
;
else
- match_xsd_string(ptr, "database", o, &req->database);
+ yaz_match_xsd_string(ptr, "database", o, &req->database);
}
}
else if (!xmlStrcmp(method->name, BAD_CAST "updateResponse"))
for (; ptr; ptr = ptr->next)
{
- if (match_xsd_string(ptr, "version", o,
+ if (yaz_match_xsd_string(ptr, "version", o,
&(*p)->srw_version))
;
- else if (match_xsd_string(ptr, "operationStatus", o,
+ else if (yaz_match_xsd_string(ptr, "operationStatus", o,
&res->operationStatus ))
;
- else if (match_xsd_string(ptr, "recordIdentifier", o,
+ else if (yaz_match_xsd_string(ptr, "recordIdentifier", o,
&res->recordId))
;
- else if (match_element(ptr, "recordVersions" ))
+ else if (yaz_match_xsd_element(ptr, "recordVersions" ))
yaz_srw_versions(o, ptr, &res->recordVersions,
&res->num_recordVersions,
client_data, ns_ucp_str);
- else if (match_element(ptr, "record"))
+ else if (yaz_match_xsd_element(ptr, "record"))
{
res->record = yaz_srw_get_record(o);
yaz_srw_record(o, ptr, res->record, &res->extra_record,
client_data, 0);
}
- else if (match_element(ptr, "diagnostics"))
+ else if (yaz_match_xsd_element(ptr, "diagnostics"))
yaz_srw_diagnostics(o, ptr, &res->diagnostics,
&res->num_diagnostics,
client_data, ns_ucp_str);