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 165 1999-02-21 22:33:58Z rjmcnab $
|
---|
9 | *
|
---|
10 | *********************************************************************/
|
---|
11 |
|
---|
12 | /*
|
---|
13 | $Log$
|
---|
14 | Revision 1.2 1999/02/21 22:33:54 rjmcnab
|
---|
15 |
|
---|
16 | Lots of stuff :-)
|
---|
17 |
|
---|
18 | Revision 1.1 1999/02/12 02:40:17 sjboddie
|
---|
19 |
|
---|
20 | Added page action
|
---|
21 |
|
---|
22 | */
|
---|
23 |
|
---|
24 |
|
---|
25 | #include "pageaction.h"
|
---|
26 |
|
---|
27 |
|
---|
28 | pageaction::pageaction () {
|
---|
29 | // this action uses cgi variables "a" and "p"
|
---|
30 | cgiarginfo arg_ainfo;
|
---|
31 | arg_ainfo.shortname = "a";
|
---|
32 | arg_ainfo.longname = "action";
|
---|
33 | arg_ainfo.multiplechar = true;
|
---|
34 | arg_ainfo.defaultstatus = cgiarginfo::weak;
|
---|
35 | arg_ainfo.argdefault = "p";
|
---|
36 | arg_ainfo.savedarginfo = cgiarginfo::must;
|
---|
37 | argsinfo.addarginfo (NULL, arg_ainfo);
|
---|
38 |
|
---|
39 | arg_ainfo.shortname = "p";
|
---|
40 | arg_ainfo.longname = "page";
|
---|
41 | arg_ainfo.multiplechar = true;
|
---|
42 | arg_ainfo.defaultstatus = cgiarginfo::weak;
|
---|
43 | arg_ainfo.argdefault = "about";
|
---|
44 | arg_ainfo.savedarginfo = cgiarginfo::can;
|
---|
45 | argsinfo.addarginfo (NULL, arg_ainfo);
|
---|
46 |
|
---|
47 | }
|
---|
48 |
|
---|
49 | pageaction::~pageaction () {
|
---|
50 | }
|
---|
51 |
|
---|
52 | bool pageaction::check_cgiargs (cgiargsclass &/*args*/, ostream &/*logout*/) {
|
---|
53 | // don't want to check anything yet.
|
---|
54 | return true;
|
---|
55 | }
|
---|
56 |
|
---|
57 | void pageaction::get_cgihead_info (cgiargsclass &/*args*/, response_t &response,
|
---|
58 | text_t &response_data, ostream &/*logout*/) {
|
---|
59 | response = content;
|
---|
60 | response_data = "text/html";
|
---|
61 | }
|
---|
62 |
|
---|
63 | bool pageaction::do_action (cgiargsclass &args, outconvertclass &outconvert,
|
---|
64 | recptproto */*collectproto*/, ostream &textout,
|
---|
65 | ostream &/*logout*/) {
|
---|
66 |
|
---|
67 | textout << outconvert << "<html>\n";
|
---|
68 | textout << outconvert << "<head><title>Page action</title></head>\n";
|
---|
69 | textout << outconvert << "<body><h2>Page action</h2>\n";
|
---|
70 | textout << outconvert << "a: " << args["a"] << " p: " << args["p"] << "\n";
|
---|
71 | textout << outconvert << "</body>\n";
|
---|
72 | textout << outconvert << "</html>\n";
|
---|
73 |
|
---|
74 | return true;
|
---|
75 | }
|
---|