我对Alfresco很陌生,他的任务是创建一个在创建文件夹时调用外部php脚本的规则。似乎没有很多信息表明这是可能的。我尝试创建如下的脚本,但收到“XMLHttpRequest未定义错误”:
function submitDoc(url, params){
var http = new XMLHttpRequest();
http.open("POST", url, true);
//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.onreadystatechange = function() {
if(http.readyState == 4 && http.status == 200) {
logger.system.out("SUCCESS!");
}
else{
logger.system.out("Failure: "+http.status);
}
}
http.send(params);
}
submitDoc("/addPage.php", "var1=somevar");