1 | /**********************************************************************
|
---|
2 | *
|
---|
3 | * htmlbrowserclass.cpp --
|
---|
4 | * Copyright (C) 1999 The New Zealand Digital Library Project
|
---|
5 | *
|
---|
6 | * A component of the Greenstone digital library software
|
---|
7 | * from the New Zealand Digital Library Project at the
|
---|
8 | * University of Waikato, New Zealand.
|
---|
9 | *
|
---|
10 | * This program is free software; you can redistribute it and/or modify
|
---|
11 | * it under the terms of the GNU General Public License as published by
|
---|
12 | * the Free Software Foundation; either version 2 of the License, or
|
---|
13 | * (at your option) any later version.
|
---|
14 | *
|
---|
15 | * This program is distributed in the hope that it will be useful,
|
---|
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
18 | * GNU General Public License for more details.
|
---|
19 | *
|
---|
20 | * You should have received a copy of the GNU General Public License
|
---|
21 | * along with this program; if not, write to the Free Software
|
---|
22 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
23 | *
|
---|
24 | *********************************************************************/
|
---|
25 |
|
---|
26 | #include "gsdl_modules_cfg.h"
|
---|
27 | #ifdef GSDL_USE_HTML_BROWSER
|
---|
28 |
|
---|
29 | #include "htmlbrowserclass.h"
|
---|
30 | #include <assert.h>
|
---|
31 | #include "OIDtools.h"
|
---|
32 |
|
---|
33 | htmlbrowserclass::htmlbrowserclass () {
|
---|
34 | }
|
---|
35 |
|
---|
36 | htmlbrowserclass::~htmlbrowserclass () {
|
---|
37 | }
|
---|
38 |
|
---|
39 | // returns the name that specifies the browserclass type
|
---|
40 | text_t htmlbrowserclass::get_browser_name () {
|
---|
41 | return "HTML";
|
---|
42 | }
|
---|
43 |
|
---|
44 | browserclass* htmlbrowserclass::clone()
|
---|
45 | {
|
---|
46 | return new htmlbrowserclass();
|
---|
47 | }
|
---|
48 |
|
---|
49 | // redirect to html page
|
---|
50 | void htmlbrowserclass::processOID (cgiargsclass &args, recptproto *collectproto,
|
---|
51 | ostream &logout) {
|
---|
52 |
|
---|
53 | // should only reach here from within a classification
|
---|
54 | if (!args["d"].empty()) return;
|
---|
55 | if (args["cl"].empty()) return;
|
---|
56 |
|
---|
57 | FilterRequest_t request;
|
---|
58 | FilterResponse_t response;
|
---|
59 | comerror_t err;
|
---|
60 | request.filterName = "NullFilter";
|
---|
61 | request.filterResultOptions = FROID;
|
---|
62 | request.docSet.push_back (args["cl"] + ".fc");
|
---|
63 | collectproto->filter (args["c"], request, response, err, logout);
|
---|
64 |
|
---|
65 | if (err != noError || response.docInfo[0].OID.empty()) return;
|
---|
66 |
|
---|
67 | // redirect to html page
|
---|
68 | args["a"] = "p";
|
---|
69 | args["p"] = "html";
|
---|
70 | args["hp"] = response.docInfo[0].OID;
|
---|
71 | }
|
---|
72 |
|
---|
73 | #endif //GSDL_USE_HTML_BROWSER
|
---|