1 | /**********************************************************************
|
---|
2 | *
|
---|
3 | * pageaction.cpp --
|
---|
4 | * Copyright (C) 1999 The New Zealand Digital Library Project
|
---|
5 | *
|
---|
6 | * PUT COPYRIGHT NOTICE HERE
|
---|
7 | *
|
---|
8 | * $Id: pageaction.cpp 261 1999-06-08 04:29:42Z sjboddie $
|
---|
9 | *
|
---|
10 | *********************************************************************/
|
---|
11 |
|
---|
12 | /*
|
---|
13 | $Log$
|
---|
14 | Revision 1.5 1999/06/08 04:29:35 sjboddie
|
---|
15 | added argsinfo to the call to check_cgiargs to make it easy to set
|
---|
16 | args to their default if they're found to be screwed up
|
---|
17 |
|
---|
18 | Revision 1.4 1999/02/28 20:00:14 rjmcnab
|
---|
19 |
|
---|
20 |
|
---|
21 | Fixed a few things.
|
---|
22 |
|
---|
23 | Revision 1.3 1999/02/25 21:58:58 rjmcnab
|
---|
24 |
|
---|
25 | Merged sources.
|
---|
26 |
|
---|
27 | Revision 1.2 1999/02/21 22:33:54 rjmcnab
|
---|
28 |
|
---|
29 | Lots of stuff :-)
|
---|
30 |
|
---|
31 | Revision 1.1 1999/02/12 02:40:17 sjboddie
|
---|
32 |
|
---|
33 | Added page action
|
---|
34 |
|
---|
35 | */
|
---|
36 |
|
---|
37 |
|
---|
38 | #include "pageaction.h"
|
---|
39 | #include "receptionist.h"
|
---|
40 |
|
---|
41 |
|
---|
42 | pageaction::pageaction () {
|
---|
43 | // this action uses cgi variables "a" and "p"
|
---|
44 | cgiarginfo arg_ainfo;
|
---|
45 | arg_ainfo.shortname = "a";
|
---|
46 | arg_ainfo.longname = "action";
|
---|
47 | arg_ainfo.multiplechar = true;
|
---|
48 | arg_ainfo.defaultstatus = cgiarginfo::weak;
|
---|
49 | arg_ainfo.argdefault = "p";
|
---|
50 | arg_ainfo.savedarginfo = cgiarginfo::must;
|
---|
51 | argsinfo.addarginfo (NULL, arg_ainfo);
|
---|
52 |
|
---|
53 | arg_ainfo.shortname = "p";
|
---|
54 | arg_ainfo.longname = "page";
|
---|
55 | arg_ainfo.multiplechar = true;
|
---|
56 | arg_ainfo.defaultstatus = cgiarginfo::weak;
|
---|
57 | arg_ainfo.argdefault = "about";
|
---|
58 | arg_ainfo.savedarginfo = cgiarginfo::can;
|
---|
59 | argsinfo.addarginfo (NULL, arg_ainfo);
|
---|
60 | }
|
---|
61 |
|
---|
62 | pageaction::~pageaction () {
|
---|
63 | }
|
---|
64 |
|
---|
65 | bool pageaction::check_cgiargs (cgiargsinfoclass &/*argsinfo*/, cgiargsclass &/*args*/,
|
---|
66 | ostream &/*logout*/) {
|
---|
67 | // don't want to check anything yet.
|
---|
68 | return true;
|
---|
69 | }
|
---|
70 |
|
---|
71 | void pageaction::get_cgihead_info (cgiargsclass &/*args*/, response_t &response,
|
---|
72 | text_t &response_data, ostream &/*logout*/) {
|
---|
73 | response = content;
|
---|
74 | response_data = "text/html";
|
---|
75 | }
|
---|
76 |
|
---|
77 | bool pageaction::do_action (cgiargsclass &args, recptproto */*collectproto*/,
|
---|
78 | displayclass &disp, outconvertclass &outconvert,
|
---|
79 | ostream &textout, ostream &/*logout*/) {
|
---|
80 |
|
---|
81 | text_t &arg_p = args["p"];
|
---|
82 |
|
---|
83 | textout << outconvert << disp << ("_" + arg_p + ":header_\n")
|
---|
84 | << ("_" + arg_p + ":imagestandardbar_\n") << ("_" + arg_p + ":content_\n")
|
---|
85 | << ("_" + arg_p + ":footer_\n");
|
---|
86 |
|
---|
87 | return true;
|
---|
88 | }
|
---|