Changeset 23806


Ignore:
Timestamp:
2011-03-23T17:50:58+13:00 (13 years ago)
Author:
davidb
Message:

Addition of two new functions: one that builds a URL to the digital library (including the domain name), and the other for cloning documnts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/web/script/gsajaxapi.js

    r23740 r23806  
    55    var collect_ = collect;
    66
     7
     8    this.fullDomainURL = function(localURL)
     9    {
     10    return window.location.protocol+'//'+window.location.host+localURL;
     11    }
     12
    713    this.apiURL = function(apiProg)
    814    {
     
    3440    {
    3541        return this.apiURL("explode-server.pl");
     42    }
     43
     44    this.myspaceserverURL = function()
     45    {
     46        return this.apiURL("myspace-server.pl");
    3647    }
    3748
     
    125136
    126137   
     138   
     139   
    127140    this.setLiveMetadata = function(id,metaname,metavalue)
    128141    {
     
    200213        this.urlGetSync(url);
    201214    }
     215
     216
     217    this.cloneDocument = function(docid,toCollect)
     218    {
     219        var msserver = this.myspaceserverURL();
     220
     221        var url = msserver + "?a=clone";
     222        url += "&c="+collect_;
     223        url += "&d="+docid;
     224        url += "&toCollect="+toCollect;
     225
     226    // alert("url = " + url);
     227   
     228        this.urlGetSync(url);
     229    }
    202230   
    203231    // consider name change to reindexDocument
Note: See TracChangeset for help on using the changeset viewer.