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_cluster *rec, *prev_r, *next_r;
struct record *r;
struct conf_service *service = global_parameters.server->service;
const char *idstr = http_argbyname(rq, "id");
return;
}
wrbuf_rewind(c->wrbuf);
- if (!(rec = show_single(s->psession, idstr)))
+ if (!(rec = show_single(s->psession, idstr, &prev_r, &next_r)))
{
if (session_set_watch(s->psession, SESSION_WATCH_RECORD,
cmd_record_ready, c, c) != 0)
wrbuf_puts(c->wrbuf, "<recid>");
wrbuf_xmlputs(c->wrbuf, rec->recid);
wrbuf_puts(c->wrbuf, "</recid>\n");
+ if (prev_r)
+ {
+ wrbuf_puts(c->wrbuf, "<prevrecid>");
+ wrbuf_xmlputs(c->wrbuf, prev_r->recid);
+ wrbuf_puts(c->wrbuf, "</prevrecid>\n");
+ }
+ if (next_r)
+ {
+ wrbuf_puts(c->wrbuf, "<nextrecid>");
+ wrbuf_xmlputs(c->wrbuf, next_r->recid);
+ wrbuf_puts(c->wrbuf, "</nextrecid>\n");
+ }
+ wrbuf_printf(c->wrbuf, "<activeclients>%d</activeclients>\n",
+ session_active_clients(s->psession));
write_metadata(c->wrbuf, service, rec->metadata, 1);
for (r = rec->records; r; r = r->next)
write_subrecord(r, c->wrbuf, service, 1);
}
#endif
-struct record_cluster *show_single(struct session *s, const char *id)
+struct record_cluster *show_single(struct session *s, const char *id,
+ struct record_cluster **prev_r,
+ struct record_cluster **next_r)
{
struct record_cluster *r;
reclist_rewind(s->reclist);
+ *prev_r = 0;
+ *next_r = 0;
while ((r = reclist_read_record(s->reclist)))
+ {
if (!strcmp(r->recid, id))
+ {
+ *next_r = reclist_read_record(s->reclist);
return r;
+ }
+ *prev_r = r;
+ }
return 0;
}
char *filter, const char **addinfo);
struct record_cluster **show(struct session *s, struct reclist_sortparms *sp, int start,
int *num, int *total, int *sumhits, NMEM nmem_show);
-struct record_cluster *show_single(struct session *s, const char *id);
+struct record_cluster *show_single(struct session *s, const char *id,
+ struct record_cluster **prev_r,
+ struct record_cluster **next_r);
struct termlist_score **termlist(struct session *s, const char *name, int *num);
int session_set_watch(struct session *s, int what, session_watchfun fun, void *data, struct http_channel *c);
int session_active_clients(struct session *s);
<record>
<recid>title how to program a computer author jack collins medium book</recid>
+<nextrecid>title computer processing of dynamic images from an anger scintillation camera author medium book</nextrecid>
+<activeclients>0</activeclients>
<md-title>How to program a computer</md-title>
<md-author>Jack Collins</md-author>
<record>
<recid>title how to program a computer author jack collins medium book</recid>
+<nextrecid>title the use of passwords for controlled access to computer resources author wood helen m medium book</nextrecid>
+<activeclients>0</activeclients>
<md-title>How to program a computer</md-title>
<md-author>Jack Collins</md-author>