-/* $Id: http_command.c,v 1.55 2007-06-28 09:36:10 adam Exp $
+/* $Id: http_command.c,v 1.57 2007-07-16 17:01:46 adam Exp $
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
*/
/*
- * $Id: http_command.c,v 1.55 2007-06-28 09:36:10 adam Exp $
+ * $Id: http_command.c,v 1.57 2007-07-16 17:01:46 adam Exp $
*/
#include <stdio.h>
http_remove_observer(obs);
- error(rs, PAZPAR2_NOT_IMPLEMENTED, addinfo);
+ error(rs, PAZPAR2_RECORD_FAIL, addinfo);
}
static void show_raw_record_ok(void *data, const char *buf, size_t sz)
const char *idstr = http_argbyname(rq, "id");
const char *offsetstr = http_argbyname(rq, "offset");
- int id;
-
if (!s)
return;
if (!idstr)
return;
}
wrbuf_rewind(c->wrbuf);
- id = atoi(idstr);
- if (!(rec = show_single(s->psession, id)))
+ if (!(rec = show_single(s->psession, idstr)))
{
error(rs, PAZPAR2_RECORD_MISSING, idstr);
return;
else
{
wrbuf_puts(c->wrbuf, "<record>\n");
- wrbuf_printf(c->wrbuf, "<recid>%d</recid>\n", rec->recid);
+ wrbuf_printf(c->wrbuf, "<recid>%s</recid>\n", rec->recid);
write_metadata(c->wrbuf, service, rec->metadata, 1);
for (r = rec->records; r; r = r->next)
write_subrecord(r, c->wrbuf, service, 1);
write_subrecord(p, c->wrbuf, service, 0); // subrecs w/o details
if (ccount > 1)
wrbuf_printf(c->wrbuf, "<count>%d</count>\n", ccount);
- wrbuf_printf(c->wrbuf, "<recid>%d</recid>\n", rec->recid);
+ wrbuf_printf(c->wrbuf, "<recid>%s</recid>\n", rec->recid);
wrbuf_puts(c->wrbuf, "</hit>\n");
}