1 | /**********************************************************************
|
---|
2 | *
|
---|
3 | * source.cpp --
|
---|
4 | * Copyright (C) 1999 The New Zealand Digital Library Project
|
---|
5 | *
|
---|
6 | * PUT COPYRIGHT NOTICE HERE
|
---|
7 | *
|
---|
8 | * $Id: source.cpp 504 1999-08-31 22:49:27Z rjmcnab $
|
---|
9 | *
|
---|
10 | *********************************************************************/
|
---|
11 |
|
---|
12 | /*
|
---|
13 | $Log$
|
---|
14 | Revision 1.6 1999/08/31 22:49:01 rjmcnab
|
---|
15 | Changes for AIX.
|
---|
16 |
|
---|
17 | Revision 1.5 1999/06/16 02:00:33 sjboddie
|
---|
18 | Few changes to get getParent filter option to return metadata of
|
---|
19 | parents as well as current OID
|
---|
20 |
|
---|
21 | Revision 1.4 1999/05/10 03:43:49 sjboddie
|
---|
22 | lots of changes to lots of files - getting document action going
|
---|
23 |
|
---|
24 | Revision 1.3 1999/04/30 02:00:48 sjboddie
|
---|
25 | lots of stuff to do with getting documentaction working
|
---|
26 |
|
---|
27 | Revision 1.2 1999/04/06 22:20:32 rjmcnab
|
---|
28 | Got browsefilter working.
|
---|
29 |
|
---|
30 | Revision 1.1 1999/03/31 23:43:40 rjmcnab
|
---|
31 | Initial revision
|
---|
32 |
|
---|
33 | */
|
---|
34 |
|
---|
35 |
|
---|
36 | #include "source.h"
|
---|
37 | #include <assert.h>
|
---|
38 |
|
---|
39 |
|
---|
40 | // default constructor does nothing
|
---|
41 | sourceclass::sourceclass () {
|
---|
42 | }
|
---|
43 |
|
---|
44 | // default destructor does nothing
|
---|
45 | sourceclass::~sourceclass () {
|
---|
46 | }
|
---|
47 |
|
---|
48 | // configure should be called once for each configuration line
|
---|
49 | // default does nothing
|
---|
50 | void sourceclass::configure (const text_t &/*key*/, const text_tarray &/*cfgline*/) {
|
---|
51 | }
|
---|
52 |
|
---|
53 | // init should be called after all the configuration is done but
|
---|
54 | // before any other methods are called
|
---|
55 | // default does nothing
|
---|
56 | bool sourceclass::init (ostream &/*logout*/) {
|
---|
57 | return true;
|
---|
58 | }
|
---|
59 |
|
---|
60 |
|
---|
61 | // translate_OID translates OIDs using ".pr", ."fc" etc.
|
---|
62 | bool sourceclass::translate_OID (const text_t &/*OIDin*/, text_t &/*OIDout*/,
|
---|
63 | comerror_t &err, ostream &/*logout*/) {
|
---|
64 | err = noError;
|
---|
65 |
|
---|
66 | return false;
|
---|
67 | }
|
---|
68 |
|
---|
69 |
|
---|
70 | // get_metadata fills out the metadata if possible, if it is not responsable
|
---|
71 | // for the given OID then it will return false.
|
---|
72 | bool sourceclass::get_metadata (const text_t &/*requestParams*/, const text_t &/*refParams*/,
|
---|
73 | bool /*getParents*/, const text_tarray &/*fields*/, const text_t &/*OID*/,
|
---|
74 | MetadataInfo_tarray &metadata, comerror_t &err, ostream &/*logout*/) {
|
---|
75 | metadata.erase(metadata.begin(), metadata.end());
|
---|
76 | err = noError;
|
---|
77 |
|
---|
78 | return false;
|
---|
79 | }
|
---|
80 |
|
---|
81 | bool sourceclass::get_document (const text_t &/*OID*/, text_t &/*doc*/,
|
---|
82 | comerror_t &err, ostream &/*logout*/) {
|
---|
83 | err = noError;
|
---|
84 |
|
---|
85 | return false;
|
---|
86 | }
|
---|
87 |
|
---|
88 |
|
---|
89 | bool operator==(const sourceptr &x, const sourceptr &y) {
|
---|
90 | return (x.s == y.s);
|
---|
91 | }
|
---|
92 |
|
---|
93 | bool operator<(const sourceptr &x, const sourceptr &y) {
|
---|
94 | return (x.s < y.s);
|
---|
95 | }
|
---|
96 |
|
---|
97 |
|
---|
98 | // thesource remains the property of the calling code but
|
---|
99 | // should not be deleted until it is removed from this list.
|
---|
100 | void sourcelistclass::addsource (sourceclass *thesource) {
|
---|
101 | // can't add a source that doesn't exist
|
---|
102 | assert (thesource != NULL);
|
---|
103 | if (thesource == NULL) return;
|
---|
104 |
|
---|
105 | sourceptr sp;
|
---|
106 | sp.s = thesource;
|
---|
107 |
|
---|
108 | sourceptrs.push_back(sp);
|
---|
109 | }
|
---|