Changeset 20917


Ignore:
Timestamp:
2009-11-09T14:16:47+13:00 (14 years ago)
Author:
davidb
Message:

Support through the metadata "allowPrint" added to control whether a realistic book (on an individual basis) can be printed or not

File:
1 edited

Legend:

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

    r17985 r20917  
    14461446    //metadata elements needed by recurse_contents
    14471447    metadata.insert ("Title");
     1448    metadata.insert ("allowPrint");
    14481449    metadata.insert ("haschildren");
    14491450
     
    14721473   
    14731474    //get the title
    1474     textout << outconvert << disp << "<Description>\n<Metadata name=\"Title\">";
     1475    textout << outconvert << disp << "<Description>\n";
     1476
     1477    textout << outconvert << disp << "  <Metadata name=\"Title\">";
    14751478    text_t t_title = section.metadata["Title"].values[0];
     1479
    14761480    //if it is highlighted
    14771481    /*if (highlight == true)
     
    14831487        textout << outconvert << disp << t_title;
    14841488    //}
    1485     textout << outconvert << disp << "</Metadata>\n</Description>\n";
    1486    
     1489
     1490    textout << outconvert << disp << "</Metadata>\n";
     1491
     1492    // if top-level document section, add in allowPrint metadata
     1493    if (is_top(section.OID)) {
     1494      textout << outconvert << disp << "  <Metadata name=\"allowPrint\">";
     1495      text_t t_allowprint = "true";
     1496
     1497      if (section.metadata["allowPrint"].values.size()>0) {
     1498        text_t opt_allowprint = section.metadata["allowPrint"].values[0];
     1499        if (!opt_allowprint.empty()) {
     1500          t_allowprint = opt_allowprint;
     1501        }
     1502      }
     1503
     1504      textout << outconvert << disp << t_allowprint;
     1505      textout << outconvert << disp << "</Metadata>\n";
     1506    }
     1507
     1508    textout << outconvert << disp << "</Description>\n";
     1509
    14871510    //get the text
    14881511    DocumentRequest_t docrequest;
Note: See TracChangeset for help on using the changeset viewer.