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

Last change on this file since 23233 was 23233, checked in by kjdon, 13 years ago

changed the url info stored in oai.cfg. Now have one optional field for web server url. Will be automatically generated if not specified. Then there are relative paths for oaiserver, library and doc root.

  • Property svn:keywords set to Author Date Id Revision
File size: 3.7 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 getRelativeBaseDocRoot();
64 text_t getRepositoryName();
65 text_t getRepositoryId();
66 text_t getRepositoryIdVersion();
67 text_t getMaintainer();
68 private:
69 bool configureCollection(const text_t &gsdlhome, const text_t &collection);
70 text_t generateBaseServerURL();
71 text_t repositoryName; // human readable name
72 text_t repositoryId; // unique (among oai servers) domain name or id for the repository
73 text_t repositoryIdVersion; // 1.1 or 2.0 for identifier scheme
74 text_t baseServerURL; // URL of web server
75 text_t oaiserverPath; // relative path for oaiserver
76 text_t libraryPath; //relative path for library.cgi (used for urls to greenstone documents )
77 text_t docRootPath; // relative path for gsdl directory (used for urls to source documents and oai xsl )
78 text_t oaiVersion; // The version of OAI running
79 int resumptionSize; // The number of items to produce before spitting out a resumptionToken
80 text_t maintainer;
81
82 text_tarray collectList; // The list of collections to be taken in hand
83 text_tset metadataSet; // The list of metadata sets to be supported
84 text_tmap infoMap; // Holds the information to be given in the case
85 // of an OAI identify request
86 oaicollectmap collectMap; // The configuration of collections
87 text_t collection; // Used to track which collection is being configured
88
89};
90#endif
91
92
Note: See TracBrowser for help on using the repository browser.