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 "htmlbrowserclass.h"
|
---|
27 | #include <assert.h>
|
---|
28 | #include "OIDtools.h"
|
---|
29 |
|
---|
30 | htmlbrowserclass::htmlbrowserclass () {
|
---|
31 | }
|
---|
32 |
|
---|
33 | htmlbrowserclass::~htmlbrowserclass () {
|
---|
34 | }
|
---|
35 |
|
---|
36 | // returns the name that specifies the browserclass type
|
---|
37 | text_t htmlbrowserclass::get_browser_name () {
|
---|
38 | return "HTML";
|
---|
39 | }
|
---|
40 |
|
---|
41 | // redirect to html page
|
---|
42 | void htmlbrowserclass::processOID (cgiargsclass &args, recptproto *collectproto,
|
---|
43 | ostream &logout) {
|
---|
44 |
|
---|
45 | // should only reach here from within a classification
|
---|
46 | if (!args["d"].empty()) return;
|
---|
47 | if (args["cl"].empty()) return;
|
---|
48 |
|
---|
49 | FilterRequest_t request;
|
---|
50 | FilterResponse_t response;
|
---|
51 | comerror_t err;
|
---|
52 | request.filterName = "NullFilter";
|
---|
53 | request.filterResultOptions = FROID;
|
---|
54 | request.docSet.push_back (args["cl"] + ".fc");
|
---|
55 | collectproto->filter (args["c"], request, response, err, logout);
|
---|
56 |
|
---|
57 | if (err != noError || response.docInfo[0].OID.empty()) return;
|
---|
58 |
|
---|
59 | // redirect to html page
|
---|
60 | args["a"] = "p";
|
---|
61 | args["p"] = "html";
|
---|
62 | args["hp"] = response.docInfo[0].OID;
|
---|
63 | }
|
---|