+pazpar2 (1.6.6-2indexdata) unstable; urgency=low
+
+ * Testing
+
+ -- Adam Dickmeiss <adam@indexdata.dk> Tue, 13 Dec 2011 14:39:42 +0100
+
pazpar2 (1.6.6-1indexdata) unstable; urgency=low
* Upstream
<listitem>
<para>
This optional parameter is an integer which, when given, makes
- Pazpar2 return the raw record for a target. The raw record
- from first target is numbered 0, second numbered 1, etc.
- When a raw record is returned Pazpar2 will XSLT transform the
- record but an XML version is returned. All ISO2709 records are
- returned as MARCXML. OPAC records are returned as YAZ'
- OPAC with an MARCXML sibling.
+ Pazpar2 return the original record for a specific target.
+ The record set from first target is numbered 0,
+ second record set is numbered 1, etc.
+ The nativesyntax setting, as usual, is used to determine how to
+ create XML from the original record - unless parameter
+ <literal>binary</literal> is given in which the record is
+ fetched as "raw" from ZOOM C (raw, original record).
</para>
<para>
- When offset is not given the Pazpar2 metadata for the record
+ When offset is not given, the Pazpar2 metadata for the record
is returned and with metadata for each targets' data specified
in a 'location' list.
</para>
</varlistentry>
<varlistentry>
+ <term>nativesyntax</term>
+ <listitem>
+ <para>
+ This optional parameter can be used to override pz:nativesyntax
+ as given for the target. This allow an alternative nativesyntax
+ to be used for original records (see parameteroffset above).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term>syntax</term>
<listitem>
<para>
<listitem>
<para>
This optional parameter enables "binary" response for retrieval
- of a raw record (i.e. when offset is specified). For binary
- responses the record is <emphasis>not</emphasis> converted to
- XML and the HTTP content type is application/octet-stream.
+ of a original record (i.e. when offset is specified). For binary
+ response the record by default is fetched from ZOOM C using
+ the "raw" option or by parameter nativesyntax if given.
</para>
</listitem>
</varlistentry>
int binary;
char *syntax;
char *esn;
+ char *nativesyntax;
void (*error_handler)(void *data, const char *addinfo);
void (*record_handler)(void *data, const char *buf, size_t sz);
void *data;
}
static void client_send_raw_present(struct client *cl);
-static int nativesyntax_to_type(struct session_database *sdb, char *type,
- ZOOM_record rec);
+static int nativesyntax_to_type(const char *s, char *type, ZOOM_record rec);
static void client_show_immediate(
ZOOM_resultset resultset, struct session_database *sdb, int position,
void *data,
void (*error_handler)(void *data, const char *addinfo),
void (*record_handler)(void *data, const char *buf, size_t sz),
- int binary)
+ int binary,
+ const char *nativesyntax)
{
ZOOM_record rec = 0;
char type[80];
error_handler(data, "no record");
return;
}
- if (binary)
- strcpy(type, "raw");
- else
- nativesyntax_to_type(sdb, type, rec);
+ nativesyntax_to_type(nativesyntax, type, rec);
buf = ZOOM_record_get(rec, type, &len);
if (!buf)
{
void (*error_handler)(void *data, const char *addinfo),
void (*record_handler)(void *data, const char *buf,
size_t sz),
- int binary)
+ int binary,
+ const char *nativesyntax)
{
+ if (!nativesyntax)
+ {
+ if (binary)
+ nativesyntax = "raw";
+ else
+ {
+ struct session_database *sdb = client_get_database(cl);
+ nativesyntax = session_setting_oneval(sdb, PZ_NATIVESYNTAX);
+ }
+ }
+
if (syntax == 0 && esn == 0)
client_show_immediate(cl->resultset, client_get_database(cl),
position, data,
error_handler, record_handler,
- binary);
+ binary, nativesyntax);
else
{
struct show_raw *rr, **rrp;
rr->esn = xstrdup(esn);
else
rr->esn = 0;
+
+ assert(nativesyntax);
+ rr->nativesyntax = xstrdup(nativesyntax);
+
rr->next = 0;
for (rrp = &cl->show_raw; *rrp; rrp = &(*rrp)->next)
{
xfree(r->syntax);
xfree(r->esn);
+ xfree(r->nativesyntax);
xfree(r);
}
connection_continue(co);
}
-static int nativesyntax_to_type(struct session_database *sdb, char *type,
+static int nativesyntax_to_type(const char *s, char *type,
ZOOM_record rec)
{
- const char *s = session_setting_oneval(sdb, PZ_NATIVESYNTAX);
-
if (s && *s)
{
if (!strncmp(s, "iso2709", 7))
yaz_snprintf(type, 80, "txml; charset=%s", cp ? cp+1 : "marc-8s");
}
else
- return -1;
+ strcpy(type, s);
return 0;
}
else /* attempt to deduce structure */
int len;
char type[80];
- if (cl->show_raw->binary)
- strcpy(type, "raw");
- else
- {
- struct session_database *sdb = client_get_database(cl);
- nativesyntax_to_type(sdb, type, rec);
- }
-
+ nativesyntax_to_type(cl->show_raw->nativesyntax, type, rec);
buf = ZOOM_record_get(rec, type, &len);
cl->show_raw->record_handler(cl->show_raw->data, buf, len);
client_show_raw_dequeue(cl);
const char *xmlrec;
char type[80];
- if (nativesyntax_to_type(sdb, type, rec))
+ const char *s = session_setting_oneval(sdb, PZ_NATIVESYNTAX);
+ if (nativesyntax_to_type(s, type, rec))
yaz_log(YLOG_WARN, "Failed to determine record type");
xmlrec = ZOOM_record_get(rec, type, NULL);
if (!xmlrec)
void (*error_handler)(void *data, const char *addinfo),
void (*record_handler)(void *data, const char *buf,
size_t sz),
- int binary);
+ int binary,
+ const char *nativesyntax);
void client_show_raw_remove(struct client *cl, void *rr);
int i;
struct record*r = rec->records;
int binary = 0;
-
+ const char *nativesyntax = http_argbyname(rq, "nativesyntax");
+
if (binarystr && *binarystr != '0')
binary = 1;
http_channel_observer_t obs =
http_add_observer(c, r->client, show_raw_reset);
int ret = client_show_raw_begin(r->client, r->position,
- syntax, esn,
- obs /* data */,
- show_raw_record_error,
- (binary ?
- show_raw_record_ok_binary :
- show_raw_record_ok),
- (binary ? 1 : 0));
+ syntax, esn,
+ obs /* data */,
+ show_raw_record_error,
+ (binary ?
+ show_raw_record_ok_binary :
+ show_raw_record_ok),
+ (binary ? 1 : 0),
+ nativesyntax);
if (ret == -1)
{
http_remove_observer(obs);
char **names;
int num_names = 0;
- if (name)
- nmem_strsplit(nmem_tmp, ",", name, &names, &num_names);
+ if (!name)
+ name = "*";
+
+ nmem_strsplit(nmem_tmp, ",", name, &names, &num_names);
session_enter(se);
{
const char *tname;
- wrbuf_puts(c->wrbuf, "<list name=\"");
- wrbuf_xmlputs(c->wrbuf, names[j]);
- wrbuf_puts(c->wrbuf, "\">\n");
-
for (i = 0; i < se->num_termlists; i++)
{
tname = se->termlists[i].name;
- if (num_names > 0 && !strcmp(names[j], tname))
+ if (!strcmp(names[j], tname) || !strcmp(names[j], "*"))
{
struct termlist_score **p = 0;
int len;
+
+ wrbuf_puts(c->wrbuf, "<list name=\"");
+ wrbuf_xmlputs(c->wrbuf, tname);
+ wrbuf_puts(c->wrbuf, "\">\n");
+
p = termlist_highscore(se->termlists[i].termlist, &len);
if (p)
{
wrbuf_puts(c->wrbuf, "</term>\n");
}
}
+ wrbuf_puts(c->wrbuf, "</list>\n");
}
}
tname = "xtargets";
- if (num_names > 0 && !strcmp(names[j], tname))
+ if (!strcmp(names[j], tname) || !strcmp(names[j], "*"))
{
+ wrbuf_puts(c->wrbuf, "<list name=\"");
+ wrbuf_xmlputs(c->wrbuf, tname);
+ wrbuf_puts(c->wrbuf, "\">\n");
+
targets_termlist_nb(c->wrbuf, se, num, c->nmem);
+ wrbuf_puts(c->wrbuf, "</list>\n");
}
- wrbuf_puts(c->wrbuf, "</list>\n");
}
session_leave(se);
nmem_destroy(nmem_tmp);
http://localhost:9763/search.pz2?session=1&command=termlist&name=xtargets%2Cauthor%2Csubject%2Cdate%2Cmedium
http://localhost:9763/search.pz2?session=1&command=search&query=8+and+computer
http://localhost:9763/search.pz2?session=1&command=show&block=1
-http://localhost:9763/search.pz2?session=1&command=termlist&name=xtargets%2Cauthor%2Csubject%2Cdate%2Cmedium
+http://localhost:9763/search.pz2?session=1&command=termlist
http://localhost:9763/search.pz2?session=1&command=search&query=6+and+computer
http://localhost:9763/search.pz2?session=1&command=show
http://localhost:9763/search.pz2?session=1&command=termlist&name=xtargets%2Cauthor%2Csubject%2Cdate%2Cmedium
<term><name>date8</name><frequency>20</frequency></term>
<term><name>date9</name><frequency>10</frequency></term>
</list>
-<list name="medium">
-</list>
</termlist>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<termlist><activeclients>0</activeclients>
-<list name="xtargets">
-<term>
-<id>localhost:9999/db1</id>
-<name>db1</name>
-<frequency>8</frequency>
-<state>Client_Idle</state>
-<diagnostic>0</diagnostic>
-</term>
-</list>
<list name="author">
<term><name>author0</name><frequency>100</frequency></term>
<term><name>author1</name><frequency>90</frequency></term>
<term><name>date8</name><frequency>20</frequency></term>
<term><name>date9</name><frequency>10</frequency></term>
</list>
-<list name="medium">
+<list name="xtargets">
+<term>
+<id>localhost:9999/db1</id>
+<name>db1</name>
+<frequency>8</frequency>
+<state>Client_Idle</state>
+<diagnostic>0</diagnostic>
+</term>
</list>
</termlist>
\ No newline at end of file
<term><name>date8</name><frequency>20</frequency></term>
<term><name>date9</name><frequency>10</frequency></term>
</list>
-<list name="medium">
-</list>
</termlist>
\ No newline at end of file
<term><name>date8</name><frequency>20</frequency></term>
<term><name>date9</name><frequency>10</frequency></term>
</list>
-<list name="medium">
-</list>
</termlist>
\ No newline at end of file
<term><name>date8</name><frequency>20</frequency></term>
<term><name>date9</name><frequency>10</frequency></term>
</list>
-<list name="medium">
-</list>
</termlist>
\ No newline at end of file
<term><name>1973</name><frequency>1</frequency></term>
<term><name>1980</name><frequency>1</frequency></term>
</list>
-<list name="medium">
-</list>
</termlist>
\ No newline at end of file
http://localhost:9763/search.pz2?command=init&pz:elements%5Bz3950.indexdata.com%2Fmarc%5D=F
1 http://localhost:9763/search.pz2?session=6&command=search&query=louis
1 http://localhost:9763/search.pz2?session=6&command=show&block=1
-http://localhost:9763/search.pz2?session=6&command=record&id=content%3A+title+computer+processing+of+dynamic+images+from+an+anger+scintillation+camera+author+medium+book&offset=0
+http://localhost:9763/search.pz2?session=6&command=record&id=content%3A+title+computer+processing+of+dynamic+images+from+an+anger+scintillation+camera+author+medium+book&offset=0&nativesyntax=txml%3Bcharset%3Dmarc-8
http://localhost:9763/search.pz2?command=init&pz:elements%5Bz3950.indexdata.com%2Fmarc%5D=F
http://localhost:9763/search.pz2?session=7&command=search&query=greece
1 http://localhost:9763/search.pz2?session=7&command=show&block=1
-<record xmlns="http://www.loc.gov/MARC21/slim">
- <leader>01369nam a2200265 i 4504</leader>
- <controlfield tag="001"> 73090924 //r82</controlfield>
- <controlfield tag="003">DLC</controlfield>
- <controlfield tag="005">19820524000000.0</controlfield>
- <controlfield tag="008">760609s1974 nyua b 10110 eng </controlfield>
- <datafield tag="010" ind1=" " ind2=" ">
- <subfield code="a"> 73090924 //r82</subfield>
- </datafield>
- <datafield tag="040" ind1=" " ind2=" ">
- <subfield code="a">DLC</subfield>
- <subfield code="c">DLC</subfield>
- <subfield code="d">DLC</subfield>
- </datafield>
- <datafield tag="050" ind1="0" ind2="0">
- <subfield code="a">RC71.3</subfield>
- <subfield code="b">.W67 1971</subfield>
- </datafield>
- <datafield tag="082" ind1="0" ind2="0">
- <subfield code="a">616.07/575/02854</subfield>
- </datafield>
- <datafield tag="111" ind1="2" ind2="0">
- <subfield code="a">Workshop on Computer Processing of Dynamic Images from an Anger Scintillation Camera,</subfield>
- <subfield code="c">Washington University,</subfield>
- <subfield code="d">1971.</subfield>
- </datafield>
- <datafield tag="245" ind1="1" ind2="0">
- <subfield code="a">Computer processing of dynamic images from an Anger scintillation camera :</subfield>
- <subfield code="b">the proceedings of a workshop /</subfield>
- <subfield code="c">cosponsored by the Biomedical Computer Laboratory and the Nuclear Medicine Division, Department of Radiology, School of Medicine, Washington University, St. Louis, January 18-22, 1971 ; edited by Kenneth B. Larson, Jerome R. Cox, Jr.</subfield>
- </datafield>
- <datafield tag="260" ind1="0" ind2=" ">
- <subfield code="a">New York :</subfield>
- <subfield code="b">Society of Nuclear Medicine,</subfield>
- <subfield code="c">[c1974]</subfield>
- </datafield>
- <datafield tag="300" ind1=" " ind2=" ">
- <subfield code="a">xiv, p. :</subfield>
- <subfield code="b">ill. ;</subfield>
- <subfield code="c">24 cm.</subfield>
- </datafield>
- <datafield tag="504" ind1=" " ind2=" ">
- <subfield code="a">Includes bibliographical references and index.</subfield>
- </datafield>
- <datafield tag="650" ind1=" " ind2="0">
- <subfield code="a">Radioisotope scanning</subfield>
- <subfield code="x">Data processing</subfield>
- <subfield code="x">Congresses.</subfield>
- </datafield>
- <datafield tag="650" ind1=" " ind2="0">
- <subfield code="a">Scintillation cameras</subfield>
- <subfield code="x">Congresses.</subfield>
- </datafield>
- <datafield tag="650" ind1=" " ind2="0">
- <subfield code="a">Imaging systems in medicine</subfield>
- <subfield code="x">Data processing</subfield>
- <subfield code="x">Congresses.</subfield>
- </datafield>
- <datafield tag="700" ind1="1" ind2="0">
- <subfield code="a">Larson, Kenneth B.</subfield>
- </datafield>
- <datafield tag="700" ind1="1" ind2="0">
- <subfield code="a">Cox, Jerome R. </subfield>
- </datafield>
- <datafield tag="710" ind1="2" ind2="0">
- <subfield code="a">Washington University, St. Louis.</subfield>
- <subfield code="b">Biomedical Computer Laboratory.</subfield>
- </datafield>
- <datafield tag="710" ind1="2" ind2="0">
- <subfield code="a">Washington University, St. Louis.</subfield>
- <subfield code="b">Nuclear Medicine Division.</subfield>
- </datafield>
-</record>
+<r xmlns="http://www.indexdata.com/turbomarc">
+ <l>01369nam a2200265 i 4504</l>
+ <c001> 73090924 //r82</c001>
+ <c003>DLC</c003>
+ <c005>19820524000000.0</c005>
+ <c008>760609s1974 nyua b 10110 eng </c008>
+ <d010 i1=" " i2=" ">
+ <sa> 73090924 //r82</sa>
+ </d010>
+ <d040 i1=" " i2=" ">
+ <sa>DLC</sa>
+ <sc>DLC</sc>
+ <sd>DLC</sd>
+ </d040>
+ <d050 i1="0" i2="0">
+ <sa>RC71.3</sa>
+ <sb>.W67 1971</sb>
+ </d050>
+ <d082 i1="0" i2="0">
+ <sa>616.07/575/02854</sa>
+ </d082>
+ <d111 i1="2" i2="0">
+ <sa>Workshop on Computer Processing of Dynamic Images from an Anger Scintillation Camera,</sa>
+ <sc>Washington University,</sc>
+ <sd>1971.</sd>
+ </d111>
+ <d245 i1="1" i2="0">
+ <sa>Computer processing of dynamic images from an Anger scintillation camera :</sa>
+ <sb>the proceedings of a workshop /</sb>
+ <sc>cosponsored by the Biomedical Computer Laboratory and the Nuclear Medicine Division, Department of Radiology, School of Medicine, Washington University, St. Louis, January 18-22, 1971 ; edited by Kenneth B. Larson, Jerome R. Cox, Jr.</sc>
+ </d245>
+ <d260 i1="0" i2=" ">
+ <sa>New York :</sa>
+ <sb>Society of Nuclear Medicine,</sb>
+ <sc>[c1974]</sc>
+ </d260>
+ <d300 i1=" " i2=" ">
+ <sa>xiv, p. :</sa>
+ <sb>ill. ;</sb>
+ <sc>24 cm.</sc>
+ </d300>
+ <d504 i1=" " i2=" ">
+ <sa>Includes bibliographical references and index.</sa>
+ </d504>
+ <d650 i1=" " i2="0">
+ <sa>Radioisotope scanning</sa>
+ <sx>Data processing</sx>
+ <sx>Congresses.</sx>
+ </d650>
+ <d650 i1=" " i2="0">
+ <sa>Scintillation cameras</sa>
+ <sx>Congresses.</sx>
+ </d650>
+ <d650 i1=" " i2="0">
+ <sa>Imaging systems in medicine</sa>
+ <sx>Data processing</sx>
+ <sx>Congresses.</sx>
+ </d650>
+ <d700 i1="1" i2="0">
+ <sa>Larson, Kenneth B.</sa>
+ </d700>
+ <d700 i1="1" i2="0">
+ <sa>Cox, Jerome R. </sa>
+ </d700>
+ <d710 i1="2" i2="0">
+ <sa>Washington University, St. Louis.</sa>
+ <sb>Biomedical Computer Laboratory.</sb>
+ </d710>
+ <d710 i1="2" i2="0">
+ <sa>Washington University, St. Louis.</sa>
+ <sb>Nuclear Medicine Division.</sb>
+ </d710>
+</r>
padding: 10px 10px 10px 10px;
border: 1px solid #B4B4B4;
font-weight: bold;
- -webkit-tap-highlight-color:rgba(0,0,0,0);
+ font-size: 16px;
+ -webkit-tap-highlight-color:rgba(0,0,0,0);
}
</select>
and show
<select name="perpage" id="perpage">
+ <option value="50" selected="selected">select</option>
<option value="5">5</option>
- <option value="5" selected="selected">10</option>
+ <option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="50">50</option>
</div>
<div id="detailview" style="display:none">
<h4>Detailed view</h4>
- <div id="detailrecord">meh</div>
+ <div id="detailrecord"></div>
</div>
<div id="targetview" style="display: none">
<div id="bytarget">