Changeset 22285 for main/trunk/greenstone2/runtime-src/src
- Timestamp:
- 2010-06-23T13:52:02+12:00 (14 years ago)
- Location:
- main/trunk/greenstone2/runtime-src/src/oaiservr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/runtime-src/src/oaiservr/oaitools.cpp
r20589 r22285 45 45 * that use ':' instead. 46 46 */ 47 void oaiclassifier::toOAI(const text_t repos_id, const text_t &collection, text_t &classifier) 48 { 49 50 text_t tmp = "oai:"; 51 tmp.append(repos_id); 52 tmp.append(":"); 53 tmp.append(collection); 54 toOAI(tmp, classifier); 55 56 } 57 58 /** 59 * Called to convert GS classifier/document identifiers that use 60 * a '.' to separate levels in the hierarchy into OAI identifiers 61 * that use ':' instead. 62 */ 47 63 void oaiclassifier::toOAI(const text_t &collection, text_t &classifier) 48 64 { … … 56 72 57 73 classifier = tmp; 74 } 75 76 void oaiclassifier::getCollectionFromOAIID(const text_t oai_id, text_t &collection_id) { 77 78 // id is like oai:repos-id:collection:OID, we just want the collection bit 79 80 text_t::const_iterator begin = oai_id.begin(); 81 text_t::const_iterator end = oai_id.end(); 82 text_t::const_iterator colon = findchar(begin, end, ':'); // 1 83 if (colon != end) { 84 colon = findchar(colon+1, end, ':'); // 2 85 } 86 text_t::const_iterator third_colon; 87 if (colon !=end) { 88 third_colon = findchar(colon+1, end, ':'); 89 } 90 if (third_colon != end) { 91 collection_id = substr(colon+1, third_colon); 92 } 58 93 } 59 94 -
main/trunk/greenstone2/runtime-src/src/oaiservr/oaitools.h
r15414 r22285 11 11 ostream &logout); 12 12 static void toOAI(const text_t &collection, text_t &classifier); 13 static void toOAI(const text_t repos_id, const text_t &collection, text_t &classifier); 13 14 static void toGSDL(text_t &collection, text_t &classifier); 15 static void getCollectionFromOAIID(const text_t oai_id, text_t &collection_id); 14 16 private: 15 17 static void swapColonsAndPeriods(text_t &classifier);
Note:
See TracChangeset
for help on using the changeset viewer.