- Timestamp:
- 2017-05-18T13:46:43+12:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/runtime-src/src/recpt/depositoraction.cpp
r30466 r31687 461 461 text_t cfgfile_name = filename_cat (collecthome, args[macro_prefix + "dirname"], "etc", "collect.cfg"); 462 462 text_t key; 463 text_t params; 463 464 text_tarray cfgline; 464 465 char *cstr = cfgfile_name.getcstr(); … … 467 468 468 469 text_t metadata_str; 470 text_t default_metadata_str; 469 471 if (confin) { 470 472 while (read_cfg_line(confin, cfgline) >= 0) { 471 if (cfgline.size () >= 2) {473 if (cfgline.size () >= 3) { 472 474 key = cfgline[0]; 473 475 if (key == "collectionmeta") { 474 476 if (cfgline[1] == "depositormetadata") { 475 metadata_str = cfgline[2]; 476 477 break; 477 if (cfgline.size() == 3) { 478 // no lang arg 479 default_metadata_str = cfgline[2]; 480 } else { 481 params = cfgline[2]; 482 text_t::const_iterator first=params.begin()+1; 483 text_t::const_iterator last=params.end()-1; 484 params=substr(first, last); 485 // get the lang out of params 486 paramhashtype params_hash; 487 splitparams(params, params_hash); 488 489 text_t lang = params_hash["l"]; 490 if (lang == args["l"]) { 491 metadata_str = cfgline[3]; 492 break; 493 } 494 if (default_metadata_str.empty()) { 495 default_metadata_str = cfgline[3]; 496 } 497 } 478 498 } 479 499 } … … 482 502 } 483 503 confin.close (); 484 504 // use default value if there was one 505 if (metadata_str.empty()) { 506 metadata_str = default_metadata_str; 507 } 508 // if there still isn't one set, use this default setting 485 509 if (metadata_str == "") { 486 510 metadata_str = "{\"name\":\"dc.Title\",\"label\":\"Title\",\"tooltip\":\"dc.Title: A name given to the resource.\",\"type\":\"text\"}, {\"name\":\"dc.Creator\",\"label\":\"Creator\",\"tooltip\":\"dc.Creator: An entity primarily responsible for making the content of the resource.\",\"type\":\"text\"}, {\"name\":\"dc.Description\",\"label\":\"Description\",\"tooltip\":\"dc.Description: An account of the content of the resource.\",\"type\":\"textarea\"}";
Note:
See TracChangeset
for help on using the changeset viewer.