Ignore:
Timestamp:
2010-12-07T17:05:38+13:00 (13 years ago)
Author:
sjb48
Message:

FormatAction constructs message containing format string that is sent to the collection. The message knows the service, and if it is the browse service, then it also knows the classifer list number.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/oran/js/gui_div.js

    r23360 r23405  
    1111    //console.log(formatStatement);
    1212
     13    // find collection name
     14
     15    var myurl = document.URL;
     16    console.log(myurl);
     17    var first = myurl.indexOf("&c")+3;
     18    var last = myurl.indexOf("&", first);
     19   
     20    var collection_name = myurl.substring(first,last); ///&c=(.*)&/.exec(myurl);
     21    console.log(collection_name);
     22
     23    first = myurl.indexOf("&s")+3;
     24    last = myurl.indexOf("&", first);
     25
     26    var service_name = myurl.substring(first,last);
     27    console.log(service_name);
     28
     29    var classifier_name = null;
     30
     31    if(service_name == "ClassifierBrowse")
     32    {
     33        first = myurl.indexOf("&cl")+4;
     34        last = myurl.indexOf("&", first);
     35
     36        classifier_name = myurl.substring(first,last);
     37        console.log(classifier_name);
     38    }
    1339
    1440    //var myurl = 'http://localhost:8080/greenstone3/format?a=s&sa=s&t='+formatStatement;
     
    1743
    1844    // How do I find out my collection name?
    19 
    20     $.post("http://localhost:8080/greenstone3/format?a=f", {data: formatStatement}, function(data) {
     45    var post_url = "http://localhost:8080/greenstone3/format?a=f&c=" + collection_name +"&s=" + service_name;
     46
     47    if(classifier_name != null)
     48        post_url = post_url + "&cl=" + classifier_name;
     49
     50    $.post(post_url, {data: formatStatement}, function(data) {
    2151        //$('.result').innerHTML = data; //html(data);
    2252        console.log("Success, we have received data");
Note: See TracChangeset for help on using the changeset viewer.