target melvyl.cdlib.org/cdl90
target z3950.loc.gov:7090/voyager
target library2.mcmaster.ca/MORRIS
-target melvyl.cdlib.org/CDL90
target info.library.mun.ca:2200/innopac
target 137.122.27.60:210/innopac
target z3950.rlg.org/BIB
<xsl:value-of select="marc:datafield[@tag='100']/marc:subfield[@code='a']"/>
</xsl:attribute>
- <pz:metadata name="id">
+ <pz:metadata type="id">
<xsl:value-of select="marc:controlfield[@tag='001']"/>
</pz:metadata>
/*
- * $Id: http_command.c,v 1.24 2007-01-17 15:27:34 quinn Exp $
+ * $Id: http_command.c,v 1.25 2007-01-18 16:21:23 quinn Exp $
*/
#include <stdio.h>
}
}
+static void write_subrecord(struct record *r, WRBUF w, struct conf_service *service)
+{
+ wrbuf_printf(w, "<location id=\"%s\">\n", r->client->database->url);
+ write_metadata(w, service, r->metadata, 1);
+ wrbuf_puts(w, "</location>\n");
+}
+
static void cmd_record(struct http_channel *c)
{
struct http_response *rs = c->response;
struct http_request *rq = c->request;
struct http_session *s = locate_session(rq, rs);
struct record_cluster *rec;
+ struct record *r;
struct conf_service *service = global_parameters.server->service;
char *idstr = http_argbyname(rq, "id");
int id;
wrbuf_puts(c->wrbuf, "<record>\n");
wrbuf_printf(c->wrbuf, "<recid>%d</recid>", rec->recid);
write_metadata(c->wrbuf, service, rec->metadata, 1);
+ for (r = rec->records; r; r = r->next)
+ write_subrecord(r, c->wrbuf, service);
wrbuf_puts(c->wrbuf, "</record>\n");
rs->payload = nmem_strdup(c->nmem, wrbuf_buf(c->wrbuf));
http_send_response(c);
-/* $Id: pazpar2.c,v 1.42 2007-01-18 14:22:25 quinn Exp $ */
+/* $Id: pazpar2.c,v 1.43 2007-01-18 16:21:23 quinn Exp $ */
#include <stdlib.h>
#include <stdio.h>
res = nmem_malloc(se->nmem, sizeof(struct record));
res->next = 0;
+ res->client = cl;
res->metadata = nmem_malloc(se->nmem,
sizeof(struct record_metadata*) * service->num_metadata);
memset(res->metadata, 0, sizeof(struct record_metadata*) * service->num_metadata);
newm->next = 0;
if (md->type == Metadata_type_generic)
{
- char *p;
- newm->data.text = nmem_strdup(se->nmem, value);
- for (p = newm->data.text + strlen(newm->data.text) - 1;
- p > newm->data.text && strchr(" ,/.", *p); p--)
- *p = '\0';
+ char *p, *pe;
+ for (p = value; *p && isspace(*p); p++)
+ ;
+ for (pe = p + strlen(p) - 1;
+ pe > p && strchr(" ,/.:([", *pe); pe--)
+ *pe = '\0';
+ newm->data.text = nmem_strdup(se->nmem, p);
}
else if (md->type == Metadata_type_year)
-/* $Id: search.js,v 1.38 2007-01-17 17:24:44 quinn Exp $
+/* $Id: search.js,v 1.39 2007-01-18 16:21:23 quinn Exp $
* ---------------------------------------------------
* Javascript container
*/
return 'Publisher';
else if (name == 'md-url')
return 'URL';
+ else if (name == 'md-title')
+ return '@';
+ else if (name == 'md-id')
+ return 'Local ID';
+ else if (name == 'recid')
+ return '@';
+ else if (name == 'location')
+ return '@';
else
return name;
}
var dname = displayname(name);
var ln = create_element('b', dname);
var tln = document.createElement('td');
- tln.setAttribute('width', 70);
+ tln.setAttribute('width', 90);
tln.setAttribute('valign', 'top');
tln.appendChild(ln);
var tr = document.createElement('tr');
return tr;
}
-function paint_details(body, xml)
+function paint_data_elements(target, node)
{
- // This is some ugly display code. Replace with your own ting o'beauty
- clear_cell(body);
- //body.appendChild(document.createElement('br'));
- var nodes = xml.childNodes[0].childNodes;
- var i;
- var table = document.createElement('table');
- table.setAttribute('cellpadding', 2);
+ var nodes = node.childNodes;
var dn = 0;
var lastname = '';
+ var i;
for (i = 0; i < nodes.length; i++)
{
if (nodes[i].nodeType != 1)
var name = nodes[i].nodeName;
if (name == 'recid' || name == 'md-title')
continue;
- if (name != lastname)
+ if (name != lastname && lastname != 'location')
{
if (dn)
{
var tr = paint_details_tr(lastname, dn);
- table.appendChild(tr);
+ target.appendChild(tr);
}
dn = document.createElement('td');
lastname = name;
}
-
+ if (name == 'location')
+ {
+ target.appendChild(paint_details_tr('Location', paint_subrecord(nodes[i])));
+ continue;
+ }
if (!nodes[i].childNodes[0])
continue;
var value = nodes[i].childNodes[0].nodeValue;
nv = document.createTextNode(value);
dn.appendChild(nv);
}
- if (dn)
+ if (dn && lastname != 'location')
{
var tr = paint_details_tr(lastname, dn);
- table.appendChild(tr);
+ target.appendChild(tr);
}
+}
+
+function paint_subrecord(node)
+{
+ var table = document.createElement('table');
+ var zurl = node.getAttribute('id');
+ var tr = paint_details_tr('Source', document.createTextNode(zurl));
+ paint_data_elements(table, node);
+ table.appendChild(tr);
+ return table;
+}
+
+function paint_details(body, xml)
+{
+ clear_cell(body);
+ var table = document.createElement('table');
+ table.setAttribute('cellpadding', 2);
+ paint_data_elements(table, xml.childNodes[0]);
body.appendChild(table);
body.style.display = 'inline';
}