Changeset 23523 for main/branches


Ignore:
Timestamp:
01/05/11 09:18:04 (10 years ago)
Author:
sjm84
Message:

Merging the latest trunk changes into this branch

Location:
main/branches/64_bit_Greenstone/greenstone2
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • main/branches/64_bit_Greenstone/greenstone2

  • main/branches/64_bit_Greenstone/greenstone2/cgi-bin/talkback-progressbar.pl

    r23183 r23523  
    230230    my $jar_dir= &util::filename_cat($gsdl_home, "bin", "java");
    231231    my $java_classpath = &util::filename_cat($jar_dir,"GLIServer.jar");
     232
     233    if (!-f $java_classpath) {
     234    my $progname = $0;
     235    $progname =~ s/^.*[\/\\]//;
     236    my $mess = "$progname:\nFailed to find $java_classpath\n";
     237    $gsdl_cgi->generate_error($mess);
     238    }
    232239
    233240    my $java_args = "\"$zip_filename\" \"$import_dir\"";
     
    428435
    429436    my $wait_dots = inc_wait_dots();
    430     my $html = "$wait_dots<br>";
     437    my $dots_html = "Waiting for transfer: $wait_dots<br>";
    431438
    432439    my $filename = $gsdl_cgi->param('uploadedfile');
    433440
     441    my $inner_html;
     442
    434443    if ((defined $filename) && ($filename ne "")) {
    435     $html .= check_status_single_file($filename);
     444    $inner_html = check_status_single_file($filename);
    436445    }
    437446    else {
    438     $html .= check_status_all();
    439     }
     447    $inner_html = check_status_all();
     448    }
     449
     450    my $html = ($inner_html ne "") ? $inner_html : $dots_html;
    440451
    441452    return $html;
  • main/branches/64_bit_Greenstone/greenstone2/cgi-bin/talkback-transfer.pl

    r23482 r23523  
    9393    my $java_classpath = &util::filename_cat($jar_dir,"GLIServer.jar");
    9494
     95    if (!-f $java_classpath) {
     96    my $progname = $0;
     97    $progname =~ s/^.*[\/\\]//;
     98    my $mess = "$progname:\nFailed to find $java_classpath\n";
     99    $gsdl_cgi->generate_error($mess);
     100    }
     101
    95102    my $zip_file = "$collect-$timestamp.zip";
    96103    my $zip_file_path = &util::filename_cat($archive_dir,$zip_file);
  • main/branches/64_bit_Greenstone/greenstone2/macros/authen.dm

    r22560 r23523  
    1111_content_ {
    1212<br><br><br><br>
    13 <form name="login" method="post" action="_gwcgi_">
     13_If_("_activateweb20_" eq "1",
     14  <form name="login" method="get" action="_gwcgi_">
     15,
     16  <form name="login" method="post" action="_gwcgi_">
     17)
    1418<input type=hidden name="e" value="_If_(_cgiarger_,_cgiarger_,_decodedcompressedoptions_)">
    1519_hiddenargs_
  • main/branches/64_bit_Greenstone/greenstone2/macros/english.dm

    r22051 r23523  
    7575_textdescrhelp_ {Help page}
    7676_textdescrpref_ {Preferences page}
     77_textdescrlogin_ {Login page}
     78_textdescrlogout_ {Logout as _cgiargun_}
     79
    7780_textdescrgreenstone_ {Greenstone Digital Library Software}
    7881_textdescrusab_ {What did you find hard to use?}
     
    211214_linktextHELP_ {HELP}
    212215_linktextPREFERENCES_ {PREFERENCES}
     216_linktextLOGIN_ {LOGIN}
     217_linktextLOGGEDIN_ {(logged in as _cgiargun_)}
     218_linktextLOGOUT_ {LOGOUT}
    213219
    214220
  • main/branches/64_bit_Greenstone/greenstone2/macros/nav_css.dm

    r20611 r23523  
    1414#######################################################################
    1515
    16 _globallinks_ {_If_("_cgiargu_" ne "1",_homelink_) _helplink_ _preflink_}
    17 _homelink_ {_navtaborig_(_httppagehome_,_linktextHOME_,_textdescrhome_)}
    18 _helplink_ {_navtaborig_(_httppagehelp_,_linktextHELP_,_textdescrhelp_)}
    19 _preflink_ {_navtaborig_(_httppagepref_,_linktextPREFERENCES_,_textdescrpref_)}
     16_globallinks_ {_If_("_cgiargu_" ne "1",_homelink_) _helplink_ _preflink__optloginlink_}
     17_homelink_  {_navtaborig_(_httppagehome_,_linktextHOME_,_textdescrhome_)}
     18_helplink_  {_navtaborig_(_httppagehelp_,_linktextHELP_,_textdescrhelp_)}
     19_preflink_  {_navtaborig_(_httppagepref_,_linktextPREFERENCES_,_textdescrpref_)}
     20
     21_optloginlink_ {
     22  _If_("_activateweb20_" >= "1",_If_("x_cgiargun__cgiarguan_" ne "x1",_loginlink_))
     23}
     24
     25_loginlink_ {
     26
     27    _If_(_cgiargun_,
     28      _navtablogoutorig_(_linktextLOGOUT_,_textdescrlogout_) _linktextLOGGEDIN_
     29      <script type="text/javascript">
     30        appendUsernameArgs("logout","uan=&un=")
     31      </script>
     32    ,
     33      _navtabloginorig_(_linktextLOGIN_,_textdescrlogin_)
     34      <script type="text/javascript">
     35        appendUsernameArgs("login","uan=1")
     36      </script>
     37    )
     38}
    2039
    2140
     
    4160# 4. optional "selected" or not if it is the current tab
    4261_navtaborig_ {<a _If_("_4_" eq "selected",class="navlink_sel">_2_,class="navlink" href="_1_" title="_3_">_2_)</a>}
     62
     63# same sa above, but without _1_ as there is no hyperlink to go to (want to say on the same page)
     64_navtabloginorig_ {<a _If_("_3_" eq "selected",class="navlink_sel postit">_1_,class="navlink postit" id="login" href="" title="_2_">_1_)</a>}
     65
     66# same sa above, but without _1_ as there is no hyperlink to go to (want to say on the same page)
     67_navtablogoutorig_ {<a _If_("_3_" eq "selected",class="navlink_sel postit">_1_,class="navlink postit" id="logout" href="" title="_2_">_1_)</a>}
    4368
    4469# parameters are
  • main/branches/64_bit_Greenstone/greenstone2/macros/seaweed.dm

    r23502 r23523  
    11package Global
    22
    3 _seaweed_ {
     3_seaweedscript_ {
    44
    55
     
    2727
    2828<script type="text/javascript" src="_httpscript_/seaweed.js"></script>
    29 <script type="text/javascript" src="_httpscript_/gsajaxapi.js"></script>
    3029
    3130
     
    126125
    127126  window.onload=function()\{
    128 //      try \{
     127      try \{
    129128      de.init();
    130129      if (window.addEventListener) \{
     
    141140       \});
    142141       
    143 /*      \}
     142      \}
    144143      catch(err) \{
    145144        alert("SeaWeed failed to initialise: " + err.message);
    146145      \}
    147 */
    148146  \}
    149147
     
    197195
    198196
     197   
     198  function seaweedReindexCollection() \{
     199    var arc = document.getElementById("seaweedRC");
     200    arc.innerHTML = "reindexing ...";
     201    gsapi.reindexCollection("incremental",seaweedReindexCallback);
     202  \}
     203
     204  function seaweedReindexCallback(xmlHttp) \{
     205    var arc = document.getElementById("seaweedRC");
     206    arc.innerHTML = "reindexing done.";
     207  \}           
     208   
     209
    199210</script>
    200211
    201 
    202212}
     213
     214_first-metadata-spanwrap_ {<span metapos="0" metaname="_1_" docoid="_2_" class="editable-metadata">}
     215_/first-metadata-spanwrap_ {</span>}
     216
     217_first-metadata-divwrap_ {<div metapos="0" metaname="_1_" docoid="_2_" class="editable-metadata">}
     218_/first-metadata-divwrap_ {</div>}
  • main/branches/64_bit_Greenstone/greenstone2/macros/style.dm

    r23501 r23523  
    151151<div class="bannerextra">_pagebannerextra_</div>
    152152<!-- end of page banner -->
    153 _If_("_cgiargtalkback_" eq "1",_talkback:uploadForm_)
     153_If_("_activateweb20_" eq "2",
     154  _If_("_activatetalkback_" eq "1",_talkback:uploadForm_)
     155)
    154156}
    155157
     
    162164<p>
    163165<!-- end of page banner -->
    164 _If_("_cgiargtalkback_" eq "1",_talkback:uploadForm_)
     166_If_("_activateweb20_" eq "2",
     167  _If_("_activatetalkback_" eq "1",_talkback:uploadForm_)
     168)
    165169}
    166170
     
    191195}
    192196
     197_loginscript_ {
     198   function appendUsernameArgs(id,addOn)
     199   \{
     200     var a=document.getElementById(id);
     201     var url = a.getAttribute("href");
     202     if (url == "") \{
     203       url = document.location.toString();
     204     \}
     205
     206     //alert("url before = " + url);
     207
     208     // clear out any earlier user name/authentication values
     209     url = url.replace(/(&|\\\\?)uan=\\d\{0,1\}/g,"");
     210     url = url.replace(/(&|\\\\?)un=[a-z0-9:\\-]*/g,"");
     211     url = url.replace(/(&|\\\\?)pw=[a-z0-9:\\-]*/g,"");
     212
     213     //alert("url after = " + url);
     214
     215     var gwcgi = "_gwcgi_";
     216
     217     var tailUrl = url.substr(url.length-gwcgi.length);
     218
     219     url += (tailUrl == "_gwcgi_") ? "?" : "&";
     220     url += addOn;
     221
     222     //alert("url with add on = " + url);
     223
     224     a.setAttribute("href",url);
     225   \}
     226}
     227
     228
    193229# imagescript only used in nav_ns4.dm
    194230_globalscripts_{
    195 
    196 _If_("_activateseaweed_" eq "1",_seaweed_)
     231_If_("_activateweb20_" eq "2",
     232  <script type="text/javascript" src="_httpscript_/gsajaxapi.js"></script>
     233  _If_("_activateseaweed_" eq "1",_seaweedscript_)
     234  _If_("_activatetalkback_" eq "1",_talkbackscript_)
     235)
    197236_If_(_pagescriptfileextra_,_pagescriptfileextra_)
    198237<script language="javascript" type="text/javascript">
     238_loginscript_
    199239_If_(_pagescriptextra_,_pagescriptextra_)
    200240_collectionspecificscript_
     
    205245
    206246_globalscripts_ [v=1] {
     247_If_("_activateweb20_" eq "2",
     248  <script type="text/javascript" src="_httpscript_/gsajaxapi.js"></script>
     249  _If_("_activateseaweed_" eq "1",_seaweedscript_)
     250  _If_("_activatetalkback_" eq "1",_talkbackscript_)
     251)
     252_If_(_pagescriptfileextra_,_pagescriptfileextra_)
    207253<script language="javascript" type="text/javascript">
    208254<!--
     255_loginscript_
    209256_If_(_cgiargx_,_scriptdetach_)
    210 _pagescriptextra_
     257_If_(_pagescriptextra_,_pagescriptextra_)
    211258_collectionspecificscript_
    212259// -->
  • main/branches/64_bit_Greenstone/greenstone2/macros/talkback.dm

    r23187 r23523  
     1package Global
     2
     3# Currently nothing in talkbackscript
     4_talkbackscript_ {
     5}
     6
     7
    18package talkback
    29
    3 # The following values are typically set in <gsdlhome>/macro/extra.dm
    4 _talkfromcgi_ {}
    5 _talktocgi_   {}
     10# The following values are typically set in <gsdlhome>/macro/zextra.dm
     11# They are left commented out here so the error log does not get swamped
     12# with 'redefined' warning
     13#_talkfromcgi_ {}
     14#_talktocgi_   {}
    615
    716_talktoCollect_   {}
     
    1423_talktoLibrary_ {_talktocgi_/library.cgi}
    1524_talktoUpload_  {_talktocgi_/talkback-progressbar.pl}
     25
    1626
    1727
     
    3141    </form>
    3242
     43    <div id="talktoProgressBar" style="display: block;">
     44      <iframe style="float: top;" width="600" height="100" frameborder="0"
     45         src="_talktoUpload_">
     46      </iframe>
     47    </div>
     48
     49
    3350   <script type="text/javascript">
     51
     52
     53     function talktoProgressBarHide(oid)
     54     \{
     55
     56         var ttpb = document.getElementById("talktoProgressBar");
     57     ttpb.style.display = "none";
     58     \}
     59
    3460     
    3561     function talkbackUploadSubmit(oid)
    3662     \{
     63         var ttpb = document.getElementById("talktoProgressBar");
     64     ttpb.style.display = "block";
     65
     66     //if (window.addEventListener) \{
     67     //    window.addEventListener('beforeunload',talktoProgressBarHide,true);
     68         //\}
     69     //else \{
     70     //    window.attachEvent('onbeforeunload',talktoProgressBarHide);
     71     //\}
     72
     73     //alert("away to submit");
     74
    3775         var uploadForm = document.uploadForm;
    3876         uploadForm.oid.value = oid;
  • main/branches/64_bit_Greenstone/greenstone2/perllib/unicode.pm

    r23387 r23523  
    633633    if ((defined $and_numeric_entities) && ($and_numeric_entities)) {
    634634    $text =~ s/\&\#x([0-9A-F]+);/pack('C', hex($1))/ige;
    635     $text =~ s/\&\#([0-9]+);/pack('C', $1)/ige;
     635    $text =~ s/\&\#u?([0-9]+);/pack('C', $1)/ige;
    636636    }
    637637
     
    764764    = map { $_ > 255 ?                  # Needs to be represent in entity form
    765765            sprintf("&#x%X;",$_) : 
    766             $_ > 128 ?              # Representable in %XX form
     766            $_>128 || $_==ord("%") ?              # Representable in %XX form
    767767            sprintf("%%%2X", $_) : 
    768768            chr($_)                 # otherwise, Ascii char
  • main/branches/64_bit_Greenstone/greenstone2/runtime-src/src/recpt/formattools.cpp

    r23305 r23523  
    3333#include <assert.h>
    3434
    35 static bool metadata_spanwrap = false;
     35static bool metadata_wrap = false;
     36static text_t metadata_wrap_type = "";
    3637
    3738// a few function prototypes
     
    694695    formatlistptr->command = comEndMetadataSpanWrap;
    695696
     697  else if (meta == "metadata-divwrap")
     698    formatlistptr->command = comMetadataDivWrap;
     699
     700  else if (meta == "/metadata-divwrap")
     701    formatlistptr->command = comEndMetadataDivWrap;
     702
    696703  else if (meta == "Summary")
    697704    formatlistptr->command = comSummary;
     
    980987
    981988
    982 static text_t spanwrap_metatext(const text_t& metatext, const text_t& OID,
     989static text_t wrap_metatext(const text_t& metatext, const text_t& OID,
    983990                const text_t metaname, int metapos=-1)
    984991{
    985992
    986   text_t tag_type = (metaname == "Text") ? "div" : "span";
     993  text_t tag_type = metadata_wrap_type;
    987994  text_t editable_type = (metaname == "Text") ? "text" : "metadata";
    988995
     
    10921099      }
    10931100
    1094       if (metadata_spanwrap) {
    1095     fresh_metatext = spanwrap_metatext(fresh_metatext,OID,meta.metaname,i);
     1101      if (metadata_wrap) {
     1102    fresh_metatext = wrap_metatext(fresh_metatext,OID,meta.metaname,i);
    10961103      }
    10971104      formatted_metatext += fresh_metatext;
     
    11711178    }
    11721179
    1173     if (metadata_spanwrap) {
    1174       fresh_metatext = spanwrap_metatext(fresh_metatext,OID,meta.metaname,position);
     1180    if (metadata_wrap) {
     1181      fresh_metatext = wrap_metatext(fresh_metatext,OID,meta.metaname,position);
    11751182    }
    11761183
     
    13881395  while (orptr != NULL) {
    13891396
    1390     if (metadata_spanwrap) {
     1397    if (metadata_wrap) {
    13911398      // need to be a bit more careful about this
    1392       // => test for it *without* spanwrap, and if defined, then
    1393       // got back and generate it again, this time with spanwrap on
    1394 
    1395       metadata_spanwrap = false;
     1399      // => test for it *without* spanwrap or divwrap, and if defined, then
     1400      // got back and generate it again, this time with spanwrap/divwrap on
     1401
     1402      metadata_wrap = false;
    13961403      text_t test_tmp = format_string (collection,collectproto,docinfo, disp, orptr,
    13971404                       options, logout);
    1398       metadata_spanwrap = true;
     1405      metadata_wrap = true;
    13991406      if (!test_tmp.empty()) {
    14001407
     
    16651672  if (decision.command == dMeta) {
    16661673
    1667     bool store_metadata_spanwrap = metadata_spanwrap;
    1668     metadata_spanwrap = 0;
    1669 
    1670     // temporarily suspend metadata-spanwrap (if on) so can test if metadata item really exits or not
     1674    bool store_metadata_wrap = metadata_wrap;
     1675    metadata_wrap = 0;
     1676
     1677    // temporarily suspend metadata-XXXwrap (if on) so can test if metadata item really exits or not
    16711678    bool metadata_exists
    16721679      = (get_meta (collection,collectproto,docinfo,disp,decision.meta,options,
    16731680           logout) != "");
    16741681
    1675     metadata_spanwrap = store_metadata_spanwrap;
     1682    metadata_wrap = store_metadata_wrap;
    16761683
    16771684    if (metadata_exists) {
     
    18971904    break;
    18981905     case comMetadataSpanWrap:
    1899         metadata_spanwrap=true; return "";
     1906        metadata_wrap=true;  metadata_wrap_type="span"; return "";
    19001907    break;
    19011908     case comEndMetadataSpanWrap:
    1902     metadata_spanwrap=false; return "";
     1909    metadata_wrap=false; metadata_wrap_type="";     return "";
     1910    break;
     1911     case comMetadataDivWrap:
     1912        metadata_wrap=true;  metadata_wrap_type="div";  return "";
     1913    break;
     1914     case comEndMetadataDivWrap:
     1915    metadata_wrap=false; metadata_wrap_type="";     return "";
    19031916    break;
    19041917     case comIf:
     
    19601973  }
    19611974
    1962   if (metadata_spanwrap) {
    1963     text = spanwrap_metatext(text,docinfo.OID,"Text");
     1975  if (metadata_wrap) {
     1976    text = wrap_metatext(text,docinfo.OID,"Text");
    19641977  }
    19651978
     
    20122025  summary.replace("\n","&#013;");
    20132026
    2014   if (metadata_spanwrap) {
    2015     summary = spanwrap_metatext(summary,docinfo.OID,"Summary");
     2027  if (metadata_wrap) {
     2028    summary = wrap_metatext(summary,docinfo.OID,"Summary");
    20162029  }
    20172030
  • main/branches/64_bit_Greenstone/greenstone2/runtime-src/src/recpt/formattools.h

    r22650 r23523  
    3535        comDoc, comHighlight, comEndHighlight,
    3636        comMetadataSpanWrap, comEndMetadataSpanWrap,
     37        comMetadataDivWrap, comEndMetadataDivWrap,
    3738        comRel, comHref, comSummary,
    3839        comTOC, comImage, comDocumentButtonDetach, comDocumentButtonHighlight,
Note: See TracChangeset for help on using the changeset viewer.