1 Components.utils.import("resource://stmodules/STRequests.jsm");
  2 Components.utils.import("resource://stmodules/Logger.jsm");
  3 Components.utils.import("resource://stmodules/stEvtMgr.jsm");
  4 
  5 Components.utils.import("resource://stmodules/Context.jsm");
  6 
  7 Components.utils.import("resource://stmodules/Context.jsm");
  8 
  9 EXPORTED_SYMBOLS = [ "SemTurkeyHTTPLegacy", "STRequests" ];
 10 
 11 var service = STRequests.ModifyName;
 12 var serviceName = service.serviceName;
 13 
 14 /**
 15  * renames an existing resource
 16  * 
 17  * @member STRequests.ModifyName
 18  * @param oldName
 19  * @param newName
 20  * @return
 21  */
 22 function rename(oldName,newName){
 23 	var oldName_p = "oldName=" + oldName;
 24 	var newName_p = "newName=" + newName;
 25 	var contextAsArray = this.context.getContextValuesForHTTPGetAsArray();
 26 	var reply = SemTurkeyHTTPLegacy.GET(serviceName, service.renameRequest, oldName_p, newName_p, contextAsArray);
 27 	
 28 	if (!reply.isFail()) {
 29 		evtMgr.fireEvent("resourceRenamed", {getOldName : function(){return oldName;}, getNewName : function(){return newName;}});
 30 	}
 31 
 32 	return reply;
 33 }
 34 //ModifyName SERVICE INITIALIZATION
 35 //this return an implementation for Project with a specified context
 36 service.prototype.getAPI = function(specifiedContext){
 37 	var newObj = new service();
 38 	newObj.context = specifiedContext;
 39 	return newObj;
 40 }
 41 service.prototype.rename = rename;
 42 service.prototype.context = new Context();  // set the default context
 43 service.constructor = service;
 44 service.__proto__ = service.prototype;