Changeset 30659

Show
Ignore:
Timestamp:
02.08.2016 16:24:56 (3 years ago)
Author:
ak19
Message:

Forgot to only do set- and remove-metadata operations synchronously since the results need to come back in sequence internally, while get-metadata operations can be asynchronous.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/js/javascript-global-functions.js

    r30617 r30659  
    424424function callMetadataServer(callingFunction, url, responseFunction) 
    425425{ 
     426    var async_setting = true; // Internal processing of 'read' operations (get meta) is not order dependent 
     427 
    426428    // If doing set- or remove- (not get-) metadata, then rewrite URLs to call GS2Construct's ModfiyMetadata service instead (which will ensure this only works when authenticated).  
    427429    // From: 
     
    436438    url = url.replace(/(&|\?)([^=]*=)/g, "$1"+"s1.$2"); // prefix param names with "s1." 
    437439    url = url.replace("cgi-bin/metadata-server.pl?",  gs.xsltParams.library_name + "?a=g&rt=r&ro=1&s=ModifyMetadata&"); 
    438     console.log("@@@@@ URL is " + url); 
     440     
     441    //console.log("@@@@@ URL is " + url); 
     442 
     443    async_setting = false; // for 'write' operations (set/remove meta), we force sequential processing of the internal operation. 
     444 
    439445    } // otherwise, such as for get- metadata operation, we proceed as before, which will not require authentication 
    440      
    441     $.ajax(url, {async: false}) 
     446 
     447 
     448    $.ajax(url, {async: async_setting}) 
    442449    .success(function(response) 
    443450    {