root/main/trunk/greenstone2/runtime-src/src/colservr/collectset.h @ 21453

Revision 21453, 2.2 KB (checked in by ak19, 10 years ago)

Dr Bainbridge improved some code by adding the helper method collection_is_collect_group().

  • Property svn:keywords set to Author Date Id Revision
Line 
1/************************************************************
2 *
3 * Collection set
4 *
5 ************************************************************/
6
7#ifndef COLLECTSET_H
8#define COLLECTSET_H
9
10#include "collectserver.h"
11#include "cnfgable.h"
12
13#ifdef ENABLE_MG
14#include "mgsearch.h"
15#endif
16#ifdef ENABLE_MGPP
17#include "mgppsearch.h"
18#endif
19#ifdef ENABLE_LUCENE
20#include "lucenesearch.h"
21#endif
22
23class collectset : public configurable
24{
25 protected:
26  collectservermapclass cservers;
27#ifdef ENABLE_MG
28  mgsearchclass         *mgsearch;
29#endif
30#ifdef ENABLE_MGPP
31  mgppsearchclass       *mgppsearch;
32#endif
33#ifdef ENABLE_LUCENE
34  lucenesearchclass     *lucenesearch;
35#endif
36
37  int                   noofservers;
38  text_t                httpdomain;
39  text_t                httpprefix;
40
41 public:
42  collectset(text_t& gsdlhome, text_t& collecthome);
43
44  // this constructor is used by the Firefox Greenstone
45  collectset(text_t& httpprefix_arg);
46
47  // this constructor is used by the local library
48  collectset();
49
50  ~collectset();
51
52  // initialise the collections
53  bool init(ostream &logout);
54
55  // configure all the servers as supplied
56  void configure (const text_t &key, const text_tarray &cfgline);
57
58  // Add/remove collections
59  void add_all_collections (const text_t &gsdlhome, const text_t& collecthome);
60  void remove_all_collections ();
61 
62  void remove_collection (const text_t &collection);
63  void remove_collection (const text_t &collection, ostream& logout);
64
65  void add_collection (const text_t &collection,
66               const text_t &gsdlhome,
67               const text_t& collecthome);
68
69  void add_collection_group(const text_t& collection,
70                const text_t& gsdlhome,
71                const text_t& collecthome);
72
73  void add_all_collection_groups (const text_t& gsdlhome,
74                  const text_t& collecthome);
75
76  // return the total number of servers in the set
77  int size();
78
79  void getCollectionList(text_tarray &collist);
80
81  // return the component map
82  collectservermapclass servers();
83
84  // return an individual collection server
85  collectserver *getCollectServer(const text_t &collection)
86    {
87      return cservers.getcollectserver(collection);
88    }
89
90 protected:
91  bool collection_is_collect_group (const text_t& collect_dir);
92};
93
94#endif
Note: See TracBrowser for help on using the browser.