[22739] | 1 | /**********************************************************************
|
---|
| 2 | *
|
---|
| 3 | * oaiconfig.h --
|
---|
| 4 | *
|
---|
| 5 | * Copyright (C) 2004-2010 The New Zealand Digital Library Project
|
---|
| 6 | *
|
---|
| 7 | * A component of the Greenstone digital library software
|
---|
| 8 | * from the New Zealand Digital Library Project at the
|
---|
| 9 | * University of Waikato, New Zealand.
|
---|
| 10 | *
|
---|
| 11 | * This program is free software; you can redistribute it and/or modify
|
---|
| 12 | * it under the terms of the GNU General Public License as published by
|
---|
| 13 | * the Free Software Foundation; either version 2 of the License, or
|
---|
| 14 | * (at your option) any later version.
|
---|
| 15 | *
|
---|
| 16 | * This program is distributed in the hope that it will be useful,
|
---|
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 19 | * GNU General Public License for more details.
|
---|
| 20 | *
|
---|
| 21 | * You should have received a copy of the GNU General Public License
|
---|
| 22 | * along with this program; if not, write to the Free Software
|
---|
| 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
| 24 | *
|
---|
| 25 | *********************************************************************/
|
---|
| 26 |
|
---|
[8182] | 27 | #ifndef _OAICONFIG_H_
|
---|
| 28 | #define _OAICONFIG_H_
|
---|
| 29 |
|
---|
| 30 | #include "cnfgable.h"
|
---|
| 31 |
|
---|
| 32 | #include <map>
|
---|
| 33 |
|
---|
| 34 | class oaicollectconfig {
|
---|
| 35 | public:
|
---|
| 36 | oaicollectconfig(const text_t &collectname) { this->collection = collectname; }
|
---|
| 37 | text_t collection;
|
---|
[22212] | 38 | text_t setName; // A display name for the set (collection)
|
---|
| 39 | text_t setDescription; // A display description for the set (collection)
|
---|
[8182] | 40 | text_tmap fieldMap; // maps from OAI name to GSDL name
|
---|
[27528] | 41 | text_tarray superCollectList; // a list of all super collections this belongs to
|
---|
[8182] | 42 | };
|
---|
| 43 |
|
---|
| 44 | typedef map<text_t, oaicollectconfig *, lttext_t> oaicollectmap;
|
---|
| 45 |
|
---|
[27528] | 46 | class oaisupercollectconfig {
|
---|
| 47 | public:
|
---|
| 48 | oaisupercollectconfig(const text_t &supercollectionname) { this->supercollection = supercollectionname; }
|
---|
| 49 | text_t supercollection;
|
---|
| 50 | text_t setName; // A display name for the set (supercollection)
|
---|
| 51 | text_t setDescription; // A display description for the set (supercollection)
|
---|
| 52 | text_tarray collectionList; // a list of collections contained in this super collection
|
---|
| 53 | };
|
---|
| 54 |
|
---|
| 55 | typedef map<text_t, oaisupercollectconfig *, lttext_t> oaisupercollectmap;
|
---|
| 56 |
|
---|
| 57 |
|
---|
[8182] | 58 | class oaiconfig : configurable {
|
---|
| 59 | public:
|
---|
| 60 | oaiconfig();
|
---|
| 61 | oaiconfig(text_t &gsdlhome, text_t &gsdlcollect);
|
---|
[21455] | 62 | virtual ~oaiconfig();
|
---|
[8303] | 63 | virtual void configure(const text_t &key, const text_tarray &cfgline);
|
---|
| 64 | text_tarray & getCollectionsList() { return this->collectList; }
|
---|
[27528] | 65 | text_tarray & getSuperCollectionsList() { return this->superCollectList; }
|
---|
| 66 | text_tarray & getSuperCollectionCollections(const text_t super_coll) {
|
---|
| 67 | return this->superCollectMap[super_coll]->collectionList;
|
---|
| 68 | }
|
---|
| 69 | text_tarray getSuperCollectionsForThisCollection(const text_t &collection);
|
---|
[18891] | 70 | text_tset & getMetadataSet() { return this->metadataSet; }
|
---|
[8303] | 71 | text_t getMapping(const text_t &collection, const text_t &collectfield);
|
---|
| 72 | text_t getMapping(const text_t &collection, const text_t &collectfield, const text_t &format);
|
---|
| 73 | text_tmap * getInformation() { return &this->infoMap; }
|
---|
[20629] | 74 | text_t getSetName(const text_t &setSpec);
|
---|
| 75 | text_t getSetDescription(const text_t &setSpec);
|
---|
[22212] | 76 | int getOAIVersion();
|
---|
| 77 | int resumeAfter();
|
---|
| 78 | text_t getBaseURL();
|
---|
| 79 | text_t getBaseLibraryURL();
|
---|
| 80 | text_t getBaseDocRoot();
|
---|
[23233] | 81 | text_t getRelativeBaseDocRoot();
|
---|
[22212] | 82 | text_t getRepositoryName();
|
---|
[22284] | 83 | text_t getRepositoryId();
|
---|
| 84 | text_t getRepositoryIdVersion();
|
---|
[22212] | 85 | text_t getMaintainer();
|
---|
[8182] | 86 | private:
|
---|
[18903] | 87 | bool configureCollection(const text_t &gsdlhome, const text_t &collection);
|
---|
[23233] | 88 | text_t generateBaseServerURL();
|
---|
[22284] | 89 | text_t repositoryName; // human readable name
|
---|
| 90 | text_t repositoryId; // unique (among oai servers) domain name or id for the repository
|
---|
| 91 | text_t repositoryIdVersion; // 1.1 or 2.0 for identifier scheme
|
---|
[23233] | 92 | text_t baseServerURL; // URL of web server
|
---|
| 93 | text_t oaiserverPath; // relative path for oaiserver
|
---|
| 94 | text_t libraryPath; //relative path for library.cgi (used for urls to greenstone documents )
|
---|
| 95 | text_t docRootPath; // relative path for gsdl directory (used for urls to source documents and oai xsl )
|
---|
[22212] | 96 | text_t oaiVersion; // The version of OAI running
|
---|
| 97 | int resumptionSize; // The number of items to produce before spitting out a resumptionToken
|
---|
| 98 | text_t maintainer;
|
---|
| 99 |
|
---|
[8303] | 100 | text_tarray collectList; // The list of collections to be taken in hand
|
---|
[18891] | 101 | text_tset metadataSet; // The list of metadata sets to be supported
|
---|
[8182] | 102 | text_tmap infoMap; // Holds the information to be given in the case
|
---|
| 103 | // of an OAI identify request
|
---|
| 104 | oaicollectmap collectMap; // The configuration of collections
|
---|
| 105 | text_t collection; // Used to track which collection is being configured
|
---|
[27528] | 106 | text_tarray superCollectList; //a list of super collections. may be empty
|
---|
| 107 | oaisupercollectmap superCollectMap; // The configuration of the super collections
|
---|
[8182] | 108 | };
|
---|
| 109 | #endif
|
---|
[22286] | 110 |
|
---|
| 111 |
|
---|