source: main/trunk/greenstone2/runtime-src/src/oaiservr/oaiconfig.h@ 22739

Last change on this file since 22739 was 22739, checked in by mdewsnip, 14 years ago

Added copyright header to runtime-src/src/oaiserver/*.cpp and runtime-src/src/oaiserver/*.h.

  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 KB
Line 
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
27#ifndef _OAICONFIG_H_
28#define _OAICONFIG_H_
29
30#include "cnfgable.h"
31
32#include <map>
33
34class oaicollectconfig {
35 public:
36 oaicollectconfig(const text_t &collectname) { this->collection = collectname; }
37 text_t collection;
38 text_t setName; // A display name for the set (collection)
39 text_t setDescription; // A display description for the set (collection)
40 text_tmap fieldMap; // maps from OAI name to GSDL name
41};
42
43typedef map<text_t, oaicollectconfig *, lttext_t> oaicollectmap;
44
45class oaiconfig : configurable {
46 public:
47 oaiconfig();
48 oaiconfig(text_t &gsdlhome, text_t &gsdlcollect);
49 virtual ~oaiconfig();
50 virtual void configure(const text_t &key, const text_tarray &cfgline);
51 text_tarray & getCollectionsList() { return this->collectList; }
52 text_tset & getMetadataSet() { return this->metadataSet; }
53 text_t getMapping(const text_t &collection, const text_t &collectfield);
54 text_t getMapping(const text_t &collection, const text_t &collectfield, const text_t &format);
55 text_tmap * getInformation() { return &this->infoMap; }
56 text_t getSetName(const text_t &setSpec);
57 text_t getSetDescription(const text_t &setSpec);
58 int getOAIVersion();
59 int resumeAfter();
60 text_t getBaseURL();
61 text_t getBaseLibraryURL();
62 text_t getBaseDocRoot();
63 text_t getRepositoryName();
64 text_t getRepositoryId();
65 text_t getRepositoryIdVersion();
66 text_t getMaintainer();
67 private:
68 bool configureCollection(const text_t &gsdlhome, const text_t &collection);
69
70 text_t repositoryName; // human readable name
71 text_t repositoryId; // unique (among oai servers) domain name or id for the repository
72 text_t repositoryIdVersion; // 1.1 or 2.0 for identifier scheme
73 text_t baseURL; // URL of oaiserver.cgi
74 text_t baseLibraryURL; // URL of library.cgi (used for urls to greenstone documents )
75 text_t baseDocRoot; // Base URL for gsdl directory (used for urls to source documents )
76 text_t oaiVersion; // The version of OAI running
77 int resumptionSize; // The number of items to produce before spitting out a resumptionToken
78 text_t maintainer;
79
80 text_tarray collectList; // The list of collections to be taken in hand
81 text_tset metadataSet; // The list of metadata sets to be supported
82 text_tmap infoMap; // Holds the information to be given in the case
83 // of an OAI identify request
84 oaicollectmap collectMap; // The configuration of collections
85 text_t collection; // Used to track which collection is being configured
86
87};
88#endif
89
90
Note: See TracBrowser for help on using the repository browser.