Changeset 12019


Ignore:
Timestamp:
2006-07-05T16:32:09+12:00 (18 years ago)
Author:
davidb
Message:

Minor improvements to depositor action.

Location:
trunk/gsdl/src/recpt
Files:
2 edited

Legend:

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

    r12008 r12019  
    318318
    319319   
    320    /* TO BE DELETED WHEN I'M SURE ITS NOT NEEDED
     320   /* ***** TO BE DELETED WHEN I'M SURE ITS NOT NEEDED
    321321   //obtain fields from form
    322322   // Iterate through the vector, and store in args     
     
    336336    args["di1lastpage"] = "0";
    337337
    338     // assign (and create) a temporary directory
    339     // This will create a new tbuild directory every time
    340     // the user goes back to select a new collection.
    341     // It causes no problems except wasted space.
    342     // Should be addressed in the future
     338    // assign (and create) a temporary directory This will create a new
     339    // tbuild directory every time the user goes back to select a new
     340    // collection.  It causes no problems except wasted space.  Should be
     341    // addressed in the future
    343342    if (assign_tmpname (args, logout)==false) {
    344343      // there was an error creating the tmp dir
     
    506505  }
    507506
    508   if(depositor_page == "bildcancel"){
     507  if ((depositor_page == "bildcancel") || (depositor_page == "bildfail")) {
    509508
    510509
     
    558557  }
    559558  disp.setmacro ("depositorbar", "depositor", depositorbar);
     559
     560  if (depositor_page == "bildfail") {
     561    text_t textfailmsg = "_textfailmsg";
     562    textfailmsg.push_back(failcode);
     563    textfailmsg.push_back('_');
     564    disp.setmacro("textfailmsg", "depositor", textfailmsg);
     565
     566    text_t bldlog = filename_cat(gsdlhome, "tmp", args["di1tmp"], args["di1dirname"] + ".bld");
     567    text_t rawlog = file_tail (bldlog, 6, 0);
     568    // we'll shove in some <br> tags where \n's occur
     569    text_t faillog;
     570    text_t::const_iterator here = rawlog.begin();
     571    text_t::const_iterator end = rawlog.end();
     572    while (here != end) {
     573      if (*here == '\n') faillog += "<br>";
     574      faillog.push_back (*here);
     575      ++here;
     576    }
     577    disp.setmacro ("faillog", "depositor", dm_safe(faillog));
     578  }
     579
     580
     581
    560582}
    561583
     
    610632  text_t stepstring = substr(here,here+4);
    611633
    612   if (depositor_page == "select" || stepstring == "step") {
     634  if ((depositor_page == "select") || (stepstring == "step")) {
    613635          textout << outconvert << disp << ("_depositor:header_\n")
    614636          << ("_depositor:" + depositor_page + "content_\n")
     
    655677
    656678
     679      cerr << "*** filename = " << filename_textt << endl;
     680
    657681      //write the metadata file
    658682      write_metadata_file(args, filename_textt, timestamp_str);
     
    674698  }
    675699
    676 
    677700  if (message.empty()) {
     701
    678702    if (depositor_page != "bild" && stepstring != "step" && depositor_page != "select") {
    679703      // output page ("bild" page was already output above)
     
    708732    metadata_file += "        <FileName>";
    709733
    710     //split the filename
    711     char* filename_front = strtok(filename_str.getcstr(),".");
    712     char* filename_end = strtok(NULL, ".");
    713 
    714     metadata_file += filename_front;
    715     metadata_file += "\\.";
    716     metadata_file += filename_end;
     734    // Generate 'regular expression' save version of filename
     735    // for now that means escaping any '.' characters
     736    // consider generalising as function in gsdltools.h/cpp?
     737
     738    text_t filename_re;
     739    text_t::const_iterator here = filename_str.begin();
     740    text_t::const_iterator end = filename_str.end();
     741    while (here != end) {
     742      if (*here == '.') {
     743    filename_re.push_back('\\');
     744      }
     745
     746      filename_re.push_back(*here);
     747      ++here;
     748    }
     749
     750    metadata_file += filename_re;
     751
    717752    metadata_file += "</FileName>\n";
    718753    metadata_file += "        <Description>\n";
  • trunk/gsdl/src/recpt/wizardaction.cpp

    r11998 r12019  
    342342  if (!mk_dir (fulltmpdir)) {
    343343    outconvertclass text_t2ascii;
    344     logout << text_t2ascii << "collectoraction::assign_tmpname unable to create directory ("
     344    logout << text_t2ascii << "wizardaction::assign_tmpname unable to create directory ("
    345345       << fulltmpdir << ")\n";
    346346    return false;
Note: See TracChangeset for help on using the changeset viewer.