static void cmd_service(struct http_channel *c)
{
struct http_session *s = locate_session(c);
+ xmlNode *xml_node;
if (!s)
return;
response_open(c, "service");
+ xml_node = s->psession->service->xml_node;
+ if (xml_node)
+ {
+ xmlNode *tmp = xmlCopyNode(xml_node, 1);
+ xmlBufferPtr buf = xmlBufferCreate();
+
+ xmlNodeDump(buf, tmp->doc, tmp, 0, 0);
+
+ wrbuf_write(c->wrbuf, (const char *) buf->content, buf->use);
+ xmlBufferFree(buf);
+ }
+
response_close(c, "service");
release_session(c, s);
}
if (!pazpar2_decref(&service->ref_count, service->mutex))
{
service_xslt_destroy(service);
+ if (service->xml_node)
+ xmlFreeNode(service->xml_node);
pp2_charset_fact_destroy(service->charsets);
ccl_qual_rm(&service->ccl_bibset);
yaz_mutex_destroy(&service->mutex);
}
}
}
+ service->xml_node = xmlCopyNode(node, 1);
return service;
}
http://localhost:9763/search.pz2?session=1&command=search&query=water
2 http://localhost:9763/search.pz2?session=1&command=show&block=1&sort=title:1p
2 http://localhost:9763/search.pz2?session=1&command=show&block=1&sort=date:0p
+http://localhost:9763/search.pz2?session=1&command=service
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<service><status>OK</status><service xmlns="http://www.indexdata.com/pazpar2/1.0">
+ <icu_chain id="relevance" locale="en">
+ <transform rule="[:Control:] Any-Remove"/>
+ <tokenize rule="l"/>
+ <transform rule="[[:WhiteSpace:][:Punctuation:]`] Remove"/>
+ <casemap rule="l"/>
+ </icu_chain>
+
+ <icu_chain id="sort" locale="en">
+ <transform rule="[[:Control:][:WhiteSpace:][:Punctuation:]`] Remove"/>
+ <casemap rule="l"/>
+ </icu_chain>
+
+ <icu_chain id="mergekey" locale="en">
+ <tokenize rule="l"/>
+ <transform rule="[[:Control:][:WhiteSpace:][:Punctuation:]`] Remove"/>
+ <casemap rule="l"/>
+ </icu_chain>
+
+ <icu_chain id="facet" locale="en">
+ <display/>
+ <transform rule="Title"/>
+ </icu_chain>
+
+ <metadata name="url" merge="unique"/>
+ <metadata name="title" brief="yes" sortkey="skiparticle" merge="longest" rank="6" mergekey="required"/>
+ <metadata name="title-remainder" brief="yes" merge="longest" rank="5"/>
+ <metadata name="isbn"/>
+ <metadata name="date" brief="yes" sortkey="numeric" type="year" merge="range" termlist="yes"/>
+ <metadata name="author" brief="yes" termlist="yes" merge="longest" rank="2" mergekey="optional"/>
+ <metadata name="subject" merge="unique" termlist="yes" rank="3"/>
+ <metadata name="id"/>
+ <metadata name="lccn" merge="unique"/>
+ <metadata name="description" brief="yes" merge="longest" rank="3"/>
+ </service></service>
\ No newline at end of file