Changeset 12943


Ignore:
Timestamp:
2006-09-29T15:32:25+12:00 (18 years ago)
Author:
kjdon
Message:

look for gs.DocumentHeader and DocumentHeader metadata, and if found, set the document:documentheader macro to this value

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/documentaction.cpp

    r12463 r12943  
    709709  //                        to the archivedir metadata element
    710710
     711  // _documentheader_       Custom header info for the specified document
    711712  // must have a valid collection server to continue
    712713
     
    733734
    734735  metadata.insert ("Title");
    735 
     736  metadata.insert ("gs.DocumentHeader");
     737  metadata.insert ("DocumentHeader");
     738 
    736739  bool fulltoc = false;
    737740
     
    788791
    789792      disp.setmacro ("header", "document", "_textheader_");
    790      
    791793      text_tarray pagetitlearray;
    792794      if (!response.docInfo[0].metadata["Title"].values[0].empty())
     
    823825      disp.setmacro ("pagetitle", "document", pagetitle);
    824826
     827      // custom header info
     828      text_t custom_header;
     829      if (is_top (arg_d)) {
     830    custom_header = response.docInfo[0].metadata["gs.DocumentHeader"].values[0];
     831    if (custom_header.empty()) {
     832      // try ex header
     833      custom_header = response.docInfo[0].metadata["DocumentHeader"].values[0];
     834    }
     835      } else {
     836    MetadataInfo_t *parentch = response.docInfo[0].metadata["gs.DocumentHeader"].parent;
     837    while (parentch != NULL) {
     838      custom_header = parentch->values[0];
     839      parentch = parentch->parent;
     840    }
     841    if (custom_header.empty()) {
     842      // try ex header
     843      MetadataInfo_t *parentch = response.docInfo[0].metadata["DocumentHeader"].parent;
     844      while (parentch != NULL) {
     845        custom_header = parentch->values[0];
     846        parentch = parentch->parent;
     847      }
     848    }
     849      }
     850      if (!custom_header.empty()) {
     851    disp.setmacro("documentheader", "document", custom_header);
     852      }
     853   
    825854      if (is_top (arg_d))
    826855    disp.setmacro ("thisOID", displayclass::defaultpackage, dm_safe(response.docInfo[0].metadata["archivedir"].values[0]));
Note: See TracChangeset for help on using the changeset viewer.