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