source: gs2-extensions/iOS-1.x/trunk/GreenstoneAPI.h@ 22548

Last change on this file since 22548 was 22548, checked in by davidb, 12 years ago

Original version of Greenstone2 app for iPhone/iPod-touch

File size: 2.3 KB
Line 
1#include "fileutil.h"
2#include "nullproto.h"
3#include "collectset.h"
4
5#import <Foundation/NSArray.h>
6#import <UIKit/UIApplication.h>
7
8class GreenstoneAPI
9{
10 public:
11 GreenstoneAPI(UIApplication* toplevelApp);
12 virtual ~GreenstoneAPI();
13
14 bool sanityCheck();
15 NSMutableArray* collectionList();
16 ColInfoResponse_t& collectInfo (const text_t& collection);
17 ColInfoResponse_t& collectInfo (NSString* nscollection);
18
19 void setLanguage(const text_t& lang) { _lang = lang; }
20
21 NSString* collectionmetaValue(ColInfoResponse_t& colinfo, text_t key);
22 NSString* collectionName(ColInfoResponse_t& colinfo);
23
24 NSString* getDocument(NSString* nscollection, NSString* nsgid); // ******
25 NSString* getResolvedDocument(NSString* nscollection, NSString* nsgid);
26
27 NSMutableArray* getMetadata(NSString* nscollection, NSString* nsgid, NSString* nsmetaname);
28 NSString* getMetadataFirst(NSString* nscollection, NSString* nsgid, NSString* nsmetaname);
29 NSString* getMetadataFirst(const text_t& collection, text_t& gid, text_t& metaname);
30
31 NSString* getSrcUrlMetadata(NSString* nscollection, NSString* nsgid);
32
33 NSMutableArray* browseClassifierList(NSString* nscollection, NSString* nsgid);
34 NSMutableArray* browseToplevelList(NSString* nscollection);
35
36 NSMutableArray* query(NSString* nscollection, NSString* nsquery);
37
38
39
40 void alert(NSString* nslevel, NSString* nsmessage);
41 void alert(char* level, char* message);
42 void alert(text_t level, text_t message);
43
44 protected:
45 text_t resolveUrls(const text_t& unresolved, const text_t& collection, const text_t& archivedir);
46 text_t srclinkToUrl(const text_t& srclink, const text_t& collection, const text_t& archivedir);
47
48 bool recurse_contents(const text_t& collection, ResultDocInfo_t& section,
49 text_tset& metadata, text_t& output_text);
50
51
52 void set_queryfilter_options (const text_t& collection, FilterRequest_t &request, const text_t &querystring);
53 NSMutableArray* filterResponseToTitlesList(const text_t& collection, FilterResponse_t &sections);
54 NSMutableArray* search_single_collection (const text_t& collection, const text_t& query);
55
56 protected:
57 UIApplication* _toplevelApp;
58 text_t _lang;
59
60 collectset* _cservers;
61 nullproto* _nproto;
62 text_t _gsdlhome;
63};
64
Note: See TracBrowser for help on using the repository browser.