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